/* Speed Dating Board: the platform around the cards.
   Yellowgrape Design System 2.3: black stage, white text, one yellow moment per screen (the primary action),
   Poppins for display, Inter for everything else, square surfaces, pills only for actions. */

:root {
  --midnight: #000;
  --signal: #FFFF00;
  --white: #fff;
  --chalk: #e3e6e4;
  --graphite: #2c2c2e;
  --g900: #1c1c1e;
  --g800: #141416;
  --g700: #48484a;
  --g500: #86868b;
  --g400: #a1a1a6;
  --g300: #c7c7cc;
  --red: #ff5c7a;
  /* statuses: the DS category palette, tested on black */
  --st-new: #86868b;
  --st-invited: #4e7aff;
  --st-draft: #bc43cb;
  --st-review: #f94381;
  --st-ready: #0b998f;
  --st-reprint: #7ba505;
  --st-printed: #ffffff;
  --st-left: #48484a;
  --display: "Poppins", "Avenir Next", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
  --gutter: 16px;
  --top-h: 60px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 160ms;
  --t-med: 240ms;
  color-scheme: dark;
}
@media (min-width: 720px) { :root { --gutter: 24px; --top-h: 64px; } }
@media (min-width: 1280px) { :root { --gutter: 32px; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--midnight); color: var(--white); -webkit-text-size-adjust: 100%; scrollbar-color: var(--g700) var(--midnight); scrollbar-width: thin; overscroll-behavior-y: none; }
body { margin: 0; min-height: 100dvh; overscroll-behavior-y: none; font: 400 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "cv11", "ss01", "tnum"; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.025em; text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
::selection { background: var(--signal); color: var(--midnight); }
:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--midnight); }
::-webkit-scrollbar-thumb { background: var(--g700); border: 3px solid var(--midnight); border-radius: 10px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.boot { padding: 48px var(--gutter); color: var(--g400); }
.muted { color: var(--g400); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  height: var(--top-h); padding: 0 var(--gutter);
  background: var(--midnight); border-bottom: 1px solid var(--graphite);
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; flex: none; min-width: 0; }
.brand img { height: 20px; width: auto; }
.brand span { font: 300 12px/1 var(--display); letter-spacing: 2px; text-transform: uppercase; color: var(--g400); padding-left: 14px; border-left: 1px solid var(--graphite); white-space: nowrap; }
.tabs { display: flex; gap: 2px; height: 100%; }
.tabs a {
  display: flex; align-items: center; padding: 0 14px; height: 100%;
  text-decoration: none; font: 500 14px/1 var(--body); color: var(--g400);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  transition: color var(--t-fast) var(--ease);
}
.tabs a:hover { color: var(--white); }
.tabs a[aria-current="page"] { color: var(--white); border-bottom-color: var(--white); }
.me { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--g400); min-width: 0; }
.me .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Admin | Colleague: a compact version of the segmented switch */
.viewswitch.switch button { height: 30px; padding: 0 12px; font-size: 13px; }
/* Colleague view: the tabs make way for the colleague you look as */
.viewas { display: flex; align-items: center; gap: 10px; min-width: 0; font: 500 14px/1 var(--body); color: var(--g400); }
.viewas .ic { width: 16px; height: 16px; color: var(--signal); }
.viewas .dd { width: 340px; flex: none; }
.banner.preview { display: flex; gap: 10px; align-items: flex-start; border-color: var(--signal); color: var(--white); }
.banner.preview .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--signal); }

/* ---------- layout ---------- */
.page { padding: 32px var(--gutter) 140px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head h1 { font-size: 36px; line-height: 1.05; }
.page-head .sub { margin-top: 8px; font-size: 15px; color: var(--g400); max-width: 64ch; text-wrap: pretty; }
.section-title { font-size: 22px; margin: 44px 0 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 100px;
  border: 1px solid var(--g700); background: transparent; color: var(--white);
  font: 500 14px/1 var(--body); text-decoration: none; white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:hover { border-color: var(--white); }
.btn:active { transform: scale(0.97); }
.btn .ic { width: 16px; height: 16px; }
.btn.primary { background: var(--white); border-color: var(--white); color: var(--midnight); }
.btn.primary:hover { background: var(--chalk); border-color: var(--chalk); }
.btn.yellow { background: var(--signal); border-color: var(--signal); color: var(--midnight); font-weight: 600; }
.btn.yellow:hover { background: #fff44d; border-color: #fff44d; }
.btn.ghost { border-color: transparent; color: var(--g400); }
.btn.ghost:hover { color: var(--white); border-color: transparent; background: var(--g900); }
.btn.danger { color: var(--red); border-color: transparent; }
.btn.danger:hover { border-color: var(--red); }
.btn.small { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.big { height: 52px; padding: 0 24px; font-size: 16px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--white); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--g700); background: transparent; color: var(--white); display: inline-grid; place-items: center; flex: none; transition: border-color var(--t-fast) var(--ease); }
.icon-btn:hover { border-color: var(--white); }

/* ---------- filter bar: sticky under the top bar ---------- */
.filterbar {
  position: sticky; top: var(--top-h); z-index: 15;
  display: flex; flex-direction: column; gap: 12px;
  margin: 0 calc(-1 * var(--gutter)) 12px; padding: 16px var(--gutter);
  background: var(--midnight); border-bottom: 1px solid var(--graphite);
}
.fb-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; min-width: 0; }
.fb-end { display: flex; align-items: center; gap: 8px; flex: none; }
.filterbar .search { width: 280px; flex: none; max-width: none; min-width: 0; }
.filterbar .search input { height: 40px; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--g400); pointer-events: none; }
.search input { width: 100%; height: 36px; padding: 0 12px 0 36px; border: 1px solid var(--graphite); background: var(--midnight); color: var(--white); font: 400 14px/1 var(--body); transition: border-color var(--t-fast) var(--ease); }
.search input::placeholder { color: var(--g500); }
.search input:hover { border-color: var(--g700); }
.search input:focus { outline: none; border-color: var(--white); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* segmented switch: one bordered whole, a white thumb slides to the chosen option */
.switch { position: relative; display: inline-flex; flex: none; max-width: 100%; border: 1px solid var(--graphite); background: var(--midnight); overflow-x: auto; overscroll-behavior: none; scrollbar-width: none; }
.switch.scrolls:not(.at-end) { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.switch::-webkit-scrollbar { display: none; }
.switch .thumb { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--white); pointer-events: none; transition: transform var(--t-med) var(--ease), width var(--t-med) var(--ease); }
.switch .thumb.still { transition: none; }
.switch button {
  position: relative; z-index: 1; flex: none; display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px; border: 0; background: transparent; color: var(--g300);
  font: 500 13px/1 var(--body); white-space: nowrap; box-shadow: inset 1px 0 0 var(--graphite);
  transition: color var(--t-fast) var(--ease);
}
.switch button:first-of-type, .switch [aria-pressed="true"], .switch [aria-pressed="true"] + button { box-shadow: none; }
.switch button:hover { color: var(--white); }
.switch button[aria-pressed="true"] { color: var(--midnight); }
.switch button b { font-weight: 600; color: var(--g500); font-variant-numeric: tabular-nums; min-width: 2ch; text-align: left; transition: color var(--t-fast) var(--ease); }
.switch button[aria-pressed="true"] b { color: var(--g700); }
.switch .ic { width: 16px; height: 16px; color: var(--c, currentColor); transition: color var(--t-fast) var(--ease); }
.switch button[aria-pressed="true"] .ic { color: currentColor; }
.switch button:focus-visible { outline: 2px solid var(--white); outline-offset: -2px; }
.switch button[aria-pressed="true"]:focus-visible { outline-color: var(--midnight); outline-offset: -4px; }
#hubswitch button { padding: 0 16px; font: 500 14px/1 var(--display); letter-spacing: -0.01em; }
#hubswitch button b { font: 600 13px/1 var(--body); letter-spacing: 0; }
@media (prefers-reduced-motion: reduce) { .switch .thumb { transition: none; } }

/* status */
.pill { display: inline-flex; align-items: center; gap: 6px; font: 500 13px/1.2 var(--body); color: var(--g300); white-space: nowrap; }
.pill .ic { width: 14px; height: 14px; stroke-width: 2; color: var(--dot, var(--st-new)); }
.pill.st-printed { color: var(--g400); }
.tag { display: inline-block; padding: 3px 8px; background: var(--g900); color: var(--g300); font: 500 12px/1.3 var(--body); white-space: nowrap; }
.tag.sero { background: linear-gradient(45deg, #0433FF, #FF40FF); color: #fff; }
.flag { display: inline-flex; align-items: center; gap: 5px; font: 500 12.5px/1.2 var(--body); color: var(--red); white-space: nowrap; }
.flag .ic { width: 14px; height: 14px; }

/* ---------- the board: one section per hub ---------- */
.hub { padding: 28px 0 8px; border-top: 1px solid var(--graphite); }
.hub:first-of-type { border-top: 0; padding-top: 12px; }
.hub-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.hub-head h2 { font-size: 24px; letter-spacing: -0.02em; }
.hub-head .n { font: 500 14px/1 var(--body); color: var(--g400); }
.hub-head .todo { font: 500 13px/1 var(--body); color: var(--g300); padding-left: 14px; border-left: 1px solid var(--graphite); }
.hub-head .todo b { color: var(--white); font-weight: 600; }
.hub-head .sel { margin-left: auto; }
/* Card frames get a quiet light-grey edge; only the card being made (the editor stage) reads like a print proof. */
.cardframe { position: relative; width: 100%; aspect-ratio: 148 / 105; background: #131217; outline: 1px solid rgba(255, 255, 255, .24); outline-offset: 0; }
.cardframe > .sdcard { position: absolute; left: 0; top: 0; transform-origin: 0 0; }

/* cards view */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 28px 20px; }
@media (min-width: 1600px) { .board { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); } }
.tile { position: relative; display: flex; flex-direction: column; gap: 12px; }
.tile-media { position: relative; transition: transform var(--t-fast) var(--ease); }
.tile .cardframe { cursor: pointer; transition: outline-color var(--t-fast) var(--ease); }
.tile .meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile .nm { font: 600 15px/1.3 var(--body); color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .tm { font-size: 13px; color: var(--g400); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .st { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.tile.selected .cardframe { outline: 2px solid var(--signal); outline-offset: 3px; }

/* View: hovering (or focusing) the card dims it and says what a click does */
.view-hint { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity 160ms var(--ease); }
.view-hint > span {
  display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 24px); height: 36px; padding: 0 16px;
  border-radius: 100px; background: var(--white); color: var(--midnight); font: 600 13px/1 var(--body);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transform: translateY(6px); transition: transform 220ms var(--ease);
}
.view-hint .ic { width: 16px; height: 16px; flex: none; }
.tile .cardframe:focus-visible .view-hint { opacity: 1; }
.tile .cardframe:focus-visible .view-hint > span { transform: none; }

/* Select: a box in the card's top-right corner; its label slides out on hover */
.pick { position: absolute; top: 0; right: 0; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; }
.pick .check { width: 22px; height: 22px; border: 1.5px solid rgba(255, 255, 255, .9); background: rgba(19, 18, 23, .72); box-shadow: 0 2px 10px rgba(0, 0, 0, .45); transition: opacity var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
.pick .check:checked { background: var(--signal); border-color: var(--signal); }
.pick .check:checked::after { width: 10px; height: 6px; }
.pick-text {
  position: absolute; right: 40px; top: 50%; padding: 6px 9px; background: var(--white); color: var(--midnight);
  font: 600 12px/1 var(--body); white-space: nowrap; opacity: 0; transform: translate(4px, -50%); pointer-events: none;
  transition: opacity 140ms var(--ease), transform 180ms var(--ease);
}
.pick-text .on, .tile.selected .pick-text .off { display: none; }
.tile.selected .pick-text .on { display: inline; }
@media (hover: hover) and (pointer: fine) {
  .tile-media:hover { transform: translateY(-2px); }
  .tile .cardframe:hover { outline-color: rgba(255, 255, 255, .45); }
  .tile .cardframe:hover .view-hint { opacity: 1; }
  .tile .cardframe:hover .view-hint > span { transform: none; }
  .pick .check { opacity: .65; }
  .tile:hover .pick .check, .selecting .pick .check, .pick .check:checked, .pick .check:focus-visible { opacity: 1; }
  .pick:hover .check { border-color: var(--white); }
  .pick:hover .pick-text { opacity: 1; transform: translate(0, -50%); }
}
@media (prefers-reduced-motion: reduce) { .view-hint > span, .pick-text, .tile-media { transition: none; transform: none; } }
.check {
  flex: none; width: 20px; height: 20px; border: 1.5px solid var(--g500); background: transparent;
  display: grid; place-items: center; cursor: pointer; appearance: none; margin: 0;
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.check:hover { border-color: var(--white); }
.check:checked { background: var(--signal); border-color: var(--signal); }
.check:checked::after { content: ""; width: 9px; height: 5px; border-left: 2px solid var(--midnight); border-bottom: 2px solid var(--midnight); transform: translateY(-1px) rotate(-45deg); }

/* list view */
.rows { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 20px 96px minmax(180px, 1.3fr) minmax(140px, 1fr) 150px minmax(180px, 1fr) 160px; gap: 16px; align-items: center; padding: 10px 0; border-top: 1px solid var(--graphite); cursor: pointer; transition: background-color var(--t-fast) var(--ease); }
.row:hover { background: var(--g800); box-shadow: 0 0 0 8px var(--g800); }
.row:first-child { border-top: 0; }
.row .cardframe { aspect-ratio: 148 / 105; }
.row .nm { font: 600 14px/1.3 var(--body); color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .tm, .row .em, .row .dt { font-size: 13px; color: var(--g400); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .em.missing { color: var(--red); }
.row.selected { background: var(--g900); box-shadow: 0 0 0 8px var(--g900); }
.rows-head { display: grid; grid-template-columns: 20px 96px minmax(180px, 1.3fr) minmax(140px, 1fr) 150px minmax(180px, 1fr) 160px; gap: 16px; padding: 0 0 8px; font: 500 12px/1 var(--body); color: var(--g500); }
@media (max-width: 1100px) {
  .row, .rows-head { grid-template-columns: 20px 84px minmax(140px, 1.2fr) minmax(120px, 1fr) 140px; }
  .row .em, .row .dt, .rows-head .em, .rows-head .dt { display: none; }
}
@media (max-width: 700px) {
  .row, .rows-head { grid-template-columns: 20px 72px minmax(0, 1fr) 120px; gap: 10px; }
  .row .tm, .rows-head .tm { display: none; }
}

.empty-state { padding: 72px 0; text-align: center; color: var(--g400); }
.empty-state h2 { color: var(--white); font-size: 24px; margin-bottom: 8px; }
.empty-state p { text-wrap: pretty; }

/* ---------- selection bar ---------- */
.selbar {
  position: fixed; left: 50%; bottom: 24px; z-index: 30; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  max-width: calc(100vw - 32px); padding: 8px 8px 8px 20px;
  background: var(--white); color: var(--midnight); border-radius: 100px;
  box-shadow: 0 24px 48px -16px rgba(0,0,0,.8);
}
.selbar .count { font: 600 14px/1 var(--body); margin-right: 8px; white-space: nowrap; }
.selbar .btn { height: 36px; color: var(--midnight); border-color: var(--g300); font-size: 13px; }
.selbar .btn:hover { border-color: var(--midnight); }
.selbar .btn.ghost { border-color: transparent; color: var(--g700); }
.selbar .btn.ghost:hover { background: var(--chalk); color: var(--midnight); }
.selbar .btn.yellow { background: var(--signal); border-color: var(--signal); }

/* ---------- forms & dialogs ---------- */
dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overscroll-behavior: none; padding: 0; border: 1px solid var(--graphite); background: var(--g900); color: var(--white); box-shadow: 0 40px 100px -20px rgba(0,0,0,.9); }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog[open] { animation: dlg-in var(--t-med) var(--ease); }
@keyframes dlg-in { from { opacity: 0; transform: scale(.97); } }
@media (prefers-reduced-motion: reduce) { dialog[open] { animation: none; } }
dialog form, .dlg { padding: 28px 28px 24px; display: flex; flex-direction: column; gap: 18px; }
dialog h2 { font-size: 26px; line-height: 1.1; }
dialog .lead { color: var(--g300); margin-top: -6px; text-wrap: pretty; }
dialog .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.wide-dialog { width: min(1080px, calc(100vw - 32px)); }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label, .field .label { font: 500 13px/1.2 var(--body); color: var(--g300); }
.field .hint { font-size: 13px; color: var(--g500); }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--g700); background: var(--midnight); color: var(--white);
  transition: border-color var(--t-fast) var(--ease);
}
.input::placeholder { color: var(--g500); }
.input:focus { outline: none; border-color: var(--white); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a1a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
textarea.input { min-height: 160px; resize: vertical; font: 400 13.5px/1.45 ui-monospace, Menlo, monospace; }
.radios { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.radios label { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--g700); cursor: pointer; font-weight: 500; transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
.radios label:has(input:checked) { border-color: var(--white); background: var(--midnight); }
.radios input { accent-color: var(--white); }
.checkline { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; color: var(--g300); }
.checkline input { margin-top: 3px; accent-color: var(--signal); width: 16px; height: 16px; }
.error { color: var(--red); font-weight: 500; }

/* ---------- toasts ---------- */
#toasts { position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast { max-width: min(560px, calc(100vw - 32px)); padding: 13px 18px; background: var(--white); color: var(--midnight); font-weight: 500; font-size: 14px; box-shadow: 0 20px 48px -16px rgba(0,0,0,.8); }
.toast.bad { background: var(--red); color: var(--midnight); }

/* ---------- sign in ---------- */
.signin { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: 56px; padding: 48px clamp(24px, 6vw, 96px); }
.signin .logo { height: 26px; margin-bottom: 56px; }
.signin h1 { font-size: clamp(52px, 7vw, 104px); line-height: .94; letter-spacing: -0.035em; }
.signin .sub { margin-top: 24px; font-size: 18px; color: var(--g300); max-width: 36ch; text-wrap: pretty; }
.signin .box { margin-top: 40px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.signin .note { font-size: 14px; color: var(--g400); }
.signin .demo .cardframe { background: transparent; }
.devlogin { margin-top: 28px; padding: 18px; border: 1px dashed var(--g700); display: flex; flex-direction: column; gap: 10px; width: min(460px, 100%); }
.devlogin .row { display: flex; gap: 8px; }
.devlogin .quick { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .signin { grid-template-columns: 1fr; gap: 36px; padding: 32px 16px 48px; }
  .signin .logo { margin-bottom: 32px; }
}

/* ---------- editor ---------- */
/* Desktop: the card fills the screen's height on the left and stays put; the right column (title, settings,
   Save) scrolls past it and ends on the same line as the card. Phone and tablet: one column. */
.editor {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; grid-template-rows: auto 1fr;
  grid-template-areas: "stage head" "stage panel"; column-gap: 40px;
}
.editor-head { grid-area: head; display: flex; flex-direction: column; gap: 8px; padding-bottom: 28px; }
.editor-head h1 { font-size: 32px; line-height: 1.1; }
.editor-head .sub { font-size: 15px; color: var(--g400); text-wrap: balance; }
.editor-head .back { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-bottom: 8px; font: 500 14px/1 var(--body); color: var(--g400); text-decoration: none; transition: color var(--t-fast) var(--ease); }
.editor-head .back:hover { color: var(--white); }
.editor-head .back .ic { width: 16px; height: 16px; }
.stage {
  --pad: 32px; --cap: 36px; --stage-h: calc(100dvh - var(--top-h) - 48px);
  grid-area: stage; align-self: start; position: sticky; top: calc(var(--top-h) + 24px);
  height: var(--stage-h); padding: var(--pad); display: flex; flex-direction: column; justify-content: center;
  background: var(--g800); border: 1px solid var(--graphite);
}
.stage .zoomwrap, .stage .caption { width: min(100%, calc((var(--stage-h) - 2 * var(--pad) - var(--cap) - 2px) * 148 / 105)); margin-inline: auto; }
.panel { grid-area: panel; }
.page.editor-page { padding-top: 24px; padding-bottom: 24px; }
/* The card being made: a red cut line on the trim and crop marks out from each corner, like a print proof. */
.stage .cardframe { --cut: #E4003A; --mark-out: 14px; --mark-len: 10px; background: transparent; outline-color: var(--cut); }
.stage .cardframe::after {
  content: ""; position: absolute; inset: calc(-1 * var(--mark-out)); z-index: 1; pointer-events: none;
  --o: calc(var(--mark-out) - 1px); --e: calc(100% - var(--mark-out) + 1px);
  background:
    linear-gradient(var(--cut) 0 0) 0 var(--o) / var(--mark-len) 1px,
    linear-gradient(var(--cut) 0 0) var(--o) 0 / 1px var(--mark-len),
    linear-gradient(var(--cut) 0 0) 100% var(--o) / var(--mark-len) 1px,
    linear-gradient(var(--cut) 0 0) var(--e) 0 / 1px var(--mark-len),
    linear-gradient(var(--cut) 0 0) 0 var(--e) / var(--mark-len) 1px,
    linear-gradient(var(--cut) 0 0) var(--o) 100% / 1px var(--mark-len),
    linear-gradient(var(--cut) 0 0) 100% var(--e) / var(--mark-len) 1px,
    linear-gradient(var(--cut) 0 0) var(--e) 100% / 1px var(--mark-len);
  background-repeat: no-repeat;
}
.stage .cardframe > .sdcard { overflow: hidden; }
.stage .caption { margin-top: 16px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--g400); }
.panel { display: flex; flex-direction: column; gap: 28px; }
.panel > .savebar { margin-top: auto; }
.panel section { display: flex; flex-direction: column; gap: 12px; }
.panel h2 { font-size: 20px; }
.panel .help { font-size: 14px; color: var(--g400); text-wrap: pretty; }
.banner { padding: 14px 16px; border: 1px solid var(--graphite); font-size: 14px; color: var(--g300); text-wrap: pretty; }
.banner.review { border-color: var(--st-review); }
.banner.printed { border-color: var(--g500); color: var(--white); }
/* A sticky bar keeps the strip below it clear (::after), so the content it floats over never peeks out underneath. */
.savebar::after, .textbar::after { content: ""; position: absolute; left: -1px; right: -1px; top: 100%; height: calc(var(--dock) + 1px); background: var(--midnight); }
.savebar { --dock: 24px; position: sticky; bottom: var(--dock); z-index: 5; display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--g900); border: 1px solid var(--graphite); box-shadow: 0 0 0 6px var(--midnight), 0 20px 40px -14px rgba(0,0,0,.8); }
.savebar .btn { width: 100%; }
.savebar .state { font-size: 13px; color: var(--g400); }
.savebar .state.bad { color: var(--red); }
.slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.slot { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--midnight); border: 1px dashed var(--g700); display: grid; place-items: center; cursor: pointer; padding: 0; color: var(--g400); transition: border-color var(--t-fast) var(--ease); }
.slot:hover { border-color: var(--white); color: var(--white); }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot.filled { border-style: solid; border-color: transparent; }
.slot.active { border-color: var(--signal); box-shadow: 0 0 0 1px var(--signal); }
.slot .num { position: absolute; left: 6px; top: 6px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--signal); color: var(--midnight); font: 600 12px/20px var(--body); text-align: center; }
.zoomrow { display: flex; align-items: center; gap: 12px; }
.zoomrow input[type="range"] { flex: 1; accent-color: var(--white); }
.ministats { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; margin: 0; }
.ministats dt { color: var(--g400); }
.ministats dd { margin: 0; font-weight: 500; }
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.compare ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--g300); }
.compare .box { margin-bottom: 12px; }
.compare .box b { display: block; font-size: 13px; margin-bottom: 2px; color: var(--white); }
@media (max-width: 1100px) {
  .editor { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "head" "stage" "panel"; row-gap: 28px; }
  .editor-head { padding-bottom: 0; }
  .stage { position: relative; top: 0; height: auto; display: block; padding: clamp(18px, 3vw, 44px); }
  .stage .zoomwrap, .stage .caption { width: auto; margin-inline: 0; }
  .page.editor-page { padding-bottom: 140px; }
}

/* ---------- mobile ---------- */
@media (max-width: 700px) {
  /* phone: logo and sign out on top, the tabs on their own full-width row; only the filter bar sticks */
  .topbar { position: relative; height: auto; flex-wrap: wrap; gap: 0 12px; }
  .brand { height: 56px; }
  .brand span { display: none; }
  .brand img { height: 18px; }
  .me { flex: none; margin-left: auto; height: 56px; gap: 8px; }
  .me .who, #signout span { display: none; }
  #signout { padding: 0 8px; }
  .viewas { order: 3; flex: 1 0 100%; height: 52px; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); border-top: 1px solid var(--graphite); }
  .viewas .dd { flex: 1; width: auto; }
  .tabs { order: 3; flex: 1 0 100%; height: 44px; margin: 0 calc(-1 * var(--gutter)); padding: 0 calc(var(--gutter) - 10px); border-top: 1px solid var(--graphite); overflow-x: auto; overscroll-behavior: none; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { padding: 0 10px; font-size: 14px; }
  .filterbar { top: 0; }
  .page { padding: 24px var(--gutter) 140px; }
  .page-head { margin-bottom: 20px; }
  .page-head h1 { font-size: 30px; }
  .filterbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "hub hub" "status status" "tools sel"; gap: 10px 8px; padding: 12px var(--gutter); }
  .fb-row { display: contents; }
  #hubswitch { grid-area: hub; }
  #statuses { grid-area: status; }
  .fb-row:first-child .fb-end { grid-area: tools; min-width: 0; }
  .fb-row:last-child .fb-end { grid-area: sel; }
  .filterbar .search { flex: 1; width: auto; }
  #modeswitch button span { display: none; }
  #hubswitch button { padding: 0 14px; font-size: 13px; }
  #modeswitch button { padding: 0 12px; }
  .hub-head h2 { font-size: 20px; }
  .board { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 20px 12px; }
  .stage { padding: 12px; overflow: hidden; }
  .stage .zoomwrap { transition: transform .25s var(--ease); transform-origin: 0 0; }
  .radios { grid-template-columns: 1fr; }
  .selbar { bottom: 12px; border-radius: 20px; padding: 8px; }
  .savebar { --dock: 10px; padding: 10px; gap: 6px; }
  .savebar .btn.big { height: 48px; font-size: 15px; }
  .savebar .state:empty { display: none; }
}

/* ---------- tables (mail log, import, archive) ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font: 500 12px/1.2 var(--body); color: var(--g500); padding: 10px 12px; border-bottom: 1px solid var(--g700); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--graphite); vertical-align: top; }
.table tr.clickable { cursor: pointer; }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table tr.clickable:hover td { background: var(--g800); }
.table tr.clickable:hover td:first-child { box-shadow: -12px 0 0 var(--g800); }
.table tr.clickable:hover td:last-child { box-shadow: 12px 0 0 var(--g800); }
.tablewrap { overflow-x: auto; overscroll-behavior: none; }
.run { border-top: 1px solid var(--graphite); padding: 24px 0; }
.run-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.run-head h2 { font-size: 22px; }
.run .board { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px 14px; }
.mailbody { margin-top: 12px; border: 1px solid var(--graphite); overflow: hidden; }
.mailbody iframe { width: 100%; height: 0; border: 0; display: block; background: var(--white); }
.progress { height: 4px; background: var(--graphite); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--signal); transition: width .2s var(--ease); }

/* ---------- colleagues (the sheet) ---------- */
.page.narrow { max-width: calc(1120px + 2 * var(--gutter)); margin-inline: auto; }
.banner + .choice { margin-top: 24px; }
.choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.option { padding: 24px; border: 1px solid var(--graphite); background: var(--g800); display: flex; flex-direction: column; gap: 12px; }
.option h2 { font-size: 20px; }
.option p { color: var(--g300); font-size: 14px; text-wrap: pretty; flex: 1; }
.option p b { color: var(--white); font-weight: 600; }
.option > :last-child { margin-top: 12px; }
.linkform { display: flex; gap: 8px; }
.linkform .input { flex: 1; min-height: 40px; padding: 8px 12px; }

/* the sheet itself */
.sheetbox { border: 1px solid var(--graphite); background: var(--g800); }
.sheetbox-head { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--graphite); }
.sheet-title { display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 12px; row-gap: 4px; align-items: center; min-width: 0; }
.sheet-title .ic { width: 20px; height: 20px; color: var(--white); }
.sheet-title h2 { font-size: 20px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-wrap: nowrap; }
.sheet-title .meta { grid-column: 2; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--g400); }
.meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--g500); flex: none; }
#savestate.bad { color: var(--red); }
.sheet-tools { display: flex; align-items: center; gap: 8px; }
.sheet-tools .search { width: 260px; flex: none; }
.sheet-foot { padding: 14px 20px; border-top: 1px solid var(--graphite); font-size: 14px; color: var(--g400); text-wrap: pretty; }
.sheet-filters { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 14px 20px; border-bottom: 1px solid var(--graphite); }
.sheet-error { display: flex; align-items: center; gap: 10px; padding: 20px; color: var(--red); font-size: 15px; }

.sheet-scroll { max-height: min(62vh, 680px); overflow: auto; overscroll-behavior: none; background: var(--g800); }
.sheet { width: 100%; min-width: 800px; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 15px; }
.sheet .c-num { width: 56px; }
.sheet .c-name { width: 24%; }
.sheet .c-email { width: 30%; }
.sheet .c-hub { width: 184px; }
.sheet .c-del { width: 44px; }
.sheet th, .sheet td { height: 42px; padding: 0; border-right: 1px solid var(--graphite); border-bottom: 1px solid var(--graphite); }
.sheet .del { border-right: 0; }
.sheet thead th { position: sticky; z-index: 2; background: var(--g900); }
.sheet .letters th { top: 0; height: 28px; font: 500 12px/1 var(--body); letter-spacing: .04em; color: var(--g500); text-align: center; }
.sheet .frozen th { top: 28px; padding: 0 14px; text-align: left; font: 600 14px/1 var(--body); color: var(--white); border-bottom: 2px solid var(--g700); }
.sheet .num { position: sticky; left: 0; z-index: 1; width: 56px; padding: 0; background: var(--g900); color: var(--g500); font: 500 13px/1 var(--body); text-align: center; font-variant-numeric: tabular-nums; }
.sheet .mark { position: absolute; left: 8px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; }
.sheet .mark.new { background: var(--st-invited); }
.sheet .mark.skip { background: var(--red); }
.sheet thead .num { z-index: 3; text-align: center; padding: 0; }
.sheet td { position: relative; background: var(--g800); transition: background-color var(--t-fast) var(--ease); }
.sheet tbody tr:hover td { background: var(--g900); }
.sheet tbody tr:hover .num, .sheet tbody tr:focus-within .num { color: var(--white); }
.sheet td:focus-within { box-shadow: inset 0 0 0 2px var(--white); z-index: 1; }
.cell { display: block; width: 100%; height: 41px; margin: 0; padding: 0 14px; border: 0; border-radius: 0; background: transparent; color: var(--chalk); font: 400 15px/41px var(--body); outline: none; text-overflow: ellipsis; }
.cell.ro { overflow: hidden; white-space: nowrap; }
.sheet tr.link { cursor: pointer; }
.sheet tr.link:focus-visible { outline: 2px solid var(--white); outline-offset: -2px; }
.cell::selection { background: var(--signal); color: var(--midnight); }
select.cell { appearance: none; cursor: pointer; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
select.cell option { background: var(--g900); color: var(--white); }
.rowdel { width: 100%; height: 41px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: var(--g500); opacity: 0; transition: opacity var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.rowdel .ic { width: 16px; height: 16px; }
.sheet tr:hover .rowdel, .rowdel:focus-visible { opacity: 1; }
.rowdel:hover { color: var(--red); }
.rowdel:focus-visible { outline: 2px solid var(--white); outline-offset: -4px; }
@media (hover: none) { .rowdel { opacity: .7; } }
.sheet tr.flash td { animation: row-flash 1.6s var(--ease); }
@keyframes row-flash { from { background: rgba(255, 255, 255, .14); } }
@media (prefers-reduced-motion: reduce) { .sheet tr.flash td { animation: none; } }
.nomatch { padding: 24px 20px; color: var(--g400); font-size: 15px; }

/* last refresh and the rules: one ledger style, values on one x */
.block { margin-top: 48px; }
.section-head { display: flex; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { font-size: 22px; }
.section-head .muted { font-size: 14px; }
.summary { color: var(--g300); font-size: 15px; margin-bottom: 16px; }
.ledger { width: 100%; border-collapse: collapse; font-size: 14px; }
.ledger th { text-align: left; font: 500 12px/1.2 var(--body); color: var(--g500); padding: 0 24px 10px 0; border-bottom: 1px solid var(--g700); }
.ledger td { padding: 12px 24px 12px 0; border-bottom: 1px solid var(--graphite); vertical-align: top; color: var(--g300); text-wrap: pretty; }
.ledger th:last-child, .ledger td:last-child { padding-right: 0; }
.ledger th:first-child, .ledger td:first-child { width: 264px; }
.ledger.changes th:nth-child(2), .ledger.changes td:nth-child(2) { width: 264px; }
.ledger .who { color: var(--white); font-weight: 500; }
.ledger .who a { color: var(--white); }
.ledger .pill { color: var(--white); font-size: 14px; line-height: inherit; vertical-align: top; }
.quiet { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: var(--g400); font: 500 14px/1.2 var(--body); text-decoration: none; cursor: pointer; transition: color var(--t-fast) var(--ease); }
.quiet:hover { color: var(--white); }
.quiet .ic { width: 16px; height: 16px; }
.block > .quiet { margin-top: 16px; }
.pagefoot { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--graphite); display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
#unlink:hover { color: var(--red); }
@media (max-width: 760px) {
  .choice { grid-template-columns: 1fr; }
  .sheetbox-head { padding: 14px 16px; }
  .sheet-title .meta .kind, .sheet-title .meta .kind + .sep { display: none; }
  .sheet-tools { width: 100%; }
  .sheet-tools .search { flex: 1; width: auto; max-width: none; min-width: 0; }
  .sheet-foot { padding: 12px 16px; }
  .sheet-filters { flex-direction: column; align-items: stretch; padding: 12px 16px; }
  .sheet-filters .switch { width: 100%; }
  .ledger th:first-child, .ledger td:first-child, .ledger.changes th:nth-child(2), .ledger.changes td:nth-child(2) { width: auto; }
  .ledger:not(.changes) th:first-child, .ledger:not(.changes) td:first-child { width: 40%; }
}

/* ---------- mail page: the invite texts and the example lines ---------- */
.mail-tabs { margin-bottom: 32px; }
.mailtab[hidden] { display: none; }
.texts, .examples { display: grid; grid-template-columns: minmax(0, 1fr) 620px; gap: 40px; align-items: start; }
.examples { grid-template-columns: minmax(0, 1fr) 460px; }
.texts-form, .ex-form { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.texts-form fieldset { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.texts-form legend { padding: 0; margin-bottom: 4px; font: 600 18px/1.2 var(--display); color: var(--white); }
/* text blocks on the Mail page: label and counter inside, a thin line that fills up towards the character limit */
.tf { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 18px; background: var(--g900); border: 1px solid var(--graphite); cursor: text; transition: border-color var(--t-fast) var(--ease); }
.tf:hover { border-color: var(--g700); }
.tf:focus-within { border-color: var(--white); }
.tf-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tf-label { font: 500 13px/1.2 var(--body); color: var(--g400); cursor: text; }
.tf-count { font: 500 12px/1 var(--body); color: var(--g500); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf.over .tf-count { color: var(--red); }
.tf-input { min-height: 1.5em; font: 400 17px/1.5 var(--body); color: var(--white); outline: none; white-space: pre-wrap; overflow-wrap: anywhere; caret-color: var(--signal); }
.tf-plain { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: transparent; color: var(--white); font: 400 17px/1.5 var(--body); outline: none; caret-color: var(--signal); }
.tf-area { display: block; width: 100%; min-height: 0; margin: 0; padding: 0; border: 0; background: transparent; color: var(--white); font: 400 16px/1.6 var(--body); resize: none; overflow: hidden; outline: none; caret-color: var(--signal); }
.tf-hint { font-size: 13px; color: var(--g500); }
.tf-hint:empty { display: none; }
.tf-hint.warn { color: var(--signal); }
.tf-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.tf-bar i { display: block; height: 100%; width: calc(var(--fill, 0) * 100%); background: var(--g700); transition: width 160ms var(--ease), background-color 160ms var(--ease); }
.tf:focus-within .tf-bar i { background: var(--g400); }
.tf.over .tf-bar i { background: var(--red); }
/* inline (not inline-flex), so a chip and the punctuation after it never break apart */
.tok { display: inline; padding: .18em .5em; margin: 0 .08em; background: var(--g700); color: var(--white); font: 600 .8em/1 var(--body); border-radius: 2px; white-space: nowrap; user-select: all; cursor: default; }
/* Personalise: one line at the top of the form that stays in reach while scrolling. It docks under the top bar
   as a solid band, so the fields scroll away underneath it. Its buttons look exactly like the chips they add. */
.tokens {
  position: sticky; top: var(--top-h); z-index: 4;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0;
  padding: 16px 0 14px; background: var(--midnight); border-bottom: 1px solid var(--graphite);
}
.tokens-label { flex: none; display: inline-flex; align-items: center; gap: 8px; font: 600 14px/1 var(--body); color: var(--white); }
.tokens-label .ic { width: 16px; height: 16px; color: var(--g400); }
.tokens-actions { display: flex; align-items: center; gap: 8px; }
.tokens button {
  flex: none; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px 0 7px;
  border: 0; border-radius: 2px; background: var(--g700); color: var(--white); font: 600 13px/1 var(--body);
  transition: background-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.tokens button .ic { width: 14px; height: 14px; color: var(--g300); }
.tokens button:hover { background: #5a5a5e; }
.tokens button:active { transform: scale(.97); }
@media (max-width: 700px) {
  .tokens { top: 0; padding: 12px 0 10px; }
  .tokens-label { font-size: 13px; }
}
.textbar {
  --dock: 24px; position: sticky; bottom: var(--dock); z-index: 5;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px;
  background: var(--g900); border: 1px solid var(--graphite); box-shadow: 0 0 0 6px var(--midnight), 0 20px 40px -14px rgba(0, 0, 0, .8);
}
.textbar .quiet { margin-left: auto; }
.textbar .state { order: 3; flex-basis: 100%; font-size: 13px; color: var(--g400); }
.textbar .state:empty { display: none; }
.textbar .state.bad { color: var(--red); }
.pv-label { margin-bottom: 10px; font: 500 12px/1 var(--body); color: var(--g500); }
.texts-preview { position: sticky; top: calc(var(--top-h) + 24px); max-height: calc(100dvh - var(--top-h) - 48px); display: flex; flex-direction: column; }
.inbox-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 14px 16px; background: var(--white); color: #202124; border: 1px solid var(--graphite); border-bottom: 0; font: 400 14px/1.3 var(--body); }
.inbox-row .from { font-weight: 600; }
.inbox-row .subj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-row .subj b { font-weight: 600; }
.inbox-row .subj span { color: #5f6368; }
.pv-frame { min-height: 0; overflow: auto; overscroll-behavior: none; border: 1px solid var(--graphite); background: #E9E9E9; }
.pv-frame iframe { display: block; width: 100%; height: 0; border: 0; }
.ex-lead { max-width: 64ch; color: var(--g300); font-size: 15px; text-wrap: pretty; }
.ex-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.ex-preview { position: sticky; top: calc(var(--top-h) + 24px); display: flex; flex-direction: column; gap: 12px; }
.ex-preview .quiet { align-self: flex-start; }
@media (max-width: 1100px) {
  .texts, .examples { grid-template-columns: minmax(0, 1fr); }
  .texts-preview, .ex-preview { position: static; max-height: none; }
  .pv-frame { overflow: visible; }
}
@media (max-width: 700px) {
  .ex-grid { grid-template-columns: minmax(0, 1fr); }
  .textbar { --dock: 12px; padding: 10px 12px; }
}

/* ---------- dropdown (enhanceSelect in ui.js): one look for every choice list ---------- */
.dd { position: relative; min-width: 0; }
.dd-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dd-trigger {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px 0 14px;
  border: 1px solid var(--g700); background: var(--midnight); color: var(--white); text-align: left;
  font: 400 15px/1.2 var(--body); cursor: pointer; transition: border-color var(--t-fast) var(--ease);
}
.dd-trigger:hover { border-color: var(--g500); }
.dd-trigger:focus-visible, .dd.open .dd-trigger { outline: none; border-color: var(--white); }
.dd-value { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; overflow: hidden; white-space: nowrap; }
.dd-value.empty { color: var(--g500); }
.dd-value .dd-sub { overflow: hidden; text-overflow: ellipsis; }
.dd-sub { color: var(--g400); font-size: .9em; }
.dd-chev { width: 16px; height: 16px; color: var(--g400); flex: none; transition: transform var(--t-fast) var(--ease); }
.dd.open .dd-chev { transform: rotate(180deg); }
.dd-pop {
  position: fixed; z-index: 70; display: flex; flex-direction: column; min-height: 0;
  background: var(--g900); border: 1px solid var(--g700); box-shadow: 0 24px 48px -12px rgba(0, 0, 0, .85);
  opacity: 0; transform: translateY(-4px); transition: opacity 140ms var(--ease), transform 180ms var(--ease);
}
.dd-pop.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .dd-pop { transition: none; transform: none; } }
.dd-search { position: relative; flex: none; padding: 8px; border-bottom: 1px solid var(--graphite); }
.dd-search .ic { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--g400); pointer-events: none; }
.dd-search input { width: 100%; height: 38px; padding: 0 12px 0 36px; border: 1px solid var(--g700); background: var(--midnight); color: var(--white); font: 400 14px/1 var(--body); }
.dd-search input:focus { outline: none; border-color: var(--white); }
.dd-list { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: none; padding: 6px 0; outline: none; }
.dd-group { padding: 12px 14px 6px; font: 600 12px/1 var(--body); color: var(--g500); }
.dd-group:first-child { padding-top: 6px; }
.dd-opt { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 14px; cursor: pointer; font: 400 15px/1.3 var(--body); color: var(--chalk); }
.dd-opt .dd-text { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.dd-opt.active { background: var(--g800); color: var(--white); box-shadow: inset 2px 0 0 var(--white); }
.dd-opt[aria-selected="true"] { color: var(--white); font-weight: 600; }
.dd-opt .ic { width: 16px; height: 16px; color: var(--signal); flex: none; }
.dd-empty { padding: 14px; color: var(--g400); font-size: 14px; }
/* variants: in the top bar, and inside a sheet cell */
.dd-compact .dd-trigger { min-height: 34px; padding: 0 10px 0 12px; font-size: 14px; font-weight: 500; }
.dd-cell { height: 100%; }
.dd-cell .dd-trigger { height: 41px; min-height: 0; padding: 0 10px 0 14px; border: 0; background: transparent; color: var(--chalk); }
.dd-cell .dd-trigger:focus-visible { outline: none; }

/* ---------- skeletons: loading states in the shape of what's coming ---------- */
.skel { position: relative; display: block; overflow: hidden; background: var(--g900); }
.skel::after {
  content: ""; position: absolute; inset: 0; z-index: 1; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .08), transparent);
  animation: skel-shine 1.4s var(--ease) infinite;
}
@keyframes skel-shine { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skel::after { animation: none; } }
.sk-tabs { width: 360px; max-width: 100%; height: 40px; }
.sk-field { width: 100%; }
/* the mail preview, before the first mail is in */
.texts-preview.loaded .pv-skeleton { display: none; }
.texts-preview:not(.loaded) .inbox-row, .texts-preview:not(.loaded) .pv-frame { position: absolute; width: 0; height: 0; overflow: hidden; visibility: hidden; }
.sk-inbox { display: flex; align-items: center; gap: 16px; height: 49px; padding: 0 16px; background: var(--white); border: 1px solid var(--graphite); border-bottom: 0; }
.sk-inbox .skel { height: 12px; background: #e6e6e8; }
.sk-inbox .skel::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .9), transparent); }
.sk-outer { padding: 32px 12px; background: #E9E9E9; border: 1px solid var(--graphite); }
.sk-mail { display: flex; flex-direction: column; gap: 12px; max-width: 600px; margin: 0 auto; padding: 36px 44px 40px; background: #131217; }
.sk-mail .skel { background: #232228; }
.sk-logo { width: 132px; height: 20px; margin-bottom: 20px; }
.sk-h1 { width: 44%; height: 36px; margin-bottom: 8px; }
.sk-p { height: 15px; }
.sk-mail .sk-card { width: calc(100% + 74px); margin: 16px -37px; aspect-ratio: 148 / 105; background: #131217; }
.sk-card i { position: absolute; background: rgba(255, 249, 3, .15); }
.sk-card i.photo { background: rgba(221, 239, 250, .16); }
.sk-mail .sk-btn { width: 170px; height: 51px; margin-top: 16px; border-radius: 100px; background: rgba(255, 249, 3, .24); }

/* ---------- the ways in: personal link + password, admin password ---------- */
.gate-form { display: flex; flex-direction: column; gap: 10px; width: min(480px, 100%); }
.gate-row { display: flex; gap: 10px; }
.gate-row .input { flex: 1; min-width: 0; height: 52px; font-size: 16px; }
.gate-form .error:empty { display: none; }
.gate-note { margin-top: 20px; }
.gate-note a { color: var(--white); }
.linkrow { display: flex; gap: 8px; }
.linkrow .input { flex: 1; min-width: 0; min-height: 40px; padding: 8px 12px; font-size: 13px; color: var(--g300); }
@media (max-width: 520px) { .gate-row { flex-direction: column; } }
