/* ===================================================================
   AutoMarko — application stylesheet
   Colour roles follow the validated data-viz palette; series colours
   were checked against both surfaces before use.
   =================================================================== */

:root {
  color-scheme: light;

  --surface-0: #f6f7f9;   /* page plane */
  --surface-1: #ffffff;   /* card / chart surface */
  --surface-2: #eef0f4;   /* subtle fills */

  --text-primary:   #0b0b0b;
  --text-secondary: #4b4f58;
  --text-muted:     #6b7280;

  --border:    rgba(11, 11, 11, 0.12);
  --border-2:  rgba(11, 11, 11, 0.07);
  --grid:      #e6e8ec;
  --axis:      #c3c2b7;

  --series-1: #2a78d6;
  --series-2: #eb6834;

  --accent:        #2a78d6;
  --accent-hover:  #256abf;
  --accent-ink:    #ffffff;

  --good:     #0ca30c;
  --good-ink: #006300;
  --warning:  #fab219;
  --critical: #d03b3b;

  --focus: #2a78d6;

  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 1px 2px rgba(11, 11, 11, 0.06), 0 8px 24px rgba(11, 11, 11, 0.05);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --shell: 1180px;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --surface-0: #0d0d0f;
  --surface-1: #15161a;
  --surface-2: #1e2027;

  --text-primary:   #f4f5f7;
  --text-secondary: #c3c2b7;
  --text-muted:     #9aa0aa;

  --border:   rgba(255, 255, 255, 0.14);
  --border-2: rgba(255, 255, 255, 0.08);
  --grid:     #2c2c2a;
  --axis:     #383835;

  --series-1: #3987e5;
  --series-2: #d95926;

  --accent:       #3987e5;
  --accent-hover: #5598e7;
  --accent-ink:   #06121f;

  --good-ink: #0ca30c;

  --focus: #86b6ef;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --surface-0: #0d0d0f;
    --surface-1: #15161a;
    --surface-2: #1e2027;

    --text-primary:   #f4f5f7;
    --text-secondary: #c3c2b7;
    --text-muted:     #9aa0aa;

    --border:   rgba(255, 255, 255, 0.14);
    --border-2: rgba(255, 255, 255, 0.08);
    --grid:     #2c2c2a;
    --axis:     #383835;

    --series-1: #3987e5;
    --series-2: #d95926;

    --accent:       #3987e5;
    --accent-hover: #5598e7;
    --accent-ink:   #06121f;

    --good-ink: #0ca30c;

    --focus: #86b6ef;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

/* --------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px; /* in-page anchors clear the sticky header */
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--surface-0);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1 0 auto; }
main:focus { outline: none; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; letter-spacing: -0.015em; }
h1 { font-size: clamp(1.9rem, 1.2rem + 2.2vw, 3rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.9rem); }
h3 { font-size: 1.06rem; }
p { margin: 0 0 1em; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.muted { color: var(--text-muted); }
.shell { width: min(var(--shell), calc(100% - 3rem)); margin-inline: auto; }

/* Visible focus everywhere — never removed, only restyled. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
/* Fallback for engines without :focus-visible support. */
@supports not selector(:focus-visible) {
  :focus { outline: 3px solid var(--focus); outline-offset: 2px; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.7rem 1.1rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0; color: var(--accent-ink); }

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

.btn {
  --btn-bg: transparent;
  --btn-ink: var(--text-primary);
  --btn-border: var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 0.8rem 1.5rem; font-size: 1.02rem; }
.btn-block { width: 100%; }

.btn-primary { --btn-bg: var(--accent); --btn-ink: var(--accent-ink); --btn-border: var(--accent); }
.btn-primary:hover { --btn-bg: var(--accent-hover); --btn-border: var(--accent-hover); color: var(--accent-ink); }

.btn-secondary { --btn-bg: var(--surface-1); }
.btn-secondary:hover { --btn-bg: var(--surface-2); }

.btn-ghost { --btn-border: transparent; color: var(--text-secondary); font-weight: 500; }
.btn-ghost:hover { --btn-bg: var(--surface-2); color: var(--text-primary); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text-primary); }

.inline-form { display: inline; margin: 0; }

/* ------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface-1) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-2);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.12rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
}
.brand strong { font-weight: 800; }
.logo { display: inline-flex; color: var(--accent); }

.nav { display: flex; gap: 0.35rem; margin-right: auto; }
.nav a {
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--text-primary); }
.nav a[aria-current="page"] { color: var(--text-primary); background: var(--surface-2); }

.header-actions { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; }
.account { display: flex; align-items: center; gap: 0.6rem; }
.account-name {
  font-size: 0.9rem; font-weight: 600; color: var(--text-secondary);
  max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Theme toggle icon swap. */
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: inline; }
}

/* --------------------------------------------------------------- hero */

.hero { padding: clamp(3rem, 6vw, 5.5rem) 0 clamp(2rem, 4vw, 3.5rem); }
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.eyebrow {
  display: inline-block;
  margin: 0 0 0.9rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-1);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
.lede { font-size: 1.1rem; color: var(--text-secondary); max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.75rem 0 1rem; }
.hero-note { font-size: 0.88rem; }

.hero-panel { display: flex; justify-content: center; }
.panel-card {
  width: 100%;
  max-width: 380px;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-1);
  box-shadow: var(--shadow);
}
.panel-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-2);
  font-size: 0.92rem;
}
.panel-row:last-of-type { border-bottom: 0; }
.panel-metric { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-live { background: var(--good); }
.dot-paused { background: var(--warning); }
.panel-spark { margin-top: 0.75rem; }
.panel-spark svg { width: 100%; height: 60px; display: block; }

/* ----------------------------------------------------------- sections */

.section { padding: clamp(3rem, 6vw, 4.5rem) 0; }
.section:focus { outline: none; }
.section-alt { background: var(--surface-1); border-block: 1px solid var(--border-2); }
.section-title { text-align: center; margin-bottom: 0.4rem; }
.section-sub { text-align: center; color: var(--text-muted); margin-bottom: 2.5rem; }

.feature-grid, .plan-grid, .plan-items, .steps, .tiles, .automation-list {
  list-style: none; margin: 0; padding: 0;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.1rem;
}
.feature-card {
  padding: 1.4rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface-1);
}
.feature-card p { margin: 0; color: var(--text-secondary); font-size: 0.95rem; }
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  margin-bottom: 0.9rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; counter-reset: step; }
.step { display: flex; gap: 1rem; }
.step h3 { margin-bottom: 0.25rem; }
.step p { margin: 0; color: var(--text-secondary); font-size: 0.95rem; }
.step-n {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; align-items: start; }
.plan {
  position: relative;
  padding: 1.6rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface-1);
}
.plan-featured { border-color: var(--accent); box-shadow: var(--shadow); }
.plan-badge {
  position: absolute; top: -0.75rem; left: 1.6rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.75rem; font-weight: 700;
}
.plan-price { margin: 0.25rem 0 0.35rem; }
.plan-price strong { font-size: 2rem; letter-spacing: -0.02em; }
.plan-blurb { color: var(--text-secondary); font-size: 0.93rem; }
.plan-items { margin: 1rem 0 1.4rem; display: grid; gap: 0.5rem; }
.plan-items li { position: relative; padding-left: 1.5rem; font-size: 0.93rem; color: var(--text-secondary); }
.plan-items li::before {
  content: "";
  position: absolute; left: 0; top: 0.55em;
  width: 9px; height: 5px;
  border-left: 2px solid var(--good); border-bottom: 2px solid var(--good);
  transform: rotate(-45deg);
}

.cta-band { padding: clamp(2.5rem, 5vw, 4rem) 0; background: var(--surface-1); border-top: 1px solid var(--border-2); }
.cta-inner { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; justify-content: space-between; }
.cta-inner h2 { margin: 0; }

/* --------------------------------------------------------------- auth */

.body-auth { background: var(--surface-0); }
.auth { display: flex; justify-content: center; padding: clamp(2rem, 6vw, 4.5rem) 1.5rem; }
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: clamp(1.75rem, 4vw, 2.5rem);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface-1);
  box-shadow: var(--shadow);
}
.auth-brand { margin-bottom: 1.5rem; }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 0.25rem; }
.auth-sub { margin-bottom: 1.5rem; font-size: 0.94rem; }
.auth-form { display: grid; gap: 1.1rem; }
.auth-foot { margin: 1.5rem 0 0; font-size: 0.85rem; }
.auth-foot code { font-size: 0.82rem; background: var(--surface-2); padding: 0.1rem 0.35rem; border-radius: 4px; }

.field { display: grid; gap: 0.4rem; }
.field label { font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); }
.field input {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  color: var(--text-primary);
  font: inherit;
}
.field input::placeholder { color: var(--text-muted); }
.field input[aria-invalid="true"] { border-color: var(--critical); }
.field-inline { margin-left: auto; }
.field-inline input { min-width: 240px; }

.password-wrap { position: relative; display: flex; }
.password-wrap input { padding-right: 4.2rem; }
.reveal-btn {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.35rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.reveal-btn:hover { background: var(--surface-2); color: var(--text-primary); }

.alert, .notice {
  margin: 0 0 1.25rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  border-left: 4px solid;
}
.alert { background: color-mix(in srgb, var(--critical) 12%, transparent); border-color: var(--critical); color: var(--text-primary); }
.notice { background: color-mix(in srgb, var(--good) 12%, transparent); border-color: var(--good); color: var(--text-primary); }

/* ---------------------------------------------------------- dashboard */

.dash { padding: 2rem 0 3.5rem; }
.dash-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1.75rem; }
.dash-head h1 { font-size: 1.9rem; margin-bottom: 0.15rem; }
.dash-head p { margin: 0; font-size: 0.92rem; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.tile {
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface-1);
}
.tile-label { margin: 0 0 0.35rem; font-size: 0.85rem; color: var(--text-muted); }
.tile-value { margin: 0 0 0.45rem; font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.tile-foot { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-size: 0.82rem; flex-wrap: wrap; }

.delta { display: inline-flex; align-items: center; gap: 0.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.delta-up { color: var(--good-ink); }
.delta-down { color: var(--critical); }
.delta-flat { color: var(--text-muted); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.card-wide { grid-column: span 1; }
@media (min-width: 1000px) { .card-wide { grid-column: span 2; } .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.card {
  padding: 1.25rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface-1);
  margin-bottom: 1rem;
}
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.card-head h2 { font-size: 1.05rem; margin: 0; }

.legend { display: flex; gap: 1rem; list-style: none; margin: 0 0 0 auto; padding: 0; font-size: 0.85rem; color: var(--text-secondary); }
.legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ------------------------------------------------------------- charts */

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

.ch-grid  { stroke: var(--grid); stroke-width: 1; }
.ch-axis  { stroke: var(--axis); stroke-width: 1; }
.ch-tick  { fill: var(--text-muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.ch-cat   { fill: var(--text-secondary); font-size: 12px; font-family: var(--font); }
.ch-value { fill: var(--text-secondary); font-size: 12px; font-weight: 600; font-family: var(--font); font-variant-numeric: tabular-nums; }
.ch-direct { fill: var(--text-secondary); font-size: 12px; font-weight: 600; font-family: var(--font); }
.ch-line  { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ch-end   { stroke: var(--surface-1); stroke-width: 2; }
.ch-bar   { fill: var(--series-1); }
.ch-hit   { fill: transparent; }
.ch-crosshair line { stroke: var(--axis); stroke-width: 1; stroke-dasharray: 3 3; }

.chart-tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  white-space: nowrap;
  transform: translate(-50%, -110%);
}
.chart-tooltip strong { display: block; margin-bottom: 0.1rem; }

.table-toggle { margin-top: 1rem; border-top: 1px solid var(--border-2); padding-top: 0.75rem; }
.table-toggle summary { cursor: pointer; font-size: 0.88rem; color: var(--text-secondary); font-weight: 600; }
.table-toggle summary:hover { color: var(--text-primary); }
.table-toggle[open] summary { margin-bottom: 0.75rem; }

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

/* Horizontal overflow scrolls; the region is focusable so keyboard users
   can reach it with Tab and scroll with the arrow / Page keys. */
.table-scroll { overflow-x: auto; overflow-y: auto; max-height: 60vh; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table caption { text-align: left; }
.data-table th, .data-table td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border-2); }
.data-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-1);
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); font-weight: 700;
  white-space: nowrap;
}
.data-table tbody th { font-weight: 600; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.empty-row { padding: 1.5rem 0.75rem; color: var(--text-muted); text-align: center; margin: 0; }

.pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem; font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill-live   { color: var(--good-ink);   background: color-mix(in srgb, var(--good) 14%, transparent);   border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.pill-paused { color: var(--text-primary); background: color-mix(in srgb, var(--warning) 20%, transparent); border-color: color-mix(in srgb, var(--warning) 45%, transparent); }
.pill-draft  { color: var(--text-muted); background: var(--surface-2); border-color: var(--border-2); }
.pill-ended  { color: var(--text-secondary); background: var(--surface-2); border-color: var(--border-2); }

.automation-list { display: grid; gap: 0.6rem; }
.automation {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--surface-0);
}
.automation-main { flex: 1; min-width: 0; }
.automation-name { margin: 0; font-weight: 600; }
.automation-main p.muted { margin: 0; font-size: 0.85rem; }

/* -------------------------------------------------------------- dialog */

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(11, 11, 11, 0.5);
}
.dialog-backdrop[hidden] { display: none; }
.dialog {
  width: min(460px, 100%);
  max-height: 85vh;
  overflow-y: auto;            /* long sheets scroll rather than clip */
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-1);
  box-shadow: var(--shadow);
}
.dialog-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.dialog-head h2 { margin: 0; font-size: 1.15rem; }
.dialog-head .icon-btn { margin-left: auto; }
.dialog-note { font-size: 0.82rem; margin: 1rem 0 0; }

.shortcut-list { margin: 0; display: grid; gap: 0.15rem; }
.shortcut-row { display: flex; align-items: center; gap: 1rem; padding: 0.45rem 0; border-bottom: 1px solid var(--border-2); }
.shortcut-row:last-child { border-bottom: 0; }
.shortcut-row dt { flex: none; display: flex; gap: 0.25rem; align-items: center; }
.shortcut-row dd { margin: 0; font-size: 0.9rem; color: var(--text-secondary); }

kbd {
  display: inline-block;
  min-width: 1.6rem;
  padding: 0.12rem 0.4rem;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 0.78rem;
  text-align: center;
  color: var(--text-primary);
}

/* --------------------------------------------------------------- misc */

.error-page { padding: clamp(3rem, 10vw, 6rem) 0; text-align: center; }
.error-code { font-size: 3.5rem; font-weight: 800; color: var(--text-muted); margin: 0; line-height: 1; }

.site-footer { border-top: 1px solid var(--border-2); background: var(--surface-1); padding: 1.5rem 0; margin-top: auto; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; font-size: 0.87rem; }
.footer-inner p { margin: 0; }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-panel { order: -1; }
  .shell { width: calc(100% - 2rem); }

  /* The nav wraps to its own scrollable row instead of being hidden — every
     link stays reachable by Tab at every width. */
  .header-inner { flex-wrap: wrap; gap: 0.5rem 1rem; padding-block: 0.5rem; }
  .brand { order: 1; }
  .header-actions { order: 2; }
  .nav {
    order: 3;
    width: 100%;
    margin: 0;
    overflow-x: auto;
    padding-bottom: 0.2rem;
    -webkit-overflow-scrolling: touch;
  }
  .nav a { white-space: nowrap; }
  .account-name { display: none; }
}

@media (forced-colors: active) {
  .btn, .card, .tile, .plan, .feature-card, .dialog { border: 1px solid CanvasText; }
  .ch-line, .ch-bar { forced-color-adjust: none; }
  :focus-visible { outline: 3px solid Highlight; }
}
