/* AnchorPoint editor. One shared stylesheet. Dark, quiet, gold accent. */
@font-face { font-family: "Hanken Grotesk"; font-weight: 300; font-style: normal; font-display: swap; src: url("/fonts/hanken-grotesk-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/hanken-grotesk-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/hanken-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/hanken-grotesk-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/geist-mono-latin-400-normal.woff2") format("woff2"); }

:root {
  --bg: #0D0D0C; --bg-2: #131312; --panel: #191917; --line: #2A2926; --line-2: #3A3934;
  --ink: #EDEAE3; --ink-2: #A3A098; --ink-3: #8C8981;
  --gold: #CDB98C; --gold-2: #E2D2A8; --gold-ink: #15130E; --focus: #E2D2A8;
  --danger: #E0907F; --ok: #A9C9A0;
  --r-sm: 10px; --r-lg: 14px;
  --font: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --bar: 56px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-weight: 400;
  font-size: 16px; line-height: 1.55; min-height: 100vh; overflow-x: hidden; overflow-wrap: anywhere;
}
h1, h2, h3 { font-weight: 300; letter-spacing: -0.01em; margin: 0; text-transform: none; }
h1 { font-size: clamp(2rem, 6vw, 3.25rem); line-height: 1.1; }
h2 { font-size: 1.25rem; font-weight: 400; }
h3 { font-size: 1.05rem; font-weight: 500; }
p { margin: 0 0 1em; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-2); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.mono { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.02em; color: var(--ink-3); }
.muted { color: var(--ink-2); }
.small { font-size: 0.9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Page chrome */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 32px; flex-wrap: wrap; }
.wordmark { font-weight: 500; font-size: 0.95rem; letter-spacing: 0.01em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.wordmark::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); display: inline-block; }
.topnav { display: flex; align-items: center; gap: 4px; }
.topnav a, .topnav button { color: var(--ink-2); text-decoration: none; font: inherit; font-size: 0.9rem; background: none; border: 0; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.topnav a:hover, .topnav button:hover, .topnav a[aria-current="page"] { color: var(--ink); }
.wrap { width: 100%; max-width: 820px; margin: 0 auto; padding: 32px 32px 120px; }
.wrap.narrow { max-width: 440px; padding-top: 72px; }
.pagehead { margin-bottom: 48px; }
.pagehead .mono { display: block; margin-bottom: 14px; }
.pagehead p { margin: 16px 0 0; color: var(--ink-2); max-width: 52ch; }
.stack > * + * { margin-top: 16px; }
.stack-gap { margin-top: 36px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.section { margin-top: 56px; }
.section > h2 { margin-bottom: 8px; }

/* Rows ("menu lines"): the main way to list things. Hairlines, no boxes. */
.rows { border-top: 1px solid var(--line); }
.rowitem { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 20px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.rowitem .main { min-width: 0; flex: 1 1 auto; }
.rowitem .title { font-size: 1.05rem; font-weight: 500; color: var(--ink); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rowitem .sub { color: var(--ink-2); font-size: 0.92rem; margin-top: 2px; }
.rowitem .end { display: flex; align-items: center; gap: 8px; flex: none; }
a.rowitem { text-decoration: none; color: inherit; transition: background .2s ease; }
a.rowitem:hover .title { color: var(--gold-2); }
.rowitem.locked .title { color: var(--ink-2); }
.arrow { color: var(--ink-3); font-size: 1.1rem; }
.rows.tight .rowitem { padding: 14px 0; }

.notice { color: var(--ink-2); font-size: 0.95rem; padding: 14px 0 14px 16px; border-left: 2px solid var(--line-2); margin: 0 0 20px; }
.notice.error { border-left-color: var(--danger); color: var(--danger); }
.notice.ok { border-left-color: var(--ok); color: var(--ok); }
.notice.gold { border-left-color: var(--gold); color: var(--ink); }

/* Buttons */
.btn { font: inherit; font-size: 0.95rem; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 18px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; transition: background .2s ease, border-color .2s ease, color .2s ease; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); background: var(--bg-2); color: var(--ink); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.primary:hover { background: var(--gold-2); border-color: var(--gold-2); color: var(--gold-ink); }
.btn.quiet { border-color: transparent; color: var(--ink-2); padding-left: 12px; padding-right: 12px; }
.btn.quiet:hover { color: var(--ink); background: var(--panel); border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 34px; padding: 5px 14px; font-size: 0.88rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.btn.link { border: 0; padding: 0; min-height: 0; color: var(--gold); background: none; text-decoration: underline; text-underline-offset: 3px; }
.iconbtn { width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; border-radius: 8px; border: 0; background: none; color: var(--ink-2); cursor: pointer; flex: none; }
.iconbtn:hover { background: var(--panel); color: var(--ink); }
.iconbtn svg { width: 18px; height: 18px; }

/* Forms */
label { display: block; font-size: 0.9rem; color: var(--ink-2); margin-bottom: 8px; }
.field { margin-bottom: 22px; min-width: 0; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="date"], textarea, select {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 11px 14px; min-height: 44px; transition: border-color .2s ease; color-scheme: dark;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input:hover, textarea:hover, select:hover { border-color: var(--line-2); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-color: var(--gold); }
input:disabled, textarea:disabled { opacity: 0.55; cursor: not-allowed; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.hint { font-size: 0.82rem; color: var(--ink-3); margin-top: 6px; }
.check { display: flex; gap: 12px; align-items: flex-start; color: var(--ink); font-size: 1rem; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--gold); }
.code { font-family: var(--mono); font-size: 0.82rem; }
textarea.code { min-height: 160px; }

.tag { font-family: var(--mono); font-size: 0.72rem; border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 8px; color: var(--ink-2); font-weight: 400; white-space: nowrap; }
.tag.gold { color: var(--gold); border-color: var(--gold); }
.linkbox { font-family: var(--mono); font-size: 0.8rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; word-break: break-all; user-select: all; margin-top: 10px; }

/* Menus and segmented switch */
.menu-wrap { position: relative; display: inline-flex; }
.menu { position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; min-width: 220px; max-width: min(360px, 92vw); background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 6px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5); max-height: min(70vh, 520px); overflow: auto; }
.menu.right { left: auto; right: 0; }
.menu-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; font: inherit; font-size: 0.95rem; color: var(--ink); background: none; border: 0; text-align: left; padding: 10px 12px; border-radius: 8px; cursor: pointer; text-decoration: none; min-height: 40px; }
.menu-item:hover, .menu-item:focus-visible { background: var(--bg-2); color: var(--ink); outline: none; }
.menu-item[aria-current="true"] { color: var(--gold-2); }
.menu-item.danger { color: var(--danger); }
.menu-item .sub { display: block; font-size: 0.82rem; color: var(--ink-3); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-head { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-3); padding: 8px 12px 4px; }
.menu-empty { padding: 12px; color: var(--ink-2); font-size: 0.92rem; }
.dropbtn { font: inherit; font-size: 0.92rem; color: var(--ink); background: none; border: 0; padding: 8px 10px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 38px; }
.dropbtn:hover, .dropbtn[aria-expanded="true"] { background: var(--panel); }
.dropbtn .chev { width: 8px; height: 8px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(45deg) translateY(-2px); flex: none; }
.dropbtn .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg { display: inline-flex; padding: 3px; background: var(--panel); border-radius: 999px; gap: 2px; }
.seg button { font: inherit; font-size: 0.86rem; color: var(--ink-2); background: none; border: 0; padding: 6px 16px; border-radius: 999px; cursor: pointer; min-height: 30px; }
.seg button[aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 0 0 1px var(--line-2); }

/* Dialog and toasts */
dialog { background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 28px; width: min(92vw, 460px); max-height: 88vh; overflow: auto; }
dialog::backdrop { background: rgba(0, 0, 0, 0.7); }
dialog h2 { margin-bottom: 12px; }
dialog .row.end { margin-top: 24px; justify-content: flex-end; }
dialog.wide { width: min(94vw, 640px); }
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 12px 16px; font-size: 0.92rem; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toast button { font: inherit; color: var(--gold); background: none; border: 0; cursor: pointer; padding: 0; text-decoration: underline; }
body.ed #toasts { bottom: 84px; }

/* Differences (publish, conflicts) */
.change { padding: 12px 0; border-top: 1px solid var(--line); }
.change:first-child { border-top: 0; }
.change .t { font-weight: 500; }
.change .s { color: var(--ink-2); font-size: 0.88rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Admin */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 14px 10px 0; border-top: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--mono); font-weight: 400; font-size: 0.74rem; color: var(--ink-3); border-top: 0; }
details.sec { border-bottom: 1px solid var(--line); }
details.sec > summary { list-style: none; cursor: pointer; padding: 20px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 1.05rem; font-weight: 500; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::after { content: ""; width: 8px; height: 8px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(45deg); transition: transform .2s ease; flex: none; }
details.sec[open] > summary::after { transform: rotate(-135deg); }
details.sec > .body { padding: 4px 0 32px; }

/* ---- The editing screen ------------------------------------------------------ */
body.ed { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.ed-bar { height: var(--bar); flex: none; display: flex; align-items: center; gap: 12px; padding: 0 14px 0 18px; background: var(--bg); border-bottom: 1px solid var(--line); position: relative; z-index: 30; }
.ed-left, .ed-right { display: flex; align-items: center; gap: 6px; flex: 1 1 0; min-width: 0; }
.ed-right { justify-content: flex-end; }
.ed-left .wordmark { margin-right: 10px; }
.ed-status { font-size: 0.84rem; color: var(--ink-3); padding: 0 8px; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.ed-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.ed-status[data-state="saved"]::before { background: var(--ok); }
.ed-status[data-state="saving"]::before { background: var(--gold); }
.ed-status[data-state="offline"] { color: var(--danger); }
.ed-status[data-state="offline"]::before { background: var(--danger); }
.chipbtn { font: inherit; font-size: 0.84rem; color: var(--gold-2); background: rgba(205, 185, 140, 0.1); border: 0; border-radius: 999px; padding: 6px 12px; cursor: pointer; white-space: nowrap; min-height: 32px; }
.chipbtn:hover { background: rgba(205, 185, 140, 0.18); }
.chipbtn[hidden] { display: none; }
.ed-notice { flex: none; background: var(--bg-2); color: var(--ink-2); font-size: 0.9rem; padding: 10px 18px; border-bottom: 1px solid var(--line); text-align: center; }
.ed-stage { flex: 1 1 auto; min-height: 0; position: relative; background: #0A0A09; display: flex; justify-content: center; }
.ed-device { width: 100%; height: 100%; position: relative; }
.ed-device iframe, .pv-stage iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.ed-stage.phone { padding: 20px 0; }
.ed-stage.phone .ed-device, .pv-stage.phone .ed-device { width: 390px; max-width: 100%; height: 100%; max-height: 844px; border-radius: 38px; border: 9px solid #22211e; overflow: hidden; background: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.ed-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); font-size: 0.92rem; background: #0A0A09; pointer-events: none; transition: opacity .25s ease; }
.ed-loading.done { opacity: 0; }
.ed-bottom { display: none; }
.ed-menu-btn { display: none; }

.sheet { position: fixed; z-index: 50; top: var(--bar); right: 0; bottom: 0; width: 392px; max-width: 100%; background: var(--panel); border-left: 1px solid var(--line-2); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .26s ease; visibility: hidden; }
.sheet.open { transform: none; visibility: visible; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 6px 24px; flex: none; }
.sheet-head h2 { font-size: 1.1rem; font-weight: 500; }
.sheet-head .sub { font-size: 0.84rem; color: var(--ink-3); display: block; margin-top: 2px; font-weight: 400; }
.sheet-body { padding: 14px 24px 24px; overflow: auto; flex: 1 1 auto; }
.sheet-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-top: 1px solid var(--line); }
.grab { display: none; }

.focal { position: relative; border-radius: 10px; overflow: hidden; cursor: crosshair; background: var(--bg-2); line-height: 0; touch-action: manipulation; }
.focal img { width: 100%; max-height: 300px; object-fit: contain; display: block; }
.focal .dot { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 2px solid #fff; background: rgba(205, 185, 140, 0.55); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45); pointer-events: none; }
.focal-hint { font-size: 0.84rem; color: var(--ink-3); margin: 10px 0 20px; }
.crops { display: flex; gap: 16px; align-items: flex-end; margin-bottom: 24px; }
.crop { min-width: 0; }
.crop .box { border-radius: 8px; overflow: hidden; background: var(--bg-2); position: relative; }
.crop.wide { flex: 1 1 62%; } .crop.wide .box { aspect-ratio: 16 / 9; }
.crop.tall { flex: 0 0 24%; } .crop.tall .box { aspect-ratio: 9 / 16; }
.crop img { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; inset: 0; }
.crop span { display: block; font-size: 0.78rem; color: var(--ink-3); margin-top: 6px; }
.sheet .field { margin-bottom: 18px; }
.upstat { font-size: 0.86rem; color: var(--ink-2); margin: 10px 0 18px; min-height: 1.3em; }
.upstat.error { color: var(--danger); }

.jgroup { border-top: 1px solid var(--line); }
.jgroup:first-child { border-top: 0; }
.jhead { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; font: inherit; color: var(--ink); background: none; border: 0; padding: 16px 0; cursor: pointer; text-align: left; }
.jhead .name { font-weight: 500; }
.jhead .count { color: var(--ink-3); font-size: 0.86rem; margin-left: 8px; font-weight: 400; }
.jhead .chev { width: 8px; height: 8px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(45deg); transition: transform .2s ease; flex: none; }
.jhead[aria-expanded="true"] .chev { transform: rotate(-135deg); }
.jbody { padding: 0 0 18px; }
.job { padding: 14px 0 18px; border-top: 1px solid var(--line); }
.job:first-child { border-top: 0; padding-top: 0; }
.job .slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.slot { width: 100%; position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--bg-2); border: 1px dashed var(--line-2); cursor: pointer; display: grid; place-items: center; color: var(--ink-2); font-size: 0.86rem; padding: 0; font: inherit; }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot .lab { position: absolute; left: 8px; top: 8px; font-size: 0.7rem; font-family: var(--mono); background: rgba(13, 13, 12, 0.7); color: var(--ink); padding: 2px 8px; border-radius: 999px; }
.slot .act { position: absolute; left: 8px; right: 8px; bottom: 8px; text-align: center; font-size: 0.78rem; background: rgba(13, 13, 12, 0.7); color: var(--ink); padding: 4px; border-radius: 6px; opacity: 0; transition: opacity .2s ease; }
.slot.has { border-style: solid; border-color: transparent; }
.slot:hover .act, .slot:focus-visible .act, .slot.busy .act { opacity: 1; }
.job .fields { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 12px; align-items: center; }
.job .fields .full { grid-column: 1 / -1; }
.job input, .job select { min-height: 40px; padding: 8px 12px; font-size: 0.95rem; }
.addjob { margin-top: 6px; }

.pv { position: fixed; inset: 0; z-index: 70; background: var(--bg); display: flex; flex-direction: column; }
.pv-bar { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); min-height: var(--bar); flex-wrap: wrap; }
.pv-bar .pages { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; flex: 1 1 200px; min-width: 0; }
.pv-bar .pages .lab { font-size: 0.84rem; color: var(--ink-3); margin-right: 4px; }
.pv-chip { font: inherit; font-size: 0.84rem; color: var(--ink-2); background: none; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.pv-chip[aria-pressed="true"] { color: var(--gold-ink); background: var(--gold); border-color: var(--gold); }
.pv-stage { flex: 1 1 auto; min-height: 0; background: #0A0A09; display: flex; justify-content: center; }
.pv-stage.phone { padding: 20px 0; }
.pv-stage .ed-device { width: 100%; height: 100%; }

@media (max-width: 760px) {
  .topbar { padding: 16px 18px; }
  .wrap { padding: 24px 18px 100px; }
  .wrap.narrow { padding-top: 40px; }
  .rowitem { padding: 16px 0; flex-wrap: wrap; }
  .rowitem .end { margin-left: auto; }
  .ed-bar { padding: 0 8px 0 12px; gap: 6px; }
  .ed-bar .wordmark, .ed-bar .seg, .ed-bar .hide-sm { display: none; }
  .ed-menu-btn { display: inline-grid; }
  .ed-left { flex: 1 1 auto; }
  .ed-right { flex: 0 0 auto; }
  .ed-stage, .ed-stage.phone { padding: 0; }
  .ed-stage.phone .ed-device { border: 0; border-radius: 0; max-height: none; width: 100%; box-shadow: none; }
  .ed-bottom { display: flex; align-items: center; gap: 10px; flex: none; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); position: relative; z-index: 30; }
  .ed-bottom .grow { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
  .sheet { top: auto; left: 0; right: 0; width: 100%; max-height: 86%; height: auto; border-left: 0; border-top: 1px solid var(--line-2); border-radius: 18px 18px 0 0; transform: translateY(100%); }
  .sheet.tall { height: 86%; }
  .sheet.open { transform: none; }
  .grab { display: block; width: 36px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 10px auto 0; flex: none; }
  .sheet-head { padding: 10px 14px 4px 20px; }
  .sheet-body { padding: 12px 20px 20px; }
  .sheet-foot { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); }
  .crops { gap: 12px; }
  .pv-bar { padding: 8px 12px; }
  .pv-bar .seg { display: none; }
  dialog { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
.menu-row { display: flex; align-items: center; gap: 4px; }
.menu-row .menu-item { flex: 1 1 auto; min-width: 0; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 0.8rem; color: var(--gold-2); }
.ed-center { flex: 0 0 auto; }
.ed-loadmsg { padding: 24px; }
body.ed #app { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.rows-flat { border-top: 1px solid var(--line); }
#sitebar { margin-top: 18px; }
h3.stack-gap { margin-top: 36px; margin-bottom: 8px; }
details.sec .rows { margin-top: 12px; }

/* ---- Portal pages (intake, files, requests, terms, dashboard groups) ---- */
/* Dashboard groups: "Your site" and "Your project" */
.dash-group + .dash-group { margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--line); }
.dash-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-group-head h2 { font-size: 1.5rem; font-weight: 400; }
.dash-group-head p { margin: 0; color: var(--ink-3); font-size: 0.92rem; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; display: flex; flex-direction: column; gap: 10px; min-width: 0; transition: border-color .2s ease; }
.card:hover { border-color: var(--line-2); }
.card h2 { font-size: 1.15rem; }
.card p { margin: 0; color: var(--ink-2); font-size: 0.95rem; }
.card .actions { margin-top: auto; padding-top: 14px; }
.card.locked { border-style: dashed; opacity: 0.85; }
.card.wide { grid-column: 1 / -1; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }

.banner { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 1px solid var(--gold); background: rgba(205, 185, 140, 0.07); border-radius: var(--r-lg); padding: 18px 22px; margin-bottom: 20px; }
.banner.warn { border-color: var(--line-2); background: var(--bg-2); }


/* Lists */
.list { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--panel); }
.list .item { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 16px 20px; border-top: 1px solid var(--line); }
.list .item:first-child { border-top: 0; }
.list .meta { min-width: 0; flex: 1 1 240px; }
.list .meta strong { font-weight: 500; }
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.diff > div { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; white-space: pre-wrap; min-width: 0; font-size: 0.95rem; }
.diff .label { grid-column: 1 / -1; font-family: var(--mono); font-size: 0.78rem; color: var(--ink-3); margin-top: 14px; }
.diff .new { border-color: var(--gold); }
.diff .head { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-3); margin-bottom: 6px; }



/* Client portal: progress, intake panels, uploads, requests */
.progress { height: 8px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line-2); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .3s ease; }
.progress.small { height: 6px; margin: 6px 0; }
.progress-row { margin-bottom: 10px; }
.card .progress { margin-top: 4px; }

.sects { margin-top: 28px; display: grid; gap: 12px; }
.sect { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.sect[open] { border-color: var(--line-2); }
.sect > summary { cursor: pointer; padding: 18px 22px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; list-style: none; min-height: 56px; }
.sect > summary::-webkit-details-marker { display: none; }
.sect > summary::before { content: "+"; font-family: var(--mono); color: var(--gold); width: 14px; flex: none; }
.sect[open] > summary::before { content: "\2212"; }
.sect-title { font-size: 1.1rem; flex: 1 1 auto; }
.sect-body { padding: 4px 22px 24px; }
.sect-body .field { margin-top: 22px; }
.label-like { font-size: 0.9rem; color: var(--ink-2); margin-bottom: 8px; }
.howto { margin: 10px 0 0 34px; color: var(--ink-2); font-size: 0.92rem; }
.howto summary { cursor: pointer; color: var(--gold); min-height: 32px; display: flex; align-items: center; }
.steps { margin: 8px 0 0; padding-left: 20px; }
.steps li { margin-bottom: 6px; }

.narrow-field { max-width: 320px; }
.drop { display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; text-align: center; min-height: 180px; padding: 28px 20px; border: 2px dashed var(--line-2); border-radius: var(--r-lg); background: var(--bg-2); cursor: pointer; color: var(--ink); font-size: 1rem; margin: 0; transition: border-color .2s ease, background .2s ease; }
.drop:hover, .drop.over { border-color: var(--gold); background: rgba(205, 185, 140, 0.07); }
.drop:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
.drop-title { font-size: 1.15rem; font-weight: 400; }
.uploads { display: grid; gap: 10px; }
.upl { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; background: var(--panel); }
.upl-name { font-weight: 500; }
.upl.done { border-color: var(--ok); }
.upl.bad { border-color: var(--danger); }
.err { color: var(--danger); }
.stack-gap-sm { margin-top: 12px; }
.list .item .meta a { text-decoration: none; }

.chip { font-family: var(--mono); font-size: 0.72rem; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 10px; color: var(--ink-2); display: inline-block; white-space: nowrap; }
.chip[data-status="new"] { color: var(--gold); border-color: var(--gold); }
.chip[data-status="in_progress"] { color: var(--ink); border-color: var(--ink-3); }
.chip[data-status="waiting_on_client"] { color: var(--danger); border-color: var(--danger); }
.chip[data-status="done"] { color: var(--ok); border-color: var(--ok); }
fieldset.attach { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; margin: 0; min-width: 0; }
fieldset.attach legend { font-size: 0.9rem; color: var(--ink-2); padding: 0 6px; }
fieldset.attach { display: grid; gap: 12px; }
fieldset.attach > p { margin: 0; }
.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.picks:empty { display: none; }
.pick { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; padding: 8px 14px 8px 10px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg-2); cursor: pointer; font-size: 0.92rem; transition: border-color .2s ease, background .2s ease; }
.pick input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--gold); }
.pick-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pick:hover { border-color: var(--ink-3); }
.pick:has(input:checked) { border-color: var(--gold); background: rgba(205, 185, 140, 0.07); }
.drop.compact { min-height: 110px; padding: 20px 16px; gap: 4px; }
.drop.compact .drop-title { font-size: 1rem; }
input[type="file"] { max-width: 100%; color: var(--ink-2); font: inherit; font-size: 0.92rem; }
.thread { display: grid; gap: 12px; margin-bottom: 20px; }
.msg { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 16px; }
.msg.theirs { border-color: var(--gold); background: rgba(205, 185, 140, 0.06); }
.msg .mono { margin-bottom: 4px; }
.badge { font-family: var(--mono); font-size: 0.72rem; background: var(--gold); color: var(--gold-ink); border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.copyrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.answers dt { font-size: 0.85rem; color: var(--ink-3); margin-top: 14px; }
.answers dd { margin: 4px 0 0; white-space: pre-wrap; }
@media (max-width: 600px) { .sect > summary { padding: 14px 16px; } .sect-body { padding: 4px 16px 20px; } .howto { margin-left: 0; } }


/* Portal top menu */
.topnav .sep { width: 1px; height: 18px; background: var(--line-2); margin: 0 6px; flex: none; }
.topnav a, .topnav button { white-space: nowrap; flex: none; }
/* Phone: one row that scrolls sideways instead of wrapping onto two. */
@media (max-width: 760px) {
  .topbar { padding: 14px 16px 10px; gap: 10px; }
  .topnav { flex-wrap: nowrap; width: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; width: calc(100% + 32px); scroll-padding: 16px;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a, .topnav button { padding: 8px 10px; }
}

.diff .new { border-color: var(--gold); }

.pill { font-family: var(--mono); font-size: 0.78rem; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 12px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.pill[data-state="saved"]::before { background: var(--ok); }
.pill[data-state="saving"]::before { background: var(--gold); }
.list .item .tag, .rowitem .tag { margin-left: 8px; }
.reqrow .main { width: 100%; } .reqrow { align-items: flex-start; } .rowitem .howto { margin-left: 0; }
.pagehead h1 { font-size: clamp(1.75rem, 5vw, 2.6rem); }
@media (max-width: 760px) { a.rowitem { flex-wrap: nowrap; } a.rowitem .end { margin-left: 0; } }
.hint { display: flex; justify-content: space-between; gap: 12px; }
