/* Rotate Digital look, as in leads-map and the Local Falcon scheduler: Lexend Deca, charcoal
   surfaces, logo teal and cream. Dark only, like them. */
@font-face {
  font-family: "Lexend Deca";
  src: url("lexend-deca.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink-950: #0b0c0b;
  --ink-900: #131514; /* page background */
  --ink-850: #171918; /* sidebar */
  --ink-800: #1d201f; /* cards */
  --ink-750: #242726;
  --ink-700: #2b2f2d;
  --ink-600: #3a3f3d; /* borders */
  --ink-500: #4e5451;
  --ink-400: #858b87; /* faint text (a step lighter than leads-map's, to stay readable at 12px) */
  --ink-300: #a4aba5; /* secondary text */
  --ink-200: #ccd2ca;
  --ink-100: #eceee6; /* body text (brand cream) */
  --ink-50: #f5f7f0;  /* headings */
  --accent-200: #b3ecdc;
  --accent-300: #7eddc4;
  --accent-400: #4fd0b0;
  --accent-500: #34c3a4; /* logo teal */
  --accent-600: #279e85;
  --warn-300: #e3be86;
  --warn-400: #cfa159;
  --danger-300: #dba49c;
  --danger-400: #c67f75;
  --danger-500: #a75c52;
  --line: color-mix(in srgb, var(--ink-600) 70%, transparent);
  --well: color-mix(in srgb, var(--ink-950) 50%, transparent);
  --shadow-card: inset 0 1px 0 0 rgb(255 255 255 / 0.04), 0 12px 32px -20px rgb(0 0 0 / 0.8);
  --shadow-pop: inset 0 1px 0 0 rgb(255 255 255 / 0.05), 0 16px 48px -16px rgb(0 0 0 / 0.85);
  --side: 296px;
  --pad: clamp(16px, 2.2vw, 36px);
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--ink-600) transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink-900) radial-gradient(80rem 42rem at 50% -14rem,
    color-mix(in oklab, var(--accent-500) 8%, transparent), transparent 60%) no-repeat fixed;
  color: var(--ink-100);
  font: 14px/1.5 "Lexend Deca", system-ui, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
::selection { background: color-mix(in oklab, var(--accent-500) 35%, transparent); color: var(--ink-50); }
:focus-visible { outline: 2px solid color-mix(in oklab, var(--accent-400) 70%, transparent); outline-offset: 2px; }

.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100dvh; }

/* ---- sidebar ---- */
.side {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: 14px; padding: 18px 16px 14px;
  background: color-mix(in srgb, var(--ink-850) 80%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--ink-600) 50%, transparent);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 4px; }
.brand svg { flex: none; }
.wordmark { font-size: 1.05rem; font-weight: 700; line-height: 1; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-50); }
.wordmark span { display: block; }
.wordmark span + span { color: var(--accent-500); }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; }
.side-head h1 { font-size: 10px; font-weight: 500; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-300); }

.filters { display: flex; flex-direction: column; gap: 8px; padding: 0 4px 14px; border-bottom: 1px solid var(--line); }
.pills { display: flex; flex-wrap: wrap; gap: 4px; }
.pill {
  flex: 1 1 auto; display: inline-flex; justify-content: center; gap: 4px; padding: 4px 5px;
  border: 1px solid var(--ink-600); border-radius: 999px; background: color-mix(in srgb, var(--ink-800) 80%, transparent);
  color: var(--ink-300); font-size: 11px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.pill:hover { border-color: var(--ink-500); color: var(--ink-100); }
.pill[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent-500) 60%, transparent); background: color-mix(in srgb, var(--accent-500) 12%, transparent); color: var(--accent-200); }
.pill .n { font-variant-numeric: tabular-nums; opacity: 0.7; }
.count { font-size: 12px; color: var(--ink-300); }
.link { border: 0; background: none; padding: 0; color: var(--accent-300); cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent-500) 40%, transparent); text-underline-offset: 2px; }
.link:hover { color: var(--accent-200); }

.list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.item {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 11px; align-items: center;
  width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: none; text-align: left; cursor: pointer;
  transition: background-color 0.15s;
}
.item:hover { background: color-mix(in srgb, var(--ink-800) 60%, transparent); }
.item[aria-current="true"] { background: var(--ink-800); box-shadow: inset 2px 0 0 0 var(--accent-500); }
.item-name { display: block; font-weight: 500; color: var(--ink-100); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item[aria-current="true"] .item-name { color: var(--ink-50); }
.item-sub, .status { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: var(--ink-300); }
.item-sub span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-500); }
.dot.live { background: var(--accent-400); }
.dot.dry_run { background: var(--warn-400); }
.unsaved { display: none; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-400); }
.item[data-dirty="true"] .unsaved { display: block; }
.file { padding: 0 4px; font-size: 11px; color: var(--ink-400); overflow-wrap: anywhere; }

/* the client's own colors */
.mark {
  width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  background: var(--c1, var(--ink-600)); color: var(--ct, #fff); box-shadow: inset 0 -4px 0 var(--c2, transparent);
  font-size: 13px; font-weight: 700; line-height: 1; padding-bottom: 3px;
}
.mark.off { filter: grayscale(1); opacity: 0.55; }

/* ---- client header ---- */
.content { display: flex; flex-direction: column; min-width: 0; }
.main { flex: 1; outline: 0; padding: 0 var(--pad) 16px; animation: reveal 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes reveal { from { opacity: 0; } }
.empty { padding-top: 40px; color: var(--ink-300); }
.head {
  position: sticky; top: 0; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  margin: 0 calc(var(--pad) * -1) 16px; padding: 14px var(--pad);
  background: color-mix(in srgb, var(--ink-900) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--ink-600) 50%, transparent);
}
.head-id { flex: 1 1 220px; display: flex; align-items: center; gap: 14px; min-width: 0; }
.head-id > div { min-width: 0; }
.head .mark { width: 42px; height: 42px; font-size: 16px; border-radius: 9px; box-shadow: inset 0 -5px 0 var(--c2, transparent); padding-bottom: 4px; }
.head h2 { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; color: var(--ink-50); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.control { display: flex; align-items: center; gap: 9px; }
.control .label { margin: 0; }
.back { display: none; }

.notice { margin-bottom: 16px; padding: 12px 16px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--danger-500) 40%, transparent); background: color-mix(in srgb, var(--danger-500) 10%, transparent); color: var(--danger-300); }
.notice ul { margin-top: 4px; padding-left: 18px; }
.notice .btn { margin-top: 10px; }

/* ---- sections ---- */
.columns { display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); gap: 14px; align-items: start; }
.column { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.section { container-type: inline-size; border: 1px solid var(--line); border-radius: 12px; background: var(--ink-800); box-shadow: var(--shadow-card); }
.section.has-errors { border-color: color-mix(in srgb, var(--danger-400) 65%, transparent); }
.section-head { display: flex; align-items: center; gap: 12px; padding-right: 14px; }
.section-head h3 { flex: 1; min-width: 0; font: inherit; }
.section-head .seg { flex: none; }
.toggle {
  display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 0 11px; align-items: center; width: 100%; min-height: 52px;
  padding: 10px 4px 10px 16px; border: 0; border-radius: 12px; background: none; text-align: left; cursor: pointer;
}
.toggle:focus-visible { outline-offset: -2px; }
.toggle svg { color: var(--ink-400); transition: transform 0.18s; }
.toggle:hover svg { color: var(--accent-300); }
.toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.toggle-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink-50); }
.toggle-sum { grid-column: 2; font-size: 12.5px; color: var(--ink-300); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toggle[aria-expanded="true"] .toggle-sum { display: none; }
.flag { padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 500; letter-spacing: 0; color: var(--accent-200); background: color-mix(in srgb, var(--accent-500) 14%, transparent); }
.flag.err { color: var(--danger-300); background: color-mix(in srgb, var(--danger-500) 18%, transparent); }
.swatch { display: inline-block; width: 11px; height: 11px; margin-right: 5px; border-radius: 3px; vertical-align: -1px; background: var(--c); box-shadow: 0 0 0 1px rgb(255 255 255 / 0.14); }
.section-body { padding: 2px 16px 18px; }
.section-note { margin-bottom: 12px; font-size: 12.5px; color: var(--ink-300); }

.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px 16px; }
@container (min-width: 400px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 620px) { .grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.field { min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.label { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-300); }
.label .opt { letter-spacing: 0; text-transform: none; color: var(--accent-300); }
.hint { margin-top: 5px; font-size: 12px; color: var(--ink-400); }
.error { margin-top: 5px; font-size: 12px; font-weight: 500; color: var(--danger-300); }

input[type="text"], input[type="search"], input[type="number"], input[type="time"], input[type="date"], select, textarea, .chips {
  width: 100%; min-height: 38px; padding: 7px 12px; border: 1px solid var(--ink-600); border-radius: 6px; background-color: var(--well);
  transition: border-color 0.15s;
}
select option { background: var(--ink-800); }
input::placeholder, textarea::placeholder { color: var(--ink-400); opacity: 1; }
textarea { display: block; min-height: 108px; resize: vertical; line-height: 1.55; }
input:hover, select:hover, textarea:hover, .chips:hover { border-color: var(--ink-500); }
input:focus-visible, select:focus-visible, textarea:focus-visible, .chips:focus-within {
  outline: 0; border-color: color-mix(in srgb, var(--accent-500) 60%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-500) 25%, transparent);
}
.bad input, .bad select, .bad textarea, .bad .chips { border-color: var(--danger-400); }
input:disabled { color: var(--ink-400); border-style: dashed; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--well); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; }
.seg span { display: grid; place-items: center; min-height: 28px; padding: 3px 13px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--ink-300); white-space: nowrap; transition: background-color 0.15s, color 0.15s; }
.seg label:hover span { color: var(--ink-100); }
.seg input:checked + span { background: var(--ink-700); color: var(--ink-50); }
.seg input:checked + span.strong { background: var(--accent-500); color: var(--ink-950); }
.seg input:focus-visible + span { outline: 2px solid color-mix(in oklab, var(--accent-400) 70%, transparent); outline-offset: 1px; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; padding: 4px 5px; cursor: text; }
.chip { display: inline-flex; align-items: center; max-width: 100%; border: 1px solid var(--ink-600); border-radius: 999px; background: color-mix(in srgb, var(--ink-800) 80%, transparent); color: var(--ink-200); font-size: 12.5px; }
.chip > span { padding: 2px 0 2px 10px; overflow-wrap: anywhere; }
.chip button { border: 0; background: none; padding: 2px 9px; color: var(--ink-400); cursor: pointer; line-height: 1.4; }
.chip button:hover { color: var(--danger-300); }
.chips input[type="text"] { flex: 1; width: auto; min-width: 120px; min-height: 28px; padding: 0 6px; border: 0; background: none; box-shadow: none; }

.colour { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 8px; }
.colour input[type="color"] { width: 38px; height: 38px; padding: 0; border: 1px solid var(--ink-600); border-radius: 6px; background: none; cursor: pointer; overflow: hidden; }
.colour input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.colour input[type="color"]::-webkit-color-swatch { border: 0; }

.rows { display: flex; flex-direction: column; gap: 7px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr) 34px; gap: 6px; }
.row button { border: 0; background: none; border-radius: 6px; color: var(--ink-400); cursor: pointer; font-size: 17px; }
.row button:hover { color: var(--danger-300); background: color-mix(in srgb, var(--danger-500) 12%, transparent); }
.rows + .btn { margin-top: 10px; }
.rows:empty + .btn { margin-top: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px;
  border: 1px solid var(--ink-600); border-radius: 6px; background: var(--ink-800); color: var(--ink-100);
  font-size: 14px; font-weight: 500; line-height: 1.4; white-space: nowrap; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--ink-500); background: var(--ink-750); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.quiet { border-color: transparent; background: none; color: var(--ink-300); }
.btn.quiet:hover { background: var(--ink-750); color: var(--ink-100); }
.btn.primary { border-color: transparent; background: var(--accent-500); color: var(--ink-950); }
.btn.primary:hover { background: var(--accent-400); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---- ready to go live ---- */
.checks { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.check { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; }
.check-mark { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; font-size: 12px; font-weight: 700; line-height: 1; color: var(--ink-300); background: var(--ink-700); }
.check.ok .check-mark { color: var(--accent-300); background: color-mix(in srgb, var(--accent-500) 18%, transparent); }
.check.warn .check-mark { color: var(--warn-300); background: color-mix(in srgb, var(--warn-400) 20%, transparent); }
.check.fail .check-mark { color: var(--danger-300); background: color-mix(in srgb, var(--danger-500) 28%, transparent); }
.check-text { display: flex; flex-wrap: wrap; gap: 0 8px; font-size: 13px; }
.check-text > :first-child { font-weight: 500; color: var(--ink-100); }
.check-msg { color: var(--ink-300); overflow-wrap: anywhere; }
.check.fail .check-msg { color: var(--danger-300); }
.link.plain { text-decoration-color: transparent; }
.link.plain:hover { text-decoration-color: currentColor; }
.check-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 14px; }
.check-foot .hint { flex: 1 1 180px; margin: 0; }
dialog .checks { margin-bottom: 12px; }

/* ---- posts ---- */
.tabs { margin-bottom: 14px; }
.posts-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.posts-head .hint { margin: 0; }
.posts-head .pills { display: flex; }
.posts-head .pill { flex: 0 1 auto; padding: 5px 12px; font-size: 12px; }
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; align-items: start; }
.post { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--ink-800); box-shadow: var(--shadow-card); }
.post-image { aspect-ratio: 4 / 3; background: var(--ink-950); }
.post-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.no-image { display: grid; place-items: center; height: 100%; padding: 16px; text-align: center; font-size: 12.5px; color: var(--ink-400); }
.post-body { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; padding: 14px 16px 16px; }
.post-when { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; width: 100%; font-size: 12.5px; color: var(--ink-300); }
.post .flag { color: var(--ink-200); background: var(--ink-700); font-size: 11.5px; }
.post .flag.good { color: var(--accent-200); background: color-mix(in srgb, var(--accent-500) 14%, transparent); }
.post .flag.warn { color: var(--warn-300); background: color-mix(in srgb, var(--warn-400) 16%, transparent); }
.post .flag.bad { color: var(--danger-300); background: color-mix(in srgb, var(--danger-500) 22%, transparent); }
.post h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; color: var(--ink-50); }
.post-text { font-size: 13px; color: var(--ink-200); white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.post-text.open { display: block; }
.post-body > .link { font-size: 12px; }
.post-issues { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--warn-300); }
.post-issues .bad { color: var(--danger-300); }
.post-note { font-size: 12.5px; color: var(--ink-300); }
.post-body .error { margin: 0; }
.post-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-300); }
.post code { max-width: 100%; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--well); font: 11.5px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; }

/* ---- account, people, history ---- */
.test-copy { color: var(--warn-300); }
.account { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 4px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.account p { display: flex; flex-direction: column; min-width: 0; }
.account p span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account .hint { margin: 0; }
.account div { display: flex; flex: none; gap: 12px; }
.lock { min-width: 0; margin: 0; padding: 0; border: 0; }
.lock input, .lock select, .lock textarea, .lock .chips { color: var(--ink-400); border-style: dashed; cursor: not-allowed; }
.lock button { visibility: hidden; }
.seg .off { opacity: 0.45; }
.seg .off, .seg .off input { cursor: not-allowed; }
.section-body.first { padding-top: 18px; }
.people { max-width: 760px; }
.person-add { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: 10px; align-items: end; }
.people-list, .history, .history ul { list-style: none; margin: 0; padding: 0; }
.people-list { margin-top: 18px; }
.people-list li { display: grid; grid-template-columns: minmax(0, 1fr) 150px 86px; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.people-list .flag { justify-self: start; }
.person { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.person .hint { margin: 0; }
.history { max-width: 900px; }
.history > li { padding: 12px 0; border-top: 1px solid var(--line); }
.history > li:first-child { border-top: 0; }
.history-who { color: var(--ink-200); }
.history-who strong { color: var(--ink-50); font-weight: 600; }
.history-who time { color: var(--ink-400); font-size: 12px; margin-left: 4px; }
.history ul { margin-top: 5px; }
.history ul li { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 12.5px; color: var(--ink-300); overflow-wrap: anywhere; }
.history-field { color: var(--ink-400); min-width: 130px; }
.history .now { color: var(--accent-200); }
.held { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0 0 12px; font-size: 12.5px; }
.held dt { color: var(--ink-400); }
.held dd { margin: 0; color: var(--ink-200); overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .person-add { grid-template-columns: minmax(0, 1fr) auto; }
  .person-add > div { grid-column: 1 / -1; }
  .people-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .people-list .person { grid-column: 1 / -1; }
}

/* ---- signing in ---- */
.gate { max-width: 400px; margin: 0 auto; padding: 16vh 20px 40px; display: flex; flex-direction: column; gap: 18px; }
.gate h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink-50); }
.gate .notice, .gate .hint { margin: 0; }
.gate .brand { padding: 0; margin-bottom: 8px; }
.gate .btn { text-decoration: none; }

/* ---- save bar, toast, dialog ---- */
.savebar {
  position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 0 var(--pad) 16px; padding: 10px 10px 10px 18px; border: 1px solid color-mix(in srgb, var(--accent-500) 45%, transparent); border-radius: 12px;
  background: var(--ink-750); box-shadow: var(--shadow-pop); animation: rise 0.18s ease-out;
}
.savebar p { min-width: 0; font-size: 13px; color: var(--ink-200); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.savebar-actions { display: flex; gap: 6px; flex: none; }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }

.toast {
  position: fixed; z-index: 6; left: 50%; bottom: 28px; transform: translate(-50%, 12px); max-width: calc(100vw - 32px);
  padding: 9px 16px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--accent-500) 45%, transparent);
  background: #17302a; color: var(--accent-200); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-pop);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

dialog { width: min(460px, calc(100vw - 32px)); padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink-800); color: var(--ink-100); box-shadow: var(--shadow-pop); }
dialog::backdrop { background: rgb(11 12 11 / 0.7); backdrop-filter: blur(2px); }
dialog h2 { margin-bottom: 8px; font-size: 18px; font-weight: 600; letter-spacing: -0.015em; color: var(--ink-50); }
dialog p { margin-bottom: 10px; color: var(--ink-300); }
dialog code { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--well); font: 12.5px/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 18px; }

/* ---- tablet ---- */
@media (max-width: 1100px) {
  :root { --side: 248px; }
  .side { padding-inline: 12px; }
}
@media (min-width: 720px) and (max-width: 1100px) { .pills { display: grid; grid-template-columns: 1fr 1fr; } }

/* ---- phone: the list or the client, one at a time ---- */
@media (max-width: 719px) {
  .shell { display: block; }
  .side { position: static; height: auto; min-height: 100dvh; border-right: 0; padding: 16px 14px 20px; }
  .list { overflow: visible; }
  .item { padding-block: 12px; }
  .item[aria-current="true"] { background: none; box-shadow: none; }
  .content { min-height: 100dvh; }
  body[data-view="list"] .content, body[data-view="form"] .side { display: none; }
  .head { display: contents; }                       /* so only the name row stays at the top */
  .head-id {
    position: sticky; top: 0; z-index: 4; gap: 10px; margin: 0 calc(var(--pad) * -1); padding: 8px var(--pad);
    background: color-mix(in srgb, var(--ink-900) 90%, transparent); backdrop-filter: blur(10px);
    border-bottom: 1px solid color-mix(in srgb, var(--ink-600) 50%, transparent);
  }
  .head h2 { font-size: 18px; }
  .head .mark { width: 36px; height: 36px; font-size: 14px; }
  .head-controls { flex-wrap: nowrap; justify-content: space-between; gap: 6px; padding: 12px 0; }
  .head-controls .seg span { padding-inline: 9px; }
  .head-controls .expand { padding-inline: 6px; }
  .control .label { display: none; }
  .back { display: grid; place-items: center; flex: none; width: 40px; height: 44px; margin-left: -10px; padding-bottom: 5px; border: 0; background: none; color: var(--ink-100); font-size: 30px; line-height: 1; cursor: pointer; }
  .savebar { bottom: 0; margin: 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); border-width: 1px 0 0; border-radius: 0; }
  .toast { bottom: 84px; }
}
@media (max-width: 374px) { .head-controls .expand { display: none; } }

/* ---- fingers: bigger targets, and 16px inputs so iOS doesn't zoom in ---- */
@media (pointer: coarse) {
  input[type="text"], input[type="search"], input[type="number"], input[type="time"], input[type="date"], select, textarea { font-size: 16px; min-height: 44px; }
  .chips { min-height: 44px; align-items: center; }
  .chips input[type="text"] { min-height: 34px; }
  .chip { font-size: 14px; }
  .chip button { min-width: 36px; min-height: 34px; }
  .seg span { min-height: 38px; }
  .btn { min-height: 44px; }
  .btn.small { min-height: 38px; }
  .pill { min-height: 36px; align-items: center; font-size: 12.5px; }
  .toggle { min-height: 60px; }
  .colour { grid-template-columns: 44px minmax(0, 1fr); }
  .colour input[type="color"] { width: 44px; height: 44px; }
  .row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 44px; }
  .link { padding: 8px 4px; }
  .check { min-height: 36px; align-items: center; }
  .check .link.plain { padding: 0; }
  .check-text { align-items: baseline; }
  .post .link { padding-inline: 0; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
