/* ==========================================================================
   Directory Display — editor
   Ink and marigold, like a lit lobby sign: dark frame, light working surface,
   one warm accent reserved for "this goes to your screens".
   ========================================================================== */

:root {
  --ink: #16202b; --ink-2: #33404d; --muted: #64707d;
  --paper: #f6f5f1; --surface: #ffffff; --line: #e1ded5; --line-2: #cbc7ba;
  --amber: #ffb53a; --amber-ink: #1c1608; --amber-text: #8a5a00;
  --blue: #1b5fc7;
  --good: #1f7a4a; --good-bg: #e4f3ea; --warn: #8f5500; --warn-bg: #fdf1d8; --bad: #b3372b; --bad-bg: #fbe9e6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(22, 32, 43, .06), 0 8px 24px rgba(22, 32, 43, .08);
  --display: "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
body.has-publish-bar { padding-bottom: 76px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.08rem; }
p { margin: 0; }
a { color: var(--blue); }
code { font: .86em ui-monospace, Consolas, "Cascadia Mono", monospace; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .88rem; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.icon { flex: none; }

/* ------------------------------------------------------------- controls */
input[type="text"], input[type="password"], input[type="email"], input[type="date"], input[type="number"], input:not([type]), select, textarea {
  width: 100%; min-height: 40px; padding: .45rem .7rem;
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 7px;
}
textarea { resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255, 181, 58, .45); }
input:disabled { background: var(--paper); color: var(--muted); }
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .3rem; }
.field { min-width: 0; }
.hint { font-size: .85rem; color: var(--muted); margin-top: .35rem; }
.hint.bad { color: var(--bad); }
.stack { display: grid; gap: .9rem; }
.stack > .hint { margin-top: -.3rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.inline-field { display: flex; gap: .5rem; }
.inline-field > input { flex: 1; min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 40px; padding: .45rem .95rem;
  font: 600 .92rem var(--sans); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 7px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #0c141c; }
.btn.accent { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.btn.accent:hover { background: #ffc35c; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { border-color: var(--line-2); }
.btn.small { min-height: 34px; padding: .25rem .7rem; font-size: .86rem; }
.btn.wide { width: 100%; }
.btn.add { margin-top: .9rem; border-style: dashed; background: transparent; }
button.link { border: 0; background: none; padding: 0; font: inherit; color: var(--blue); text-decoration: underline; cursor: pointer; }

.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; color: var(--ink-2); background: transparent; border: 1px solid transparent; border-radius: 7px; cursor: pointer; }
.icon-btn:hover { background: #ebe9e2; color: var(--ink); }
.icon-btn.danger:hover { color: var(--bad); }

.switch { display: inline-flex; align-items: center; gap: .55rem; font-weight: 400; font-size: .94rem; margin: 0; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; flex: none; width: 40px; height: 24px; margin: 0; border-radius: 12px; background: #c4c0b3; position: relative; cursor: pointer; transition: background .15s; min-height: 0; padding: 0; border: 0; }
.switch input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.switch input:checked { background: var(--ink); }
.switch input:checked::after { transform: translateX(16px); }

.chip { display: inline-flex; align-items: center; min-height: 32px; padding: .15rem .8rem; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font: 400 .86rem var(--sans); color: var(--ink-2); cursor: pointer; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg { display: inline-flex; padding: 3px; background: #e9e6dd; border-radius: 8px; gap: 2px; flex-wrap: wrap; }
.seg:empty { display: none; }
.seg button { min-height: 30px; padding: .15rem .75rem; border: 0; border-radius: 6px; background: transparent; font: 600 .83rem var(--sans); color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }

.badge { display: inline-block; padding: .05rem .5rem; border-radius: 999px; background: #e9e6dd; color: var(--ink-2); font-size: .76rem; font-weight: 600; vertical-align: middle; }
.badge.ok { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.notice { padding: .6rem .8rem; border-radius: 7px; background: #eceae3; font-size: .9rem; }
.notice.warn { background: var(--warn-bg); color: #5c3700; }
.error { padding: .55rem .75rem; border-radius: 7px; background: var(--bad-bg); color: var(--bad); font-size: .9rem; }
.empty { padding: 1.4rem; border: 1px dashed var(--line-2); border-radius: var(--radius); text-align: center; color: var(--muted); }
.dot { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; background: #a6aaae; }
.dot.ok { background: #2fa866; } .dot.late { background: #e5a11c; } .dot.down { background: #d9523f; }

/* ----------------------------------------------------------------- auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.2rem; background: radial-gradient(900px 500px at 50% -10%, #263646, var(--ink)); }
.auth-card { width: min(100%, 400px); padding: 1.8rem 1.7rem; background: var(--surface); border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .4); display: grid; gap: 1rem; border-top: 4px solid var(--amber); }
.auth-brand { display: flex; align-items: center; gap: .55rem; font: 700 1rem var(--display); color: var(--ink); text-decoration: none; }
.auth-card h1 { font-size: 1.6rem; }
.auth-card .lead { color: var(--muted); margin-top: -.5rem; }
.auth-links { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .9rem; }
.dev-note { padding: .5rem .7rem; background: #eef3fb; border-radius: 7px; }

/* ---------------------------------------------------------------- frame */
#shell { min-height: 100vh; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto 1fr; }
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: .9rem; padding: .55rem clamp(.8rem, 2.5vw, 1.6rem); background: var(--ink); color: #fff; }
.brand { display: flex; align-items: center; gap: .55rem; font: 700 1.02rem var(--display); color: #fff; text-decoration: none; white-space: nowrap; }
.switcher { width: auto; max-width: min(46vw, 320px); min-height: 36px; padding: .25rem .6rem; background: #24313f; border-color: #3a4958; color: #fff; font-weight: 600; }
.spacer { flex: 1; }
.save-state { font-size: .82rem; color: #aeb8c2; white-space: nowrap; }
.save-state.bad { color: #ffb4a8; }
.menu { position: relative; }
.menu summary { list-style: none; display: flex; align-items: center; gap: .3rem; padding: .35rem .6rem; border-radius: 7px; cursor: pointer; font-weight: 600; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover, .menu[open] summary { background: #24313f; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 220px; padding: .4rem; background: var(--surface); color: var(--ink); border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, .28); display: grid; }
.menu-list a, .menu-list button { display: block; padding: .5rem .7rem; border: 0; border-radius: 6px; background: none; font: inherit; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer; }
.menu-list a:hover, .menu-list button:hover { background: var(--paper); }
.menu-who { padding: .5rem .7rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; display: grid; }
.menu-who span { color: var(--muted); font-size: .84rem; }

.banner { grid-column: 1 / -1; display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; padding: .5rem 1rem; background: #e7ecf3; font-size: .9rem; text-align: center; }
.banner.warn { background: var(--warn-bg); color: #5c3700; }
.banner a, .banner .link { font-weight: 600; }

.side { grid-column: 1; align-self: start; position: sticky; top: 0; display: grid; gap: 2px; width: 196px; padding: 1.2rem .7rem; }
.side a { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: 8px; color: var(--ink-2); font-weight: 600; text-decoration: none; }
.side a:hover { background: #ebe9e2; }
.side a.on { background: var(--ink); color: #fff; }
.side a.on .icon { color: var(--amber); }
.layout { grid-column: 2; padding: 1.4rem clamp(.9rem, 2.4vw, 1.8rem) 3rem; min-width: 0; }
.side[hidden] + .layout { grid-column: 1 / -1; }
.layout.with-preview { display: grid; grid-template-columns: minmax(0, 760px) minmax(300px, 1fr); gap: clamp(1rem, 2.2vw, 2rem); align-items: start; }
.content { min-width: 0; }
.panel.narrow { max-width: 760px; margin: 0 auto; }
.panel.wide { max-width: 1180px; margin: 0 auto; }
.panel > * + * { margin-top: 1rem; }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.panel-head .muted { margin-top: .2rem; }
.row-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.card { padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.card.options { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: .8rem 1rem; align-items: start; }
.danger-zone { border-color: #ecc9c4; }

/* ------------------------------------------------------------ directory */
.thead, .trow { display: grid; grid-template-columns: minmax(0, 1fr) 110px 84px 36px; gap: .4rem; align-items: center; }
.tlist.manual .trow, .thead.manual { grid-template-columns: 28px minmax(0, 1fr) 110px 84px 36px; }
.thead { padding: 0 .1rem; font-size: .74rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.thead span:first-child { display: none; }
.thead.manual span:first-child { display: block; }
.thead + .tlist { margin-top: .3rem; }
.trow { padding: .2rem 0; }
.trow.dragging, .slide-card.dragging { opacity: .45; }
.handle { display: none; place-items: center; width: 28px; height: 36px; padding: 0; border: 0; background: none; color: #a09b8c; cursor: grab; touch-action: none; }
.tlist.manual .handle, .slide-card .handle { display: grid; }

/* -------------------------------------------------------- announcements */
.ann-card { display: grid; gap: .6rem; }
.ann-card.off { background: #f3f1eb; }
.ann-top { display: flex; gap: .5rem; align-items: flex-start; }
.ann-top textarea { flex: 1; }
.ann-meta { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center; }
.ann-meta .label { font-size: .84rem; color: var(--muted); }
.count { font-size: .76rem; color: var(--muted); text-align: right; margin-top: -.3rem; }

/* ----------------------------------------------------------------- look */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; }
.themes.compact { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.theme { display: grid; gap: .3rem; padding: .6rem; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: inherit; }
.theme:hover { border-color: var(--line-2); }
.theme.on { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255, 181, 58, .5); }
.theme > span:last-child:not(.swatch) { font-size: .84rem; color: var(--muted); }
.swatch { position: relative; display: block; height: 84px; border-radius: 6px; overflow: hidden; border: 1px solid rgba(0, 0, 0, .08); }
.themes.compact .swatch { height: 64px; }
.swatch-title { position: absolute; left: 10px; top: 8px; font: 700 15px var(--display); padding: 0 5px; border-radius: 4px; }
.swatch-rows { position: absolute; left: 12px; right: 30px; top: 36px; display: grid; gap: 6px; }
.themes.compact .swatch-rows { top: 32px; gap: 5px; }
.swatch-rows i { display: block; height: 4px; border-radius: 2px; opacity: .65; }
.swatch-rows i:nth-child(2) { width: 72%; } .swatch-rows i:nth-child(3) { width: 86%; }
.swatch-dot { position: absolute; right: 10px; top: 36px; width: 12px; height: 12px; border-radius: 50%; }
.accent-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .6rem; }
.accent-row input[type="color"] { width: 46px; height: 40px; padding: 2px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); cursor: pointer; }
.accent-row .hex { width: 110px; font-family: ui-monospace, Consolas, monospace; }
.card > h3 + select, .card > h3 + .logo-row { margin-top: .6rem; }
.logo-row { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.logo-preview { width: 150px; height: 70px; object-fit: contain; border: 1px solid var(--line); border-radius: 7px; background: repeating-conic-gradient(#eeece6 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.logo-preview.none { display: grid; place-items: center; color: var(--muted); font-size: .84rem; background: var(--paper); }

/* -------------------------------------------------------------- screens */
.screen-tabs { display: flex; gap: .4rem; flex-wrap: wrap; }
.screen-tab { display: inline-flex; align-items: center; gap: .45rem; min-height: 38px; padding: .3rem .9rem; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font: 600 .9rem var(--sans); color: var(--ink-2); cursor: pointer; }
.screen-tab.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.screen-tab.add { border-style: dashed; background: transparent; }
.layouts { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: .7rem; }
.layouts.portrait { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.layout-pick { display: grid; gap: .35rem; justify-items: center; min-width: 0; padding: .5rem; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; font: 600 .82rem var(--sans); color: var(--ink-2); }
.layout-pick:hover { border-color: var(--line-2); }
.layout-pick.on { border-color: var(--ink); color: var(--ink); box-shadow: 0 0 0 3px rgba(255, 181, 58, .5); }
.layout-thumb { width: 100%; height: auto; display: block; }
.layout-thumb.portrait { width: 62%; }
.layout-thumb .t-bg { fill: #27333f; }
.layout-thumb .t-photo { fill: #6f8194; }
.layout-thumb .t-main { fill: #3a4856; }
.layout-thumb .t-title { fill: #ffb53a; }
.layout-thumb .t-small { fill: #55657a; }
.layout-thumb .t-line { fill: #94a3b3; }
.layout-thumb .t-line.strong { fill: #dfe6ee; }
.zone-row { padding: .7rem 0; border-top: 1px solid var(--line); display: grid; gap: .6rem; }
.zone-head { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: .8rem; align-items: center; }
.zone-name { font-weight: 600; }
.opts { padding-left: calc(150px + .8rem); display: grid; gap: .6rem; }
.opts.row-actions { display: flex; gap: .5rem 1.2rem; }
p.opts { display: block; }
.shapes { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.shape { display: grid; justify-items: center; gap: .2rem; padding: .8rem; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.shape.on { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255, 181, 58, .5); }
.shape .layout-thumb { width: 120px; }
.shape .layout-thumb.portrait { width: 54px; }
.shape span { font-size: .84rem; color: var(--muted); }

.seconds { display: inline-flex; align-items: center; gap: .45rem; font-size: .88rem; font-weight: 400; color: var(--ink-2); margin: 0; }
.seconds input { width: 72px; min-height: 34px; }
.strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: .6rem; }
.strip-empty { grid-column: 1 / -1; padding: 1.3rem; border: 1px dashed var(--line-2); border-radius: var(--radius); text-align: center; color: var(--muted); }
.slide-card { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.slide-card .thumb, .pick .thumb { position: relative; aspect-ratio: 4 / 3; background: #dcd8cc; }
.slide-card .thumb img, .pick .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; -webkit-user-drag: none; user-select: none; }
.slide-card.off .thumb img { filter: grayscale(1); opacity: .45; }
.slide-card .num { position: absolute; left: 6px; top: 6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: rgba(22, 32, 43, .85); color: #fff; font: 600 .78rem/24px var(--sans); text-align: center; }
.slide-card .handle { position: absolute; right: 4px; top: 4px; width: 30px; height: 30px; border-radius: 6px; background: rgba(255, 255, 255, .9); color: var(--ink-2); }
.slide-card .tag { position: absolute; left: 6px; bottom: 6px; right: 6px; padding: 1px 6px; border-radius: 4px; background: rgba(22, 32, 43, .85); color: #fff; font-size: .72rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slide-actions { display: flex; justify-content: space-between; padding: 2px; }
.slide-actions .icon-btn { width: 34px; height: 34px; }
.slide-card.busy .thumb { display: grid; place-items: center; color: var(--muted); font-size: .8rem; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: .6rem; max-height: min(56vh, 520px); overflow: auto; padding: 3px; margin-top: .7rem; }
.pick { position: relative; border: 3px solid transparent; border-radius: var(--radius); cursor: pointer; overflow: hidden; }
.pick.on { border-color: var(--ink); }
.pick.on::after { content: "\2713"; position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--amber); color: var(--amber-ink); font: 700 .9rem/24px var(--sans); text-align: center; }
.pick .del { position: absolute; left: 4px; top: 4px; width: 28px; height: 28px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, .92); display: none; place-items: center; color: var(--bad); cursor: pointer; }
.pick:hover .del, .pick:focus-within .del { display: grid; }

.screen-status { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.ways { display: grid; gap: .9rem; }
.way { padding-top: .9rem; border-top: 1px solid var(--line); display: grid; gap: .45rem; }
.way .hint { margin: 0; }
.code-input { max-width: 150px; text-transform: uppercase; letter-spacing: .18em; font: 600 1.05rem ui-monospace, Consolas, monospace; }
.address { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.address code, .way code { padding: .25rem .5rem; border-radius: 6px; background: var(--paper); border: 1px solid var(--line); word-break: break-all; }

/* ------------------------------------------------------- account pages */
.buildings { display: grid; gap: .7rem; }
.building { display: flex; align-items: center; gap: 1rem; color: inherit; text-decoration: none; }
.building:hover { border-color: var(--ink); }
.building-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 10px; background: var(--ink); color: var(--amber); flex: none; }
.building-text { flex: 1; min-width: 0; display: grid; gap: .1rem; }
.building-text b { font: 700 1.1rem var(--display); }
.slug-row { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; }
.slug-fix { color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
.slug-input { width: 220px; flex: 0 1 220px; font-family: ui-monospace, Consolas, monospace; }
.people { display: grid; }
.person { display: flex; align-items: center; gap: .8rem; padding: .65rem 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.person:first-child { border-top: 0; padding-top: 0; }
.person:last-child { padding-bottom: 0; }
.person-text { flex: 1; min-width: 180px; display: grid; }
.person-text b + .badge { justify-self: start; }
.person select { width: auto; }
.invite-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px auto; gap: .5rem; }
.standing { border-left: 5px solid var(--good); }
.standing.warn { border-left-color: #e5a11c; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; }
.plan { display: grid; gap: .5rem; align-content: start; padding: 1rem; border: 1px solid var(--line-2); border-radius: var(--radius); }
.plan.best { border-color: var(--ink); box-shadow: inset 0 4px 0 var(--amber); }
.plan b { font: 700 1.05rem var(--display); }
.price span { font: 700 1.9rem var(--display); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .7rem; }
.tile { padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: grid; }
.tile b { font: 700 1.6rem var(--display); font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: .84rem; }
.table-wrap { overflow-x: auto; padding: 0; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }

/* -------------------------------------------------------------- preview */
.preview { position: sticky; top: 16px; min-width: 0; }
.preview-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .6rem; flex-wrap: wrap; }
.preview-close, .preview-open, .preview-fab { display: none; }
.preview-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0d1620; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin: 0 auto; }
.preview-frame.portrait { aspect-ratio: 9 / 16; width: auto; height: min(72vh, 740px); max-width: 100%; }
.preview-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }

/* -------------------------------------------------------------- publish */
.publish { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; justify-content: flex-end; gap: .6rem; padding: .7rem clamp(.9rem, 2.4vw, 1.8rem); background: var(--ink); color: #fff; box-shadow: 0 -6px 24px rgba(0, 0, 0, .2); }
.publish-text { margin-right: auto; font-weight: 600; }
.publish .btn.ghost { color: #fff; }
.publish .btn.ghost:hover { border-color: rgba(255, 255, 255, .4); }

/* -------------------------------------------------------------- dialogs */
.dialog { width: min(92vw, 460px); padding: 1.4rem; border: 0; border-radius: 14px; box-shadow: 0 24px 70px rgba(0, 0, 0, .38); color: var(--ink); }
.dialog.wide { width: min(94vw, 760px); }
.dialog::backdrop { background: rgba(13, 22, 32, .6); }
.dialog h3 { font-size: 1.3rem; margin-bottom: .7rem; }
.dialog-text { color: var(--ink-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; margin-top: 1.2rem; }
.toasts { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); z-index: 80; display: grid; gap: .5rem; width: min(92vw, 480px); pointer-events: none; }
.toast { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; border-radius: 9px; background: #0d1620; color: #fff; box-shadow: var(--shadow); pointer-events: auto; transition: opacity .4s, transform .4s; }
.toast.bad { background: var(--bad); }
.toast.gone { opacity: 0; transform: translateY(8px); }
.toast button { border: 0; background: none; color: var(--amber); font: 600 .9rem var(--sans); cursor: pointer; padding: .2rem .3rem; }

/* --------------------------------------------------------------- narrow */
@media (max-width: 1080px) {
  #shell { grid-template-columns: minmax(0, 1fr); }
  .side { grid-column: 1; position: static; width: auto; display: flex; gap: .2rem; padding: .4rem .6rem; overflow-x: auto; background: var(--surface); border-bottom: 1px solid var(--line); }
  .side a { white-space: nowrap; padding: .45rem .7rem; }
  .layout, .side[hidden] + .layout { grid-column: 1; }
  .layout.with-preview { display: block; }
  .preview { display: none; }
  .preview.open { display: block; position: fixed; inset: 0; z-index: 70; top: 0; padding: 1rem; background: var(--paper); overflow: auto; }
  .preview.open .preview-close { display: inline-flex; margin-left: auto; }
  .preview-frame.portrait { height: min(78vh, 780px); }
  .preview-open { display: inline-flex; }
  .preview-fab:not([hidden]) { display: inline-flex; position: fixed; right: 1rem; bottom: 1rem; z-index: 30; box-shadow: var(--shadow); }
  body.has-publish-bar .preview-fab { display: none; }
}
@media (max-width: 640px) {
  .brand span, .save-state { display: none; }
  .thead { display: none; }
  .trow, .tlist.manual .trow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; grid-template-areas: "name name del" "suite floor del"; padding: .5rem 0; border-bottom: 1px solid var(--line); }
  .tlist.manual .trow { grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr) 36px; grid-template-areas: "grip name name del" "grip suite floor del"; }
  .trow .handle { grid-area: grip; } .trow .name { grid-area: name; } .trow .suite { grid-area: suite; } .trow .floor { grid-area: floor; } .trow .icon-btn { grid-area: del; }
  .two, .invite-row, .zone-head { grid-template-columns: 1fr; }
  .card.options { grid-template-columns: 1fr 1fr; }
  .opts { padding-left: 0; }
  .publish-text { font-size: .84rem; }
  .publish #discard { display: none; }
  h2 { font-size: 1.45rem; }
}
