:root {
  color-scheme: light;
  --ground: #f7f4f3;
  --surface: #fff;
  --raised: #f4f1f0;
  --border: #e6dfdd;
  --rule: #eee9e8;
  --ink: #211b1a;
  --muted: #625a58;
  --faint: #716765;
  --accent: #bd1e2d;
  --accent-dark: #951727;
  --success: #26734e;
  --danger: #b4232a;
  --radius-sheet: 16px;
  --radius-card: 8px;
  --radius-control: 6px;
  --space: 24px;
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "DM Sans", sans-serif;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--ground);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--ground); }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 65%, white); outline-offset: 2px; }
.app-frame { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; padding: 22px 14px 18px; background: var(--ground); }
.brand { display: flex; min-height: 48px; align-items: center; gap: 10px; padding: 0 10px; color: var(--ink); text-decoration: none; }
.brand-mark, .mobile-brand { font: 700 1.45rem/1 var(--font-display); letter-spacing: -.08em; }
.brand-mark span, .mobile-brand > span:first-child { color: var(--accent); }
.brand-label { font-size: .9rem; font-weight: 600; }
.nav-caption { margin: 36px 10px 9px; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .08em; }
.side-nav { display: grid; gap: 4px; }
.nav-item { position: relative; display: flex; width: 100%; min-height: 42px; align-items: center; gap: 11px; padding: 0 11px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; text-align: left; cursor: pointer; font-size: .92rem; font-weight: 500; }
.nav-item:hover { color: var(--ink); background: rgb(255 255 255 / 58%); }
.nav-item.is-current { color: var(--ink); background: var(--surface); font-weight: 700; }
.nav-item.is-current::before { position: absolute; inset: 8px auto 8px 0; width: 2px; border-radius: 2px; background: var(--accent); content: ""; }
.nav-symbol { display: grid; width: 20px; height: 20px; place-items: center; color: var(--muted); font: 600 .77rem/1 var(--font-display); }
.sidebar-bottom { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 12px 10px; color: var(--muted); font-size: .82rem; }
.access-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.workspace { min-width: 0; padding: 0 8px 8px 0; }
.topbar { display: flex; height: 48px; align-items: center; justify-content: flex-end; padding: 0 28px; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.topbar a { color: var(--muted); font-size: .85rem; text-decoration: none; }
.topbar a:hover { color: var(--accent-dark); }
.sheet { min-height: calc(100vh - 56px); padding: 32px clamp(18px, 3vw, 40px) 48px; border: 1px solid var(--border); border-radius: var(--radius-sheet); background: var(--surface); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--rule); }
.page-heading h1 { margin: 0; font: 600 clamp(1.55rem, 2vw, 1.9rem)/1.15 var(--font-display); letter-spacing: -.04em; }
.page-heading p { margin: 7px 0 0; color: var(--muted); font-size: .93rem; }
.button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius-control); color: var(--ink); background: var(--surface); cursor: pointer; font-size: .87rem; font-weight: 600; transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease; }
.button:hover:not(:disabled) { border-color: #cfc3c0; background: var(--raised); }
.button:disabled { color: #716765; background: #f3f0ef; cursor: not-allowed; }
.button-primary { border-color: var(--accent); color: #fff; background: var(--accent); }
.button-primary:hover:not(:disabled) { border-color: var(--accent-dark); color: #fff; background: var(--accent-dark); }
.button-save { border-color: var(--ink); color: #fff; background: var(--ink); }
.button-save:hover:not(:disabled) { border-color: #3e3533; color: #fff; background: #3e3533; }
.save-row { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 16px; }
#save-status { margin: 0; color: var(--muted); font-size: .84rem; }
#save-status[data-state="saved"] { color: var(--success); }
#save-status[data-state="error"] { color: var(--danger); }
.editor-layout { display: grid; grid-template-columns: minmax(220px, .72fr) minmax(0, 1.55fr); gap: 24px; align-items: start; }
.item-list { min-width: 0; }
.list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; color: var(--muted); font-size: .82rem; }
.list-heading strong { color: var(--ink); font-weight: 600; }
.list-row { display: grid; width: 100%; min-height: 54px; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px; border-bottom: 1px solid var(--rule); color: var(--ink); }
.list-row-select { display: grid; width: 100%; min-width: 0; min-height: 52px; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 10px; border: 0; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.list-row-select:hover, .list-row-select[aria-current="true"] { background: var(--raised); }
.list-row-actions { display: flex; align-items: center; gap: 3px; padding-right: 6px; }
.order-button { display: inline-grid; width: 30px; height: 30px; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 5px; color: var(--muted); background: transparent; cursor: pointer; }
.order-button:hover:not(:disabled) { border-color: var(--border); color: var(--ink); background: var(--surface); }
.order-button:disabled { opacity: .35; cursor: not-allowed; }
.list-row-title { overflow: hidden; font-size: .88rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.list-row-meta { margin-top: 3px; color: var(--muted); font-size: .77rem; }
.row-chevron { color: var(--muted); }
.editor-form { min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.editor-form h2 { margin: 0 0 5px; font: 600 1.1rem/1.3 var(--font-display); letter-spacing: -.025em; }
.form-intro { margin: 0 0 20px; color: var(--muted); font-size: .87rem; line-height: 1.5; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; min-width: 0; gap: 7px; }
.field.is-wide { grid-column: 1 / -1; }
.field label, .field-label { color: var(--ink); font-size: .88rem; font-weight: 600; }
.field input, .field textarea, .field select { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid #d6cfcd; border-radius: var(--radius-control); color: var(--ink); background: #fff; font-size: .92rem; }
.field textarea { min-height: 105px; resize: vertical; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); opacity: 1; }
.field-hint { margin: -1px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--rule); }
.danger-button { border-color: #e7c9c9; color: var(--danger); }
.danger-button:hover:not(:disabled) { border-color: #d6a4a4; color: #8f151c; background: #fff7f7; }
.empty-state, .loading-state, .error-state { padding: 22px 18px; border: 1px dashed #d8d0ce; border-radius: var(--radius-card); color: var(--muted); font-size: .92rem; line-height: 1.55; }
.about-editor { display: grid; gap: 24px; }
.about-block { padding-bottom: 20px; border-bottom: 1px solid var(--rule); }
.about-block:last-child { padding-bottom: 0; border-bottom: 0; }
.block-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.block-heading h2 { margin: 0; font: 600 1.05rem/1.25 var(--font-display); }
.block-heading p { margin: 4px 0 0; color: var(--muted); font-size: .83rem; }
.paragraph-editor { display: grid; gap: 14px; }
.paragraph-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 38px; align-items: start; gap: 10px; }
.paragraph-controls { display: grid; gap: 4px; }
.category-actions { display: flex; align-items: end; gap: 8px; margin-bottom: 12px; }
.category-actions .field { flex: 1; }
.category-actions > .button { min-height: 40px; white-space: nowrap; }
.category-order { display: flex; align-items: center; padding-bottom: 1px; }
.media-upload { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.upload-label { display: inline-flex; width: fit-content; min-height: 36px; align-items: center; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-control); color: var(--ink); background: var(--raised); cursor: pointer; font-size: .86rem; font-weight: 600; }
.upload-label:hover { border-color: #cfc3c0; }
.upload-label.is-disabled { opacity: .55; cursor: not-allowed; }
.gallery-field-title { margin: 0; font-size: .92rem; font-weight: 700; }
.gallery-editor-list { display: grid; gap: 8px; }
.gallery-editor-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-control); }
.gallery-editor-item img { display: block; width: 64px; height: 48px; object-fit: cover; background: var(--raised); }
.gallery-editor-path { min-width: 0; overflow: hidden; color: var(--muted); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.password-editor { display: grid; max-width: 850px; gap: 16px; }
.password-count { margin: 0; color: var(--muted); font-size: .9rem; }
.password-row .form-actions { align-items: center; }
.icon-button { display: grid; width: 38px; min-height: 38px; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); background: var(--surface); cursor: pointer; font-size: 1.1rem; }
.icon-button:hover { color: var(--danger); border-color: #d6a4a4; }
.subcollection { display: grid; gap: 16px; }
.subcollection-item { padding: 16px; border: 1px solid var(--border); border-radius: 8px; }
.subcollection-item + .subcollection-item { margin-top: 12px; }
.subcollection-item .form-actions { margin-top: 14px; padding-top: 12px; }
.contact-mark-preview { display: inline-grid; width: 22px; height: 22px; place-items: center; border: 1px solid var(--border); border-radius: 4px; color: var(--accent-dark); font: 700 .7rem/1 var(--font-display); }
.mobile-brand { display: none; align-items: center; gap: 8px; font-size: 1.2rem; }
.mobile-brand > span:last-child { font: 600 .87rem var(--font-body); letter-spacing: 0; }
.loading-state { border-style: solid; border-color: var(--rule); }
.error-state { border-color: #e7c9c9; color: #8f151c; background: #fff9f9; }
.login-screen { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.login-panel { width: min(100%, 420px); padding: clamp(26px, 6vw, 42px); border: 1px solid var(--border); border-radius: var(--radius-sheet); background: var(--surface); box-shadow: 0 20px 60px rgb(33 27 26 / 7%); }
.login-wordmark { color: var(--ink); font: 700 2rem/1 var(--font-display); letter-spacing: -.08em; text-decoration: none; }
.login-wordmark span { color: var(--accent); }
.login-kicker { margin: 40px 0 10px; color: var(--accent-dark); font-size: .76rem; font-weight: 700; letter-spacing: .12em; }
.login-panel h1 { margin: 0; font: 600 clamp(1.8rem, 5vw, 2.35rem)/1.08 var(--font-display); letter-spacing: -.05em; }
.login-copy { margin: 12px 0 28px; color: var(--muted); line-height: 1.6; }
.login-panel label { display: block; margin-bottom: 8px; font-size: .9rem; font-weight: 600; }
.login-panel input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #d6cfcd; border-radius: var(--radius-control); color: var(--ink); background: var(--surface); font: inherit; }
.login-submit { width: 100%; min-height: 46px; margin-top: 14px; }
.login-status { min-height: 1.4em; margin: 12px 0 0; color: var(--danger); font-size: .86rem; }
[hidden] { display: none !important; }
@media (max-width: 820px) {
  .app-frame { grid-template-columns: 1fr; }
  .sidebar { position: sticky; z-index: 5; top: 0; display: block; width: 100%; height: auto; padding: 0 18px; border-bottom: 1px solid var(--border); background: var(--ground); }
  .brand, .nav-caption, .sidebar-bottom { display: none; }
  .side-nav { display: flex; max-width: 640px; justify-content: center; gap: clamp(12px, 4vw, 34px); margin: 0 auto; }
  .nav-item { width: auto; min-height: 52px; justify-content: center; gap: 7px; padding: 0 6px; font-size: .86rem; }
  .nav-item.is-current::before { inset: auto 6px 0; width: auto; height: 2px; }
  .nav-symbol { display: none; }
  .workspace { padding: 0 8px 8px; }
  .topbar { height: 44px; padding-inline: 18px; }
  .topbar-actions { gap: 12px; }
  .sheet { min-height: calc(100vh - 104px); padding: 26px clamp(16px, 3vw, 26px) 38px; }
}
@media (max-width: 650px) {
  .sidebar { padding-inline: 10px; }
  .side-nav { gap: clamp(12px, 5vw, 28px); }
  .nav-item { min-height: 48px; font-size: .82rem; }
  .topbar { justify-content: space-between; padding-inline: 8px; }
  .topbar-actions { gap: 10px; }
  .export-button { min-height: 34px; padding-inline: 9px; font-size: .76rem; }
  .mobile-brand { display: inline-flex; }
  .sheet { min-height: calc(100vh - 100px); padding: 23px 16px 32px; border-radius: 12px; }
  .page-heading { align-items: flex-start; padding-bottom: 18px; }
  .page-heading h1 { font-size: 1.45rem; }
  .page-heading p { max-width: 28ch; font-size: .85rem; }
  .page-heading > .button { min-height: 36px; padding-inline: 10px; font-size: .8rem; }
  .save-row { min-height: 58px; }
  #save-status { max-width: 58%; font-size: .78rem; }
  .button { min-height: 40px; }
  .editor-layout { grid-template-columns: 1fr; gap: 16px; }
  .item-list { max-height: 230px; overflow: auto; border-bottom: 1px solid var(--rule); }
  .item-list .list-row { min-height: 48px; }
  .editor-form { padding: 16px; }
  .field-grid { grid-template-columns: 1fr; gap: 14px; }
  .field.is-wide { grid-column: auto; }
  .form-actions { align-items: stretch; }
  .form-actions .button { flex: 1 1 auto; }
  .paragraph-row { grid-template-columns: minmax(0, 1fr) auto 36px; }
  .category-actions { flex-wrap: wrap; }
  .category-actions .field { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
