:root {
  color-scheme: light;
  --canvas: #f3f4f0;
  --surface: #ffffff;
  --surface-muted: #f7f8f5;
  --ink: #17211f;
  --muted: #6e7975;
  --line: #dfe3de;
  --line-strong: #cbd2cc;
  --green: #164a42;
  --green-deep: #103b35;
  --coral: #ed5746;
  --yellow: #f5c94a;
  --danger: #b9382d;
  --shadow: 0 14px 36px rgba(18, 42, 37, 0.12);
  --sidebar-width: 292px;
  --preview-width: min(42vw, 620px);
  font-family: Inter, Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html,
body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: var(--canvas); color: var(--ink); }

body { min-width: 320px; }

button,
input,
textarea,
select { font: inherit; }

button,
a,
select,
input[type="file"] { -webkit-tap-highlight-color: transparent; }

button { color: inherit; }

svg { width: 19px; height: 19px; stroke-width: 1.8; }

.admin-root { width: 100%; height: 100%; min-height: 0; overflow: hidden; }

.admin-loading,
.login-view {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.admin-loading { color: var(--muted); font-weight: 650; }

.login-view {
  background: var(--green);
  grid-template-columns: minmax(0, 440px) minmax(320px, 520px);
  gap: clamp(40px, 8vw, 120px);
}

.login-brand { color: #fff; align-self: end; padding-bottom: 18px; }

.login-brand__mark,
.sidebar-brand__mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  font: 700 20px/1 Georgia, serif;
}

.login-brand h1 { margin: 28px 0 14px; max-width: 560px; font: 400 clamp(42px, 6vw, 76px)/0.98 Georgia, serif; letter-spacing: 0; }
.login-brand p { margin: 0; max-width: 480px; color: rgba(255,255,255,.7); font-size: 17px; line-height: 1.6; }

.login-panel { width: 100%; padding: clamp(26px, 5vw, 44px); background: var(--surface); box-shadow: var(--shadow); border-radius: 8px; }
.login-panel__head { margin-bottom: 30px; }
.login-panel__head span { color: var(--coral); text-transform: uppercase; font-size: 12px; font-weight: 800; }
.login-panel h2 { margin: 8px 0 0; font: 400 34px/1.15 Georgia, serif; }
.login-form { display: grid; gap: 18px; }
.login-error { min-height: 20px; margin: 0; color: var(--danger); font-size: 14px; }

.admin-shell {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}
.admin-shell.has-preview { grid-template-columns: var(--sidebar-width) minmax(520px, 1fr) var(--preview-width); }
.admin-shell.is-structure-mode { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.admin-shell.is-structure-mode .preview-panel { display: none; }

.sidebar {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--green-deep);
  color: #fff;
  border-right: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
}

.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; }
.sidebar-brand strong { display: block; font-size: 15px; }
.sidebar-brand small { display: block; margin-top: 3px; color: rgba(255,255,255,.58); }
.sidebar-brand__mark { width: 36px; height: 36px; flex: 0 0 auto; font-size: 17px; }

.object-picker { margin: 0 14px 16px; padding: 12px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.11); border-radius: 6px; }
.object-picker__label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: rgba(255,255,255,.58); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.object-picker__row { display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: 6px; }
.object-picker select { width: 100%; min-width: 0; height: 40px; padding: 0 10px; color: #fff; background: #123d37; border: 1px solid rgba(255,255,255,.18); border-radius: 5px; outline: none; }
.object-picker select option { color: var(--ink); background: #fff; }

.section-nav { display: grid; gap: 14px; padding: 0 10px 12px; overflow-y: auto; scrollbar-width: thin; }
.section-nav__group { display: grid; gap: 5px; }
.section-nav__group + .section-nav__group { padding-top: 13px; border-top: 1px solid rgba(255,255,255,.1); }
.section-nav__group-label { padding: 0 12px; color: rgba(255,255,255,.38); font-size: 9px; font-weight: 850; letter-spacing: 0; text-transform: uppercase; }
.section-nav__group-items { display: grid; gap: 2px; }
.section-nav__item {
  width: 100%; min-height: 42px; display: flex; align-items: center; gap: 12px;
  padding: 0 12px; border: 0; border-radius: 5px; background: transparent;
  color: rgba(255,255,255,.7); text-align: left; cursor: pointer;
}
.section-nav__item:hover { color: #fff; background: rgba(255,255,255,.07); }
.section-nav__item.is-active { color: #fff; background: rgba(255,255,255,.12); }
.section-nav__item svg { width: 18px; height: 18px; }

.sidebar-footer { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-top: 1px solid rgba(255,255,255,.1); }
.user-badge { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.12); font-size: 13px; font-weight: 800; }
.sidebar-footer__user { min-width: 0; flex: 1; }
.sidebar-footer__user strong { display: block; font-size: 13px; }
.sidebar-footer__user small { display: block; margin-top: 2px; color: rgba(255,255,255,.52); }

.workspace { width: 100%; height: 100%; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--canvas); }

.toolbar {
  position: relative; z-index: 8; min-height: 76px; display: flex; align-items: center; gap: 16px;
  padding: 12px 24px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line);
}
.toolbar__title { min-width: 0; flex: 1; }
.toolbar__title small { display: block; margin-bottom: 2px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolbar__title h1 { margin: 0; overflow: hidden; font-size: 18px; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; }
.toolbar__actions { display: flex; align-items: center; gap: 8px; }
.save-state { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.save-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #9aa39f; }
.save-state.is-dirty::before { background: var(--coral); }
.save-state.is-saved::before { background: #2b967c; }
.save-state.is-error { color: var(--danger); }
.save-state.is-error::before { background: var(--danger); }

.editor-scroll { width: 100%; flex: 1; min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; scroll-behavior: smooth; }
.editor { width: min(860px, 100%); max-width: 100%; min-width: 0; margin: 0 auto; padding: 36px clamp(20px, 4vw, 52px) 100px; overflow-x: hidden; }

.editor-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 28px; }
.editor-head__copy { max-width: 680px; }
.editor-kicker { margin: 0 0 7px; color: var(--coral); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.editor-head h2 { margin: 0; font: 400 clamp(30px, 3vw, 42px)/1.08 Georgia, serif; }
.editor-head p { margin: 12px 0 0; color: var(--muted); line-height: 1.55; }

.form-section { width: 100%; min-width: 0; padding: 26px 0 32px; border-top: 1px solid var(--line-strong); }
.form-section:first-of-type { border-top: 0; padding-top: 0; }
.form-section__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.form-section__head h3 { margin: 0; font-size: 16px; }
.form-section__head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }

.field-grid { width: 100%; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { min-width: 0; display: grid; gap: 8px; align-content: start; }
.field--wide { grid-column: 1 / -1; }
.field label,
.field__label { color: #3b4743; font-size: 12px; font-weight: 750; }
.field input,
.field textarea,
.field select {
  width: 100%; min-width: 0; border: 1px solid var(--line-strong); border-radius: 5px;
  background: var(--surface); color: var(--ink); outline: none; transition: border-color .16s, box-shadow .16s;
}
.field input,
.field select { height: 44px; padding: 0 12px; }
.field textarea { min-height: 112px; padding: 11px 12px; resize: vertical; line-height: 1.5; }
.field textarea.is-long { min-height: 320px; }
.field input:focus,
.field textarea:focus,
.field select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22,74,66,.1); }
.field__hint { color: var(--muted); font-size: 11px; line-height: 1.4; }

.image-field { width: 100%; max-width: 100%; min-width: 0; grid-column: 1 / -1; display: grid; grid-template-columns: 184px minmax(0, 1fr); gap: 18px; padding: 14px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.image-field__preview { position: relative; min-height: 126px; overflow: hidden; background: #e8ebe6; border-radius: 4px; }
.image-field__preview img { width: 100%; height: 100%; min-height: 126px; position: absolute; inset: 0; object-fit: cover; }
.image-field__empty { height: 100%; min-height: 126px; display: grid; place-items: center; color: #82908a; }
.image-field__empty svg { width: 26px; height: 26px; }
.image-field__body { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 11px; }
.image-field__body strong { font-size: 13px; }
.image-field__path { overflow: hidden; color: var(--muted); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.image-field__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.file-control input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-progress { color: var(--green); font-size: 12px; font-weight: 700; }

.repeater-list { width: 100%; min-width: 0; display: grid; gap: 10px; }
.repeater-item { width: 100%; max-width: 100%; min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.repeater-item__head { min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 7px 10px 7px 14px; border-bottom: 1px solid var(--line); }
.repeater-item__number { color: var(--coral); font: 400 20px/1 Georgia, serif; }
.repeater-item__title { min-width: 0; flex: 1; display: -webkit-box; overflow: hidden; font-size: 13px; font-weight: 750; line-height: 1.35; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.repeater-item__tools { display: flex; gap: 3px; }
.repeater-item__body { min-width: 0; padding: 16px; overflow: hidden; }
.repeater-item .image-field { grid-template-columns: 126px minmax(0, 1fr); padding: 10px; }
.repeater-item .image-field__preview,
.repeater-item .image-field__empty,
.repeater-item .image-field__preview img { min-height: 92px; }
.special-editor__images { min-width: 0; grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.special-editor__image { min-width: 0; display: grid; gap: 12px; padding: 10px; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 6px; }
.special-editor__images .image-field { grid-column: auto; grid-template-columns: 92px minmax(0, 1fr); }
.special-editor__images .image-field__preview,
.special-editor__images .image-field__empty,
.special-editor__images .image-field__preview img { min-height: 84px; }
.special-editor__image > .image-field { padding: 0; background: transparent; border: 0; }
.special-editor__image .field-grid { gap: 10px; }

.object-list { display: grid; border-top: 1px solid var(--line-strong); }
.object-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(140px,.55fr) auto; align-items: center; gap: 18px; padding: 17px 4px; border-bottom: 1px solid var(--line); }
.object-row__title { min-width: 0; }
.object-row__title strong { display: block; }
.object-row__title small,
.object-row__date { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.object-row__title small { overflow-wrap: anywhere; }
.object-row__actions { display: flex; gap: 5px; }

.location-list { width: 100%; border-top: 1px solid var(--line-strong); }
.location-row {
  width: 100%; min-width: 0; min-height: 66px; display: grid;
  grid-template-columns: 38px minmax(0, 1fr) minmax(96px, auto) auto;
  align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line);
}
.location-row--city { min-height: 76px; background: rgba(22,74,66,.045); border-bottom-color: var(--line-strong); }
.location-row--district { padding-left: 28px; }
.location-row--complex { padding-left: 62px; }
.location-row__icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--green); border: 1px solid var(--line-strong); border-radius: 50%; }
.location-row__icon svg { width: 17px; height: 17px; }
.location-row__copy { min-width: 0; }
.location-row__copy span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.location-row__copy strong { display: block; overflow-wrap: anywhere; font-size: 14px; }
.location-row__usage { color: var(--muted); font-size: 12px; white-space: nowrap; }
.location-row__actions { display: flex; align-items: center; gap: 5px; }
.location-empty { padding: 28px 4px; color: var(--muted); }
.structure-note { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

.library-tabs { display: flex; gap: 4px; margin-bottom: 24px; padding: 4px; overflow-x: auto; background: #e7eae5; border: 1px solid var(--line); border-radius: 6px; scrollbar-width: none; }
.library-tabs::-webkit-scrollbar { display: none; }
.library-tabs button { min-width: max-content; min-height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 0 13px; color: var(--muted); background: transparent; border: 0; border-radius: 4px; font-weight: 750; cursor: pointer; }
.library-tabs button span { min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; background: rgba(22,74,66,.08); border-radius: 10px; font-size: 10px; }
.library-tabs button.is-active { color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgba(18,42,37,.1); }
.library-list { width: 100%; border-top: 1px solid var(--line-strong); }
.library-row { min-height: 78px; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.library-row__image,
.library-row__icon { width: 48px; height: 48px; background: #e7eae5; border: 1px solid var(--line); border-radius: 4px; }
.library-row__image { display: block; object-fit: cover; }
.library-row__icon { display: grid; place-items: center; color: var(--green); }
.library-row__icon svg { width: 19px; height: 19px; }
.library-row__copy { min-width: 0; }
.library-row__copy strong { display: block; overflow-wrap: anywhere; font-size: 14px; }
.library-row__copy p { display: -webkit-box; margin: 5px 0 0; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.library-row__copy small { display: block; width: fit-content; margin-top: 7px; padding: 3px 6px; border: 1px solid var(--yellow); color: var(--ink); font-size: 10px; font-weight: 750; }
.library-row__actions { display: flex; gap: 5px; }
.scope-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.scope-chip { display: inline-flex; min-height: 23px; align-items: center; padding: 2px 7px; color: var(--green); background: rgba(22,74,66,.08); border-radius: 3px; font-size: 10px; font-weight: 750; }
.library-empty { display: grid; gap: 6px; padding: 34px 4px; color: var(--muted); }
.library-empty strong { color: var(--ink); font-size: 15px; }

.inherited-list { border-top: 1px solid var(--line-strong); }
.inherited-row { min-height: 62px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.inherited-row.is-hidden { opacity: .56; }
.inherited-row__state { width: 32px; height: 32px; display: grid; place-items: center; color: var(--green); border: 1px solid var(--line); border-radius: 50%; }
.inherited-row__state svg { width: 15px; height: 15px; }
.inherited-row__copy { min-width: 0; }
.inherited-row__copy strong { display: block; overflow-wrap: anywhere; font-size: 13px; }
.inherited-row__copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.inherited-row__actions { display: flex; gap: 5px; }

.button,
.icon-button {
  border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); cursor: pointer;
  transition: background .16s, border-color .16s, color .16s, transform .16s;
}
.button:hover,
.icon-button:hover { border-color: #aeb8b1; background: #f8f9f7; }
.button:active,
.icon-button:active { transform: translateY(1px); }
.button:disabled,
.icon-button:disabled { opacity: .48; cursor: not-allowed; }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; text-decoration: none; font-size: 13px; font-weight: 750; }
.button--primary { color: #fff; background: var(--coral); border-color: var(--coral); }
.button--primary:hover { color: #fff; background: #dc493a; border-color: #dc493a; }
.button--green { color: #fff; background: var(--green); border-color: var(--green); }
.button--green:hover { color: #fff; background: var(--green-deep); border-color: var(--green-deep); }
.button--danger { color: var(--danger); }
.button--compact { min-height: 36px; padding: 0 11px; }
.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; }
.icon-button--ghost { color: inherit; background: transparent; border-color: transparent; }
.icon-button--ghost:hover { background: rgba(255,255,255,.08); border-color: transparent; }
.icon-button--danger { color: var(--danger); }

.preview-panel { width: 100%; height: 100%; min-width: 0; min-height: 0; display: none; flex-direction: column; overflow: hidden; background: #dfe3de; border-left: 1px solid var(--line-strong); }
.admin-shell.has-preview .preview-panel { display: flex; }
.preview-toolbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.preview-toolbar strong { font-size: 13px; }
.preview-close { display: inline-grid; }
.segmented { display: inline-flex; padding: 3px; background: var(--canvas); border: 1px solid var(--line); border-radius: 6px; }
.segmented button { width: 38px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; }
.segmented button.is-active { color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgba(18,42,37,.12); }
.preview-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 18px; overflow: hidden; }
.preview-frame { width: 100%; height: 100%; background: #fff; border: 0; box-shadow: 0 12px 32px rgba(18,42,37,.15); transition: width .2s, height .2s, border-radius .2s; }
.preview-panel.is-mobile .preview-frame { width: min(390px, 100%); height: min(844px, 100%); border-radius: 8px; }

.toast-stack { position: fixed; z-index: 80; right: 18px; bottom: 18px; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 250px; max-width: 380px; padding: 13px 15px; color: #fff; background: var(--green-deep); border-radius: 6px; box-shadow: var(--shadow); font-size: 13px; animation: toast-in .2s ease both; }
.toast.is-error { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.object-dialog { width: min(480px, calc(100% - 28px)); padding: 0; color: var(--ink); background: var(--surface); border: 0; border-radius: 8px; box-shadow: 0 26px 70px rgba(8,25,22,.3); }
.object-dialog::backdrop { background: rgba(10,30,26,.54); }
.object-dialog__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.object-dialog__head h2 { margin: 0; font-size: 18px; }
.object-dialog__body { display: grid; gap: 16px; padding: 20px; }
.object-dialog__actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 20px; }
.dialog-error { min-height: 18px; margin: 0; color: var(--danger); font-size: 12px; }
.dialog-divider { display: flex; align-items: center; gap: 10px; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.dialog-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.object-dialog .location-fields { gap: 12px; }
.dialog-kicker { display: block; margin-bottom: 4px; color: var(--coral); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.library-dialog { width: min(760px, calc(100% - 28px)); }
.library-dialog__body { max-height: min(72vh, 760px); overflow-y: auto; }
.library-image-field { grid-template-columns: 136px minmax(0, 1fr); }
.library-special-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.library-special-image { min-width: 0; display: grid; gap: 10px; padding: 10px; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 6px; }
.library-special-image .image-field { grid-template-columns: 96px minmax(0, 1fr); padding: 0; background: transparent; border: 0; }
.library-special-image .image-field__preview,
.library-special-image .image-field__empty,
.library-special-image .image-field__preview img { min-height: 88px; }
.library-special-image .field-grid { gap: 10px; }
.placement-editor { padding-top: 20px; border-top: 1px solid var(--line-strong); }
.placement-editor > header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 12px; }
.placement-editor h3 { margin: 0; font-size: 14px; }
.placement-editor p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.placement-list { display: grid; gap: 8px; }
.placement-row { display: grid; grid-template-columns: minmax(130px, .7fr) minmax(180px, 1.3fr) 38px; align-items: end; gap: 8px; padding: 10px; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 5px; }

.mobile-only { display: none; }

@media (max-width: 1540px) {
  .admin-shell,
  .admin-shell.has-preview { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  .preview-panel { position: fixed; z-index: 50; inset: 0 0 0 auto; width: min(720px, 92vw); transform: translateX(105%); box-shadow: -18px 0 50px rgba(10,30,26,.2); transition: transform .24s ease; }
  .admin-shell.has-preview .preview-panel { transform: translateX(0); }
}

@media (max-width: 1100px) {
  :root { --safe-bottom: env(safe-area-inset-bottom, 0px); }
  html,
  body { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; }
  .admin-root { height: auto; min-height: 100dvh; overflow: visible; }
  .login-view { grid-template-columns: 1fr; align-content: center; gap: 28px; padding: 20px; }
  .login-brand { align-self: auto; padding: 0; }
  .login-brand h1 { margin-top: 18px; font-size: 42px; }
  .login-brand p { display: none; }
  .login-panel { padding: 24px 20px; }
  .admin-shell { display: flex; flex-direction: column; width: 100%; height: auto; min-height: 100dvh; overflow: visible; }
  .admin-shell.is-structure-mode { display: flex; }
  .sidebar { position: relative; z-index: 20; width: 100%; height: auto; flex: 0 0 auto; background: var(--green-deep); }
  .sidebar-brand { padding: 12px 14px 8px; }
  .sidebar-brand__mark { width: 32px; height: 32px; }
  .sidebar-brand small { display: none; }
  .object-picker { margin: 0 10px 8px; padding: 8px; }
  .object-picker__label { display: none; }
  .object-picker select { height: 38px; }
  .section-nav { max-width: 100vw; display: flex; gap: 12px; padding: 0 10px 9px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-inline: contain; scroll-padding-inline: 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .section-nav::-webkit-scrollbar { display: none; }
  .section-nav__group { min-width: max-content; display: grid; align-items: start; gap: 4px; }
  .section-nav__group + .section-nav__group { padding: 0 0 0 12px; border-top: 0; border-left: 1px solid rgba(255,255,255,.16); }
  .section-nav__group-label { padding: 0 8px; color: rgba(255,255,255,.5); font-size: 8px; }
  .section-nav__group-items { display: flex; gap: 3px; }
  .section-nav__item { width: auto; min-width: max-content; min-height: 36px; padding: 0 10px; gap: 7px; font-size: 12px; }
  .section-nav__item svg { width: 16px; height: 16px; }
  .sidebar-footer { display: none; }
  .workspace { width: 100%; height: auto; min-height: 0; flex: 1; overflow: visible; }
  .toolbar { position: sticky; top: 0; min-height: 58px; padding: 8px 12px; }
  .toolbar__title small,
  .save-state,
  .toolbar .desktop-only { display: none; }
  .toolbar__title h1 { font-size: 16px; }
  .toolbar__actions { gap: 5px; }
  .toolbar .button { min-height: 38px; padding: 0 11px; }
  .toolbar .button span { display: none; }
  .mobile-only { display: inline-grid; }
  .editor-scroll { width: 100%; overflow: visible; }
  .editor { padding: 26px 16px calc(88px + var(--safe-bottom)); }
  .editor-head { align-items: flex-start; margin-bottom: 24px; }
  .editor-head h2 { font-size: 31px; }
  .editor-head p { font-size: 14px; }
  .field-grid { grid-template-columns: 1fr; gap: 14px; }
  .field--wide { grid-column: auto; }
  .image-field { grid-column: auto; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 10px; }
  .image-field__preview,
  .image-field__empty,
  .image-field__preview img { min-height: 104px; }
  .image-field__actions .button { padding: 0 10px; }
  .repeater-item__body { padding: 12px; }
  .repeater-item .image-field { grid-template-columns: 92px minmax(0,1fr); }
  .special-editor__images { grid-template-columns: 1fr; }
  .special-editor__images .image-field { grid-template-columns: 92px minmax(0, 1fr); }
  .object-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .object-row__date { display: none; }
  .object-row__actions .button { width: 36px; min-height: 36px; padding: 0; }
  .object-row__actions .button span { display: none; }
  .location-row { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 9px; padding: 10px 0; }
  .location-row--district { padding-left: 16px; }
  .location-row--complex { padding-left: 32px; }
  .location-row__usage { grid-column: 2; margin-top: -7px; }
  .location-row__actions { grid-column: 3; grid-row: 1 / span 2; }
  .location-row__actions .button { width: 36px; min-height: 36px; padding: 0; }
  .location-row__actions .button span { display: none; }
  .library-row { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; }
  .library-row__image,
  .library-row__icon { width: 42px; height: 42px; }
  .inherited-row { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 8px; }
  .inherited-row__actions .button { width: 36px; padding: 0; }
  .inherited-row__actions .button span { display: none; }
  .placement-row { grid-template-columns: minmax(0, 1fr) 38px; }
  .placement-row .field { grid-column: 1; }
  .placement-row .icon-button { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .preview-panel { width: 100%; }
  .preview-toolbar { min-height: 58px; }
  .preview-stage { padding: 0; }
  .preview-panel.is-mobile .preview-frame { width: 100%; height: 100%; border-radius: 0; }
  .toast-stack { right: 10px; bottom: calc(10px + var(--safe-bottom)); left: 10px; }
  .toast { min-width: 0; max-width: none; }
}

@media (max-width: 430px) {
  .image-field { grid-template-columns: 1fr; }
  .image-field__preview { aspect-ratio: 16 / 8; }
  .image-field__path { display: none; }
  .repeater-item .image-field { grid-template-columns: 88px minmax(0,1fr); }
  .repeater-item .image-field__preview { aspect-ratio: auto; }
  .location-row--complex { padding-left: 20px; }
  .location-row__icon { width: 30px; height: 30px; }
  .library-dialog__body { max-height: 68vh; }
  .library-image-field { grid-template-columns: 1fr; }
  .library-special-images { grid-template-columns: 1fr; }
}
