/* Accountable Gateway — workspace app.
   Shares the marketing site's system: paper, ink and Accountable blue; Geist for UI,
   Geist Mono for labels and identifiers, Instrument Serif italic for the odd accent.
   Every color is a token; dark mode follows the operating system. */

@font-face {
  font-family: 'Geist';
  src: url('/fonts/geist-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/fonts/geist-mono-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('/fonts/instrument-serif-italic.woff2') format('woff2');
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f6f4ef;
  --paper-2: #efece5;
  --card: #fdfcf9;
  --field: #fffefb;
  --hover: rgba(15, 27, 45, 0.035);
  --ink: #0f1b2d;
  --ink-2: #47515f;
  --ink-3: #6c7480;
  --rule: rgba(15, 27, 45, 0.1);
  --rule-strong: rgba(15, 27, 45, 0.18);
  --blue: #2a59f0;
  --blue-deep: #1b3fc4;
  --blue-text: #2148d6;
  --blue-wash: #e8eefe;
  --ok: #1d8a5f;
  --ok-wash: #e3f2ea;
  --amber: #a8620c;
  --amber-wash: #f8ecd9;
  --red: #b93a2b;
  --red-wash: #fbe7e3;
  --night: #0c1424;
  --night-2: #142039;
  --night-ink: #e8edf6;
  --night-ink-2: #9eabc2;
  --night-rule: rgba(255, 255, 255, 0.1);
  --shadow: 0 1px 0 rgba(15, 27, 45, 0.03), 0 1px 3px rgba(15, 27, 45, 0.04);
  --shadow-lift: 0 18px 50px -12px rgba(15, 27, 45, 0.22), 0 2px 6px rgba(15, 27, 45, 0.06);
  --backdrop: rgba(12, 20, 36, 0.42);
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --radius: 14px;
  --radius-sm: 9px;
  --top: 60px;
  --side: 236px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%23808896' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #0b1220;
    --paper-2: #0f182a;
    --card: #111a2c;
    --field: #0d1626;
    --hover: rgba(255, 255, 255, 0.035);
    --ink: #e8edf6;
    --ink-2: #a9b3c4;
    --ink-3: #808b9d;
    --rule: rgba(255, 255, 255, 0.08);
    --rule-strong: rgba(255, 255, 255, 0.16);
    --blue: #4a78ff;
    --blue-deep: #3a66f0;
    --blue-text: #8eaeff;
    --blue-wash: rgba(74, 120, 255, 0.14);
    --ok: #4cc38a;
    --ok-wash: rgba(76, 195, 138, 0.13);
    --amber: #e3a250;
    --amber-wash: rgba(227, 162, 80, 0.14);
    --red: #f2806f;
    --red-wash: rgba(242, 128, 111, 0.14);
    --night: #13203d;
    --night-2: #1a2a4d;
    --night-rule: rgba(255, 255, 255, 0.12);
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
    --shadow-lift: 0 24px 60px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--rule);
    --backdrop: rgba(3, 7, 15, 0.6);
  }
}

/* ── Base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 400 14px/1.55 var(--sans);
  font-feature-settings: 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
a {
  color: var(--blue-text);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
small {
  font-size: 12px;
}
code,
.mono,
kbd {
  font-family: var(--mono);
  font-size: 0.92em;
  letter-spacing: -0.01em;
}
code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  font-size: 12.5px;
}
::selection {
  background: var(--blue-wash);
  color: var(--ink);
}
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 6px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.app-skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}
.app-skip-link:focus {
  transform: none;
}
.hint {
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 400;
}
.sub {
  color: var(--ink-2);
}
.eyebrow,
.hipaa-kicker,
.sidebar-caption {
  font: 500 11px/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.error {
  color: var(--red);
  font-size: 13px;
}
.error:empty {
  display: none;
}

/* ── Buttons ── */
button,
.button-link {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font: 500 13.5px/1 var(--sans);
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s,
    transform 0.15s var(--ease);
}
button:hover,
.button-link:hover {
  background: var(--paper-2);
  border-color: var(--rule-strong);
  text-decoration: none;
}
button:active,
.button-link:active {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.primary,
button.primary,
.button-link.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 1px 2px rgba(27, 63, 196, 0.25);
}
.primary:hover,
button.primary:hover,
.button-link.primary:hover {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
}
.quiet,
button.quiet,
.button-link.quiet {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--blue-text);
  padding-inline: 8px;
}
.quiet:hover,
button.quiet:hover,
.button-link.quiet:hover {
  background: var(--blue-wash);
  border-color: transparent;
}
.small,
button.small,
.button-link.small {
  min-height: 30px;
  padding: 0 11px;
  font-size: 12.5px;
  border-radius: 8px;
}
.danger,
button.danger {
  color: var(--red);
}
button.danger:hover {
  background: var(--red-wash);
}
.icon-button {
  width: 32px;
  min-height: 32px;
  padding: 0;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--ink-3);
}
.icon-button:hover {
  color: var(--ink);
  background: var(--hover);
}
.icon-button svg {
  width: 17px;
  height: 17px;
}

/* ── Fields ── */
label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
label > input:not([type='checkbox']):not([type='radio']),
label > select,
label > textarea {
  display: block;
  margin-top: 7px;
}
label > div.hint,
label > small.hint {
  display: block;
  margin-top: 7px;
}
.period-select > select,
.chart-metric > select {
  margin-top: 0;
}
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--ink);
  font: 400 14px/1.4 var(--sans);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
input::placeholder,
textarea::placeholder {
  color: var(--ink-3);
  opacity: 0.8;
}
input:hover,
select:hover,
textarea:hover {
  border-color: color-mix(in srgb, var(--ink) 30%, transparent);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-wash);
}
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 34px;
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
textarea {
  resize: vertical;
  line-height: 1.55;
}
input[type='checkbox'],
input[type='radio'] {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex: none;
  accent-color: var(--blue);
  box-shadow: none;
}
.fieldset {
  display: grid;
  gap: 18px;
}
.form-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
label.check,
label.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
  color: var(--ink-2);
  cursor: pointer;
}
label.check input,
label.consent input {
  margin-top: 2px;
}
label.check span small,
.completion-toggle small {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-weight: 400;
}
.completion-toggle {
  padding: 13px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--paper);
}
.completion-toggle > span {
  color: var(--ink);
  font-weight: 500;
}
.json-editor {
  font: 12.5px/1.6 var(--mono);
}
details > summary {
  cursor: pointer;
  list-style: none;
}
details > summary::-webkit-details-marker {
  display: none;
}

/* ── Pills ── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--ok-wash);
  color: var(--ok);
  font: 500 11.5px/1 var(--mono);
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-transform: none;
}
.pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill.gray {
  background: var(--paper-2);
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--rule);
}
.pill.gray::before {
  display: none;
}
.pill.amber {
  background: var(--amber-wash);
  color: var(--amber);
}
.pill.red {
  background: var(--red-wash);
  color: var(--red);
}
.capability-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--paper-2);
  color: var(--ink-2);
  font: 500 11.5px/1 var(--mono);
  vertical-align: 2px;
}

/* ── Shell: top bar ── */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--top);
  padding: 0 20px 0 22px;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.top-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  text-decoration: none !important;
  flex: none;
}
.brand .accountable-wordmark {
  width: 131px;
  height: auto;
}
.brand-accent {
  fill: var(--blue);
}
.brand-suffix {
  font: 400 17px/1 var(--sans);
  letter-spacing: -0.02em;
  color: var(--ink-3);
  transform: translateY(1px);
}
.top-divider {
  color: var(--rule-strong);
  font-size: 20px;
  font-weight: 300;
}
.workspace-name {
  overflow: hidden;
  max-width: 220px;
  font-weight: 500;
  font-size: 13.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.env-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--amber-wash);
  color: var(--amber);
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.env-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent);
}
.global-nav {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: 11px;
  background: var(--paper-2);
}
.global-nav a {
  padding: 6px 13px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s;
}
.global-nav a:hover {
  color: var(--ink);
}
.global-nav a.active {
  background: var(--card);
  color: var(--ink);
  box-shadow:
    0 1px 2px rgba(15, 27, 45, 0.08),
    0 0 0 1px var(--rule);
}
.navigation-toggle,
.navigation-close,
.navigation-backdrop {
  display: none !important;
}

/* ── Shell: sidebar ── */
.sidebar {
  position: fixed;
  top: var(--top);
  bottom: 0;
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: var(--side);
  padding: 22px 12px 0;
  border-right: 1px solid var(--rule);
  background: var(--paper);
  overflow-y: auto;
}
.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 10px 10px;
}
.nav {
  display: grid;
  gap: 1px;
}
.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 450;
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s;
}
.nav a:hover {
  background: var(--hover);
  color: var(--ink);
}
.nav a.active {
  background: var(--card);
  color: var(--ink);
  font-weight: 550;
  box-shadow:
    0 1px 2px rgba(15, 27, 45, 0.06),
    0 0 0 1px var(--rule);
}
/* The active page is marked with Accountable's hexagon. */
.nav a.active::after {
  content: '';
  position: absolute;
  right: 12px;
  width: 8px;
  height: 9px;
  background: var(--blue);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.nav .icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--ink-3);
}
.nav a.active .icon {
  color: var(--blue);
}
.nav .icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.45;
}
.sidebar-bottom {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding: 20px 4px 0;
}
.app-docs-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 13px;
  text-decoration: none !important;
}
.app-docs-link:hover {
  background: var(--hover);
  color: var(--ink);
}
.app-docs-link svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.4;
  color: var(--ink-3);
}
.environment {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 8px;
  font: 500 11px/1.3 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.environment + p {
  margin: -6px 8px 4px 22px;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.5;
}
.environment .dot,
.notice-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
}
.environment .dot::after,
.notice-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--ok);
  opacity: 0;
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.7;
  }
  70%,
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}
.sidebar-account {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -12px;
  padding: 14px 16px;
  border-top: 1px solid var(--rule);
}
.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--paper);
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.02em;
  flex: none;
}
.account-name {
  overflow: hidden;
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ── Shell: page ── */
.main {
  margin-left: var(--side);
  padding-top: var(--top);
  min-width: 0;
}
.page {
  padding: 34px clamp(20px, 3.4vw, 48px) 72px;
  outline: none;
}
#content {
  display: grid;
  gap: 20px;
  max-width: 1180px;
  margin-inline: auto;
}
#content > * {
  min-width: 0;
}
.pagehead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 6px;
}
.pagehead h1,
.analytics-header h1 {
  font-size: clamp(26px, 2.4vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.pagehead .sub,
.analytics-header p {
  margin-top: 8px;
  max-width: 62ch;
  color: var(--ink-2);
  font-size: 14.5px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.workspace-notice {
  border: 1px solid color-mix(in srgb, var(--ok) 28%, transparent);
  border-radius: 11px;
  background: var(--ok-wash);
}
.workspace-notice summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--ink-2);
}
.workspace-notice summary strong {
  color: var(--ink);
  font-weight: 600;
}
.notice-details {
  margin-left: auto;
  font: 500 11.5px/1 var(--mono);
  color: var(--ink-3);
}
.notice-details::after {
  content: ' +';
}
.workspace-notice[open] .notice-details::after {
  content: ' −';
}
.workspace-notice p {
  padding: 0 14px 12px 31px;
  color: var(--ink-2);
  font-size: 13px;
}
.footer-note,
.panel-note {
  color: var(--ink-3);
  font-size: 12.5px;
}
.panel-note {
  padding: 14px 20px;
  border-top: 1px solid var(--rule);
}

/* ── Panels ── */
.panel {
  min-width: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panelhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule);
}
.panelhead h2 {
  font-size: 15px;
  letter-spacing: -0.01em;
}
.panelhead p {
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 13px;
}
.panelhead > a {
  font-size: 13px;
  font-weight: 500;
}
.panelbody {
  display: grid;
  gap: 14px;
  padding: 20px;
}
.panelbody > p {
  color: var(--ink-2);
  max-width: 75ch;
}
.panelbody > .button-link,
.panelbody > button,
.panelbody > a {
  justify-self: start;
}
#report-view {
  display: grid;
  gap: 20px;
}
.panelbody h2,
.panelbody h3 {
  font-size: 15px;
}
.twocol {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.twocol > div {
  display: grid;
  gap: 20px;
  min-width: 0;
}
.settingsrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 13.5px;
}
.panelbody > .settingsrow:first-child {
  padding-top: 0;
}
.panelbody > .settingsrow:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}
.settingsrow strong {
  color: var(--ink);
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}
.settingsrow strong small {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-weight: 400;
}
.settingsrow + .hint {
  margin-top: 2px;
}
.readme h3 {
  margin-bottom: 6px;
}
.readme p {
  color: var(--ink-2);
}

/* ── Tables ── */
.tablewrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
th {
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 55%, var(--card));
  color: var(--ink-3);
  font: 500 11px/1.3 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
  vertical-align: middle;
}
th:first-child,
td:first-child {
  padding-left: 20px;
}
th:last-child,
td:last-child {
  padding-right: 20px;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr {
  transition: background 0.12s;
}
tbody tr:hover {
  background: var(--hover);
}
td strong {
  display: block;
  color: var(--ink);
  font-weight: 550;
}
td small {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
}
td.money,
th.money,
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
td.money {
  color: var(--ink);
  font-weight: 500;
}
td.money small {
  font-weight: 400;
}
td.mono {
  font-size: 12px;
  color: var(--ink-3);
}
.key-budget {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 140px;
  height: 4px;
  margin: 8px 0 0 auto;
  border: 0;
  border-radius: 99px;
  background: var(--paper-2);
  overflow: hidden;
}
.key-budget::-webkit-progress-bar {
  background: var(--paper-2);
}
.key-budget::-webkit-progress-value {
  background: var(--blue);
  border-radius: 99px;
}
.key-budget::-moz-progress-bar {
  background: var(--blue);
  border-radius: 99px;
}
.model-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}
.model-identity .pill {
  margin-top: 6px;
}
.model-logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--ink-2);
  flex: none;
}
.model-logo svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.4;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--rule);
  color: var(--ink-3);
  font: 500 12px/1 var(--mono);
}

/* ── Empty states: the icon sits inside Accountable's hexagon ── */
.empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 44px 24px 46px;
  color: var(--ink-3);
  font-size: 13.5px;
  text-align: center;
  text-wrap: balance;
}
.empty strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.empty .button-link,
.empty button {
  margin-top: 10px;
}
.empty br {
  display: none;
}
.empty-symbol {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 52px;
  margin-bottom: 10px;
  color: var(--blue);
}
.empty-hex {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: var(--blue-wash);
  stroke: color-mix(in srgb, var(--blue) 35%, transparent);
  stroke-width: 1.4;
}
.empty-symbol > svg:not(.empty-hex) {
  position: relative;
  width: 19px;
  height: 19px;
  stroke-width: 1.5;
}

/* ── Activity ── */
.analytics-page {
  display: grid;
  gap: 20px;
}
.analytics-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.report-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.timezone-tag {
  display: inline-grid;
  place-items: center;
  height: 36px;
  padding: 0 10px;
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-sm);
  color: var(--ink-3);
  font: 500 11.5px/1 var(--mono);
}
.report-filters {
  position: relative;
}
.report-filters summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow);
}
.report-filters summary:hover,
.report-filters[open] summary {
  background: var(--paper-2);
}
.report-filters summary svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.5;
  color: var(--ink-3);
}
.report-filters summary b {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 99px;
  background: var(--blue);
  color: #fff;
  font: 600 10.5px/1 var(--mono);
}
.usage-filters {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: min(460px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-lift);
  animation: rise 0.18s var(--ease);
}
.filter-title,
.filter-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.filter-title span {
  color: var(--ink-3);
  font: 500 11px/1 var(--mono);
}
.filter-actions {
  justify-content: flex-end;
  padding-top: 4px;
}
.period-select select {
  min-height: 36px;
  width: auto;
  font-weight: 500;
  font-size: 13.5px;
  background-color: var(--card);
  box-shadow: var(--shadow);
}
.report-refresh {
  width: 36px;
  padding: 0;
  font-size: 16px;
}
.report-refresh:hover {
  transform: rotate(-60deg);
}
.report-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.report-filter-chips button:not(.quiet) {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 99px;
  background: var(--blue-wash);
  border-color: transparent;
  color: var(--blue-text);
  font-size: 12.5px;
  box-shadow: none;
}
.analytics-context {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}
.health-context,
.credit-context {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  text-decoration: none !important;
  box-shadow: var(--shadow);
  transition:
    border-color 0.15s,
    transform 0.2s var(--ease);
}
.health-context:hover,
.credit-context:hover {
  border-color: var(--rule-strong);
  transform: translateY(-1px);
}
.health-context > svg {
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 10px;
  background: var(--blue-wash);
  color: var(--blue);
  stroke-width: 1.4;
  flex: none;
}
.health-context > span:nth-child(2) {
  display: grid;
  gap: 1px;
  flex: 1;
}
.health-context strong {
  font-weight: 600;
}
.health-context small {
  color: var(--ink-3);
  font-size: 12.5px;
}
.health-context > span:last-child,
.credit-context > span:last-child {
  color: var(--ink-3);
}
.credit-context {
  gap: 18px;
}
.credit-context > span:first-child {
  font: 500 11px/1.3 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.credit-context strong {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.report-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--rule);
}
.report-tabs button {
  position: relative;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--ink-3);
  font-weight: 500;
}
.report-tabs button:hover {
  background: none;
  color: var(--ink);
}
.report-tabs button[aria-selected='true'] {
  color: var(--ink);
}
.report-tabs button[aria-selected='true']::after {
  content: '';
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 2px;
  border-radius: 2px;
  background: var(--blue);
}
.report-tabs a {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 500;
}
.report-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.report-metric {
  position: relative;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 18px 18px 16px;
}
.report-metric + .report-metric {
  border-left: 1px solid var(--rule);
}
.report-metric h2 {
  font: 500 11px/1.3 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.report-metric strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(24px, 2.2vw, 30px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.report-metric p {
  margin-top: 8px;
  color: var(--ink-3);
  font-size: 12px;
}
.metric-spark {
  width: 100%;
  height: 30px;
  color: var(--blue);
  opacity: 0.85;
}
.ranking-grid,
.trend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.ranking-panel .panelhead .quiet {
  min-height: 28px;
  font-size: 12.5px;
}
.report-ranking {
  margin: 0;
  padding: 8px 0;
  list-style: none;
}
.report-ranking li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
}
.rank-number {
  padding-left: 20px;
  color: var(--ink-3);
  font: 500 11.5px/1 var(--mono);
}
.report-ranking li > button {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 0;
  padding: 12px 20px 12px 6px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  text-align: left;
  font-weight: 400;
  white-space: normal;
}
.report-ranking li > button:hover {
  background: var(--hover);
}
.rank-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--series-color);
}
.rank-name {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.rank-name strong {
  overflow: hidden;
  font-weight: 550;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.rank-name small {
  color: var(--ink-3);
}
.rank-track {
  display: block;
  height: 3px;
  margin-top: 6px;
  border-radius: 3px;
  background: var(--paper-2);
  overflow: hidden;
}
.rank-track span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--series-color);
}
.rank-value {
  display: grid;
  justify-items: end;
  gap: 3px;
  font-variant-numeric: tabular-nums;
}
.rank-value strong {
  font-weight: 600;
}
.rank-value em {
  color: var(--ink-3);
  font: 500 10.5px var(--mono);
  font-style: normal;
}
.rank-value small {
  color: var(--ink-3);
}
.time-panel .panelhead p {
  font-family: var(--mono);
  font-size: 11.5px;
}
.chart-metric select {
  min-height: 32px;
  width: auto;
  padding-block: 4px;
  font-size: 13px;
}
.report-chart {
  padding: 16px 12px 4px;
}
.report-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.report-chart .mobile-chart {
  display: none;
}
.chart-bar {
  fill: var(--blue);
  transition: fill 0.15s;
}
.chart-bar:hover {
  fill: var(--blue-deep);
}
.chart-grid {
  stroke: var(--rule);
  stroke-dasharray: 2 4;
}
.report-chart text {
  fill: var(--ink-3);
  font: 500 10.5px var(--mono);
}
.chart-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px 16px;
  color: var(--ink-3);
  font-size: 12.5px;
}
.chart-caption i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--blue);
  vertical-align: -1px;
}
.chart-caption a {
  font-weight: 500;
}
.analytics-footnote {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--ink-3);
  font-size: 12.5px;
}
.analytics-footnote strong {
  color: var(--ink-2);
  font-weight: 500;
}

/* ── Request logs ── */
.audit-scroll {
  max-height: 440px;
  overflow: auto;
}
.audit-scroll th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card);
  box-shadow: 0 1px 0 var(--rule);
}
td.event-name {
  color: var(--ink);
  font-size: 12.5px;
}
.log-table td:first-child {
  white-space: nowrap;
  color: var(--ink);
}

/* ── Playground ── */
.prompt-examples {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.prompt-examples span {
  margin-right: 4px;
  color: var(--ink-3);
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.prompt-examples button {
  min-height: 28px;
  padding: 0 11px;
  border-radius: 99px;
  border-style: dashed;
  background: transparent;
  box-shadow: none;
  color: var(--ink-2);
  font-size: 12.5px;
}
.prompt-examples button:hover {
  border-style: solid;
  border-color: var(--blue);
  background: var(--blue-wash);
  color: var(--blue-text);
}
.completion-options {
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
}
.completion-options > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 500;
}
.completion-options > summary::after {
  content: '+';
  color: var(--ink-3);
  font: 400 16px/1 var(--mono);
}
.completion-options[open] > summary::after {
  content: '−';
}
.completion-options > .fieldset {
  padding: 4px 14px 16px;
}
.completion-actions {
  display: flex;
  gap: 8px;
}
.completion-actions .primary {
  flex: 1;
  min-height: 42px;
  font-size: 14px;
}
.codebox {
  position: relative;
  overflow: auto;
  border-radius: 12px;
  background: var(--night);
  color: var(--night-ink);
  box-shadow: inset 0 0 0 1px var(--night-rule);
}
.codebox::before {
  content: '';
  display: block;
  height: 30px;
  border-bottom: 1px solid var(--night-rule);
  background:
    radial-gradient(circle at 16px 15px, #ff6b5f 3.5px, transparent 4px),
    radial-gradient(circle at 30px 15px, #febc2e 3.5px, transparent 4px),
    radial-gradient(circle at 44px 15px, #28c840 3.5px, transparent 4px);
  opacity: 0.7;
}
.codebox pre {
  margin: 0;
  padding: 16px 18px 18px;
  font: 12.5px/1.75 var(--mono);
  white-space: pre;
}
.response {
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.65;
  white-space: pre-wrap;
}
.response-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding-top: 10px;
  border-top: 1px dashed var(--rule-strong);
  color: var(--ink-3);
  font: 500 12px/1.4 var(--mono);
}
.response-meta span:nth-child(2) {
  color: var(--ok);
}
.stream-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue-text);
  font: 500 12px/1 var(--mono);
}
.stream-status span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink {
  to {
    visibility: hidden;
  }
}
#response-content h3 {
  font-size: 14px;
}

/* ── Get started ── */
.setup-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  counter-reset: step;
  position: relative;
}
.setup-steps::before {
  content: '';
  position: absolute;
  top: 17px;
  right: 12.5%;
  left: 12.5%;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--rule-strong) 0 4px, transparent 4px 8px);
}
.setup-steps a {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 0 8px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  text-decoration: none !important;
}
.setup-steps a span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 36px;
  background: var(--card);
  color: var(--ink-2);
  font: 600 12px/1 var(--mono);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  box-shadow: inset 0 0 0 40px var(--card);
  position: relative;
}
.setup-steps a span::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--rule-strong);
  clip-path: polygon(
    50% 0,
    100% 25%,
    100% 75%,
    50% 100%,
    0 75%,
    0 25%,
    50% 0,
    50% 3%,
    3% 27%,
    3% 73%,
    50% 97%,
    97% 73%,
    97% 27%,
    50% 3%
  );
}
.setup-steps a:hover {
  color: var(--ink);
}
.setup-steps a.complete span {
  background: var(--blue);
  color: #fff;
  box-shadow: none;
}
.setup-steps a.complete span::before {
  display: none;
}
.setup-notice {
  padding: 13px 16px 13px 18px;
  border-left: 3px solid var(--blue);
  border-radius: 4px 11px 11px 4px;
  background: var(--blue-wash);
  color: var(--ink-2);
  font-size: 13.5px;
}
.setup-notice strong {
  color: var(--ink);
}
.setup-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.setup-locked {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--amber-wash);
  color: var(--amber);
}
.agreement-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.agreement-title span {
  color: var(--ink-3);
  font-size: 12px;
}
.agreement-document {
  max-height: 320px;
  margin: 0;
  padding: 22px 24px;
  overflow: auto;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  font: 13.5px/1.75 var(--sans);
  white-space: pre-wrap;
  box-shadow: inset 0 -24px 24px -24px rgba(15, 27, 45, 0.12);
}
.legal-document {
  border: 1px solid var(--rule);
  border-radius: 11px;
  background: var(--card);
}
.legal-document > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 500;
}
.legal-document > summary::before {
  content: '+';
  width: 14px;
  color: var(--ink-3);
  font: 400 15px/1 var(--mono);
}
.legal-document[open] > summary::before {
  content: '−';
}
.legal-document > summary .mono {
  color: var(--ink-3);
  font-size: 11.5px;
}
.legal-document > .agreement-document {
  margin: 0 12px 12px;
}
.legal-document > .panelbody {
  padding-top: 4px;
}
.agreement-hash {
  overflow-wrap: anywhere;
}
.agreement-form {
  padding-top: 18px;
  border-top: 1px dashed var(--rule-strong);
}
.agreement-form > button.primary {
  justify-self: start;
}
.agreement-signed {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-radius: 12px;
  background: var(--ok-wash);
}
.agreement-signed > div {
  flex: 1;
  display: grid;
  gap: 2px;
}
.control-tick {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  font-weight: 700;
  flex: none;
}

/* ── HIPAA & privacy ── */
.hipaa-access {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  border-radius: 18px;
  background: var(--night);
  color: var(--night-ink);
  overflow: hidden;
  isolation: isolate;
}
.hipaa-access::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='64' viewBox='0 0 56 64'%3E%3Cpath d='M28 2 53 16.5v31L28 62 3 47.5v-31z' fill='none' stroke='%23ffffff' stroke-opacity='.07'/%3E%3C/svg%3E");
  background-size: 56px 64px;
  -webkit-mask-image: radial-gradient(60% 90% at 0% 0%, #000, transparent 70%);
  mask-image: radial-gradient(60% 90% at 0% 0%, #000, transparent 70%);
}
.hipaa-access-status,
.hipaa-next {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 12px;
  padding: 30px 32px;
}
.hipaa-next {
  border-left: 1px solid var(--night-rule);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
}
.hipaa-access .hipaa-kicker {
  color: var(--night-ink-2);
}
.hipaa-access h2 {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.hipaa-access h3 {
  font-size: 20px;
  letter-spacing: -0.02em;
}
.hipaa-access p {
  max-width: 52ch;
  color: var(--night-ink-2);
}
.hipaa-access .pill.gray {
  background: rgba(255, 255, 255, 0.07);
  color: var(--night-ink-2);
  box-shadow: inset 0 0 0 1px var(--night-rule);
}
.hipaa-access .primary {
  margin-top: 4px;
}
.hipaa-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.hipaa-summary .panel {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px 20px 20px;
}
.hipaa-card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--ink-3);
}
.hipaa-card-label svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.5;
}
.hipaa-card-label h2 {
  font: 500 11px/1.3 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hipaa-summary strong {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.hipaa-summary p {
  color: var(--ink-2);
  font-size: 13px;
}
.hipaa-summary .panel > a,
.hipaa-summary .panel > button,
.hipaa-summary .panel > span:last-child {
  justify-self: start;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
}
.hipaa-muted {
  color: var(--ink-3);
  font-size: 12.5px;
}
.hipaa-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
.hipaa-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.hipaa-check-result {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--amber-wash);
  border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent);
  outline: none;
}
.hipaa-check-result.is-allowed {
  background: var(--ok-wash);
  border-color: color-mix(in srgb, var(--ok) 30%, transparent);
}
.hipaa-check-result p,
.hipaa-check-result li {
  color: var(--ink-2);
  font-size: 13px;
}
.hipaa-check-result ul,
.hipaa-reasons ul {
  margin: 0;
  padding-left: 18px;
}
.hipaa-data {
  margin: 0;
  padding: 4px 20px;
}
.hipaa-data > div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--rule);
}
.hipaa-data > div:last-child {
  border-bottom: 0;
}
.hipaa-data dt {
  font-weight: 500;
  font-size: 13px;
}
.hipaa-data dd {
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
}
.hipaa-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 55%, var(--card));
  font-size: 13px;
  font-weight: 500;
}
.hipaa-reasons > summary {
  color: var(--blue-text);
  font-size: 13px;
  font-weight: 500;
}
.hipaa-reasons > summary::after {
  content: ' ↓';
}
.hipaa-reasons ul {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 12.5px;
}
.hipaa-managed > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  font-weight: 550;
}
.hipaa-managed > summary > span:first-child::before {
  content: '+';
  display: inline-block;
  width: 20px;
  color: var(--ink-3);
  font: 400 15px/1 var(--mono);
}
.hipaa-managed[open] > summary > span:first-child::before {
  content: '−';
}
.hipaa-managed[open] > summary {
  border-bottom: 1px solid var(--rule);
}
.control-list {
  display: grid;
  padding: 6px 20px;
}
.control-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--rule);
}
.control-item:last-child {
  border-bottom: 0;
}
.control-item h3 {
  font-size: 13.5px;
}
.control-item p {
  color: var(--ink-2);
  font-size: 13px;
}
.review-dot {
  color: var(--amber);
  font-size: 15px;
  line-height: 1.3;
}

/* ── Credits ── */
.balance-panel .panelbody {
  position: relative;
  gap: 10px;
  padding: 26px 28px 28px;
  justify-items: start;
}
.balance-panel .panelbody::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 40%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='64' viewBox='0 0 56 64'%3E%3Cpath d='M28 2 53 16.5v31L28 62 3 47.5v-31z' fill='none' stroke='%232a59f0' stroke-opacity='.12'/%3E%3C/svg%3E");
  background-size: 56px 64px;
  -webkit-mask-image: radial-gradient(80% 100% at 100% 50%, #000, transparent 75%);
  mask-image: radial-gradient(80% 100% at 100% 50%, #000, transparent 75%);
  pointer-events: none;
}
.balance-panel .balance-figure {
  margin: 2px 0 4px;
  font-size: clamp(40px, 4.6vw, 56px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}
.balance-panel .primary {
  margin-top: 8px;
}
.recharge-notice {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--paper);
  border: 1px solid var(--rule);
  font-size: 13px;
}
.credit-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.credit-options button {
  min-height: 64px;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.credit-options button.selected {
  border-color: var(--blue);
  background: var(--blue-wash);
  color: var(--blue-text);
  box-shadow: 0 0 0 1px var(--blue);
}
.credit-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 0 2px;
  border-top: 1px dashed var(--rule-strong);
  color: var(--ink-2);
}
.credit-total strong {
  color: var(--ink);
  font-size: 22px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ── Dialog ── */
#dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 28px;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-lift);
  overflow: auto;
}
#dialog[open] {
  display: grid;
  gap: 16px;
  animation: rise 0.22s var(--ease);
}
#dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
}
#dialog h2 {
  padding-right: 32px;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.025em;
}
#dialog > p {
  margin-top: -8px;
  color: var(--ink-2);
}
#dialog .actions {
  justify-content: flex-end;
  padding-top: 4px;
}
.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  min-height: 32px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--ink-3);
  font-size: 20px;
  font-weight: 300;
}
.modal-close:hover {
  background: var(--hover);
  color: var(--ink);
}
.checks {
  display: grid;
  margin-top: 8px;
  border: 1px solid var(--rule);
  border-radius: 11px;
  overflow: hidden;
}
.checks label.check {
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  font-weight: 500;
}
.checks label.check:last-child {
  border-bottom: 0;
}
.checks label.check:hover {
  background: var(--hover);
}
.checks label.check input {
  margin: 0;
}
.checks .pill {
  margin-left: auto;
}
/* Shown once: the key sits on a perforated slip. */
.secret {
  position: relative;
  padding: 18px 18px 18px 20px;
  border: 1px dashed var(--rule-strong);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: 500 13.5px/1.5 var(--mono);
  overflow-wrap: anywhere;
  user-select: all;
}
.secret::before {
  content: 'Shown once';
  position: absolute;
  top: -9px;
  left: 14px;
  padding: 0 6px;
  background: var(--card);
  color: var(--amber);
  font: 500 10.5px/18px var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
/* Request details read like the landing page's request receipt. */
.request-id {
  margin-top: -10px;
  color: var(--ink-3);
  font-size: 12px;
}
.request-details {
  padding: 6px 16px;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--rule);
}
.request-details .settingsrow {
  position: relative;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 0;
  font-size: 13px;
}
.request-details .settingsrow::after {
  content: '';
  order: 1;
  flex: 1;
  min-width: 16px;
  border-bottom: 1px dotted var(--rule-strong);
  transform: translateY(-4px);
}
.request-details .settingsrow strong {
  order: 2;
  font: 500 12.5px/1.4 var(--mono);
}
.request-details + .hint {
  font-size: 12px;
}

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 10px 10px 10px 14px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13.5px;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition:
    opacity 0.2s,
    transform 0.25s var(--ease);
}
#toast:empty {
  display: none;
}
#toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}
.toast-symbol {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font: 700 11px/1 var(--mono);
  flex: none;
}
#toast[data-tone='success'] .toast-symbol {
  background: var(--ok);
}
#toast[data-tone='error'] .toast-symbol {
  background: var(--red);
}
#toast > button {
  width: 26px;
  min-height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  opacity: 0.6;
  font-size: 16px;
}
#toast > button:hover {
  opacity: 1;
  background: transparent;
}

/* ── Sign-in, signing page, loading, errors ── */
.auth {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  isolation: isolate;
}
.auth::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='64' viewBox='0 0 56 64'%3E%3Cpath d='M28 2 53 16.5v31L28 62 3 47.5v-31z' fill='none' stroke='%23808896' stroke-opacity='.16'/%3E%3C/svg%3E");
  background-size: 56px 64px;
  -webkit-mask-image: radial-gradient(50% 60% at 50% 40%, #000, transparent 75%);
  mask-image: radial-gradient(50% 60% at 50% 40%, #000, transparent 75%);
}
.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px max(16px, env(safe-area-inset-left, 0px));
  padding-inline: clamp(16px, 3vw, 32px);
}
.environment-label {
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--amber-wash);
  color: var(--amber);
  font: 500 11px/1.3 var(--mono);
  letter-spacing: 0.04em;
}
.auth-form-wrap {
  display: grid;
  place-items: center;
  padding: 24px 16px 64px;
}
.auth-form {
  display: grid;
  gap: 14px;
  width: min(440px, 100%);
  padding: 36px 36px 30px;
  border: 1px solid var(--rule);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow-lift);
}
.auth-form h1 {
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.auth-form > p {
  color: var(--ink-2);
}
.auth-form form {
  display: grid;
  gap: 16px;
  margin-top: 6px;
}
.auth-form form .primary {
  min-height: 44px;
  font-size: 14.5px;
}
.auth-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 46px;
  margin-bottom: 4px;
  background: var(--blue);
  color: #fff;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.auth-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.6;
}
.auth-demo {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding-top: 18px;
  border-top: 1px dashed var(--rule-strong);
  text-align: center;
}
.auth-demo button {
  min-height: 42px;
}
.auth-demo p,
.auth-pricing {
  color: var(--ink-3);
  font: 500 11.5px/1.4 var(--mono);
}
.auth-pricing {
  display: flex;
  justify-content: center;
  gap: 18px;
}
.signing-card {
  width: min(760px, 100%);
}
.signing-card .agreement-form {
  border-top: 0;
  padding-top: 0;
}
.loading,
.workspace-error {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  min-height: 100vh;
  padding: 24px;
  text-align: center;
  color: var(--ink-3);
}
.signing-card .loading {
  min-height: 160px;
}
.loading strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}
.loading-mark {
  width: 34px;
  height: 39px;
  margin-bottom: 10px;
  background: var(--blue);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  animation: breathe 1.6s var(--ease) infinite;
}
@keyframes breathe {
  50% {
    transform: scale(0.82) rotate(30deg);
    opacity: 0.55;
  }
}
.workspace-error h1 {
  color: var(--ink);
  font-size: 24px;
  letter-spacing: -0.025em;
}
.workspace-error p {
  max-width: 46ch;
  margin-bottom: 10px;
}
.error-orbit {
  display: grid;
  place-items: center;
  width: 44px;
  height: 50px;
  margin-bottom: 8px;
  background: var(--amber-wash);
  color: var(--amber);
  font: 700 18px/1 var(--mono);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

/* ── Responsive ── */
@media (max-width: 1180px) {
  .report-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .report-metric:nth-child(4) {
    border-left: 0;
  }
  .report-metric:nth-child(n + 4) {
    border-top: 1px solid var(--rule);
  }
  .hipaa-summary {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 1020px) {
  :root {
    --side: 208px;
  }
  .twocol,
  .hipaa-tools,
  .ranking-grid,
  .trend-grid,
  .hipaa-access {
    grid-template-columns: minmax(0, 1fr);
  }
  .hipaa-next {
    border-left: 0;
    border-top: 1px solid var(--night-rule);
  }
  .workspace-name {
    max-width: 140px;
  }
}
@media (max-width: 760px) {
  :root {
    --top: 56px;
  }
  .topbar {
    padding: 0 12px 0 10px;
    gap: 8px;
  }
  .top-divider,
  .workspace-name,
  .global-nav {
    display: none;
  }
  .env-badge {
    margin-left: auto;
  }
  .brand .accountable-wordmark {
    width: 118px;
  }
  .brand-suffix {
    font-size: 15.5px;
  }
  .navigation-toggle {
    display: inline-flex !important;
    width: 38px;
    min-height: 38px;
    padding: 0;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }
  .navigation-toggle svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
  }
  .sidebar {
    top: 0;
    width: min(290px, 86vw);
    padding-top: 18px;
    background: var(--card);
    box-shadow: var(--shadow-lift);
    transform: translateX(-104%);
    visibility: hidden;
    transition:
      transform 0.28s var(--ease),
      visibility 0.28s;
    z-index: 60;
  }
  .sidebar.is-open {
    transform: none;
    visibility: visible;
  }
  .navigation-close {
    display: inline-flex !important;
    width: 34px;
    min-height: 34px;
    padding: 0;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    font-size: 22px;
    font-weight: 300;
  }
  .nav a {
    min-height: 44px;
    font-size: 15px;
  }
  .navigation-backdrop:not([hidden]) {
    display: block !important;
    position: fixed;
    inset: 0;
    z-index: 50;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: var(--backdrop);
    backdrop-filter: blur(2px);
    box-shadow: none;
  }
  body.navigation-open {
    overflow: hidden;
  }
  .main {
    margin-left: 0;
  }
  .page {
    padding: 22px 16px 56px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  #content {
    gap: 16px;
  }
  .pagehead {
    align-items: flex-start;
  }
  .report-toolbar {
    width: 100%;
    flex-wrap: wrap;
  }
  .period-select {
    flex: 1;
  }
  .period-select select {
    width: 100%;
  }
  .report-filters {
    position: static;
  }
  .usage-filters {
    right: 16px;
    left: 16px;
    width: auto;
    grid-template-columns: minmax(0, 1fr);
  }
  .analytics-context {
    grid-template-columns: minmax(0, 1fr);
  }
  .report-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .report-metric:nth-child(n) {
    border-left: 0;
    border-top: 1px solid var(--rule);
  }
  .report-metric:nth-child(1),
  .report-metric:nth-child(2) {
    border-top: 0;
  }
  .report-metric:nth-child(even) {
    border-left: 1px solid var(--rule);
  }
  .report-metric:last-child {
    grid-column: 1 / -1;
  }
  .report-tabs {
    overflow-x: auto;
  }
  .report-tabs a {
    display: none;
  }
  .form-columns,
  .hipaa-form-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .setup-steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .setup-steps::before {
    top: 18px;
    bottom: 18px;
    left: 16px;
    right: auto;
    width: 1px;
    height: auto;
    background: repeating-linear-gradient(180deg, var(--rule-strong) 0 4px, transparent 4px 8px);
  }
  .setup-steps a {
    grid-template-columns: 32px 1fr;
    justify-items: start;
    align-items: center;
    padding: 0;
    text-align: left;
  }
  .hipaa-access-status,
  .hipaa-next {
    padding: 24px 20px;
  }
  .hipaa-data > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .panelhead {
    flex-wrap: wrap;
  }
  .settingsrow {
    flex-direction: column;
    gap: 3px;
  }
  .settingsrow strong {
    text-align: left;
  }
  .request-details .settingsrow {
    flex-direction: row;
  }
  .analytics-footnote,
  .chart-caption,
  .hipaa-panel-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .auth-form {
    padding: 28px 22px 24px;
  }
  #dialog {
    padding: 24px 20px;
  }
  .credit-options button {
    font-size: 17px;
  }
}
@media (max-width: 600px) {
  .report-chart .desktop-chart {
    display: none;
  }
  .report-chart .mobile-chart {
    display: block;
  }
  .env-badge {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

.model-filter {
  padding: 16px 22px;
  border-bottom: 1px solid var(--rule);
}
.model-filter label {
  display: block;
  font-size: 12px;
  margin-bottom: 7px;
}
.model-filter input {
  max-width: 380px;
  width: 100%;
}
.model-table tr[hidden] {
  display: none;
}

.model-filter .pending-models {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  color: var(--muted);
}
.model-filter .pending-models input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.model-catalog-note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--rule);
  font-size: 12px;
  color: var(--muted);
}
.model-catalog-note p {
  margin: 0;
}
.model-catalog-note details {
  max-width: 560px;
}
.model-catalog-note summary {
  cursor: pointer;
  color: var(--ink);
}
.model-catalog-note details[open] p {
  margin-top: 10px;
  line-height: 1.7;
}
.model-catalog-note details a {
  display: inline-block;
  margin-top: 8px;
}
.model-limit {
  color: inherit;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}
.model-limit span {
  padding-left: 6px;
  opacity: 0.35;
  font-size: 10px;
}
.model-limit:hover {
  text-decoration: underline;
}
.model-limit:hover span {
  opacity: 1;
}
.model-table {
  min-width: 1100px;
}
