/*
 * The kit's components and the dashboards, in the site system (site.css supplies the tokens). Every page loads it:
 * public pages use the components (fields, buttons, notices); the dashboards add the app shell.
 *
 * The shell is measured from Linear's app (2026): a 240px side nav with 28px rows at 13px/510 and an inset content
 * panel with a hairline. Figures and charts follow Polar's product UI. docs/DESIGN_SYSTEM.md has the rules.
 */

:root.c-site {
  /* States. Each has a mark color (dots, icons, edges) and a text color for words on its own 12% tint; every text
     color passes 4.5:1 on that tint over --c-raised and on the ground. Color is never the only cue: the words or an
     icon always say the state too.
       success: live, approved, paid, delivered: done and good.
       warning: needs you: something to do before it can go on.
       info:    in progress or waiting on the network: nothing to do.
       danger:  refused, failed, blocked, and destructive actions.
       neutral: off, paused, ended, draft: not running, not a problem. */
  --c-success: #4cb782;        /* 7.6:1 on --c-raised */
  --c-success-text: #8fd9b0;   /* 9.2:1 on its tint */
  --c-success-tint: rgba(76, 183, 130, 0.12);
  --c-success-line: rgba(76, 183, 130, 0.4);
  --c-warning: #f2b94b;        /* 10.7:1 on --c-raised */
  --c-warning-text: #f5c97a;   /* 9.7:1 on its tint */
  --c-warning-tint: rgba(242, 185, 75, 0.12);
  --c-warning-line: rgba(242, 185, 75, 0.4);
  --c-info: #6aa6ff;           /* 7.7:1 on --c-raised */
  --c-info-text: #9cc3ff;      /* 8.5:1 on its tint */
  --c-info-tint: rgba(106, 166, 255, 0.12);
  --c-info-line: rgba(106, 166, 255, 0.4);
  --c-alert: #eb5757;          /* 5.5:1 on --c-raised */
  --c-alert-text: #f2a3a3;     /* 7.8:1 on its tint */
  --c-alert-line: rgba(235, 87, 87, 0.4);
  --c-alert-tint: rgba(235, 87, 87, 0.12);
  --c-wait: #d0d6e0;
  --c-panel: rgba(255, 255, 255, 0.012);
  --c-active: rgba(255, 255, 255, 0.05);
  --c-focus: #9cc3ff;          /* focus rings: 10.6:1 on --c-raised, distinct from every state */
}
.d-i { flex: none; display: block; }
.k-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.k-text-supporting { font-size: 13px; line-height: 20px; color: var(--c-text-3); }
.k-text-large { font-size: 17px; line-height: 26px; color: var(--c-text); }
.k-text-medium { font-weight: 510; color: var(--c-text-2); }
.k-text-semibold { font-weight: 590; color: var(--c-text); }
.k-text-secondary { color: var(--c-text-3); }
.k-stack { display: flex; min-width: 0; }
.k-vstack { flex-direction: column; }
.k-vstack > * { min-width: 0; }
.k-grid { display: grid; }
.k-card { border: 1px solid var(--c-line); border-radius: var(--c-r-card); background: rgba(255, 255, 255, 0.02); min-width: 0; }
.k-link { color: var(--c-text-2); text-decoration: underline; text-decoration-color: var(--c-line-3); text-underline-offset: 3px; }
.k-link:hover { color: var(--c-text); text-decoration-color: var(--c-text-3); }

.k-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; box-sizing: border-box; border-radius: 999px;
  border: 1px solid var(--c-line-2); background: transparent; color: var(--c-text-2); font: inherit; font-size: 13px; line-height: 20px; font-weight: 510;
  white-space: nowrap; text-decoration: none; cursor: pointer; transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease; }
.k-btn:hover { border-color: var(--c-line-3); color: var(--c-text); }
.k-btn:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.k-btn-sm { height: 32px; padding: 0 12px; }
.k-btn-primary { background: var(--c-pill); border-color: var(--c-pill); color: var(--c-on-pill); }
.k-btn-primary:hover { background: var(--c-pill-hover); border-color: var(--c-pill-hover); color: var(--c-on-pill); }
.k-btn-ghost { border-color: transparent; color: var(--c-text-3); }
.k-btn-ghost:hover { border-color: transparent; background: rgba(255, 255, 255, 0.04); }
.k-btn-destructive { border-color: var(--c-alert-line); color: var(--c-alert-text); }
.k-btn-destructive:hover { border-color: var(--c-alert); color: #fff; background: var(--c-alert-tint); }
.k-btn[disabled], .k-btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
/* Buttons that are links: site.css's `.c-site a { color: inherit }` would otherwise win. */
.c-site a.k-btn { color: var(--c-text-2); }
.c-site a.k-btn:hover { color: var(--c-text); }
.c-site a.k-btn-primary, .c-site a.k-btn-primary:hover { color: var(--c-on-pill); }
.c-site a.k-btn-ghost { color: var(--c-text-3); }
.c-site a.k-btn-destructive { color: var(--c-alert-text); }
.c-site a.k-btn-destructive:hover { color: #fff; }
.k-btn .d-i { width: 14px; height: 14px; }

.k-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.k-label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; line-height: 20px; font-weight: 510; color: var(--c-text-2); }
.k-label .k-req { color: var(--c-text-4); font-weight: 400; font-size: 12px; }
.k-label .k-hint { font-weight: 400; color: var(--c-text-4); font-variant-numeric: tabular-nums; }
.k-help { margin: 0; font-size: 12px; line-height: 18px; color: var(--c-text-4); }
.k-help a { color: var(--c-text-3); text-decoration: underline; text-underline-offset: 2px; }
.k-input, .sa-native-input { width: 100%; min-height: 36px; padding: 7px 12px; box-sizing: border-box; border: 1px solid rgba(255, 255, 255, 0.36); border-radius: var(--c-r-input);
  background: rgba(255, 255, 255, 0.02); color: var(--c-text); font: inherit; font-size: 13px; line-height: 20px; }
.k-input::placeholder, .sa-native-input::placeholder { color: var(--c-text-4); }
.k-input:hover, .sa-native-input:hover { border-color: rgba(255, 255, 255, 0.48); }
.k-input:focus-visible, .sa-native-input:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 1px; border-color: var(--c-focus); }
textarea.k-input { resize: vertical; }
select.k-input, select.sa-native-input { appearance: none; -webkit-appearance: none; padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--c-text-3) 50%), linear-gradient(135deg, var(--c-text-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) 15px, calc(100% - 12px) 15px; background-size: 5px 5px; background-repeat: no-repeat; }
select option { background: var(--c-raised); color: var(--c-text); }
input[type="date"].sa-native-input { color-scheme: dark; }
.k-form { display: flex; flex-direction: column; gap: 18px; }

.sa-choice { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.sa-choice > legend { margin-bottom: 8px; padding: 0; font-size: 13px; font-weight: 510; color: var(--c-text-2); }
.sa-choice-help { margin: -4px 0 4px; font-size: 12px; color: var(--c-text-4); }
.sa-choice-list { display: grid; gap: 8px; }
.sa-choice-row { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.c-site .sa-choice-item { display: flex; align-items: flex-start; gap: 12px; padding: 11px 14px; border: 1px solid var(--c-line-2); border-radius: var(--c-r-input); background: transparent; cursor: pointer; }
.c-site .sa-choice-item:hover { border-color: var(--c-line-3); }
.c-site .sa-choice-item:has(input:checked) { border-color: var(--c-text-2); box-shadow: none; background: rgba(255, 255, 255, 0.03); }
.c-site .sa-choice-item input { -webkit-appearance: none; appearance: none; flex: none; display: grid; place-content: center; width: 16px; height: 16px; margin: 2px 0 0;
  border: 1.5px solid var(--c-text-4); border-radius: 50%; background: transparent; cursor: pointer; }
.c-site .sa-choice-item input[type="checkbox"] { border-radius: 4px; }
.c-site .sa-choice-item input::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c-text); transform: scale(0); transition: transform 100ms ease; }
.c-site .sa-choice-item input[type="checkbox"]::before { border-radius: 2px; }
.c-site .sa-choice-item input:checked { border-color: var(--c-text); }
.c-site .sa-choice-item input:checked::before { transform: scale(1); }
.c-site .sa-choice-item input:focus-visible { outline: 2px solid var(--c-text-2); outline-offset: 2px; }
.sa-choice-text { display: grid; gap: 2px; font-size: 13px; line-height: 20px; }
.sa-choice-text b { font-weight: 510; color: var(--c-text); }
.sa-choice-text span { color: var(--c-text-4); font-size: 12px; line-height: 18px; }

.k-note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--c-line); border-radius: var(--c-r-card); background: var(--c-raised); color: var(--c-text-3); }
.k-note > .d-i { margin-top: 2px; color: var(--c-info); }
.k-note-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.k-note-title { font-weight: 510; color: var(--c-text); }
.k-note-text { color: var(--c-text-3); }
.k-note-text > * { margin: 0; }
.k-note-text > * + * { margin-top: 6px; }
.k-note-action { flex: none; align-self: center; display: flex; gap: 8px; flex-wrap: wrap; }
.k-note-action form { margin: 0; }
.k-note-success { border-color: var(--c-success-line); }
.k-note-success > .d-i { color: var(--c-success); }
.k-note-info { border-color: var(--c-info-line); }
.k-note-warning { border-color: var(--c-warning-line); background: var(--c-warning-tint); }
.k-note-warning > .d-i { color: var(--c-warning); }
.k-note-error { border-color: var(--c-alert-line); background: var(--c-alert-tint); }
.k-note-error > .d-i { color: var(--c-alert); }

.k-badge { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 22px; padding: 0 9px; box-sizing: border-box; border-radius: 999px; background: var(--c-chip);
  font-size: 12px; line-height: 16px; font-weight: 510; color: var(--c-text-2); white-space: nowrap; vertical-align: middle; }
.k-badge::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--c-text-4); }
.k-badge-icon::before { display: none; }
.k-badge .d-i { margin-left: -2px; }
.k-badge-success { background: var(--c-success-tint); color: var(--c-success-text); }
.k-badge-success::before { background: var(--c-success); }
.k-badge-warning { background: var(--c-warning-tint); color: var(--c-warning-text); }
.k-badge-warning::before { background: var(--c-warning); }
.k-badge-info { background: var(--c-info-tint); color: var(--c-info-text); }
.k-badge-info::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c-info); }
.k-badge-error { background: var(--c-alert-tint); color: var(--c-alert-text); }
.k-badge-error::before { background: var(--c-alert); }
.k-badge-plain::before { display: none; }
.sa-badge { display: inline-flex; max-width: 100%; }

.k-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 20px; text-align: center; }
.k-empty b { font-weight: 510; color: var(--c-text-2); }
.k-empty p { margin: 0; max-width: 46ch; color: var(--c-text-4); }
.k-empty-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.c-scroll { overflow-x: auto; max-width: 100%; }
.c-table td, .c-table th { vertical-align: middle; }
.c-table tbody tr:hover > * { background: rgba(255, 255, 255, 0.015); }
.k-table-compact th, .k-table-compact td { padding-block: 9px; }
.k-table-compact thead th { padding-block: 8px; }
.c-table .k-sub, .k-sub { display: block; font-size: 12px; line-height: 18px; font-weight: 400; color: var(--c-text-4); }
.c-table a { color: var(--c-text); text-decoration: none; }
.c-table a:hover { text-decoration: underline; text-decoration-color: var(--c-line-3); text-underline-offset: 3px; }
.c-table .k-act { width: 1%; white-space: nowrap; text-align: right; }
.c-table .k-act form { display: inline-flex; margin: 0; }
.k-nowrap { white-space: nowrap; }
.sa-money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sa-credit { color: var(--c-text); font-weight: 510; }
.sa-ago { white-space: nowrap; }

.sa-list-tools { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.c-site .sa-tabs { display: flex; flex-wrap: wrap; gap: 20px; width: auto; padding: 0; border: 0; border-bottom: 1px solid var(--c-line-soft); border-radius: 0; background: transparent; }
.c-site .sa-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 0 0 10px; margin-bottom: -1px; border-radius: 0; border-bottom: 2px solid transparent;
  background: transparent; box-shadow: none; color: var(--c-text-3); font-size: 13px; font-weight: 510; text-decoration: none; white-space: nowrap; }
.c-site .sa-tabs a:hover { color: var(--c-text); background: transparent; }
.c-site .sa-tabs a[aria-current="page"] { color: var(--c-text); border-bottom-color: var(--c-text); background: transparent; box-shadow: none; font-weight: 510; }
.c-site .sa-tabs-n { font-family: inherit; font-size: 12px; color: var(--c-text-4); }
.c-site .sa-tabs a[aria-current="page"] .sa-tabs-n { color: var(--c-text-3); }
.sa-search { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.sa-search-q { width: 260px; max-width: 100%; }
.sa-search .sa-native-input:not(.sa-search-q) { width: auto; min-width: 150px; }
.sa-search-clear { font-size: 12px; color: var(--c-text-3); text-decoration: underline; text-underline-offset: 3px; }
.c-site .sa-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 20px; border: 0; border-top: 1px solid var(--c-line-soft); border-radius: 0; background: transparent; }
.sa-pager-count { font-size: 12px; color: var(--c-text-4); font-variant-numeric: tabular-nums; }
.sa-pager-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.c-site .sa-pager-links > a, .c-site .sa-pager-links > span[aria-disabled] { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 10px; box-sizing: border-box;
  border: 1px solid var(--c-line-2); border-radius: 999px; background: transparent; color: var(--c-text-2); font-size: 12px; text-decoration: none; font-variant-numeric: tabular-nums; }
.c-site .sa-pager-links > a:hover { border-color: var(--c-line-3); color: var(--c-text); }
.c-site .sa-pager-links > a[aria-current="page"] { background: var(--c-pill); border-color: var(--c-pill); color: var(--c-on-pill); }
.c-site .sa-pager-links > span[aria-disabled] { border-color: transparent; color: var(--c-text-4); }
.sa-pager-gap { padding: 0 2px; color: var(--c-text-4); }

.c-site .sa-pre { margin: 0; padding: 12px 14px; border: 1px solid var(--c-line); border-radius: var(--c-r-input); background: var(--c-bg); color: var(--c-text-2);
  font-family: var(--c-mono); font-size: 12px; line-height: 19px; white-space: pre; overflow-x: auto; }
.sa-copy { position: relative; min-width: 0; }
.sa-copy .sa-pre { padding-right: 84px; }
.c-site .sa-copy-btn { position: absolute; top: 7px; right: 7px; display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border: 1px solid var(--c-line-2); border-radius: 999px;
  background: var(--c-raised); color: var(--c-text-2); font: inherit; font-size: 12px; font-weight: 510; cursor: pointer; }
.c-site .sa-copy-btn:hover { border-color: var(--c-line-3); color: var(--c-text); background: var(--c-raised); }
.sa-copy-btn[hidden] { display: none; }
.c-site .sa-secret { padding: 16px; border: 1px solid var(--c-line-2); border-radius: var(--c-r-card); background: var(--c-raised); }
.c-site :not(pre) > code { font-family: var(--c-mono); font-size: 0.9em; padding: 1px 5px; border-radius: 4px; background: var(--c-chip); color: var(--c-text-2); }
.sa-steps { margin: 0; padding-left: 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.sa-steps > li::marker { font-size: 12px; color: var(--c-text-4); }
.sa-steps > li, .sa-copy { min-width: 0; }
.sa-prose ul, .sa-bullets { list-style: disc; padding-left: 20px; display: grid; gap: 6px; margin: 0; }
.sa-details { border-top: 1px solid var(--c-line-soft); padding-top: 12px; }
.sa-details > summary { cursor: pointer; font-weight: 510; color: var(--c-text-2); }
.sa-details > summary:hover { color: var(--c-text); }
.sa-label { display: grid; gap: 6px; font-weight: 510; font-size: 13px; color: var(--c-text-2); max-width: 240px; }
.sa-wrap { overflow-wrap: anywhere; }
.sa-trunc { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-text); }

.sa-checks { list-style: none; margin: 0; padding: 0; display: grid; }
.sa-checks li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--c-line-soft); font-size: 13px; line-height: 20px; color: var(--c-text-2); }
.sa-checks li:first-child { border-top: 0; padding-top: 0; }
.sa-checks li:last-child { padding-bottom: 0; }
.c-site .sa-check-mark { display: inline-grid; place-items: center; width: 20px; height: 20px; margin: 0; box-sizing: border-box; border-radius: 50%; font-size: 11px; font-weight: 700; line-height: 1; }
.c-site .sa-check-ok .sa-check-mark { background: var(--c-live); color: var(--c-bg); border: 0; }
.sa-check-ok .sa-check-mark::before { content: "✓"; }
.c-site .sa-check-look { color: var(--c-text); }
.c-site .sa-check-look .sa-check-mark { border: 1.5px solid var(--c-alert); background: transparent; color: var(--c-alert); }
.sa-check-look .sa-check-mark::before { content: "!"; }
.c-site .sa-check-info .sa-check-mark { border: 1.5px solid var(--c-line-3); background: transparent; color: var(--c-text-3); }
.sa-check-info .sa-check-mark::before { content: "i"; }

.sa-facts { display: grid; margin: 0; border-top: 0; }
.sa-facts > div { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 4px 24px; padding: 11px 0; border-bottom: 1px solid var(--c-line-soft); }
.sa-facts > div:last-child { border-bottom: 0; }
.sa-facts > div:first-child { padding-top: 0; }
.sa-facts dt { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--c-text-4); }
.sa-facts dd { margin: 0; font-size: 13px; color: var(--c-text-2); overflow-wrap: anywhere; }
.c-site .sa-facts-tag { padding: 0 7px; border-radius: 999px; background: var(--c-chip); color: var(--c-text-2); font-family: inherit; font-size: 11px; font-weight: 510; }
.sa-facts-changed dd { color: var(--c-text); font-weight: 510; }
.sa-kv > div { grid-template-columns: minmax(0, 168px) minmax(0, 1fr); }
.sa-none { color: var(--c-text-4); }
.sa-split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.sa-inline-form { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin: 0; }
.sa-inline-form .sa-native-input { width: 120px; }
.sa-people { list-style: none; margin: 0; padding: 0; display: grid; }
.sa-people li { display: grid; gap: 2px; padding: 12px 0; border-top: 1px solid var(--c-line-soft); font-size: 13px; color: var(--c-text-2); overflow-wrap: anywhere; }
.sa-people li:first-child { border-top: 0; padding-top: 0; }
.sa-people b { font-weight: 510; color: var(--c-text); }
.sa-people-meta { color: var(--c-text-4); font-size: 12px; }
.sa-figure-text { font-size: 15px; font-weight: 510; color: var(--c-text); }
.sa-figure-link { color: inherit; text-decoration: underline; text-decoration-color: var(--c-line-3); text-underline-offset: 4px; }
.c-site .sa-diff { width: 100%; border-collapse: collapse; font-size: 13px; }
.c-site .sa-diff th, .c-site .sa-diff td { padding: 9px 12px; border-bottom: 1px solid var(--c-line-soft); text-align: left; vertical-align: top; color: var(--c-text-3); }
.c-site .sa-diff thead th { font-family: inherit; font-size: 12px; font-weight: 510; color: var(--c-text-4); }
.c-site .sa-diff tbody th { font-weight: 510; color: var(--c-text-4); white-space: nowrap; }
.c-site .sa-diff td:last-child { color: var(--c-text); font-weight: 510; }

.k-trail { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; font-size: 12px; color: var(--c-text-3); }
.k-trail-bars { display: inline-flex; gap: 3px; }
.k-trail-bars i { display: block; width: 14px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); }
.k-trail-bars i.on { background: var(--c-text-2); }
.k-trail-done .k-trail-bars i.on { background: var(--c-live); }
.k-trail-done { color: var(--c-text-2); }
.k-trail-expired { color: var(--c-text-4); }

.sa-combo { position: relative; width: 100%; }
.k-field:has(.sa-combo) { position: relative; z-index: 5; }
.sa-combo-select, .sa-combo-input { width: 100%; }
.sa-combo-input { padding-right: 34px; }
.sa-combo::after { content: ""; position: absolute; top: 13px; right: 14px; width: 6px; height: 6px; border-right: 1.5px solid var(--c-text-3); border-bottom: 1.5px solid var(--c-text-3); transform: rotate(45deg); pointer-events: none; }
.c-site .sa-combo-list { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; max-height: 288px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--c-raised); border: 1px solid var(--c-line-2); border-radius: var(--c-r-input); box-shadow: var(--c-shadow-card); }
.c-site .sa-combo-list [role="option"] { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; font-size: 13px; color: var(--c-text-2); cursor: pointer; }
.c-site .sa-combo-list [role="option"]:hover, .c-site .sa-combo-list [role="option"].active { background: rgba(255, 255, 255, 0.06); color: var(--c-text); }
.sa-combo-list [role="option"][aria-selected="true"] { font-weight: 510; color: var(--c-text); }
.sa-combo-flag { width: 1.4em; text-align: center; }
.sa-combo-empty { padding: 8px 10px; font-size: 13px; color: var(--c-text-4); }

.d-app { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; min-height: 100vh; padding: 8px; box-sizing: border-box; color: var(--c-text-3);
  font-size: 13px; line-height: 20px; letter-spacing: -0.006em; }
.d-side { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 20px; padding: 6px 8px 8px; box-sizing: border-box;
  position: sticky; top: 8px; align-self: flex-start; min-height: calc(100vh - 16px); max-height: calc(100vh - 16px); overflow-y: auto; }
.d-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; background: var(--c-panel); border: 1px solid var(--c-line-soft); border-radius: var(--c-r-window); }
.d-org { display: flex; align-items: center; gap: 10px; min-width: 0; height: 40px; padding: 0 8px; border-radius: 8px; color: var(--c-text); text-decoration: none; }
.d-org:hover { background: rgba(255, 255, 255, 0.04); }
.d-org-cell { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--c-text); color: var(--c-bg); font-size: 12px; font-weight: 600; }
.d-org-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.d-org-name b { font-size: 13px; line-height: 18px; font-weight: 590; color: var(--c-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-org-name span { font-size: 12px; line-height: 16px; color: var(--c-text-4); }
.d-org > .d-i { color: var(--c-text-4); }
/* The account menu (kit.tsx AccountMenu): the chip opens the person's other accounts, ways to start one, and the
   accounts page, over the nav. */
.d-org-menu { position: relative; }
.d-org-menu > summary { list-style: none; cursor: pointer; }
.d-org-menu > summary::-webkit-details-marker { display: none; }
.d-org-menu[open] > summary { background: var(--c-active); }
.d-org-pop { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; min-width: 220px; display: grid; gap: 2px; padding: 4px;
  background: var(--c-raised); border: 1px solid var(--c-line-2); border-radius: var(--c-r-input); box-shadow: var(--c-shadow-card); }
.d-org-pop form { margin: 0; }
.d-org-item { display: grid; gap: 1px; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.d-org-item b { font-size: 13px; line-height: 18px; font-weight: 510; color: var(--c-text); }
.d-org-item span { font-size: 12px; line-height: 16px; color: var(--c-text-4); }
.d-org-item:hover { background: rgba(255, 255, 255, 0.06); }
.d-org-item:focus-visible { outline: 2px solid var(--c-focus); outline-offset: -2px; }
.d-nav { display: flex; flex-direction: column; gap: 1px; }
.d-nav-label { padding: 0 8px 4px; font-size: 12px; line-height: 16px; font-weight: 510; color: var(--c-text-4); }
.d-nav a { display: flex; align-items: center; gap: 10px; height: 28px; padding: 0 8px; border-radius: 6px; font-size: 13px; font-weight: 510; color: var(--c-text-2); text-decoration: none; }
.d-nav a > .d-i { color: var(--c-text-3); }
.d-nav a:hover { background: rgba(255, 255, 255, 0.03); color: var(--c-text); }
.d-nav a[aria-current="page"] { background: var(--c-active); color: var(--c-text); }
.d-nav a[aria-current="page"] > .d-i { color: var(--c-text); }
.d-nav a:focus-visible, .d-org:focus-visible { outline: 2px solid var(--c-focus); outline-offset: -2px; }
.d-count { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 999px; background: rgba(255, 255, 255, 0.08); font-size: 11px; line-height: 18px; text-align: center; color: var(--c-text-2); }
.d-side-end { margin-top: auto; }
.d-me { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 10px 8px 0; border-top: 1px solid var(--c-line-soft); }
.d-me form { margin: 0; display: flex; }
.d-avatar { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); font-size: 11px; font-weight: 590; color: var(--c-text); text-transform: uppercase; }
.d-me-email { flex: 1; min-width: 0; font-size: 12px; color: var(--c-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.d-me-email:hover { color: var(--c-text); }
.d-icon-btn { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--c-text-4); cursor: pointer; }
.d-icon-btn:hover { background: rgba(255, 255, 255, 0.05); color: var(--c-text); }
.d-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 24px; border-bottom: 1px solid var(--c-line-soft); box-sizing: border-box; }
.d-crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; font-weight: 510; color: var(--c-text-3); }
.d-crumbs a { color: var(--c-text-3); text-decoration: none; }
.d-crumbs a:hover { color: var(--c-text); }
.d-crumbs b { font-weight: 510; color: var(--c-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-crumbs .d-i { color: var(--c-text-4); }
.d-page { display: flex; flex-direction: column; gap: 28px; width: 100%; max-width: 1120px; margin: 0 auto; padding: 36px 40px 80px; box-sizing: border-box; min-width: 0; }
.d-page > * { min-width: 0; }

.d-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; }
.d-head-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.d-head-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.d-head h1 { margin: 0; font-size: 24px; line-height: 32px; font-weight: 510; letter-spacing: -0.012em; color: var(--c-text); }
.d-head-desc { max-width: 680px; font-size: 14px; line-height: 21px; color: var(--c-text-3); }
.d-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.d-card { background: var(--c-raised); border: 1px solid var(--c-line); border-radius: var(--c-r-card); min-width: 0; }
.d-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--c-line-soft); }
.d-card-head > div:first-child { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.d-card-head h2 { margin: 0; font-size: 13px; line-height: 20px; font-weight: 590; color: var(--c-text); }
.d-card-desc { margin: 0; max-width: 72ch; font-size: 12px; line-height: 18px; color: var(--c-text-4); }
.d-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.d-card-actions form { margin: 0; }
.d-card-body { display: flex; flex-direction: column; gap: 16px; padding: 20px; min-width: 0; }
.d-card-body > .d-card-desc { font-size: 13px; line-height: 20px; color: var(--c-text-3); }
/* Tables and lists bleed to the card's edges. */
.d-card-body > .c-scroll { margin-inline: -20px; max-width: none; }
.d-card-body > .c-scroll:first-child { margin-top: -20px; }
.d-card-body > .c-scroll:last-child { margin-bottom: -20px; }
.d-card-body > .c-scroll:not(:first-child) { border-top: 1px solid var(--c-line-soft); }
.d-card-body > .c-scroll + .sa-pager { margin: -16px -20px -20px; }
.d-card-body > .sa-pager:last-child { margin: 0 -20px -20px; }
.d-card-body > .k-empty:only-child { margin: -8px 0; }
.d-card-body > .d-list { margin: -20px; }
.d-card-body > .d-list:not(:first-child) { margin-top: 0; border-top: 1px solid var(--c-line-soft); }

/* Each cell draws its own right and bottom hairline, pulled under the box's border, so a short last row leaves no hole. */
.d-stats { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 0; margin: 0; background: var(--c-raised); border: 1px solid var(--c-line); border-radius: var(--c-r-card); overflow: hidden; }
.d-stat { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 18px 20px 20px; margin: 0 -1px -1px 0; border-right: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); background: var(--c-raised); }
.d-stat dt { order: 1; font-size: 12px; line-height: 16px; font-weight: 510; color: var(--c-text-3); }
.d-stat dd { order: 2; margin: 0; font-size: 28px; line-height: 34px; font-weight: 510; letter-spacing: -0.022em; color: var(--c-text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.d-stat dd .sa-money { white-space: nowrap; }
.d-stat-foot { order: 3; font-size: 12px; line-height: 16px; color: var(--c-text-4); }
.d-up { color: var(--c-success-text); font-weight: 510; }
.d-down { color: var(--c-warning-text); font-weight: 510; }
.d-flat { color: var(--c-text-2); font-weight: 510; }

.d-chart { display: block; width: 100%; height: auto; overflow: visible; }
.d-chart .grid { stroke: var(--c-line-soft); stroke-width: 1; }
.d-chart .axis { fill: var(--c-text-4); font-family: var(--c-mono); font-size: 10px; }
.d-chart .line { fill: none; stroke: var(--c-text); stroke-width: 1.75; stroke-linejoin: round; }
.d-chart .line-2 { fill: none; stroke: var(--c-text-4); stroke-width: 1.25; stroke-dasharray: 3 3; }
.d-chart .bar { fill: #62666e; } /* 3.3:1 on --c-raised (WCAG 1.4.11) */
.d-chart .bar-hi { fill: var(--c-text-2); }
.d-chart .dot { fill: var(--c-text); }
.d-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--c-text-3); }
.d-legend span { display: inline-flex; align-items: center; gap: 6px; }
.d-legend i { width: 14px; height: 0; border-top: 2px solid var(--c-text); }
.d-legend i.d-dash { border-top: 1.5px dashed var(--c-text-4); }
.d-chart-empty { display: grid; place-items: center; height: 180px; color: var(--c-text-4); }

.d-grid { display: grid; gap: 16px; min-width: 0; }
.d-grid > * { min-width: 0; }
.d-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.d-grid-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }

.d-list { display: flex; flex-direction: column; }
.d-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px 20px; border-top: 1px solid var(--c-line-soft); color: inherit; text-decoration: none; }
.d-row:first-child { border-top: 0; }
a.d-row:hover { background: rgba(255, 255, 255, 0.015); }
.d-row-main { min-width: 0; display: flex; align-items: center; gap: 10px; }
.d-row-text { min-width: 0; display: flex; flex-direction: column; }
.d-row-text b { font-weight: 510; color: var(--c-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-row-text span { font-size: 12px; line-height: 18px; color: var(--c-text-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; color: var(--c-text-4); }
.d-cell { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); font-size: 11px; font-weight: 590; color: var(--c-text-2); text-transform: uppercase; }
.d-progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--c-raised); border: 1px solid var(--c-line); border-radius: var(--c-r-card); overflow: hidden; }
.d-progress > li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: center; padding: 14px 18px; border-left: 1px solid var(--c-line-soft); list-style: none; }
.d-progress > li:first-child { border-left: 0; }
.d-progress { margin: 0; padding: 0; }
.d-progress b { display: block; font-weight: 510; color: var(--c-text-3); }
.d-progress li > span:last-child > span { display: block; font-size: 12px; line-height: 16px; color: var(--c-text-4); }
.d-progress-mark { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--c-line-2); font-size: 11px; font-weight: 590; color: var(--c-text-3); }
.d-progress .done .d-progress-mark { background: var(--c-live); box-shadow: none; color: var(--c-bg); }
.d-progress .done .d-progress-mark .d-i { stroke-width: 2.5; }
.d-progress .now .d-progress-mark { box-shadow: inset 0 0 0 1.5px var(--c-text-2); color: var(--c-text); }
.d-progress .now b { color: var(--c-text); }
.d-sections { display: flex; flex-wrap: wrap; gap: 20px; border-bottom: 1px solid var(--c-line-soft); }
.d-sections a { padding: 0 0 10px; margin-bottom: -1px; font-size: 13px; font-weight: 510; color: var(--c-text-3); text-decoration: none; border-bottom: 2px solid transparent; }
.d-sections a:hover, .d-sections a[aria-current="page"] { color: var(--c-text); }
.d-sections a[aria-current="page"] { border-bottom-color: var(--c-text); }
[id] { scroll-margin-top: 16px; }

.d-seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(64px, auto); gap: 2px; padding: 2px; border-radius: 999px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--c-line-soft); }
.d-seg a { display: flex; align-items: center; justify-content: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 510; color: var(--c-text-3); text-decoration: none; white-space: nowrap; }
.d-seg a:hover { color: var(--c-text); }
.d-seg a[aria-current="page"] { background: rgba(255, 255, 255, 0.09); color: var(--c-text); }

.d-answer { padding: 16px 18px; border-radius: var(--c-r-card); background: #000; border: 1px solid var(--c-line); font-size: 13px; line-height: 21px; color: #d8d8d8; overflow-wrap: anywhere; }
.d-answer p { margin: 0; }
.d-answer-tag { margin-bottom: 8px !important; font-size: 11px; line-height: 16px; color: #9b9b9b; }
.d-answer u { color: #fff; text-underline-offset: 2px; }
.d-skel { display: block; height: 8px; margin: 0 0 9px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); }

.sa-install { counter-reset: install; display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.sa-install > li { counter-increment: install; position: relative; display: grid; gap: 12px; padding: 18px 0 18px 40px; border-top: 1px solid var(--c-line-soft); min-width: 0; }
.sa-install > li:first-child { border-top: 0; padding-top: 2px; }
.c-site .sa-install > li::before { content: counter(install); position: absolute; left: 0; top: 17px; display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--c-line-3); font-family: inherit; font-size: 11px; font-weight: 590; color: var(--c-text-2); }
.sa-install > li:first-child::before { top: 1px; }
.c-site .sa-install h3 { margin: 0; font-size: 14px; line-height: 22px; font-weight: 510; letter-spacing: 0; color: var(--c-text); }
.c-site .sa-install p { margin: 0; max-width: 68ch; font-size: 13px; line-height: 20px; color: var(--c-text-3); }
.sa-install-help { color: var(--c-text-4); }
.c-site .sa-perms { width: 100%; max-width: 680px; border-collapse: collapse; font-size: 13px; border: 1px solid var(--c-line); border-radius: var(--c-r-input); }
.c-site .sa-perms th, .c-site .sa-perms td { padding: 9px 12px; border-bottom: 1px solid var(--c-line-soft); text-align: left; color: var(--c-text-3); }
.c-site .sa-perms thead th { background: transparent; font-family: inherit; font-size: 12px; font-weight: 510; color: var(--c-text-4); }
.c-site .sa-perms tbody th { font-weight: 510; color: var(--c-text-2); white-space: nowrap; }
.c-site .sa-perms td:nth-child(2) { font-family: inherit; font-size: 13px; color: var(--c-text-2); }
.sa-perms-scope { margin-left: 6px; font-size: 12px; font-weight: 400; color: var(--c-text-4); }
.sa-hosts { display: grid; gap: 14px; }
.sa-hosts-group { display: grid; grid-template-columns: minmax(0, 10rem) minmax(0, 1fr); gap: 6px 16px; align-items: baseline; }
.sa-hosts-label { font-size: 12px; color: var(--c-text-4); }
.sa-hosts ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.c-site .sa-hosts a { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border: 1px solid var(--c-line-2); border-radius: 999px; color: var(--c-text-3); text-decoration: none; font-size: 13px; }
.c-site .sa-hosts a:hover { border-color: var(--c-line-3); color: var(--c-text); }
.c-site .sa-hosts a[aria-current="page"] { background: rgba(255, 255, 255, 0.05); border-color: var(--c-text-2); color: var(--c-text); }
.sa-host-steps { margin: 0; }
.c-site .sa-writer { padding: 16px; border: 1px solid var(--c-line); border-radius: var(--c-r-card); background: rgba(255, 255, 255, 0.02); }
.sa-drafts { list-style: none; margin: 0; padding: 0; display: grid; border: 1px solid var(--c-line); border-radius: var(--c-r-card); overflow: hidden; }
.c-site .sa-drafts li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 12px 14px; border: 0; border-top: 1px solid var(--c-line-soft); border-radius: 0; background: transparent; }
.sa-drafts li:first-child { border-top: 0; }
.sa-drafts-use { justify-self: end; }
.sa-default-submit { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.sa-hops { margin: 0; padding-left: 20px; display: grid; gap: 2px; font-size: 13px; }
.sa-hops-url { overflow-wrap: anywhere; font-family: var(--c-mono); font-size: 12px; color: var(--c-text-2); }
.sa-review { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; padding: 22px 0; border-top: 1px solid var(--c-line-soft); }
.d-card-body > .sa-review:first-of-type { border-top: 0; padding-top: 0; }
.sa-review-main { display: grid; gap: 16px; align-content: start; min-width: 0; }
.sa-review-head h3 { margin: 0; font-size: 15px; font-weight: 510; color: var(--c-text); overflow-wrap: anywhere; }
.sa-review-head h3 a { color: inherit; text-underline-offset: 3px; }
.sa-review-head p { margin: 4px 0 0; font-size: 13px; color: var(--c-text-3); }
.c-site .sa-review-side { display: grid; gap: 14px; align-content: start; align-self: start; padding: 16px; border: 1px solid var(--c-line); border-radius: var(--c-r-card); background: rgba(255, 255, 255, 0.02); font-size: 13px; }
.sa-review-decide { padding-top: 14px; border-top: 1px solid var(--c-line-soft); display: grid; gap: 10px; }
.sa-review .sa-kv > div { padding: 8px 0; }
.sa-price-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: start; }
.sa-price-input { width: 110px; font-variant-numeric: tabular-nums; }
.sa-price-bad { font-weight: 510; color: var(--c-alert-text); }
.c-site .sa-price-stats { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--c-line); border-radius: var(--c-r-card); background: rgba(255, 255, 255, 0.02); }
.sa-price-stats h3 { margin: 0; font-size: 12px; font-weight: 510; color: var(--c-text-4); }
.sa-price-stats .sa-kv > div { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 7px 0; }
.sa-price-stats .sa-kv dd { text-align: right; font-variant-numeric: tabular-nums; }
.sa-method { border-top: 1px solid var(--c-line-soft); padding: 16px 0 0; display: flex; flex-direction: column; gap: 10px; }
.sa-method h3 { margin: 0; font-size: 14px; font-weight: 510; color: var(--c-text); }
.sa-method form { display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
.sa-page-access { font-size: 12px; color: var(--c-text-4); margin-top: 2px; }
/* Two-factor QR on white, so phones can read it */
.sa-qr { width: 208px; padding: 8px; background: #fff; border-radius: var(--c-r-input); line-height: 0; }
.sa-qr svg { width: 100%; height: auto; }
.sa-message { display: grid; gap: 6px; padding: 16px 0; border-top: 1px solid var(--c-line-soft); }
.sa-message:first-child { border-top: 0; padding-top: 0; }

@media (max-width: 1080px) {
  .sa-split, .sa-price-grid, .d-grid-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .sa-review { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .d-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .d-progress { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .d-progress > li:nth-child(3) { border-left: 0; }
  .d-progress > li:nth-child(n + 3) { border-top: 1px solid var(--c-line-soft); }
}
@media (max-width: 860px) {
  .d-app { padding: 0; gap: 0; }
  .d-side { position: static; flex: 1 1 100%; min-height: 0; max-height: none; flex-direction: row; align-items: center; gap: 4px; padding: 8px 12px; overflow-x: auto; border-bottom: 1px solid var(--c-line-soft); }
  .d-org { flex: none; max-width: 200px; }
  .d-org-name span { display: none; }
  /* The nav scrolls sideways here, which would clip the menu: it opens below the bar instead. */
  .d-org-pop { position: fixed; top: 56px; left: 12px; right: 12px; }
  .d-nav { flex-direction: row; flex: none; }
  .d-nav-label, .d-me-email, .d-avatar { display: none; }
  .d-me { margin: 0; padding: 0; border: 0; }
  .d-side-end { margin-top: 0; }
  .d-nav a { white-space: nowrap; }
  .d-main { border: 0; border-radius: 0; background: transparent; }
  .d-top { padding: 0 16px; }
  .d-page { padding: 24px 16px 56px; gap: 22px; }
  .d-head h1 { font-size: 22px; line-height: 28px; }
  .sa-facts > div, .sa-kv > div { grid-template-columns: minmax(0, 1fr); }
  .sa-hosts-group { grid-template-columns: minmax(0, 1fr); }
  .sa-list-tools { flex-direction: column; align-items: stretch; }
  .c-site .sa-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .sa-search-q { flex: 1; width: auto; min-width: 0; }
  .sa-copy { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
  .sa-copy .sa-pre { width: 100%; box-sizing: border-box; padding-right: 14px; }
  .c-site .sa-copy-btn { position: static; order: -1; }
  .sa-hide-phone, .k-hide-phone { display: none; }
  .d-app .c-table { min-width: 560px; }
  .d-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sa-choice-row { grid-auto-flow: row; }
}


.k-skip { position: absolute; left: 12px; top: -100px; z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--c-pill); color: var(--c-on-pill) !important; font-weight: 590; font-size: 14px; text-decoration: none; }
.k-skip:focus { top: 12px; outline: 2px solid var(--c-focus); outline-offset: 2px; }
main:focus { outline: none; }
.c-site a:focus-visible, .c-site button:focus-visible, .c-site summary:focus-visible, .c-site [tabindex]:focus-visible,
.c-site input[type="radio"]:focus-visible, .c-site input[type="checkbox"]:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; border-radius: 4px; }
.c-site .k-btn:focus-visible, .c-site .sa-pager-links > a:focus-visible, .c-site .d-seg a:focus-visible { border-radius: 999px; }
.c-site .d-nav a:focus-visible, .c-site .d-org:focus-visible { outline-offset: -2px; border-radius: 6px; }
/* Links inside text are underlined, so they don't rely on color (WCAG 1.4.1). */
.d-card-desc a, .k-help a, .k-note-text a, .d-head-desc a, .sa-checks a, .sa-facts a, .d-page p a:not(.k-btn) { color: var(--c-text-2); text-decoration: underline; text-decoration-color: var(--c-line-3); text-underline-offset: 3px; }
.d-card-desc a:hover, .k-help a:hover, .k-note-text a:hover, .d-head-desc a:hover, .d-page p a:not(.k-btn):hover { color: var(--c-text); text-decoration-color: var(--c-text-3); }
.c-table td a:not(.k-btn) { color: var(--c-text); font-weight: 510; }
.c-table td a:not(.k-btn):hover { text-decoration: underline; text-underline-offset: 3px; }
.k-error { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: 12px; line-height: 18px; color: var(--c-alert-text); }
.k-error .d-i { flex: none; margin-top: 2px; color: var(--c-alert); }
.k-field-error .k-input, .k-input[aria-invalid="true"] { border-color: var(--c-alert); }
.sa-auth-form .k-req { display: none; }
.k-btn[aria-disabled="true"] { opacity: 0.6; cursor: progress; }
.k-btn.k-busy { opacity: 1; position: relative; color: transparent !important; }
.k-btn.k-busy::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--c-on-pill) transparent var(--c-on-pill) transparent; animation: k-spin 800ms linear infinite; }
.k-btn-secondary.k-busy::after, .k-btn-ghost.k-busy::after { border-color: var(--c-text-2) transparent var(--c-text-2) transparent; }
@keyframes k-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .k-btn.k-busy::after { animation: none; border-color: currentColor; opacity: 0.5; } }
.k-agent { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--c-text-2); font-weight: 510; }
.k-agent-mark { flex: none; width: 16px; height: 16px; color: var(--c-text); }
.k-agent-cell { flex: none; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: rgba(255, 255, 255, 0.1); font-size: 10px; font-weight: 700; color: var(--c-text); text-transform: uppercase; }
.k-agent-unknown { color: var(--c-text-3); font-weight: 400; }
.k-agent-unknown .k-agent-cell { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c-line-3); color: var(--c-text-3); }
.sa-credit { color: var(--c-success-text); }
/* Windows high contrast: keep edges and states visible. */
@media (forced-colors: active) {
  .k-badge, .k-note, .d-card, .d-stats, .k-input, .k-btn { border: 1px solid CanvasText; }
  .k-badge::before { forced-color-adjust: none; }
}

/* Reflow at 320px (WCAG 1.4.10): nothing may push the page sideways. */
.sa-install > li { grid-template-columns: minmax(0, 1fr); }
.sa-install > li > * { min-width: 0; max-width: 100%; }
@media (max-width: 640px) {
  .c-site .sa-perms { display: block; overflow-x: auto; max-width: 100%; }
}
@media (max-width: 480px) {
  .k-btn { white-space: normal; height: auto; min-height: 36px; padding-block: 8px; text-align: center; line-height: 18px; }
  .k-btn-sm { min-height: 32px; padding-block: 6px; }
}
