/*
 * Developer portal layout, on top of the shared "Dusk" shell (tailend.css).
 * Tokens only, so light and dark both follow the shell. Colour is never the
 * only signal: banners and tags carry words. No inline styles anywhere.
 */
.portal-main {
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 20px 72px;
}

:is(.portal-main, .app-main) h1 {
  font: 800 32px/1.1 var(--display);
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

:is(.portal-main, .app-main) h2 {
  font: 700 18px/1.25 var(--display);
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}

:is(.portal-main, .app-main) h3 {
  font: 600 15px/1.3 var(--text);
  margin: 0 0 2px;
}

:is(.portal-main, .app-main) .section-h {
  margin: 36px 0 12px;
  font-size: 20px;
}

:is(.portal-main, .app-main) .eyebrow {
  margin: 0 0 6px;
  font: 600 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lead-ink);
}

:is(.portal-main, .app-main) .lede {
  color: var(--ink-2);
  margin: 0 0 18px;
  max-width: 60ch;
}


.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--paper);
  padding: 22px;
  margin: 0 0 20px;
}

.card > :last-child {
  margin-bottom: 0;
}

.field {
  margin: 0 0 16px;
}

.field label,
.inline-label {
  display: block;
  font: 600 12px/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}

.inline-label {
  display: inline-block;
  margin: 0 8px 0 0;
}

:is(.portal-main, .app-main) input[type='text'],
:is(.portal-main, .app-main) input[type='email'],
:is(.portal-main, .app-main) input[type='password'],
:is(.portal-main, .app-main) input[type='number'],
:is(.portal-main, .app-main) select {
  width: 100%;
  max-width: 420px;
  font: 400 15px/1.3 var(--text);
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

:is(.portal-main, .app-main) select {
  width: auto;
}

:is(.portal-main, .app-main) input:focus-visible,
:is(.portal-main, .app-main) select:focus-visible,
:is(.portal-main, .app-main) button:focus-visible,
:is(.portal-main, .app-main) a:focus-visible {
  outline: 2px solid var(--lead);
  outline-offset: 2px;
}

.hint,
.tile-note,
.row-meta {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 0;
}

.estimate {
  font: 500 13px/1.4 var(--mono);
  color: var(--ink-2);
  margin: 10px 0 16px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

:is(.portal-main, .app-main) button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.link-btn {
  background: none;
  border: 0;
  padding: 6px 2px;
  font: 600 13px/1 var(--text);
  color: var(--lead-ink);
  text-decoration: underline;
  cursor: pointer;
}

.btn-danger {
  color: var(--danger);
  border-color: var(--danger);
}

.form-error {
  color: var(--danger);
  background: var(--err-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 0 0 12px;
  font-size: 14px;
}

.notice {
  background: var(--lead-soft);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 0 0 18px;
}

.notice-ok {
  background: var(--ok-soft);
}

.notice-warn {
  background: var(--warn-soft);
}

.notice-error {
  background: var(--err-soft);
}

.banner-bar {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  background: var(--soft);
}

.banner-info {
  background: var(--lead-soft);
}

.banner-warn {
  background: var(--warn-soft);
  border-color: var(--accent);
}

.banner-error {
  background: var(--err-soft);
  border-color: var(--danger);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 0 0 24px;
}

.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.tile p {
  margin: 0;
}

.tile-label {
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.tile-value {
  font: 800 28px/1.2 var(--display);
  letter-spacing: -0.02em;
  margin-top: 8px !important;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
}

.secret {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  background: var(--deep);
  color: var(--deep-text);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.secret code {
  flex: 1 1 260px;
  overflow-wrap: anywhere;
  font: 500 13px/1.5 var(--mono);
  user-select: all;
}

.mono {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
}

.tag {
  font: 600 12px/1 var(--mono);
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.data th,
table.data td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.data th {
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

table.data .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

table.data progress {
  width: 120px;
  height: 8px;
  accent-color: var(--lead);
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 20px;
  margin: 0 0 12px;
}

.facts dt {
  font: 600 12px/1.6 var(--mono);
  text-transform: uppercase;
  color: var(--muted);
}

.facts dd {
  margin: 0;
}

.empty {
  color: var(--muted);
  margin: 0;
}


/* ---- app shell: fixed sidebar + main ---- */
.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px 14px;
  background: var(--soft);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  z-index: 30;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  padding: 0 6px;
}

.side-org {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 10px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.org-name {
  margin: 0;
  font: 700 14px/1.2 var(--text);
  overflow-wrap: anywhere;
}

.plan-badge,
.chip-tag {
  font: 600 11px/1 var(--mono);
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--lead-soft);
  color: var(--lead-ink);
  white-space: nowrap;
}

.side-nav {
  display: grid;
  gap: 2px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font: 600 14px/1 var(--text);
  color: var(--ink-2);
  text-decoration: none;
}

.side-nav a:hover {
  background: var(--surface);
  color: var(--ink);
}

.side-nav a[aria-current='page'] {
  background: var(--lead-soft);
  color: var(--lead-ink);
}

.ico {
  flex: none;
}

.side-bottom {
  margin-top: auto;
  display: grid;
  gap: 14px;
}

.meter-mini {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.meter-mini p {
  margin: 0;
}

.meter-label {
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.meter-value {
  font: 800 22px/1.2 var(--display);
  letter-spacing: -0.02em;
  margin-top: 6px !important;
}

.meter-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px !important;
}

.meter-mini progress {
  margin-top: 8px;
}

.side-links {
  display: flex;
  gap: 16px;
  padding: 0 6px;
}

.side-links a {
  font: 600 13px/1 var(--text);
  color: var(--muted);
  text-decoration: none;
}

.side-links a:hover {
  color: var(--ink);
}

.side-user {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 6px 0;
  border-top: 1px solid var(--line);
}

.side-email {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.app-col {
  flex: 1;
  min-width: 0;
  margin-left: 248px;
}

.app-main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 32px 72px;
}

.mobile-bar,
.scrim {
  display: none;
}

/* ---- page header ---- */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 20px;
  margin: 0 0 22px;
}

.page-head .lede {
  margin: 0;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn-sm {
  padding: 6px 10px !important;
  font-size: 12px !important;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.two-col > .card {
  margin: 0;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}

.card-head h2 {
  margin: 0;
}

.reveal {
  border-color: var(--lead);
  box-shadow: 0 0 0 3px var(--lead-soft), var(--paper);
}

/* ---- panels and tables ---- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--paper);
  max-height: 70vh;
  overflow: auto;
}

table.data th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--soft);
}

table.data td,
table.data th {
  padding: 11px 14px;
}

table.data tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--soft) 55%, transparent);
}

table.data tbody tr:hover {
  background: var(--lead-soft);
}

table.data tbody tr:last-child td {
  border-bottom: 0;
}

table.data .note {
  color: var(--muted);
  max-width: 34ch;
}

table.data td .sub {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

table.data tr.row-off {
  opacity: 0.6;
}

.actions-cell .row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.chips-inline {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.remain {
  display: grid;
  gap: 4px;
  min-width: 140px;
}

.amt {
  font-weight: 600;
}

.amt.pos {
  color: var(--ok);
}

time {
  white-space: nowrap;
}

.empty-state {
  padding: 28px 16px;
  text-align: center;
}

.empty-title {
  margin: 0 0 4px;
  font-weight: 600;
}

.panel > .empty {
  padding: 18px 16px;
}

progress {
  display: block;
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--line);
  accent-color: var(--lead);
  appearance: none;
}

progress::-webkit-progress-bar {
  background: var(--line);
}

progress::-webkit-progress-value {
  background: var(--lead);
  border-radius: 999px;
}

progress::-moz-progress-bar {
  background: var(--lead);
}

progress.is-warn::-webkit-progress-value {
  background: var(--accent);
}

progress.is-warn::-moz-progress-bar {
  background: var(--accent);
}

progress.is-full::-webkit-progress-value {
  background: var(--danger);
}

progress.is-full::-moz-progress-bar {
  background: var(--danger);
}

.tile progress {
  margin-top: 10px;
}

/* ---- add-on cards ---- */
.addons {
  border: 0;
  padding: 0;
  margin: 0 0 16px;
}

.addons legend {
  font: 600 12px/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0;
  margin-bottom: 8px;
}

.addon-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.addon-card {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 10px 10px 10px 34px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
}

.addon-card input {
  position: absolute;
  left: 11px;
  top: 12px;
  accent-color: var(--lead);
}

.addon-card.is-on {
  border-color: var(--lead);
  background: var(--lead-soft);
}

.addon-card.is-off {
  opacity: 0.55;
  cursor: not-allowed;
}

.addon-card:focus-within {
  outline: 2px solid var(--lead);
  outline-offset: 2px;
}

.addon-name {
  font: 600 14px/1.2 var(--text);
}

.addon-price {
  font: 500 12px/1.3 var(--mono);
  color: var(--lead-ink);
}

.addon-note {
  color: var(--muted);
  font-size: 12px;
}

/* ---- secret ---- */
.secret {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  background: var(--deep);
  color: var(--deep-text);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.secret code {
  flex: 1 1 260px;
  overflow-wrap: anywhere;
  font: 500 13px/1.5 var(--mono);
  user-select: all;
}

.mono {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
}

.tag {
  font: 600 12px/1 var(--mono);
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
}

/* ---- buy chips ---- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

button.chip {
  font: 600 13px/1 var(--text);
  color: var(--ink-2);
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
}

button.chip:hover {
  border-color: var(--lead);
}

button.chip[aria-pressed='true'] {
  background: var(--lead-soft);
  border-color: var(--lead);
  color: var(--lead-ink);
}

/* ---- chart ---- */
.legend {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
}

.key::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
}

.key-base::before {
  background: var(--lead);
}

.key-addon::before {
  background: var(--accent);
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-svg .grid {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-svg .axis {
  font: 500 11px var(--mono);
  fill: var(--muted);
}

.chart-svg .hit {
  fill: transparent;
}

.chart-svg .bar-base {
  fill: var(--lead);
}

.chart-svg .bar-addon {
  fill: var(--accent);
}

.chart-svg .bar:hover .hit,
.chart-svg .bar:focus .hit {
  fill: var(--lead-soft);
  opacity: 0.6;
}

.chart-svg .bar:focus {
  outline: none;
}

.chart-svg .tip-bg {
  fill: var(--deep);
  stroke: var(--deep-line);
}

.chart-svg .tip-head {
  font: 700 12px var(--text);
  fill: var(--deep-text);
}

.chart-svg .tip-line {
  font: 500 11px var(--mono);
  fill: var(--deep-muted);
}

/* ---- collapsible daily table ---- */
.collapse {
  margin: 28px 0 0;
}

.collapse summary {
  cursor: pointer;
  font: 700 18px/1.25 var(--display);
  padding: 6px 0 12px;
}

/* ---- drawer ---- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: flex-end;
  background: rgba(20, 17, 28, 0.5);
}

.drawer-panel {
  width: min(480px, 100%);
  height: 100%;
  overflow-y: auto;
  background: var(--surface);
  border-left: 1px solid var(--line);
  padding: 22px;
  box-shadow: var(--paper);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
}

.drawer-head h2 {
  margin: 0;
}

/* ---- narrow screens: sidebar behind a menu button ---- */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.18s ease;
    box-shadow: var(--paper);
  }

  .app.nav-open .sidebar {
    transform: none;
  }

  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 25;
    border: 0;
    background: rgba(20, 17, 28, 0.5);
  }

  .app-col {
    margin-left: 0;
  }

  .mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 10px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }

  .mobile-bar[hidden] {
    display: none;
  }

  .app-main {
    padding: 22px 16px 56px;
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar {
    transition: none;
  }
}

@media (max-width: 640px) {
  .portal-main {
    padding: 20px 16px 56px;
  }

  :is(.portal-main, .app-main) h1 {
    font-size: 26px;
  }

  .card {
    padding: 16px;
  }

  :is(.portal-main, .app-main) input[type='text'],
  :is(.portal-main, .app-main) input[type='email'],
  :is(.portal-main, .app-main) input[type='password'],
  :is(.portal-main, .app-main) input[type='number'] {
    max-width: none;
  }

  .addon-grid {
    grid-template-columns: 1fr;
  }

  .drawer-panel {
    padding: 16px;
  }

  .panel {
    max-height: none;
  }

  /* Tables become stacked cards so nothing scrolls sideways. */
  table.data thead {
    position: absolute;
    left: -9999px;
  }

  table.data,
  table.data tbody,
  table.data tr,
  table.data td {
    display: block;
    width: 100%;
  }

  table.data tr {
    border-bottom: 1px solid var(--line-2);
    padding: 6px 0;
  }

  table.data td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border: 0;
    padding: 5px 12px;
    text-align: right;
  }

  table.data td::before {
    content: attr(data-label);
    font: 600 11px/1.6 var(--mono);
    text-transform: uppercase;
    color: var(--muted);
    text-align: left;
    flex: none;
  }

  table.data td.actions-cell::before {
    content: none;
  }

  table.data td.note {
    max-width: none;
  }

  .actions-cell .row-actions {
    flex-wrap: wrap;
  }

  .facts {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .facts dd {
    margin-bottom: 10px;
  }
}

.tag-warn {
  background: var(--warn-soft);
  color: var(--accent-ink);
}

/* ---- Icons on headings and tiles; cards share one frame ---- */
.with-ico { display: flex; align-items: center; gap: 10px; }
.h-ico, .tile-ico {
  display: inline-grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 9px;
  color: var(--lead-ink);
  background: color-mix(in srgb, var(--lead) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lead) 18%, transparent);
}
.h-ico .ico { width: 17px; height: 17px; }
.card-title { margin: 0 0 10px; font-size: 17px; }
.collapse summary { display: flex; align-items: center; gap: 10px; }

.tile { display: flex; flex-direction: column; gap: 2px; min-height: 128px; box-shadow: var(--paper); }
.tile-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile-ico { width: 28px; height: 28px; border-radius: 8px; }
.tile .tile-note { margin-top: auto !important; padding-top: 6px; }
.tile progress { margin-top: 8px; }

/* Side-by-side cards: same height, actions pinned to the bottom */
.two-col { align-items: stretch; }
.two-col > .card { display: flex; flex-direction: column; }
.two-col > .card > form { display: flex; flex-direction: column; flex: 1; }
.two-col > .card > form > .actions { margin-top: auto; padding-top: 14px; }
.two-col > section:not(.card) { display: flex; flex-direction: column; }
.two-col > section:not(.card) > .table-wrap { flex: 1; }

/* Tables use the same frame as cards */
.table-wrap.panel { box-shadow: var(--paper); border-radius: var(--radius); }

/* ---- Sign-up stepper ---- */
.stepper-wrap { margin: 0 0 20px; }
.stepper { display: flex; list-style: none; margin: 0 0 12px; padding: 0; gap: 8px; }
.stepper .step { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font: 600 13px/1.2 var(--text); }
.step-dot {
  flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 999px;
  font: 700 12px/1 var(--mono); color: var(--muted); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2);
}
.stepper .step.is-current { color: var(--ink); }
.stepper .step.is-current .step-dot { color: var(--lead-ink); background: var(--lead-soft); box-shadow: inset 0 0 0 2px var(--lead); }
.stepper .step.is-done { color: var(--ink-2); }
.stepper .step.is-done .step-dot { color: var(--ok); background: var(--ok-soft); box-shadow: inset 0 0 0 1px var(--ok); }
.stepper .step.is-done .step-dot::after { content: '\2713'; }
.stepper .step.is-done .step-dot { font-size: 0; }
.stepper .step.is-done .step-dot::after { font-size: 13px; }
.stepper-text { margin: 8px 0 0; color: var(--muted); font: 500 12px/1 var(--mono); }
@media (max-width: 480px) {
  .stepper .step-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .stepper .step:not(.is-current) .step-name { display: none; }
}

/* ---- Get started checklist ---- */
.progress-card progress { margin: 4px 0 0; }
.steps { list-style: none; margin: 0; padding: 0; }
.step-card { scroll-margin-top: 16px; }
.step-head { display: flex; align-items: flex-start; gap: 12px; }
.step-copy { flex: 1; min-width: 0; }
.step-copy .card-title { margin: 0 0 2px; }
.step-line { margin: 0; color: var(--ink-2); font-size: 14px; }
.step-body { margin-top: 14px; padding-left: 42px; }
.step-status {
  flex: none; font: 600 11px/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase;
  padding: 5px 8px; border-radius: 999px; color: var(--muted); background: var(--soft);
}
.step-status.tag-done { color: var(--ok); background: var(--ok-soft); }
.step-card[data-state='done'] .h-ico { color: var(--ok); background: var(--ok-soft); box-shadow: inset 0 0 0 1px var(--ok); }
.step-note { color: var(--muted); font-size: 13px; }
.mini-form .field { margin-bottom: 12px; }
.plain-list { margin: 0 0 4px; padding-left: 18px; color: var(--ink-2); font-size: 14px; }
.step-body .code-card { margin: 0 0 8px; }
.step-body .reveal { margin-top: 4px; }
.actions-center { justify-content: center; }
.empty-state .btn-primary { text-decoration: none; display: inline-block; }
@media (max-width: 640px) {
  .step-body { padding-left: 0; }
  .step-head { flex-wrap: wrap; }
  .step-status { order: 3; }
}

/* ---- Skeleton loading: shimmer blocks shaped like the content they stand in for ---- */
.skel-wrap { display: block; }
.tiles > .skel-wrap, .skel-tiles { display: contents; }
.skel {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--soft) 0%, var(--line) 50%, var(--soft) 100%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.4s ease-in-out infinite;
}
@keyframes skel-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) {
  .skel { animation: none; background: var(--line); }
}
.skel-line { height: 12px; margin: 8px 0; }
.skel-block { height: 30px; margin: 10px 0 8px; }
.skel-value { width: 55%; }
.skel-w40 { width: 40%; } .skel-w50 { width: 50%; } .skel-w60 { width: 60%; } .skel-w80 { width: 80%; }
.skel-tile { min-height: 128px; }
.skel-row { display: flex; gap: 18px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.skel-row:last-child { border-bottom: 0; }
.skel-row .skel { flex: 1; margin: 0; width: auto; }
.skel-row .skel:first-child { flex: 2; }
.skel-item { padding: 10px 0; }
.skel-bars { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding: 0 8px; }
.skel-bar { flex: 1; border-radius: 6px 6px 0 0; }
.skel-h3 { height: 30%; } .skel-h4 { height: 42%; } .skel-h5 { height: 55%; } .skel-h6 { height: 68%; } .skel-h7 { height: 80%; } .skel-h8 { height: 92%; }
[data-org-name] .skel, [data-meter-balance] .skel, [data-email] .skel { margin: 3px 0; }

.skel-pill { display: inline-block; width: 44px; height: 18px; border-radius: 999px; }
.skel-pill[hidden] { display: none; }

/* ---- Overview ---- */
.section-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); margin: 36px 0 12px; }
.seg-btn {
  appearance: none; border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
  padding: 8px 14px; font: 600 13px/1 var(--mono); min-width: 48px;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--line-2); }
.seg-btn:hover { background: var(--soft); color: var(--ink); }
.seg-btn[aria-pressed='true'] { background: var(--lead-soft); color: var(--lead-ink); }
.sub-h { margin: 22px 0 10px; font: 700 15px/1.3 var(--display); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0; }
.facts dt { color: var(--muted); font: 600 12px/1.5 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts .sub { display: block; color: var(--muted); font-size: 12px; }
.facts .big { font: 800 24px/1.2 var(--display); letter-spacing: -0.02em; }
.news { list-style: none; margin: 0 0 6px; padding: 0; }
.news-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.news-item:first-child { padding-top: 0; }
.news-item:last-child { border-bottom: 0; }
.news-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font: 500 12px/1 var(--mono); }
.news .kind { padding: 3px 7px; border-radius: 999px; background: var(--lead-soft); color: var(--lead-ink); font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.04em; }
.news-title { display: block; margin-top: 6px; font: 700 15px/1.3 var(--text); color: var(--ink); text-decoration: none; }
.news-title:hover { text-decoration: underline; }
.news-summary { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.card .actions + .hint, .news + .hint { margin-top: 4px; }

/* ---- Sidebar: project switcher, credits meter, account row ---- */
.side-ctx { display: grid; gap: 8px; }
.project-select {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  padding: 9px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--ink-2); font: 600 13px/1.2 var(--text); text-align: left;
}
.project-select:disabled { cursor: not-allowed; opacity: 0.75; }
.project-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter-mini { padding: 10px; }
.side-bottom { gap: 10px; }
.acct { position: relative; }
.acct-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0;
  padding: 9px 10px; border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--ink); text-align: left; cursor: pointer;
}
.acct-btn:hover, .acct-btn[aria-expanded='true'] { background: var(--surface); }
.acct-btn:focus-visible { outline: 2px solid var(--lead); outline-offset: 2px; }
.acct-btn > .ico { margin-left: auto; color: var(--muted); }
.avatar {
  flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 999px;
  background: var(--lead-soft); color: var(--lead-ink); font: 800 13px/1 var(--display);
}
.acct-text { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.acct-email, .acct-role { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-email { font: 600 13px/1.2 var(--text); }
.acct-role { font: 500 12px/1.2 var(--text); color: var(--muted); min-height: 1em; }
.acct-menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 40;
  display: grid; gap: 2px; padding: 6px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--paper);
}
.acct-menu[hidden] { display: none; }
.acct-menu a, .acct-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-2); font: 600 14px/1 var(--text); text-align: left; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.acct-menu a:hover, .acct-menu button:hover, .acct-menu a:focus-visible, .acct-menu button:focus-visible { background: var(--soft); color: var(--ink); outline: none; }
.acct-menu button:focus-visible, .acct-menu a:focus-visible { box-shadow: inset 0 0 0 2px var(--lead); }

/* ---- Confirm dialog ---- */
.confirm { justify-content: center; align-items: center; }
.confirm[hidden] { display: none; }
.confirm-panel {
  width: min(420px, calc(100% - 32px)); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--paper); padding: 22px;
}
.confirm-panel h2 { margin: 0 0 8px; }
.confirm-panel p { margin: 0; color: var(--ink-2); }
.confirm-panel .actions { justify-content: flex-end; }
.confirm-panel .btn-danger { background: var(--err-soft); }

/* Inline skeletons inside running text stay on the line (the overview lede) */
.lede .skel-wrap, .lede .skel { display: inline-block; vertical-align: middle; }
.lede .skel { width: 7em; height: 0.9em; margin: 0; }

/* ---- per-key credit limits ---- */
.limits {
  border: 0;
  padding: 0;
  margin: 0 0 16px;
}

.limits legend {
  font: 600 12px/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0;
  margin-bottom: 8px;
}

.limit-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.limit-cell {
  display: grid;
  gap: 4px;
  min-width: 120px;
}

.limit-cell .sub {
  display: block;
}

table.data .limit-cell progress {
  width: 100%;
  max-width: 140px;
  height: 6px;
}

.tag-danger {
  color: var(--danger);
  border-color: var(--danger);
}

@media (max-width: 640px) {
  .limit-row {
    grid-template-columns: 1fr;
  }
}

/* ---- keys table: row menu and compact limits ---- */
.row-menu {
  position: fixed;
  right: auto;
  bottom: auto;
  width: max-content;
  min-width: 170px;
  z-index: 60;
}
.row-menu .menu-sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.row-menu .is-danger { color: var(--danger); }
.row-menu .is-danger:hover, .row-menu .is-danger:focus-visible { color: var(--danger); }
.row-menu-btn { min-width: 36px; font-size: 18px; line-height: 1; letter-spacing: 0.1em; }
.actions-cell { width: 1%; white-space: nowrap; }
.actions-cell .row-actions { flex-wrap: nowrap; align-items: center; }
.limit-cell { gap: 4px; min-width: 130px; }
.limit-line { display: grid; gap: 2px; }
.limit-line .sub { font-size: 12px; line-height: 1.3; white-space: nowrap; }
table.data .limit-line progress { width: 100%; max-width: 140px; height: 4px; }
.limit-cell .tag { justify-self: start; }
