/* OrderUp admin. Sits on top of public/style.css (the shared tokens) and is only loaded by
   the admin pages. One accent, one grey family, Geist + Geist Mono.
   Shape rule, used everywhere: buttons and chips are pills, inputs are 12px, a panel is a
   26px shell holding a 20px core. Layers: nav 20, dialog (browser top layer), toast 40, grain 50. */

:root {
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --shell: color-mix(in srgb, var(--ink) 3.5%, transparent);
  --shadow: 0 1px 1px rgba(20, 24, 31, .04), 0 18px 40px -24px rgba(20, 24, 31, .28);
  --warning-ink: #8a5a00;
  --r-shell: 26px;
  --r-core: 20px;
  --r-input: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --shell: color-mix(in srgb, var(--ink) 5%, transparent);
    --shadow: 0 1px 1px rgba(0, 0, 0, .5), 0 22px 44px -26px rgba(0, 0, 0, .9);
    --warning-ink: #f2c35a;
  }
}

[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { font-family: var(--sans); min-height: 100dvh; }
/* A whisper of grain so large flat areas do not look sterile. Fixed, never repainted. */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
a { color: var(--accent-text); }

/* ---------- floating nav ---------- */

.island {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 20;
  width: min(1180px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap;
  padding: 8px 10px 8px 18px; border-radius: 28px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 0 0 1px var(--hairline), inset 0 1px 0 rgba(255, 255, 255, .35), var(--shadow);
}
.island .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.island .brand img { height: 22px; width: auto; display: block; }
.island .brand span { font-size: .78rem; color: var(--ink-muted); padding-left: 10px; border-left: 1px solid var(--hairline); }
.island nav { display: flex; gap: 2px; margin: 0 auto; }
.island nav a {
  font-size: .88rem; font-weight: 500; color: var(--ink-2); text-decoration: none;
  padding: 9px 15px; border-radius: 999px; transition: background .3s var(--ease), color .3s var(--ease);
}
.island nav a:hover { background: var(--surface-2); color: var(--ink); }
.island nav a[aria-current="page"] { background: var(--ink); color: var(--plane); }
.island .right { display: flex; align-items: center; gap: 4px; }
@media (max-width: 760px) {
  .island { padding: 8px 10px 8px 14px; }
  .island nav { order: 3; width: 100%; margin: 0; overflow-x: auto; scrollbar-width: none; }
  .island .right { margin-left: auto; }
}

main { max-width: 1180px; margin: 0 auto; padding: 118px 20px 96px; }
@media (max-width: 760px) { main { padding: 148px 14px 72px; } }

/* ---------- entry motion: views and their blocks rise in, in order ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.view > * { animation: rise .7s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 70ms); }
.view > :nth-child(2) { --i: 1; } .view > :nth-child(3) { --i: 2; } .view > :nth-child(4) { --i: 3; } .view > :nth-child(5) { --i: 4; }

/* ---------- page head ---------- */

.head { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.head h1 { font-size: clamp(1.7rem, 3.2vw, 2.25rem); font-weight: 600; letter-spacing: -.04em; line-height: 1.1; margin: 0 0 6px; }
.head p { color: var(--ink-2); margin: 0; max-width: 60ch; }
.head .side { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.back { display: inline-block; font-size: .85rem; color: var(--ink-2); text-decoration: none; margin-bottom: 14px; }
.back:hover { color: var(--ink); }

/* ---------- buttons ---------- */

.btn {
  border-radius: 999px; padding: 12px 20px; font-family: var(--sans);
  transition: transform .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
a.btn { text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.small { padding: 8px 14px; font-size: .82rem; }
.btn.danger { background: transparent; color: var(--critical-ink); border-color: var(--hairline); }
.btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--critical) 9%, transparent); }
/* Main actions carry their arrow in its own circle, flush with the button's edge. */
.btn.go { padding: 6px 6px 6px 20px; gap: 12px; }
.btn.go i {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-style: normal;
  background: color-mix(in srgb, var(--accent-ink) 16%, transparent);
  transition: transform .4s var(--ease);
}
.btn.go:hover:not(:disabled) i { transform: translateX(3px); }
.linkish { font: 500 .85rem var(--sans); color: var(--accent-text); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- panels: a shell holding a core ---------- */

.shell { padding: 6px; border-radius: var(--r-shell); background: var(--shell); box-shadow: 0 0 0 1px var(--hairline); margin-bottom: 20px; min-width: 0; }
.core { border-radius: var(--r-core); background: var(--surface); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), var(--shadow); padding: 24px; min-width: 0; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .core { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), var(--shadow); } }
.core.flush { padding: 0; overflow: hidden; }
.core-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.core-head h2 { font-size: 1.02rem; font-weight: 600; letter-spacing: -.02em; margin: 0 auto 0 0; }
.core.flush .core-head { padding: 20px 24px 0; }
h3 { font-size: .95rem; font-weight: 600; letter-spacing: -.015em; margin: 0 0 4px; }
.why { font-size: .86rem; color: var(--ink-2); margin: 0 0 16px; max-width: 68ch; }
.muted { color: var(--ink-muted); }
.two { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
.two > .shell { margin-bottom: 0; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }

/* ---------- headline figures ---------- */

.tiles { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); }
.tile { padding: 22px 24px; border-left: 1px solid var(--hairline); min-width: 0; }
.tile:first-child { border-left: 0; }
.tile .k { font-size: .8rem; color: var(--ink-2); margin-bottom: 10px; }
.tile .v { font-size: 1.7rem; font-weight: 500; letter-spacing: -.045em; line-height: 1.05; white-space: nowrap; }
.tile:first-child .v { font-size: 2.3rem; }
.tile .v small { font-size: .85rem; font-weight: 400; color: var(--ink-muted); letter-spacing: 0; margin-left: 4px; }
.tile .sub { font-size: .78rem; color: var(--ink-muted); margin-top: 8px; }
.tile.alert .v { color: var(--critical-ink); }
@media (max-width: 900px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile { border-left: 0; border-top: 1px solid var(--hairline); }
  .tile:first-child { grid-column: 1 / -1; border-top: 0; }
}

/* ---------- tables ---------- */

.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: 14px 10px; white-space: nowrap; vertical-align: middle; }
th { font-weight: 500; color: var(--ink-muted); font-size: .76rem; padding-top: 10px; padding-bottom: 10px; }
tbody tr { border-top: 1px solid var(--hairline); transition: background .3s var(--ease); }
tbody tr:hover { background: color-mix(in srgb, var(--ink) 2.5%, transparent); }
.core.flush th:first-child, .core.flush td:first-child { padding-left: 24px; }
.core.flush th:last-child, .core.flush td:last-child { padding-right: 24px; }
td.num, th.num { text-align: right; }
td small { display: block; color: var(--ink-muted); font-size: .78rem; margin-top: 3px; }
td a { text-decoration: none; }
td a:hover { text-decoration: underline; }
.who { display: flex; align-items: center; gap: 12px; }
.who strong { font-weight: 500; display: block; }
.mono-tile {
  width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center;
  font: 600 .82rem var(--sans); letter-spacing: -.02em; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.mono-tile.big { width: 56px; height: 56px; border-radius: 17px; font-size: 1.15rem; }
.name-btn { font: inherit; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.name-btn:hover strong { color: var(--accent-text); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.overdue { color: var(--critical-ink); font-weight: 500; }

.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 500; background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-muted); }
.pill.live::before, .pill.good::before { background: var(--good); }
.pill.paused::before, .pill.warn::before { background: var(--warning); }
.pill.bad::before { background: var(--critical); }
.pill.cancelled { opacity: .7; }
.health.down { color: var(--critical-ink); font-weight: 500; }

.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search {
  font: 400 .9rem var(--sans); padding: 10px 14px; min-width: 210px; color: var(--ink);
  border: 1px solid var(--hairline); border-radius: 999px; background: var(--plane);
}
.blank { padding: 64px 24px; text-align: center; color: var(--ink-2); }
.blank strong { display: block; color: var(--ink); font-weight: 600; font-size: 1.05rem; margin-bottom: 6px; }
.blank .btn { margin-top: 18px; }
.skeleton { height: 64px; margin: 10px 24px; }

/* ---------- forms ---------- */

.cols { display: grid; gap: 0 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols .wide { grid-column: 1 / -1; }
@media (max-width: 640px) { .cols { grid-template-columns: 1fr; } }
.field { margin-bottom: 18px; align-content: start; }
.field label { color: var(--ink); }
.field input, .field select, .field textarea {
  font: 400 .95rem/1.35 var(--sans); color: var(--ink); width: 100%;
  padding: 12px 14px; border: 1px solid var(--hairline); border-radius: var(--r-input); background: var(--plane);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.field textarea { min-height: 84px; resize: vertical; }
.field input[type="color"] { padding: 4px; height: 46px; cursor: pointer; }
.field input[type="file"] { padding: 9px; font-size: .84rem; }
.field input:disabled { color: var(--ink-muted); }
.field .hint { color: var(--ink-2); }
.field .error { color: var(--critical-ink); font-size: .84rem; }
.with-btn { display: flex; gap: 8px; }
.with-btn input { flex: 1; min-width: 0; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .9rem; margin-bottom: 16px; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }
details.help { margin: -8px 0 18px; font-size: .86rem; color: var(--ink-2); }
details.help summary { cursor: pointer; color: var(--accent-text); font-weight: 500; width: fit-content; }
details.help ol { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; max-width: 66ch; }
.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; font-size: .88rem;
  background: var(--accent-wash); color: var(--ink); margin-bottom: 18px;
}
.notice.warn { background: color-mix(in srgb, var(--warning) 16%, transparent); }
.notice.bad { background: color-mix(in srgb, var(--critical) 12%, transparent); }
.notice.good { background: color-mix(in srgb, var(--good) 12%, transparent); }
.notice b { font-weight: 600; }
.notice > div { min-width: 0; }

/* ---------- the client editor: a rail of sections beside the form ---------- */

.editor { display: grid; gap: 20px; grid-template-columns: 230px minmax(0, 1fr); align-items: start; }
.rail { position: sticky; top: 96px; display: grid; gap: 2px; }
.rail button {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  font: 500 .9rem var(--sans); color: var(--ink-2); background: none; border: 0; padding: 10px 12px; border-radius: 14px;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.rail button:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.rail button[aria-current="step"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--hairline), var(--shadow); }
.rail button:disabled { opacity: .5; cursor: default; }
.rail .dot {
  width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font: 500 .7rem var(--mono); background: var(--surface-2); color: var(--ink-muted);
}
.rail button[aria-current="step"] .dot { background: var(--ink); color: var(--plane); }
.rail button.done .dot { background: var(--accent); color: var(--accent-ink); }
.pane h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.03em; margin: 0 0 6px; }
.pane > .why { margin-bottom: 24px; }
.pane h3 { margin-top: 28px; }
.foot { display: flex; align-items: center; gap: 10px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--hairline); }
.foot .error { margin-right: auto; color: var(--critical-ink); font-size: .88rem; }
.foot .spacer { margin-right: auto; }
@media (max-width: 900px) {
  .editor { grid-template-columns: 1fr; }
  .rail { position: static; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
}

.client-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.client-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; letter-spacing: -.04em; margin: 0 0 4px; line-height: 1.1; }
.client-head .links { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: .86rem; }
.client-head .side { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* choice cards: one of two ways to send */
.choices { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 22px; }
@media (max-width: 640px) { .choices { grid-template-columns: 1fr; } }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice div {
  height: 100%; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--hairline); background: var(--plane);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease);
}
.choice strong { display: block; font-weight: 600; margin-bottom: 4px; }
.choice span { display: block; font-size: .84rem; color: var(--ink-2); }
.choice input:checked + div { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--ring); }
.choice input:focus-visible + div { outline: 2px solid var(--accent); outline-offset: 2px; }

/* the WhatsApp checklist */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps > li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; padding: 18px; border-radius: 16px; border: 1px solid var(--hairline); background: var(--plane); }
.steps .mark {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font: 500 .78rem var(--mono); background: var(--surface-2); color: var(--ink-muted);
}
.steps li.done .mark { background: var(--good); color: #fff; }
.steps h3 { margin: 3px 0 4px; }
.steps p { margin: 0 0 12px; font-size: .86rem; color: var(--ink-2); max-width: 64ch; }
.steps li > div > :last-child { margin-bottom: 0; }
.template { border: 1px solid var(--hairline); border-radius: 14px; background: var(--surface); padding: 14px 16px; margin-bottom: 10px; }
.template dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: .86rem; }
.template dt { color: var(--ink-muted); }
.template dd { margin: 0; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; overflow-wrap: anywhere; }
.template code, .secrets { font-family: var(--mono); font-size: .84rem; }
.switch { display: flex; align-items: center; gap: 12px; font-size: .92rem; font-weight: 500; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch i { width: 44px; height: 26px; border-radius: 999px; background: var(--axis); position: relative; flex: none; transition: background .3s var(--ease); }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .4s var(--ease); }
.switch input:checked + i { background: var(--good); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:disabled + i { opacity: .45; }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* live preview of the customer form */
.preview { border-radius: 22px; border: 1px solid var(--hairline); background: var(--plane); padding: 26px 20px 22px; text-align: center; position: sticky; top: 96px; }
.preview img { max-width: 150px; max-height: 60px; display: block; margin: 0 auto 12px; }
.preview .slogan { font-size: .95rem; color: var(--ink-2); margin: 0 0 18px; }
.preview .fake-input { height: 42px; border-radius: 12px; border: 1px solid var(--hairline); background: var(--surface); margin-bottom: 10px; display: flex; align-items: center; padding: 0 14px; font-size: .82rem; color: var(--ink-muted); }
.preview .fake-btn { height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 500; font-size: .92rem; transition: background .3s var(--ease); }
.preview small { display: block; margin-top: 14px; font-size: .74rem; color: var(--ink-muted); }
.summary { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 24px; margin: 0; font-size: .92rem; }
.summary dt { color: var(--ink-muted); }
.summary dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- server page ---------- */

.verdict { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.verdict .badge { font: 600 .8rem var(--sans); padding: 7px 14px; border-radius: 999px; white-space: nowrap; }
.verdict.ok .badge { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good-ink); }
.verdict.plan .badge { background: color-mix(in srgb, var(--warning) 22%, transparent); color: var(--warning-ink); }
.verdict.now .badge { background: color-mix(in srgb, var(--critical) 14%, transparent); color: var(--critical-ink); }
.verdict h2 { font-size: 1.3rem; font-weight: 600; letter-spacing: -.03em; margin: 0 0 6px; }
.verdict p { margin: 0 0 6px; color: var(--ink-2); max-width: 70ch; font-size: .92rem; }
.verdict > div { flex: 1; min-width: 240px; }
.meters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.meter { padding: 22px 24px; border-left: 1px solid var(--hairline); }
.meter:first-child { border-left: 0; }
@media (max-width: 760px) { .meters { grid-template-columns: 1fr; } .meter { border-left: 0; border-top: 1px solid var(--hairline); } .meter:first-child { border-top: 0; } }
.meter .k { font-size: .8rem; color: var(--ink-2); display: flex; justify-content: space-between; gap: 10px; }
.meter .v { font-size: 1.9rem; font-weight: 500; letter-spacing: -.045em; margin: 8px 0 12px; }
.meter .v small { font-size: .85rem; color: var(--ink-muted); font-weight: 400; letter-spacing: 0; margin-left: 6px; }
.bar { position: relative; height: 8px; border-radius: 4px; background: var(--surface-2); }
.bar b { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--series-1); min-width: 4px; }
.bar.plan b { background: var(--warning); }
.bar.now b { background: var(--critical); }
.bar u { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink-muted); border-radius: 1px; }
.meter .sub { font-size: .78rem; color: var(--ink-muted); margin-top: 10px; }
.legend { display: flex; gap: 18px; font-size: .82rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 3px; border-radius: 2px; }
text.tick { font: 400 11px var(--mono); fill: var(--ink-muted); }
text.series-label { font: 500 11px var(--sans); }
.tip {
  position: absolute; z-index: 30; pointer-events: none; opacity: 0;
  background: var(--surface); color: var(--ink); border: 1px solid var(--hairline); border-radius: 10px; box-shadow: var(--shadow);
  padding: 8px 11px; font-size: .8rem; line-height: 1.5; white-space: nowrap; transition: opacity .12s;
}
.tip.show { opacity: 1; }
.tip b { font-weight: 500; }
.tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }

/* ---------- packages ---------- */

.packages { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.package { border-radius: 18px; border: 1px solid var(--hairline); background: var(--plane); padding: 20px; display: flex; flex-direction: column; }
.package .fee { font-size: 1.6rem; font-weight: 500; letter-spacing: -.04em; margin: 6px 0 8px; }
.package .fee small { font-size: .8rem; color: var(--ink-muted); font-weight: 400; letter-spacing: 0; }
.package p { font-size: .86rem; color: var(--ink-2); margin: 0 0 16px; flex: 1; }
.package .meta { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--ink-muted); }
.package .meta span { margin-right: auto; }

/* ---------- small dialogs (quick actions only) ---------- */

dialog {
  border: 0; padding: 6px; border-radius: var(--r-shell); background: color-mix(in srgb, var(--surface) 70%, var(--plane)); color: var(--ink);
  width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 0 0 1px var(--hairline), 0 40px 80px -30px rgba(0, 0, 0, .5);
}
dialog[open] { animation: rise .5s var(--ease); }
dialog::backdrop { background: rgba(10, 12, 16, .5); }
dialog form { background: var(--surface); border-radius: var(--r-core); padding: 24px; }
dialog h2 { font-size: 1.12rem; font-weight: 600; letter-spacing: -.02em; margin: 0 0 8px; }
dialog .foot { margin-top: 8px; padding-top: 18px; }
.secrets { background: var(--plane); border: 1px solid var(--hairline); border-radius: 14px; padding: 14px 16px; white-space: pre-wrap; word-break: break-all; margin: 14px 0; }

.toast { z-index: 40; border-radius: 999px; padding: 12px 20px; }

/* ---------- sign in ---------- */

.signin { min-height: 100dvh; display: grid; align-content: center; justify-items: center; gap: 22px; padding: 24px 16px; max-width: 420px; margin: 0 auto; }
.signin .logo { width: 150px; height: auto; }
.signin .shell { width: 100%; margin: 0; }
.signin h1 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.03em; margin: 0 0 20px; }
.signin .btn { width: 100%; padding: 14px; }
.signin .error { margin: -4px 0 14px; font-size: .86rem; color: var(--critical-ink); }
.signin .fine { color: var(--ink-muted); font-size: .8rem; text-align: center; margin: 0; }

/* chains in the client list: the chain's row, then its branches set in beneath it */
tr.chain { background: color-mix(in srgb, var(--ink) 2%, transparent); }
tr.nested td:first-child { padding-left: 52px !important; position: relative; }
tr.nested td:first-child::before { content: ""; position: absolute; left: 36px; top: 0; bottom: 0; width: 2px; background: var(--hairline); }

/* the two notification workflows, as rows of steps */
.flows { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .flows { grid-template-columns: 1fr; } }
.flow { border: 1px solid var(--hairline); border-radius: 16px; background: var(--plane); padding: 16px 18px; min-width: 0; }
.flow-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.flow-head strong { font-weight: 600; margin-right: auto; }
.flow ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 6px; }
.flow li { flex: 1 0 86px; padding: 10px 10px 10px 14px; border-left: 2px solid var(--axis); }
.flow li .num { display: block; font-size: 1.35rem; font-weight: 500; letter-spacing: -.03em; }
.flow li small { display: block; font-size: .74rem; color: var(--ink-2); margin-top: 2px; }
.flow li.bad { border-left-color: var(--critical); }
.flow li.bad .num { color: var(--critical-ink); }

/* Brand identity: the profile drop, what was found, the colours, and the page cropper */
.drop { display: grid; gap: 4px; place-items: center; text-align: center; padding: 34px 18px; border: 1.5px dashed var(--axis); border-radius: 18px; background: var(--plane); cursor: pointer; transition: border-color .3s var(--ease), background .3s var(--ease); }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-wash); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop strong { font-weight: 600; }
.drop span { font-size: .84rem; color: var(--ink-2); }
.id-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 20px; }
.id-tile { border: 1px solid var(--hairline); border-radius: 14px; overflow: hidden; background: var(--surface); display: grid; }
.id-tile.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--ring); }
.id-pic { height: 120px; display: grid; place-items: center; padding: 10px;
  background: repeating-conic-gradient(#e7e7e3 0 25%, #f7f7f5 0 50%) 0 0 / 16px 16px; }
.id-pic img { max-width: 100%; max-height: 100%; object-fit: contain; }
.id-meta { padding: 8px 10px 10px; display: grid; gap: 6px; font-size: .76rem; color: var(--ink-2); }
.id-meta select { font: 400 .84rem var(--sans); padding: 6px 8px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--plane); color: var(--ink); }
.id-swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.id-swatches button { width: 54px; height: 54px; border-radius: 14px; border: 2px solid transparent; cursor: pointer; display: grid; align-items: end; padding: 0 0 4px; font: 500 .62rem var(--mono); }
.id-swatches button[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--plane) inset; }
.id-pages { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.id-pages button { flex: none; border: 1px solid var(--hairline); border-radius: 10px; padding: 4px; background: var(--surface); cursor: pointer; display: grid; gap: 4px; font-size: .72rem; color: var(--ink-2); }
.id-pages img { height: 110px; width: auto; border-radius: 6px; display: block; }
.id-crop { border: 1px solid var(--hairline); border-radius: 16px; padding: 12px; background: var(--plane); margin-bottom: 14px; }
.id-crop-stage { position: relative; display: inline-block; max-width: 100%; cursor: crosshair; user-select: none; touch-action: none; }
.id-crop-stage canvas { display: block; max-width: 100%; height: auto; border-radius: 8px; }
.id-box { position: absolute; border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); pointer-events: none; }

/* ---------- iPhone app: switches, design and a phone preview ---------- */
.app-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
@media (max-width: 960px) { .app-layout { grid-template-columns: 1fr; } }
.app-preview-wrap { position: sticky; top: 90px; }
.switches { display: grid; }
.switch-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); cursor: pointer; }
.switch-row:first-child { border-top: 0; padding-top: 4px; }
.switch-row .text { flex: 1; min-width: 0; }
.switch-row strong { display: block; font-weight: 500; }
.switch-row small { display: block; color: var(--ink-2); font-size: .82rem; margin-top: 2px; }
.switch { position: relative; flex: none; width: 46px; height: 28px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .25s cubic-bezier(.3,1.4,.5,1); }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.design-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.design-row:first-child { border-top: 0; padding-top: 4px; }
.phone { margin: 4px auto 0; width: 300px; padding: 10px; border-radius: 46px; background: #1b1b1a; box-shadow: 0 20px 50px rgba(0,0,0,.18); }
.phone-screen { position: relative; height: 600px; overflow: hidden; border-radius: 37px; background: var(--pv-canvas); color: #1a1a19; font-family: -apple-system, 'SF Pro Text', Geist, sans-serif; }
.phone-screen .island { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 92px; height: 26px; border-radius: 999px; background: #000; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 0 9px; }
.phone-screen .island img { width: 18px; height: 18px; border-radius: 5px; background: #fff; object-fit: contain; }
.phone-screen .island b { color: #fff; font-size: 11px; }
.pv-glow { position: absolute; inset: 0 0 auto; height: 260px; background: radial-gradient(circle at 50% 0, var(--pv-accent-soft), transparent 70%); }
.pv { position: relative; padding: 52px 18px 18px; display: grid; gap: 12px; justify-items: center; text-align: center; }
.pv-plate { padding: 4px; border-radius: var(--pv-r-lg); border: 1px solid #eaeaea; background: rgba(0,0,0,.03); }
.pv-plate div { background: #fff; border-radius: calc(var(--pv-r-lg) - 4px); padding: 10px 20px; min-width: 110px; }
.pv-plate img { display: block; max-width: 130px; max-height: 52px; margin: auto; }
.pv-slogan { max-width: 150px; max-height: 20px; }
.pv-eyebrow { font: 600 8px/1 'Geist Mono', monospace; letter-spacing: .16em; color: #787774; border: 1px solid #eaeaea; border-radius: 999px; padding: 4px 8px; margin-top: 6px; }
.pv-number { font-size: 68px; line-height: .9; font-weight: 600; letter-spacing: -.04em; }
.pv-number.serif { font-family: 'New York', 'Iowan Old Style', Georgia, serif; }
.pv-number.rounded { font-family: 'SF Pro Rounded', ui-rounded, 'Arial Rounded MT Bold', sans-serif; }
.pv-number.mono { font-family: 'SF Mono', 'Geist Mono', monospace; letter-spacing: -.06em; }
.pv-state { font: italic 15px Georgia, serif; color: var(--pv-accent); }
.pv-card { width: 100%; text-align: left; background: #fff; border: 1px solid #eaeaea; border-radius: var(--pv-r); padding: 10px 12px; font-size: 11px; display: grid; gap: 8px; }
.pv-step { display: flex; align-items: center; gap: 8px; }
.pv-step i { width: 12px; height: 12px; border-radius: 50%; background: #eaeaea; flex: none; }
.pv-step.done i, .pv-step.now i { background: var(--pv-accent); }
.pv-step.now { font-weight: 600; }
.pv-step span:last-child { margin-left: auto; color: #787774; font-family: 'Geist Mono', monospace; font-size: 9px; }
.pv-bar { height: 3px; border-radius: 3px; background: #eaeaea; overflow: hidden; margin: -2px 0 0 20px; }
.pv-bar b { display: block; width: 38%; height: 100%; background: var(--pv-accent); }
.pv-note { display: flex; gap: 8px; align-items: flex-start; }
.pv-note i { width: 18px; height: 18px; border-radius: 6px; background: var(--pv-accent-soft); flex: none; }
.pv-powered { font: 9px 'Geist Mono', monospace; color: #9c9b97; }
