/* Zipaya control panel (C3-242). The operator's tool, in Quentin's direction (2026-11-28): a light grey ground, content
   on white panels with large rounded corners (one level, never nested), black for the primary action and the active
   choice, one blue for the switch, links and focus, red only for what failed. Geist and the layout rules of DESIGN.md;
   no brand green, no rainbow of states. */

@font-face {
  font-family: "Geist Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/geist-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/geist-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/geist-mono-latin-wght-normal.woff2") format("woff2-variations");
}

:root {
  color-scheme: light dark;
  --primary: #111318;
  --primary-hover: #2b2e35;
  --primary-fg: #ffffff;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --ring: #2563eb;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --mist: #f3f4f6;
  --selection: #e5e7eb;
  --ink: #0f1218;
  --graphite: #4b5361;
  --pewter: #5f6675;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --line-control: #878e9b;
  --overlay: rgb(15 18 24 / 0.32);
  --danger: #c8261c;
  --danger-hover: #ad2018;
  --danger-fg: #ffffff;
  /* States in black, blue and grey: blue is running, black needs a look, grey is off, red failed. */
  --success: var(--accent);
  --warning: var(--ink);
  --info: var(--accent);
  --shadow-panel: 0 1px 2px rgb(15 18 24 / 0.04), 0 1px 1px rgb(15 18 24 / 0.02);
  --shadow-pop: 0 1px 2px rgb(15 18 24 / 0.06), 0 8px 24px rgb(15 18 24 / 0.12);
  --shadow-sheet: 0 2px 6px rgb(15 18 24 / 0.08), 0 24px 48px rgb(15 18 24 / 0.18);

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;

  --control-h: 36px;
  --row-h: 44px;
  --control-text: 14px;
  --page-x: 24px;
  --panel-x: 20px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  --sans: "Geist Variable", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono Variable", ui-monospace, SFMono-Regular, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #f3f4f6;
    --primary-hover: #ffffff;
    --primary-fg: #0b0c0f;
    --accent: #6ba1ff;
    --accent-hover: #8db6ff;
    --ring: #6ba1ff;
    --bg: #0b0c0f;
    --surface: #16181d;
    --mist: #1d2026;
    --selection: #262a31;
    --ink: #eceef1;
    --graphite: #a7adb8;
    --pewter: #8f96a2;
    --line: #262a31;
    --line-strong: #353a43;
    --line-control: #636a77;
    --overlay: rgb(0 0 0 / 0.6);
    --danger: #f97066;
    --danger-hover: #fb8a82;
    --danger-fg: #0b0c0f;
    --shadow-panel: 0 0 0 1px rgb(255 255 255 / 0.03);
    --shadow-pop: 0 0 0 1px rgb(255 255 255 / 0.06), 0 8px 24px rgb(0 0 0 / 0.5);
    --shadow-sheet: 0 0 0 1px rgb(255 255 255 / 0.06), 0 24px 48px rgb(0 0 0 / 0.6);
  }
}

@media (pointer: coarse) {
  :root {
    --control-h: 44px;
    --row-h: 48px;
    --control-text: 16px;
  }
}
@media (max-width: 640px) {
  :root {
    --page-x: 16px;
    --panel-x: 16px;
    --control-text: 16px;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/20px var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
a { color: inherit; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
/* A tap fires at once (no double-tap wait); a control's label is never selected by a long press. */
button, a, label, summary, select, input[type="checkbox"], input[type="radio"] { touch-action: manipulation; }
button, .tabs a, .brand, .back, .segmented, .facet { user-select: none; -webkit-user-select: none; }
.tabs a, .brand, .back { -webkit-touch-callout: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; }
h2 { font-size: 15px; line-height: 24px; font-weight: 600; }
.mono, .num { font-family: var(--mono); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.num { text-align: right; }
.muted { color: var(--graphite); }
.subtle { color: var(--pewter); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }
svg.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--control-h); padding: 0 12px; border-radius: var(--r-md);
  border: 1px solid transparent; background: transparent; color: var(--ink);
  font-weight: 500; white-space: nowrap; text-decoration: none;
  transition: background-color 120ms var(--ease-out), border-color 120ms var(--ease-out), transform 120ms var(--ease-out);
  user-select: none; -webkit-user-select: none;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn--primary { background: var(--primary); color: var(--primary-fg); }
.btn--secondary { background: var(--surface); border-color: var(--line-strong); }
.btn--danger { background: var(--danger); color: var(--danger-fg); }
.btn--quiet { color: var(--graphite); }
.btn--block { width: 100%; }
.btn--icon { width: var(--control-h); padding: 0; }
.btn:disabled { opacity: 0.55; }
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover:not(:disabled) { background: var(--primary-hover); }
  .btn--secondary:hover:not(:disabled), .btn--ghost:hover:not(:disabled), .btn--quiet:hover:not(:disabled) { background: var(--mist); }
  .btn--danger:hover:not(:disabled) { background: var(--danger-hover); }
}
.link {
  background: none; border: 0; padding: 0; color: var(--accent); font-weight: 500; text-decoration: none;
  min-height: 24px;
}
@media (hover: hover) and (pointer: fine) { .link:hover { text-decoration: underline; } }
/* Text links answer the press itself, as on iOS: the tap highlight is off, so this is the only feedback. */
.link:active, .back:active, .brand:active, .record-head .domain:active, .props dd a:active { opacity: 0.6; }
/* A busy button: a spinner before its label (DESIGN.md, Buttons > Loading). */
.btn[aria-busy="true"]::before {
  content: ""; width: 14px; height: 14px; flex: none; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin 600ms linear infinite;
}
.btn[aria-busy="true"]:disabled { opacity: 0.8; }

/* --- Inputs --- */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: 14px; }
.label { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--graphite); display: flex; justify-content: space-between; gap: 8px; }
.label .subtle { font-weight: 400; }
.input, .select, .textarea {
  width: 100%; min-height: var(--control-h); padding: 0 10px;
  border: 1px solid var(--line-control); border-radius: var(--r-md);
  background: var(--surface); font-size: var(--control-text);
  transition: border-color 120ms var(--ease-out), box-shadow 120ms var(--ease-out);
}
.textarea { padding: 8px 10px; min-height: 72px; resize: vertical; line-height: 20px; }
.select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--pewter) 50%), linear-gradient(135deg, var(--pewter) 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 20%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input::placeholder { color: var(--pewter); }
.input--code { font-family: var(--mono); font-size: 22px; letter-spacing: 0.3em; text-align: center; min-height: 48px; }
.hint { font-size: 12px; line-height: 16px; color: var(--graphite); overflow-wrap: anywhere; }
.hint--error { color: var(--danger); }
.hint--ok { color: var(--accent); }
.affix { display: flex; align-items: stretch; min-width: 0; }
.affix .input { flex: 1 1 0; min-width: 0; width: auto; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.affix span { display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--line-control); border-left: 0; border-radius: 0 var(--r-md) var(--r-md) 0; color: var(--graphite); background: var(--mist); font-size: var(--control-text); white-space: nowrap; flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }

.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--mist); }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: inline-flex; align-items: center; min-height: calc(var(--control-h) - 6px); padding: 0 14px; border-radius: 999px; font-weight: 500; color: var(--graphite); }
.segmented input:checked + span { background: var(--primary); color: var(--primary-fg); }
@media (pointer: coarse) { .segmented span { min-height: 44px; } }
.segmented input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 1px; }

/* --- Status: a dot and a word --- */
.status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; color: var(--ink); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; background: currentColor; }
.status--success::before { background: var(--success); }
.status--warning::before { background: var(--warning); }
.status--danger::before { background: var(--danger); }
.status--info::before { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
.status--neutral { color: var(--graphite); }
.status--neutral::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--pewter); }
.status--muted { color: var(--graphite); }
.status--muted::before { background: var(--pewter); }
.qualifier { display: inline-flex; align-items: center; gap: 6px; color: var(--graphite); white-space: nowrap; }
.qualifier::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--pewter); }
.qualifier--warning { color: var(--warning); }
.qualifier--warning::before { background: var(--warning); }
.state-line { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }

/* --- Switch --- */
.switch {
  position: relative; width: 36px; height: 20px; border-radius: 999px; border: 0; padding: 0; flex: none;
  background: var(--line-control); transition: background-color 150ms var(--ease-out);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgb(15 18 24 / 0.2); transition: transform 150ms var(--ease-out);
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(16px); background: #ffffff; }
.switch:disabled { opacity: 0.5; }
.switch-hit { display: inline-grid; place-items: center; min-width: 44px; min-height: 36px; }
@media (pointer: coarse) { .switch-hit { min-height: 44px; } }

/* --- Shell --- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: 48px; display: flex; align-items: center; gap: 16px;
  padding: 0 max(var(--page-x), env(safe-area-inset-right)) 0 max(var(--page-x), env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px);
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; letter-spacing: -0.01em; text-decoration: none; }
.brand svg { width: 24px; height: 24px; }
.brand svg rect { fill: var(--ink); }
.brand svg path { stroke: var(--surface); }
.tabs { display: flex; gap: 2px; }
.tabs a { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: 999px; color: var(--graphite); text-decoration: none; font-weight: 500; }
.tabs a[aria-current="page"] { background: var(--primary); color: var(--primary-fg); }
@media (hover: hover) and (pointer: fine) { .tabs a:hover { color: var(--ink); } }
.tabs a:active:not([aria-current="page"]) { background: var(--mist); color: var(--ink); }
@media (pointer: coarse) { .tabs a { min-height: 44px; } }
.topbar .spacer { flex: 1; }
.account { position: relative; }
.account-btn { max-width: 220px; }
.account-btn .mono { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--selection); color: var(--ink); display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; text-transform: uppercase; }
@media (max-width: 640px) {
  .account-btn .who { display: none; }
  .brand span { display: none; }
}
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; max-width: min(320px, calc(100vw - 32px)); padding: 4px; z-index: 40;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop);
  transform-origin: top right; animation: pop 120ms var(--ease-out);
}
.menu-head { padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-head .mono { display: block; overflow-wrap: anywhere; }
.menu-label { padding: 6px 10px 2px; font-size: 12px; color: var(--pewter); font-weight: 500; }
.menu button { display: flex; width: 100%; align-items: center; gap: 8px; min-height: 32px; padding: 0 10px; border: 0; background: none; border-radius: var(--r-md); text-align: left; }
.menu button[aria-checked="true"]::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
@media (hover: hover) and (pointer: fine) { .menu button:hover { background: var(--mist); } }
.menu button:active { background: var(--mist); }
@media (pointer: coarse) { .menu button { min-height: 44px; } }

.page {
  max-width: 1240px; margin: 0 auto;
  padding: 24px max(var(--page-x), env(safe-area-inset-right)) 64px max(var(--page-x), env(safe-area-inset-left));
}
.page--narrow { max-width: 760px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.page-head h1 { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.tag { flex: none; white-space: nowrap; display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: var(--r-sm); background: var(--selection); color: var(--graphite); font-size: 12px; font-weight: 500; letter-spacing: 0; }

.notice { display: flex; gap: 8px; align-items: flex-start; padding: 10px 14px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-panel); color: var(--ink); margin: 0 0 12px; overflow-wrap: anywhere; }
.notice .icon { margin-top: 2px; color: var(--ink); }
.notice--danger .icon { color: var(--danger); }

/* --- Panels: white on the grey ground, one level only (a panel never holds another) --- */
.panel { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-panel); padding: 6px var(--panel-x); }

/* --- Tenants --- */
.totals { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin: 0 0 16px; }
.totals .label { font-size: 12px; }
.totals .amount { font-family: var(--mono); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.table tbody tr.row--separate { cursor: default; }
.btn--compact { min-height: 28px; padding: 0 10px; font-size: 13px; }
@media (pointer: coarse) { .btn--compact { min-height: 44px; } }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.facets { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--page-x)); padding: 2px var(--page-x); flex: 1 1 100%; overscroll-behavior-x: contain; }
.facets::-webkit-scrollbar { display: none; }
.facet {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px; flex: none;
  border: 1px solid transparent; background: var(--surface); box-shadow: var(--shadow-panel); color: var(--graphite); font-weight: 500;
  transition: transform 120ms var(--ease-out);
}
.facet:active { transform: scale(0.98); }
.facet:active:not([aria-pressed="true"]) { background: var(--mist); }
.facet .count { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--pewter); }
.facet[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.facet[aria-pressed="true"] .count { color: color-mix(in srgb, var(--primary-fg) 70%, transparent); }
.facet .status { color: inherit; }
@media (pointer: coarse) {
  .facet { height: var(--control-h); }
  .back, .link { min-height: 44px; display: inline-flex; align-items: center; }
  .brand { min-height: 44px; min-width: 44px; }
  .props dd a { min-height: 44px; }
}
@media (hover: hover) and (pointer: fine) { .facet:hover:not([aria-pressed="true"]) { background: var(--mist); } }
.toolbar .search { flex: 1 1 220px; max-width: 320px; position: relative; }
.toolbar .search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--pewter); }
.toolbar .search .input { padding-left: 32px; }
/* On the grey ground the search and the plan are white fields like the pills; the frame comes back on focus. */
.toolbar .input, .toolbar .select { border-color: transparent; box-shadow: var(--shadow-panel); border-radius: 999px; }
.toolbar .search .input { padding-left: 34px; }
.toolbar .search .icon { left: 12px; }
.toolbar .select { width: auto; min-width: 150px; }
@media (max-width: 640px) {
  .toolbar .search { max-width: none; flex-basis: 100%; }
  .toolbar .select { flex: 1; }
}

.table { width: 100%; border-collapse: collapse; }
.table th {
  position: sticky; top: 48px; z-index: 5; height: 36px; padding: 0 12px; text-align: left;
  font-size: 12px; font-weight: 500; color: var(--pewter); white-space: nowrap;
  background: color-mix(in srgb, var(--surface) 95%, transparent); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.table th.num { text-align: right; font-family: var(--sans); font-size: 12px; font-weight: 500; color: var(--pewter); }
.table td { height: var(--row-h); padding: 6px 12px; border-bottom: 1px solid var(--line); color: var(--graphite); vertical-align: middle; }
.table td:first-child, .table th:first-child { padding-left: 4px; }
.table tbody tr:last-child td { border-bottom: 0; }
/* No fade on row hover: the pointer crosses rows all day, and the highlight follows it at once. */
.table tbody tr { cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .table tbody tr:hover { background: var(--mist); } }
.table tbody tr:focus-within { background: var(--mist); }
.cell-title { display: grid; gap: 1px; min-width: 0; }
.cell-title a { color: var(--ink); font-weight: 500; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.cell-title a:focus-visible { outline-offset: 4px; }
.cell-title .sub { font-size: 12px; line-height: 16px; color: var(--pewter); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.cell-stack { display: grid; gap: 2px; }
.td-access { width: 64px; text-align: center; }
.table .num { color: var(--ink); }
.table .td-date { white-space: nowrap; }
tr.busy { opacity: 0.6; }

/* Phone: the same tenants as a list, two lines each, a hairline between them. */
.cards { display: none; list-style: none; margin: 0; padding: 0; }
.card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center;
  margin: 0 calc(-1 * var(--panel-x)); padding: 12px var(--panel-x); border-bottom: 1px solid var(--line);
}
.card:last-child { border-bottom: 0; }
/* The row answers the finger as it lands, before the next page opens. */
.card:has(.card-main:active) { background: var(--mist); }
.card-main { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; text-decoration: none; }
.card-top { display: flex; align-items: baseline; gap: 8px; }
.card-top .num { flex: none; }
.card-top .name { flex: 1; min-width: 0; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--graphite); font-size: 13px; }
.card-meta .status { color: var(--graphite); }
.card-sub { font-size: 12px; color: var(--pewter); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Below a full desk the seven columns crush the names and wrap the dates: the two-line list reads better. */
@media (max-width: 960px) {
  .table { display: none; }
  .cards { display: block; }
}
@media (max-width: 760px) {
  /* The one primary floats above the bottom edge, under the thumb. */
  .page-head .btn--primary {
    position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30;
    min-height: 48px; padding: 0 18px; border-radius: 999px; box-shadow: var(--shadow-pop);
  }
  .page:has(.page-head .btn--primary) { padding-bottom: 96px; }
}

.skeleton { display: block; height: 12px; border-radius: var(--r-sm); background: var(--mist); animation: pulse 1.4s ease-in-out infinite; }
.skeleton-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.skeleton-row .skeleton:first-child { width: 70%; }
.table--plain tbody tr { cursor: default; }
@media (hover: hover) and (pointer: fine) { .table--plain tbody tr:hover { background: transparent; } }
.empty { display: grid; justify-items: center; gap: 8px; padding: 64px 16px; text-align: center; }
.empty .icon { width: 24px; height: 24px; color: var(--pewter); stroke-width: 1.5; }
.empty h2 { font-size: 16px; }
.empty p { max-width: 384px; overflow-wrap: anywhere; }

/* --- Tenant --- */
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--graphite); text-decoration: none; font-weight: 500; min-height: 32px; margin-bottom: 8px; }
@media (hover: hover) and (pointer: fine) { .back:hover { color: var(--ink); } }
.record-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 16px; padding: 20px var(--panel-x); background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-panel); }
.record-head .titles { flex: 1 1 280px; min-width: 0; display: grid; gap: 6px; }
.record-head h1 { font-size: 28px; line-height: 36px; font-weight: 700; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.record-head .domain { color: var(--graphite); display: inline-flex; align-items: center; gap: 4px; text-decoration: none; width: fit-content; overflow-wrap: anywhere; }
@media (pointer: coarse) { .back, .record-head .domain { min-height: 44px; } }
@media (hover: hover) and (pointer: fine) { .record-head .domain:hover { color: var(--ink); text-decoration: underline; } }
.record-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section { margin-top: 12px; padding: 16px var(--panel-x) 10px; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-panel); }
.section h2 { margin-bottom: 4px; }
/* Inside a sheet or a dialog, a section is a group of the white surface, not a panel on it. */
.sheet-body .section, .dialog .section { margin-top: 20px; padding: 0; background: none; border-radius: 0; box-shadow: none; }
.props > dt:nth-last-child(2), .props > dd:last-child { border-bottom: 0; }
.props { display: grid; grid-template-columns: 160px 1fr; margin: 0; }
.props dt, .props dd { margin: 0; min-height: 36px; padding: 8px 0; display: flex; align-items: center; }
.props dt { color: var(--graphite); }
.props dd { min-width: 0; flex-wrap: wrap; gap: 4px 8px; overflow-wrap: anywhere; }
.props dd a { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); }
.props dd .copy { margin-left: auto; }
.props dd .mono { min-width: 0; overflow-wrap: anywhere; }
/* Text the user typed keeps its line breaks (a reason, a note). */
.pre { white-space: pre-line; }
@media (max-width: 640px) {
  .props { grid-template-columns: 1fr; }
  .props dt { min-height: 0; padding: 10px 0 0; font-size: 12px; line-height: 16px; }
  .props dd { min-height: 0; padding: 2px 0 10px; border-bottom: 1px solid var(--line); }
  .props dd:last-of-type { border-bottom: 0; }
}
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 0 10px; padding: 10px 0; }
.activity li + li { border-top: 1px solid var(--line); }
.activity .marker { width: 8px; height: 8px; border-radius: 50%; margin: 6px 4px 0; background: var(--pewter); }
.activity .marker--danger { background: var(--danger); }
.activity .marker--success { background: var(--accent); }
.activity .marker--warning { background: var(--ink); }
.activity .what { color: var(--ink); font-weight: 500; }
.activity .meta { color: var(--graphite); font-size: 13px; overflow-wrap: anywhere; }
.activity .why { color: var(--ink); margin-top: 2px; overflow-wrap: anywhere; white-space: pre-line; }

/* --- Overlays --- */
dialog { padding: 0; border: 0; background: transparent; color: var(--ink); max-width: none; max-height: none; }
dialog::backdrop { background: var(--overlay); animation: fade 150ms var(--ease-out); }
.dialog {
  width: min(420px, calc(100vw - 32px)); margin: auto; padding: 20px; display: grid; gap: 14px;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-sheet);
  animation: zoom 160ms var(--ease-out);
}
.dialog h2 { font-size: 16px; line-height: 24px; overflow-wrap: anywhere; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
dialog.sheet { position: fixed; inset: 8px 8px 8px auto; margin: 0; height: auto; }
.sheet-panel {
  width: min(480px, calc(100vw - 16px)); height: calc(100dvh - 16px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-sheet);
  animation: slide-in 180ms var(--ease-out);
}
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { flex: 1; font-size: 16px; }
.sheet-head h2:focus { outline: none; }
.sheet-body { flex: 1; overflow-y: auto; padding: 20px; overscroll-behavior: contain; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.sheet-body form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.field { min-width: 0; }
.sheet-body form .field + .field { margin-top: 0; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-2 .field + .field { margin-top: 0; }
.row-2 .segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.row-2 .segmented span { justify-content: center; width: 100%; }
.secret { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-md); background: var(--mist); }
.secret .mono { flex: 1; min-width: 0; overflow-wrap: anywhere; user-select: all; }
@media (max-width: 640px) {
  .dialog, .sheet-panel { animation: rise 180ms var(--ease-out); }
  dialog.modal { position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; }
  dialog.modal .dialog { width: 100%; border-radius: var(--r-xl) var(--r-xl) 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  dialog.modal .actions { display: grid; grid-template-columns: 1fr 1fr; }
  /* A bottom sheet on phones (DESIGN.md, Overlays): it rises from the edge it belongs to, the list dimmed above it. */
  dialog.sheet { inset: auto 0 0 0; }
  .sheet-panel { width: 100%; height: 92dvh; border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .row-2 { grid-template-columns: 1fr; }
}

/* --- Sign-in --- */
.auth {
  min-height: 100dvh; display: grid; align-content: start; justify-items: center;
  padding: max(48px, 12vh) max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left));
}
.auth-col { width: min(360px, 100%); display: grid; gap: 20px; }
.auth .brand svg { width: 32px; height: 32px; }
.auth-card { display: grid; gap: 16px; padding: 24px; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-panel); }
.auth-card form { display: grid; gap: 14px; }
.auth-card .field + .field { margin-top: 0; }
.auth-card p { color: var(--graphite); }
.auth .error { color: var(--danger); }
.qr { display: grid; place-items: center; padding: 12px; background: #fff; border-radius: var(--r-lg); border: 1px solid var(--line); }
.qr svg { width: 176px; height: 176px; display: block; }
.qr svg path { fill: #0f1218; }
.key { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; letter-spacing: 0.04em; }
.langs { display: flex; justify-content: center; gap: 4px; }
.langs button { border: 0; background: none; padding: 0 8px; min-height: 32px; color: var(--graphite); border-radius: var(--r-md); }
.langs button[aria-current="true"] { color: var(--ink); font-weight: 500; }
.langs button:active { background: var(--mist); color: var(--ink); }
@media (pointer: coarse) { .langs button { min-height: 44px; } }

/* --- Updates --- */
.check { display: inline-flex; align-items: center; gap: 8px; min-height: var(--control-h); }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.td-pick { width: 64px; text-align: center; }
.td-pick input { width: 16px; height: 16px; accent-color: var(--accent); }
.plan-box { display: grid; gap: 12px; margin-top: 12px; padding: 16px var(--panel-x); background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-panel); }
.plan-box.live p:first-child { color: var(--danger); font-weight: 500; }
.steps { margin: 4px 0 0; padding-left: 18px; color: var(--graphite); font-size: 13px; overflow-wrap: anywhere; }
.steps .bad { color: var(--danger); }
details summary { cursor: pointer; color: var(--graphite); }

/* Centred by its insets, not by a transform, so the rise keyframe moves it straight up and a long line wraps at the
   screen's width rather than at half of it. */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60;
  width: fit-content; max-width: 560px; margin: 0 auto; overflow-wrap: anywhere;
  padding: 8px 14px; border-radius: var(--r-md); background: var(--ink); color: var(--bg); font-weight: 500;
  box-shadow: var(--shadow-pop); animation: rise 180ms var(--ease-out);
}
/* On a phone it clears the floating primary and a sheet's footer (after the rule above, so it wins). */
@media (max-width: 760px) { .toast { bottom: calc(80px + env(safe-area-inset-bottom)); } }

@keyframes pop { from { opacity: 0; transform: scale(0.97); } }
@keyframes zoom { from { opacity: 0; transform: scale(0.97); } }
@keyframes fade { from { opacity: 0; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(16px); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes pulse { 50% { opacity: 0.5; } }
@keyframes spin { to { transform: rotate(360deg); } }
/* Reduced transparency: the bars that float over the list turn solid. More contrast: solid bars, firmer lines. */
@media (prefers-reduced-transparency: reduce) {
  .topbar, .table th { background: var(--bg); backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --line: #c9ced7; --line-strong: #878e9b; --graphite: #3f4652; --pewter: #4b5260; --shadow-panel: 0 0 0 1px #c9ced7; }
  .topbar, .table th { background: var(--bg); backdrop-filter: none; }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root { --line: #3a3f4a; --line-strong: #636a77; --graphite: #c3c9d2; --pewter: #a9b0bb; }
}
/* Reduced motion: nothing moves or scales; overlays still fade, so a change stays visible. */
@media (prefers-reduced-motion: reduce) {
  .dialog, .sheet-panel, .menu, .toast { animation-name: fade !important; }
  .btn:active:not(:disabled), .facet:active { transform: none; }
  .btn[aria-busy="true"]::before { animation-duration: 1.5s; }
  .switch::after { transition: none; }
  .skeleton { animation: none; }
}
