/* The customer app: shell, onboarding (the line order continued), lines,
   the line page, keys, webhooks, members, billing, consent. Tokens and shared
   components are in ostra.css. No amber rule here: that belongs to staff. */

/* ---------- Shells ---------- */
.frame-app { min-height: 100dvh; }
.main { padding: 22px max(var(--gutter), env(safe-area-inset-right)) calc(56px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left)); min-width: 0; }
.main:focus { outline: none; }
/* Stacked blocks on a page keep one rhythm. */
.main > .panel, .main > .grid-2, .main > .notice, .main > .placeholder-block, .main > .danger-zone, .main > .owner-note { margin-bottom: 18px; }

.side { display: none; }
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 8px max(var(--gutter), env(safe-area-inset-left));
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.top .wordmark { font-size: 19px; }
.top-title { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 12px; border-left: 1px solid var(--line); }
.menu-btn { margin-left: auto; }

@media (min-width: 960px) {
  .frame-app { display: grid; grid-template-columns: 232px minmax(0, 1fr); }
  .top { display: none; }
  .side {
    display: flex; flex-direction: column; gap: 18px;
    position: sticky; top: var(--bar-h, 0px); height: calc(100dvh - var(--bar-h, 0px)); overflow-y: auto;
    padding: 20px 14px 18px; border-right: 1px solid var(--line); background: var(--bg);
  }
  .side-top { padding: 0 6px; }
  .main { padding: 26px 32px 72px; max-width: 1240px; width: 100%; }
}
@media (min-width: 1400px) { .main { padding-left: 44px; padding-right: 44px; } }

.org { padding: 12px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); display: grid; gap: 3px; }
.org-name { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.org-state { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); }
.org-state[data-lamp='live'] { color: var(--live-text); }
.org-state[data-lamp='down'] { color: var(--down-text); }

.nav { list-style: none; display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 36px; padding: 6px 10px; border-radius: 6px;
  color: var(--muted); text-decoration: none; font-size: 14px;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}
@media (hover: hover) { .nav a:hover { color: var(--text); background: var(--surface); } }
.nav a[aria-current='page'] { color: var(--text); background: var(--surface-2); font-weight: 500; }
.nav .count { min-width: 22px; padding: 1px 6px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); font-size: 11.5px; color: var(--text-2); text-align: center; }
.nav .count:empty { display: none; }
.nav a[aria-current='page'] .count { background: var(--bg); }
.side-foot { margin-top: auto; display: grid; gap: 6px; padding: 12px 10px 0; border-top: 1px solid var(--line); }
.who { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; font-family: var(--mono); letter-spacing: -0.01em; }
.side-foot .btn { justify-self: start; padding-left: 0; padding-right: 0; }

/* The phone menu: the same nav in a sheet from the left. */
.sheet {
  position: fixed; inset: 0 auto 0 0; margin: 0; height: 100dvh; max-height: none;
  overscroll-behavior: contain; overflow-y: auto;
  width: min(320px, 86vw); padding: calc(14px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom));
  border: 0; border-right: 1px solid var(--line-2); background: var(--bg); color: var(--text);
  display: none; flex-direction: column; gap: 16px; box-shadow: var(--sheet-shadow);
}
.sheet[open] { display: flex; }
.sheet::backdrop { background: var(--scrim); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
@media (prefers-reduced-motion: no-preference) {
  .sheet[open] { animation: slide-in 240ms var(--ease); }
  .sheet[open]::backdrop { animation: fade 240ms var(--ease); }
}
@keyframes slide-in { from { transform: translateX(-24px); opacity: 0; } }

/* Before an organisation exists: a slim bar. */
.bare-bar { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 10px max(var(--gutter), env(safe-area-inset-left)); border-bottom: 1px solid var(--line); }
@media (max-width: 479px) { .bare-who { display: none !important; } .bare-bar .btn { margin-left: auto; } }
.bare-who { margin-left: auto; font: 400 12.5px/1.3 var(--mono); color: var(--muted); overflow-wrap: anywhere; min-width: 0; text-align: right; }
.frame-bare .main { max-width: 1180px; margin: 0 auto; padding-top: 32px; }

/* Signed out: one card. */
.frame-center { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.center-head { display: flex; justify-content: center; padding: calc(28px + env(safe-area-inset-top)) var(--gutter) 8px; }
.frame-center .main { display: grid; justify-items: center; align-content: start; padding-top: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.center-card { width: min(460px, 100%); padding: 26px 22px; display: grid; gap: 16px; box-shadow: var(--lift); }
.center-card h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.15; }
.center-card h1:focus { outline: none; }
.center-card .lede { font-size: 15.5px; }
@media (min-width: 560px) { .center-card { padding: 34px 34px 30px; } .frame-center .main { padding-top: 7vh; } }
.sent-to { font-size: 17px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); }
.mock-mail { display: grid; gap: 6px; justify-items: start; padding: 14px; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--bg); }
.mail-meta { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.mail-meta span:first-child { margin-right: 2px; }
.mail-subject { font-weight: 600; font-size: 14.5px; margin-bottom: 4px; }

/* ---------- Onboarding: the line order, continued from the website ---------- */
.onboard { display: grid; gap: 32px; align-items: start; }
.onboard-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; min-width: 0; }
.onboard-main > .page-head { margin-bottom: 0; }
@media (min-width: 1100px) {
  .onboard { grid-template-columns: minmax(0, 1fr) minmax(320px, 380px); gap: 40px; }
  .onboard-side { position: sticky; top: calc(var(--bar-h, 0px) + 24px); }
}
@media (min-width: 1280px) { .frame-bare .onboard { grid-template-columns: minmax(0, 1fr) 420px; gap: 64px; } }
.page-head h1 .n { font-size: .62em; font-weight: 500; color: var(--muted); margin-right: 12px; letter-spacing: -0.02em; vertical-align: 0.12em; }

.order-sheet { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.order-sheet .sheet-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sheet-mark { width: 28px; height: 28px; flex: none; color: var(--text); }
.order-sheet .sheet-head > div { min-width: 0; }
.order-sheet .sheet-head h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.order-sheet .sheet-head p { font-size: 12.5px; color: var(--muted); }
.order-sheet .sheet-head .status-word { margin-left: auto; }
.sheet-rows { margin: 0; }
.sheet-rows > div { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.45; }
.sheet-rows > div:first-child { border-top: 0; }
.sheet-rows dt { color: var(--muted); font-size: 12.5px; padding-top: 1px; }
.sheet-rows dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--text); }
.sheet-rows dd.mono { font-size: 13px; }
.sheet-rows .with-lamp { display: inline-flex; align-items: center; gap: 7px; }
.sheet-foot { border-top: 1px solid var(--line); padding: 16px 16px 14px; }

.track { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: relative; }
.track::before { content: ''; position: absolute; top: 7px; left: 7px; right: calc(20% - 7px); height: 1.5px; background: var(--line-2); }
.track li { position: relative; display: grid; gap: 6px; align-content: start; min-width: 0; padding-right: 4px; }
.track .stop { position: relative; z-index: 1; width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--surface); display: grid; place-items: center; }
.track .stop-check { width: 9px; height: 9px; color: var(--bg); }
.track .label { font-size: 12.5px; color: var(--muted); line-height: 1.25; }
.track .label .n { display: block; font-size: 11px; font-weight: 400; }
.stage-note { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.track [data-state='done'] .stop { background: var(--text); border-color: var(--text); }
.track [data-state='done'] .label { color: var(--text); }
.track [data-state='current'] .stop, .track [data-state='waiting'] .stop { border-color: var(--text); box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 8px var(--text); }
.track [data-state='current'] .label, .track [data-state='waiting'] .label { color: var(--text); font-weight: 600; }
.track [data-state='current'] .stage-note, .track [data-state='waiting'] .stage-note { color: var(--text-2); }
.track [data-state='declined'] .stop { border-color: var(--down); }
.track [data-state='declined'] .stage-note { color: var(--down-text); }

.steps { list-style: none; display: grid; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 4px 14px; align-items: start; padding: 16px; }
.steps li + li { border-top: 1px solid var(--line); }
.steps li > a, .steps li > .step-locked { grid-column: 2; justify-self: start; margin-top: 8px; }
@media (min-width: 640px) { .steps li { grid-template-columns: 28px minmax(0, 1fr) auto; padding: 18px 20px; } .steps li > a, .steps li > .step-locked { grid-column: 3; grid-row: 1; margin-top: 0; align-self: center; } }
.steps h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 2px; }
.steps p { font-size: 14px; color: var(--text-2); }
.step-dot { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; font: 600 12.5px/1 var(--sans); color: var(--text-2); }
.step-dot .icon { width: 13px; height: 13px; }
.steps [data-state='done'] .step-dot { background: var(--text); border-color: var(--text); color: var(--bg); }
.steps [data-state='current'] .step-dot { border-color: var(--text); color: var(--text); }
.steps [data-state='later'] h2, .steps [data-state='later'] p { color: var(--muted); }
.step-locked { font-size: 13px; color: var(--muted); }

.next-list { list-style: none; counter-reset: next; display: grid; gap: 0; border-top: 1px solid var(--line); }
.next-list li { counter-increment: next; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; color: var(--text-2); }
.next-list li::before { content: counter(next); font: 500 12.5px/1.8 var(--mono); color: var(--muted); }
.next-list strong { color: var(--text); font-weight: 600; }
.reviewer-note { border-color: var(--down-line); }

.sandbox-panel { border-style: dashed; border-color: var(--line-2); background: transparent; }
.sandbox-panel .panel-body { padding: 16px 18px; gap: 10px; }
.sandbox-panel h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }

/* The KYB form */
.kyb { display: grid; gap: 28px; }
.form-section { display: grid; gap: 16px; padding-top: 22px; border-top: 1px solid var(--line); }
.form-section > h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.form-summary { padding: 12px 14px; border: 1px solid var(--down-line); border-radius: 8px; background: var(--down-dim); font-size: 14px; display: grid; gap: 6px; }
.form-summary:focus-visible { box-shadow: var(--ring); }
.form-summary ul { padding-left: 18px; }
.form-summary a { color: var(--text); }
.count-hint { font-variant-numeric: tabular-nums; }

.ticks { display: grid; gap: 8px; }
.agree-err:empty { display: none; }
.agree-err { display: grid; gap: 8px; }
.policy-card { padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); display: grid; gap: 10px; }
.policy-card header { display: grid; gap: 2px; }
.policy-card h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.policy-card h2 .n { margin-right: 8px; font-size: 13px; }
.policy-version { font-size: 13px; color: var(--muted); }
.policy-card ul { padding-left: 18px; display: grid; gap: 6px; font-size: 14.5px; color: var(--text-2); }
.policy-card li::marker { color: var(--muted); }
.policy-card a { justify-self: start; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.policy-card a .icon { width: 13px; height: 13px; }

/* ---------- Lines ---------- */
.line-sheet { list-style: none; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.line-sheet li + li { border-top: 1px solid var(--line); }
.line-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: start;
  padding: 14px 16px; color: var(--text); text-decoration: none;
  transition: background-color 160ms var(--ease);
}
@media (hover: hover) { .line-row:hover { background: var(--surface-2); text-decoration: none; } .line-row:hover .lr-go { color: var(--text); transform: translateX(2px); } }
.line-row:focus-visible { border-radius: 10px; }
.lr-status { grid-column: 2; grid-row: 1; justify-self: end; }
.lr-id { grid-column: 1; grid-row: 1; display: grid; gap: 1px; min-width: 0; }
.lr-id .id { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
.lr-id .lr-num { font-size: 13px; color: var(--text-2); }
.lr-net { grid-column: 1 / -1; display: grid; gap: 2px; font-size: 13px; min-width: 0; }
.lr-net .carrier { font-weight: 500; font-size: 13.5px; }
.exit { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; color: var(--text-2); }
.exit .fam { width: 30px; font-size: 11.5px; color: var(--muted); flex: none; }
.exit .addr { font-size: 12.5px; color: var(--text); overflow-wrap: anywhere; min-width: 0; }
.exit .asn { font-size: 11.5px; color: var(--muted); }
.lr-id .lr-num.none { font-family: var(--sans); }
.lr-tag { grid-column: 1; }
.lr-tag:empty { display: none; }
.lr-since { font-size: 12.5px; color: var(--text-2); }
.lr-check { grid-column: 1 / -1; display: grid; align-items: center; }
.lr-when { font-size: 12.5px; color: var(--muted); }
.lr-notice { grid-column: 1 / -1; font-size: 12.5px; line-height: 1.45; color: var(--text-2); padding: 8px 10px; border: 1px dashed var(--line-2); border-radius: 7px; }
.lr-go { display: none; color: var(--muted); transition: color 160ms var(--ease), transform 160ms var(--ease); }
.is-sandbox .line-row .id { color: var(--text-2); }
@media (min-width: 1080px) {
  .line-row { grid-template-columns: 150px 156px minmax(0, 1fr) 176px 140px 16px; gap: 0 18px; align-items: center; padding: 15px 20px; }
  .lr-status, .lr-id, .lr-net, .lr-tag, .lr-check { grid-row: 1; justify-self: stretch; }
  .lr-status { grid-column: 1; }
  .lr-id { grid-column: 2; }
  .lr-net { grid-column: 3; }
  .lr-tag { grid-column: 4; }
  .lr-check { grid-column: 5; }
  .lr-go { display: block; grid-column: 6; }
  .lr-notice { grid-row: 2; grid-column: 2 / 6; margin-top: 10px; }
}
.sandbox-block { margin-top: 28px; display: grid; gap: 10px; }
.sandbox-block h2 { font-size: 13px; font-weight: 500; color: var(--muted); }
.sandbox-block .line-sheet { border-style: dashed; border-color: var(--line-2); background: transparent; }
.main > .fine, .main > .request { margin-top: 16px; }
.empty { display: grid; gap: 10px; justify-items: start; padding: 22px; border: 1px dashed var(--line-2); border-radius: 10px; }
.empty h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.empty p { color: var(--text-2); max-width: 62ch; font-size: 14.5px; }

/* ---------- The line page ---------- */
.line-head { gap: 10px; margin-bottom: 16px; }
.line-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.line-id { font-family: var(--mono); font-weight: 500 !important; letter-spacing: -0.02em !important; font-size: clamp(26px, 6vw, 32px) !important; }
.tabs { margin: 0 calc(-1 * var(--gutter)) 22px; padding: 0 var(--gutter); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs[data-edge='start'] { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
.tabs[data-edge='end'] { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); }
.tabs[data-edge='middle'] { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
.tabs ul { list-style: none; display: flex; gap: 4px; }
.tabs a { display: inline-flex; align-items: center; min-height: 42px; padding: 0 10px; color: var(--muted); text-decoration: none; font-size: 14px; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 160ms var(--ease), border-color 160ms var(--ease); }
@media (hover: hover) { .tabs a:hover { color: var(--text); } }
.tabs a[aria-current='page'] { color: var(--text); font-weight: 500; border-bottom-color: var(--text); }
@media (min-width: 960px) { .tabs { margin-left: 0; margin-right: 0; padding: 0; } }
.tab-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; }

.health { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; }
.health-text { padding: 20px 18px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.health-say { font-size: clamp(24px, 5.2vw, 34px); font-weight: 600; line-height: 1.12; letter-spacing: -0.035em; font-variation-settings: 'opsz' 32; text-wrap: balance; }
.health-say .net { color: var(--signal-text); }
.health-why { font-size: 14.5px; color: var(--text-2); max-width: 60ch; }
.exits { display: grid; gap: 0; margin-top: 6px; border-top: 1px solid var(--line); }
.exit-big { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.exit-big:last-child { border-bottom: 0; padding-bottom: 0; }
.exit-big .fam { font-size: 12.5px; color: var(--muted); }
.exit-big .addr { font: 500 clamp(19px, 4.6vw, 26px)/1.2 var(--mono); letter-spacing: -0.01em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.exit-big .addr.none { font: 500 15px/1.4 var(--sans); color: var(--warn-text); }
.exit-big .owner { font-size: 13px; color: var(--text-2); }
.exit-big .owner .mono { font-size: 12.5px; }
.exit-big .checked { color: var(--muted); }
.health-side { padding: 18px; border-top: 1px solid var(--line); min-width: 0; }
.health-side h3 { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 10px; }
.health-rule { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--text-2); max-width: 52ch; }
.health-side.sim { display: grid; align-content: center; }
.health-side.sim p { font-size: 14px; color: var(--muted); max-width: 46ch; }
@media (min-width: 1000px) {
  .health { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .health-text { padding: 26px 28px; }
  .health-side { border-top: 0; border-left: 1px solid var(--line); padding: 26px 26px 22px; }
}

.grid-2 { display: grid; gap: 18px; align-items: start; }
.stack-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; }
@media (min-width: 1140px) { .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

.endpoints { display: grid; gap: 12px; }
@container (min-width: 600px) { .endpoints { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.snippet { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
/* A long command wraps inside its box, with continuation lines indented 2ch so
   they read as one command; the Copy button keeps its own row under the box. */
.snippet pre { margin: 0; padding: 12px 14px 12px calc(14px + 2ch); text-indent: -2ch; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 12.5px; line-height: 1.6; color: var(--text); white-space: pre-wrap; overflow-wrap: break-word; }
.snippet .btn-copy { justify-self: end; margin-top: 2px; }

.cip-act { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.cip-state:empty { display: none; }
.cip-state p { font-size: 14px; color: var(--text-2); }
.cip-state strong { color: var(--text); font-weight: 600; }
.cip-result:empty { display: none; }
.job-steps { list-style: none; display: grid; gap: 6px; margin-bottom: 8px; }
.job-steps li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.job-dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--idle); flex: none; }
.job-steps [data-done='yes'] { color: var(--text); }
.job-steps [data-done='yes'] .job-dot { background: var(--text); box-shadow: none; }
.job-done { font-size: 14px; color: var(--text-2); }
.job-done .mono { color: var(--text); }

.big-num { font-size: clamp(22px, 5vw, 28px); font-weight: 500; letter-spacing: -0.01em; }

/* Texts: bodies closed until a person opens one. */
.seal-note { display: flex; gap: 10px; align-items: flex-start; }
.seal-note .icon { margin-top: 3px; color: var(--muted); }
.sealed-list { list-style: none; border-top: 1px solid var(--line); }
.sealed { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sealed-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; }
.sealed-meta .from { color: var(--text); font-size: 13.5px; }
.sealed-meta time, .sealed-meta .dur { color: var(--muted); font-size: 12.5px; }
.sealed-closed { display: flex; align-items: center; gap: 12px; }
.seal-bar { flex: 1; height: 10px; max-width: 360px; border-radius: 3px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.is-open .sealed-closed { display: none; }
.seal-open { font-size: 13px; }
.sealed-list.compact .sealed { padding: 10px 0; }
.sms { padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2); font-size: 14.5px; line-height: 1.55; color: var(--text); overflow-wrap: anywhere; max-width: 62ch; }
.sealed-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.sealed-foot > span { flex: 1 1 220px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar select { min-height: 36px; padding: 6px 32px 6px 10px; font-size: 13.5px; width: auto; }
.records-sum { font-size: 13px; color: var(--text-2); margin-bottom: 10px; font-variant-numeric: tabular-nums; }

.report { display: grid; gap: 20px; }
.report-section h3 { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 4px; }

/* Texts: the next page by cursor. */
.more-row { margin-top: 12px; }

/* Access: proxy credentials. */
.cred-form { display: grid; gap: 12px; }
@media (min-width: 720px) { .cred-form { grid-template-columns: minmax(0, 1fr) 150px auto; align-items: end; } .cred-form .field-error { grid-column: 1 / -1; } }
.status-word.wrap { white-space: normal; align-items: flex-start; }
.status-word.wrap .lamp { margin-top: 5px; }
/* The register: a username and a date never break, a label (free text, up to
   100 characters, maybe one long token) takes what is left. A table only where
   all six columns fit on one line each (the panel's container, not the window). */
.records.creds tbody th[data-k='Username'], .records.creds td[data-k='Issued'], .records.creds td[data-k='Expires'] { white-space: nowrap; }
.records.creds td[data-k='Issued'], .records.creds td[data-k='Expires'] { font-variant-numeric: tabular-nums; }
.records.creds td[data-k='Label'] { overflow-wrap: anywhere; }
.records.creds .status-word.wrap { max-width: 30ch; }
/* Revoke's label sits on the row's text line, so a row with the button is as tall as one without. */
.records.creds .act .btn { margin-block: -5px; }
/* Narrower: each credential a ruled record, labels above values. Two lines:
   username and label, then issued, expires, state and Revoke, in reading order.
   The button's track keeps its width in a row without one, so the columns line up. */
@container (max-width: 779px) {
  .records.creds thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .records.creds, .records.creds tbody { display: block; }
  .records.creds tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(72px, auto); gap: 10px 16px; align-items: start; padding: 12px 14px; border-top: 1px solid var(--line); }
  .records.creds tbody tr:first-child { border-top: 0; }
  .records.creds th, .records.creds td { display: block; min-width: 0; padding: 0; border: 0; text-align: left; }
  .records.creds tbody th::before, .records.creds td::before { content: attr(data-k); display: block; font: 400 11.5px/1.4 var(--sans); color: var(--muted); letter-spacing: 0; }
  .records.creds tbody th { grid-column: 1; }
  .records.creds td[data-k='Label'] { grid-column: 2 / -1; }
  .records.creds tr:has(> .act:empty) > td[data-k='State'] { grid-column: 3 / -1; }
  .records.creds .act { grid-column: 4; align-self: end; justify-self: end; }
  .records.creds .act::before { content: none; }
  .records.creds .act:empty { display: none; }
  .records.creds .status-word.wrap { max-width: none; }
}
/* A phone: username and label take the whole width; a live credential's state
   shares its line with Revoke, at the right edge where the table keeps it. */
@container (max-width: 599px) {
  .records.creds tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; padding: 12px; }
  .records.creds tbody th, .records.creds td[data-k='Label'] { grid-column: 1 / -1; }
  .records.creds tr:has(> .act:empty) > td[data-k='State'] { grid-column: 1 / -1; }
  .records.creds .act { grid-column: 2; }
}
/* Full width, the panels' prose keeps a reading measure (DESIGN.md: 58 to 72ch). */
#endpoints .panel-body > p.fine, #creds .panel-body > p.fine { max-width: 72ch; }

/* ---------- Keys, webhooks, members ---------- */
.keys-grid { align-items: stretch; }
.key-name { display: block; font-weight: 600; color: var(--text); }
.key-prefix { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.line-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-top: 4px; }
.line-pick .tick { padding: 10px 12px; }
.grant-list { list-style: none; border-top: 1px solid var(--line); }
.grant { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.grant-name { font-weight: 600; font-size: 14.5px; }
.grant > div { display: grid; gap: 4px; min-width: 0; }
/* Scopes behind a disclosure, so a short word ("Full", "Read only") can be checked. */
.scope-list { font-size: 13px; color: var(--text-2); }
.scope-list summary { cursor: pointer; color: var(--muted); font-size: 12.5px; width: max-content; max-width: 100%; border-radius: 4px; }
@media (hover: hover) { .scope-list summary:hover { color: var(--text); } }
.scope-list ul { list-style: none; display: grid; gap: 6px; margin-top: 8px; padding-left: 2px; }
.scope-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; line-height: 1.45; }
.scope-code { font-size: 11.5px; color: var(--muted); }
.field-date input { max-width: 220px; }
.reserved { margin: 0 6px; padding: 0 6px; font-size: 11px; vertical-align: 1px; }
.hook-desc { color: var(--text-2); overflow-wrap: anywhere; }
.usage-days { margin-top: 6px; }
.usage-days summary { cursor: pointer; font-size: 13.5px; color: var(--text-2); margin-bottom: 10px; width: max-content; border-radius: 4px; }

/* More than one organisation: switch between them. */
.org-switch { display: grid; gap: 4px; padding: 0 2px; }
.org-switch label { font-size: 12px; font-weight: 400; color: var(--muted); }
/* 16px on a phone (the sheet), so focusing it never zooms the page; smaller in the desktop side column. */
@media (min-width: 960px) { .org-switch select { min-height: 36px; padding: 6px 32px 6px 10px; font-size: 13.5px; } }
.hook-list { list-style: none; border-top: 1px solid var(--line); }
.hook-list li + li { border-top: 1px solid var(--line); }
.hook-row { display: grid; grid-template-columns: minmax(0, 1fr) 16px; gap: 8px 14px; padding: 14px 4px; color: var(--text); text-decoration: none; align-items: center; }
.hook-url { grid-column: 1; font-size: 13.5px; overflow-wrap: anywhere; }
.hook-events { grid-column: 1; display: flex; flex-wrap: wrap; gap: 5px; }
.hook-last { grid-column: 1; display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.hook-row .lr-go { display: block; grid-column: 2; grid-row: 1 / span 3; }
@media (hover: hover) { .hook-row:hover .lr-go { color: var(--text); transform: translateX(2px); } }
.hook-title { font-size: clamp(18px, 4vw, 24px) !important; overflow-wrap: anywhere; font-weight: 500 !important; letter-spacing: -0.02em !important; }
.events { display: grid; gap: 8px; }
@media (min-width: 720px) { .events { grid-template-columns: 1fr 1fr; } }
.events .tick b { display: block; font-size: 13px; margin-bottom: 2px; }
.danger-zone { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 16px 20px; border: 1px solid var(--down-line); border-radius: 10px; }
.danger-zone h2 { font-size: 15px; font-weight: 600; }
.danger-zone p { font-size: 14px; color: var(--text-2); }
.person { display: block; font-weight: 600; }
.members .chip { margin-top: 4px; }
.members select { min-height: 34px; padding: 4px 32px 4px 10px; font-size: 13.5px; width: auto; }
.add-member { display: grid; gap: 12px; padding-bottom: 6px; }
@media (min-width: 720px) { .add-member { grid-template-columns: minmax(0, 1fr) 170px auto; align-items: end; } .add-member .field-error { grid-column: 1 / -1; } }
.field-btn .btn { min-height: 44px; }

/* ---------- Consent ---------- */
.consent { width: min(540px, 100%); }
.consent-pair { display: flex; align-items: center; gap: 10px; }
.app-tile { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); font-weight: 600; font-size: 17px; }
.pair-line { width: 36px; height: 1.5px; background: var(--line-2); }
.pair-mark { width: 40px; height: 40px; color: var(--text); }
.consent-h { font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 4px; }
.scopes { list-style: none; display: grid; border-top: 1px solid var(--line); }
.scopes li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: start; }
.scopes .lamp { margin-top: 6px; }
.scopes b { display: block; font-weight: 600; font-size: 14.5px; }
.scopes span { font-size: 13.5px; color: var(--text-2); }
.scopes.never .icon { width: 14px; height: 14px; margin-top: 4px; color: var(--muted); }
.line-pick.open { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

/* ---------- Billing (API.md 16) ----------
   The account panel is the page's one lifted panel, built like the line
   page's verdict: the status word, the answer as a display sentence, the
   figures in mono, the one action; beside it the object the state turns on
   (the period or the grace days as a tape of day cells, or the steps back). */
.main > .bill, .main > .bill-notices { margin-bottom: 18px; }
.bill-notices:empty { display: none; }
.bill { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; }
.bill-text { padding: 20px 18px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.bill-word { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.bill-say { font-size: clamp(24px, 5.2vw, 34px); font-weight: 600; line-height: 1.12; letter-spacing: -0.035em; font-variation-settings: 'opsz' 32; text-wrap: balance; }
.bill-say .when { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bill-why { font-size: 14.5px; color: var(--text-2); max-width: 62ch; }
.bill-figs { display: flex; flex-wrap: wrap; column-gap: 28px; margin-top: 6px; border-top: 1px solid var(--line); }
.bill-fig { flex: 1 1 150px; display: grid; gap: 2px; align-content: start; padding: 12px 0 2px; min-width: 0; }
.fig-label { font-size: 12.5px; color: var(--muted); }
.fig-value { font: 500 clamp(22px, 5vw, 28px)/1.15 var(--mono); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fig-sub { font-size: 13px; color: var(--text-2); }
.bill-act { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.bill-why-not { font-size: 13.5px; color: var(--muted); max-width: 60ch; }
.bill-side { padding: 18px; border-top: 1px solid var(--line); min-width: 0; display: grid; gap: 12px; align-content: start; }
.bill-side h3 { font-size: 13px; font-weight: 500; color: var(--muted); }
.bill-rule { padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--text-2); max-width: 52ch; }
.bill-foot { grid-column: 1 / -1; padding: 10px 20px 12px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
@media (min-width: 1100px) { .bill-foot { padding: 10px 28px 12px; } }
@media (min-width: 1000px) {
  .bill { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .bill-text { padding: 26px 28px; }
  .bill-side { border-top: 0; border-left: 1px solid var(--line); padding: 26px 26px 22px; }
}

/* The day tape: one cell a day, as the line page's minute tape. Days gone
   are filled (a count, in text-2; in a grace period the warn lamp, since it
   is the clock to a suspension), today is outlined, days ahead are empty. */
.day-tape { margin: 0; display: grid; gap: 8px; }
.day-tape figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13.5px; color: var(--text-2); }
.tape-label { font: inherit; color: var(--text-2); }
.day-tape figcaption .mono { font-size: 13px; color: var(--text); white-space: nowrap; }
.tape-days { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; height: 22px; }
.tape-day { border-radius: 2px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.tape-day[data-at='gone'] { background: var(--text-2); box-shadow: none; }
.tape-day[data-at='today'] { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text); }
.day-tape[data-kind='grace'] .tape-day[data-at='gone'] { background: var(--warn); }
.day-tape[data-kind='grace'] .tape-day[data-at='today'] { box-shadow: inset 0 0 0 1.5px var(--warn); }
.tape-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.tape-axis .mono { font-size: 11.5px; }

.bill-steps { margin: 0; }
.bill-steps li { font-size: 14px; }
.bill-steps [data-done='now'] { color: var(--text); font-weight: 500; }
.bill-steps [data-done='now'] .job-dot { box-shadow: inset 0 0 0 2px var(--text); }

.rates .unit { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); }
.rates .price { font-size: 13.5px; color: var(--text); font-variant-numeric: tabular-nums; }
.rates tbody th { font-weight: 500; }
@media (max-width: 760px) {
  .rates tbody th::before { content: none; }
  .rates tr { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .rates tbody th { grid-column: 1; }
  .rates td.num { grid-column: 2; text-align: right !important; }
  .rates td.num::before { content: none; }
}

.bill-lines { list-style: none; display: grid; border-top: 1px solid var(--line); }
.bill-lines li { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto; align-items: center; gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.bill-lines li:last-child { border-bottom: 0; }
.bill-line-id { font-size: 14px; color: var(--text); text-decoration: none; }
@media (hover: hover) { .bill-line-id:hover { text-decoration: underline; text-underline-offset: 3px; } }
.bill-line-from { font-size: 13.5px; color: var(--text-2); }
@media (max-width: 520px) {
  .bill-lines li { grid-template-columns: minmax(0, 1fr) auto; }
  .bill-line-from { grid-column: 1 / -1; grid-row: 2; }
}

/* The paste-the-link path on the sign-in pages (signin.ts pasteLinkForm). */
.paste-link { margin-top: 4px; }
.paste-link summary { cursor: pointer; color: var(--muted); font-size: 13.5px; width: max-content; max-width: 100%; border-radius: 4px; }
.paste-link summary:focus-visible { box-shadow: var(--ring); }
.paste-link[open] summary { margin-bottom: 12px; }

/* ---------- Devices (API.md 3.13) ----------
   The register: each Ostra app device filed under the line it reaches, a
   panel per line headed by its ID in mono, and a row's status word carrying
   its reason under it, so "off" always says why. */
.dev-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 14px; margin-bottom: 18px; }
.dev-filter .field { flex: 0 1 240px; }
.dev-filter select { min-height: 40px; padding-top: 7px; padding-bottom: 7px; }
.dev-all { min-height: 40px; padding: 9px 12px; align-items: center; }
.dev-all input { margin-top: 0; }
@media (min-width: 960px) { .dev-filter select { font-size: 13.5px; } .dev-all { font-size: 13.5px; } }
.main > .dev-status:empty { display: none; }
.main > .dev-status { margin-bottom: 18px; }
.main > .dev-line { margin-bottom: 18px; }
.dev-line .panel-head h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; min-width: 0; }
.dev-line-id { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; color: var(--text); text-decoration: none; border-radius: 4px; }
@media (hover: hover) { .dev-line-id:hover { text-decoration: underline; text-underline-offset: 3px; } }
.dev-carrier { font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.dev { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 1px 10px; align-items: start; }
.dev-icon { grid-row: 1 / span 2; margin-top: 2px; color: var(--text-2); }
.dev-name { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.dev-sub { font-size: 12.5px; font-weight: 400; color: var(--muted); overflow-wrap: anywhere; }
.dev-sub .mono { font-size: 12px; }
.reg-who { display: block; color: var(--text); overflow-wrap: anywhere; }
.reg-who.mono { font-size: 12.5px; }
.status-why { display: block; margin-top: 3px; max-width: 34ch; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.dev-line-why { font-size: 13.5px; color: var(--text-2); }
.records.devices .push-on { color: var(--text); }
.records.devices .push-off { color: var(--muted); }
.records.devices td[data-k='Last seen'] .sub { margin-top: 1px; }
.dev-sub .mono { white-space: nowrap; }
.records tr.is-revoked .dev-name, .records tr.is-revoked .reg-who { color: var(--muted); }
.records tr.is-revoked .dev-icon { color: var(--idle); }
/* A desktop table with one set of column widths, so every line's register lines up with the next. */
@media (min-width: 1200px) {
  .records.devices { table-layout: fixed; }
  .records.devices thead th:nth-child(1) { width: 24%; }
  .records.devices thead th:nth-child(2) { width: 26%; }
  .records.devices thead th:nth-child(3) { width: 21%; }
  .records.devices thead th:nth-child(4) { width: 12%; }
  .records.devices thead th:nth-child(5) { width: 7%; }
  .records.devices thead th:nth-child(6) { width: 10%; }
  .records.devices .act { padding-left: 4px; }
}
/* Narrower: each device a ruled block in its line's panel, labels above values (the shared stacked rows, from 1199px down). */
@media (max-width: 1199px) {
  .dev-line .table-wrap { border: 0; border-radius: 0; }
  .records.devices thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .records.devices, .records.devices tbody { display: block; }
  .records.devices tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 16px; padding: 14px 0; border-top: 1px solid var(--line); }
  .records.devices tbody tr:first-child { border-top: 0; padding-top: 4px; }
  .records.devices th, .records.devices td { display: block; padding: 0; border: 0; text-align: left !important; min-width: 0; overflow-wrap: anywhere; }
  .records.devices td::before { content: attr(data-k); display: block; font: 400 11.5px/1.4 var(--sans); color: var(--muted); letter-spacing: 0; }
  .records.devices tbody th { grid-column: 1 / -1; }
  .records.devices tbody th::before { content: none; }
  .records.devices .act { grid-column: 1 / -1; }
  .records.devices .act:empty { display: none; }
  .records.devices .act .btn { margin-left: -10px; }
  .status-why { max-width: 52ch; }
}
/* A phone: only the device's name shares a line with its status word (DESIGN.md, check row); the reason runs full width under them. */
@media (max-width: 560px) {
  .records.devices tr { grid-template-columns: minmax(0, 1fr) auto; }
  .records.devices tbody th { grid-column: 1; grid-row: 1; }
  .records.devices td[data-k='Status'] { display: contents; }
  .records.devices td[data-k='Status']::before { content: none; }
  .records.devices td[data-k='Status'] .status-word { grid-column: 2; grid-row: 1; justify-self: end; align-self: start; }
  .records.devices td[data-k='Status'] .status-why { grid-column: 1 / -1; grid-row: 2; margin-top: -2px; }
  .records.devices td[data-k='Registered by'] { grid-column: 1 / -1; }
}
