/* GENERATED from packages/design/base.css by packages/design/scripts/sync.mjs — do not edit here. */
/* Kardio base styles — element defaults and the shared header chrome for the
   vanilla (apps/ekg) and Svelte (apps/echo) apps. Requires tokens.css.

   NOT for apps/learn: unscoped `button { background: var(--accent) }` would
   restyle every Tailwind button there. The course uses tailwind.preset.cjs
   and renders the same header from its own components (see HEADER.md).

   Origin: EKG Studio css/studio.css + EchoSchema src/lib/styles/theme.css,
   which were already near-identical; values now come from tokens. */

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-ui);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: var(--leading-tight); text-wrap: balance; }
p, li { overflow-wrap: break-word; }

button, input, select, textarea { font: inherit; letter-spacing: normal; }

button {
  flex: 0 0 auto;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  padding: 10px 15px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
button:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.4; cursor: default; }
button.secondary, button.quiet { background: var(--surface); border-color: var(--line); color: var(--ink); }
button.quiet { background: transparent; border-color: transparent; }
button.secondary:hover, button.quiet:hover { background: var(--surface-soft); border-color: var(--line); }
button.toggle-btn.active { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }

:focus-visible { outline: var(--focus-ring); outline-offset: 3px; }
a { color: var(--accent); }

input, select, textarea {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  padding: 10px 11px;
  min-height: 40px;
  max-width: 100%;
}
select { cursor: pointer; }
textarea { width: 100%; resize: vertical; line-height: 1.6; }
input[type="range"] { border: 0; padding: 0; min-height: 24px; accent-color: var(--accent); background: transparent; }
input[type="checkbox"] { accent-color: var(--accent); min-height: 0; width: 16px; height: 16px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
optgroup { color: var(--muted); font-weight: 600; }
option { color: var(--ink); background: var(--surface); }
input, output { font-variant-numeric: tabular-nums; }

/* ── Header ──────────────────────────────────────────────────────────────
   One row, four slots (HEADER.md):
     .brand · .platform-nav · [app slot, e.g. .mode-tabs] · .header-actions */

.app-header {
  background: var(--surface);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--header-pad-y) var(--header-pad-x);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-size: var(--text-2xl);
  letter-spacing: -0.7px;
  flex-shrink: 0;
}
.brand strong { font-weight: 450; }
.brand small {
  display: block;
  font-size: var(--text-2xs);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.25px;
  color: var(--muted);
  margin-top: 3px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-panel);
  background: var(--accent);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.brand-mark svg {
  width: 29px;
  fill: none;
  stroke: var(--on-accent);
  stroke-width: 1.7;
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* Platform switch: Kurs · EKG · Echo. Plain links, current app marked with
   aria-current="page". Sits right after the brand, before the app slot. */
.platform-nav { display: flex; gap: 2px; margin-right: auto; }
.platform-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-input);
}
.platform-nav a:hover { color: var(--ink); background: var(--surface-soft); }
.platform-nav a[aria-current="page"] { color: var(--accent-ink); background: var(--accent-soft); }

.mode-tabs { margin: 0; display: flex; gap: var(--space-1); padding: var(--space-1); background: var(--surface-soft); border-radius: var(--radius-panel); }
.mode-tab { border: 0; background: transparent; color: var(--muted); padding: 9px 18px; font-size: var(--text-sm); }
.mode-tab:hover { background: var(--surface); color: var(--ink); }
.mode-tab.active { background: var(--surface); color: var(--accent-ink); border: 0; box-shadow: var(--shadow-raised); }

.header-actions { display: flex; align-items: center; gap: 5px; }
.local-badge { color: var(--muted); font-size: var(--text-xs); margin-right: 10px; white-space: nowrap; }
.local-badge i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 5px; }

.disclaimer {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 10px var(--header-pad-x);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-xs);
}
.eyebrow { color: var(--accent); font-size: var(--text-xs); font-weight: 700; letter-spacing: 1.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;
}

@media (max-width: 1200px) {
  .app-header { padding: 18px 22px; gap: var(--space-4); }
  .local-badge { display: none; }
}
@media (max-width: 900px) {
  .app-header { flex-wrap: wrap; }
  .platform-nav { order: 3; width: 100%; margin-right: 0; }
}
@media (max-width: 767px) {
  .app-header { padding: var(--space-4); gap: var(--space-3); }
  .brand { font-size: 18px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .brand-mark svg { width: 24px; }
  .disclaimer { padding: 9px var(--space-4); font-size: var(--text-2xs); }
  .disclaimer .eyebrow { display: none; }
}

/* 44px touch targets; 16px inputs stop iOS Safari zooming on focus. */
@media (hover: none) and (pointer: coarse) {
  button, select, input:not([type="range"]):not([type="checkbox"]) { min-height: 44px; }
  input, select, textarea { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
