/* ═══════════════════════════════════════════
   Brake Service Checklist — Shared Stylesheet
   2016 Civic EX-T Coupe (FC3)
   Design tokens mirror my-car-story (car_resume)
   ═══════════════════════════════════════════ */
/* ═══════════════════════════════════════════
   Design Tokens — mirrors my-car-story palette
   ═══════════════════════════════════════════ */
:root {
  --color-primary: #17271D;
  --color-accent: #2D8A56;
  --color-accent-hover: #236B43;
  --color-danger: #E74C3C;
  --color-warning: #F59E0B;
  --color-success: #27AE60;

  --bg-page: #F0F3F1;
  --bg-surface: #FFFFFF;
  --bg-ghost: #F0FAF4;
  --bg-ghost-hover: #E0F5E8;
  --bg-light: #F8F9FA;
  --bg-warning: #FFF3CD;
  --text-warning: #856404;
  --bg-error-light: #FFF0F0;

  --text-primary: #333333;
  --text-secondary: #666666;
  --text-muted: #999999;
  --text-heading: #222222;

  --border-default: #DDDDDD;
  --border-light: #EEEEEE;

  --shadow-card: 0 2px 10px rgba(0,0,0,0.07);
  --shadow-card-hover: 0 10px 30px rgba(0,0,0,0.12);
  --shadow-header: 0 2px 8px rgba(0,0,0,0.15);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 20px;

  --warn: #C0392B;
  --caution: #B7791F;
  --note: #2C5282;

  --font-body: 'Raleway', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Bebas Neue', 'Raleway', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'Roboto Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ─── Header ─── */
.site-header {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-header);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.header-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.04em;
  margin: 0;
  line-height: 1;
}
.header-sub {
  font-size: 0.78rem;
  color: #9CB8A8;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
.header-progress {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: #BFD6C8;
}
.progress-track {
  width: 140px;
  height: 8px;
  background: rgba(255,255,255,0.16);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  transition: width 0.3s ease;
}
.progress-num { font-family: var(--font-mono); font-size: 0.85rem; min-width: 46px; text-align: right; }

/* ─── Tabs ─── */
.tabbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  position: sticky;
  top: 62px;
  z-index: 90;
}
.tabbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
}
.tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.85rem 1rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.02em;
  transition: all 0.15s;
}
.tab:hover { color: var(--color-accent); background: var(--bg-ghost); }
.tab.active { color: var(--color-accent); border-bottom-color: var(--color-accent); }
.tab .tcount {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--bg-light);
  border-radius: var(--radius-pill);
  padding: 0.1rem 0.5rem;
  margin-left: 0.35rem;
  color: var(--text-muted);
}
.tab.active .tcount { background: var(--bg-ghost); color: var(--color-accent); }

/* ─── Layout ─── */
.wrap { max-width: 1080px; margin: 0 auto; padding: 2rem 1.5rem 5rem; }
.panel { display: none; }
.panel.active { display: block; animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ─── Cards ─── */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.card-tight { padding: 1.1rem 1.25rem; }

/* ─── Phase header ─── */
.phase {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.phase-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.35rem;
  background: linear-gradient(90deg, var(--color-primary) 0%, #21382A 100%);
  color: #fff;
}
.phase-num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  background: var(--color-accent);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 1;
}
.phase-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.05em;
  margin: 0;
  line-height: 1.1;
}
.phase-title small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9CB8A8;
  font-weight: 700;
  margin-top: 0.15rem;
}
.phase-body { padding: 0.5rem 0; }

/* ─── Checklist items ─── */
.item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 1.35rem;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.12s;
}
.item:last-child { border-bottom: none; }
.item:hover { background: var(--bg-light); }
.item.crit { border-left: 4px solid var(--color-danger); background: #FFFAFA; }
.item.crit:hover { background: #FFF5F5; }

.item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 0.15rem;
  border: 2px solid #B9C4BE;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
  background: #fff;
}
.item input[type="checkbox"]:hover { border-color: var(--color-accent); }
.item input[type="checkbox"]:checked {
  background: var(--color-accent);
  border-color: var(--color-accent);
}
.item input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.item-main { flex: 1; min-width: 0; }
.item-label {
  font-weight: 600;
  color: var(--text-heading);
  display: block;
}
.item.done .item-label { color: var(--text-muted); text-decoration: line-through; text-decoration-color: #C4D4CA; }
.item-detail {
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
  line-height: 1.5;
}
.item-detail code, .mono {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  padding: 0.05em 0.3em;
  color: #33473B;
}
.torque {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent);
  background: var(--bg-ghost);
  border: 1px solid #C8E6D4;
  border-radius: var(--radius-pill);
  padding: 0.1rem 0.55rem;
  white-space: nowrap;
  flex: 0 0 auto;
  margin-top: 0.15rem;
}
.tag {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  padding: 0.12rem 0.4rem;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.tag-crit { background: var(--color-danger); color: #fff; }
.tag-gate { background: var(--color-warning); color: #4A3200; }
.tag-opt  { background: #E2E8F0; color: #4A5568; }

/* ─── Callouts (aviation WARNING / CAUTION / NOTE) ─── */
.callout {
  margin: 0.85rem 1.35rem;
  padding: 0.85rem 1rem 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  border-left: 5px solid;
  font-size: 0.88rem;
  line-height: 1.6;
}
.callout .ctitle {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.07em;
  display: block;
  margin-bottom: 0.3rem;
}
.callout ul { margin: 0.3rem 0 0; padding-left: 1.1rem; }
.callout li { margin-bottom: 0.2rem; }
.callout p { margin: 0.35rem 0 0; }
.callout p:first-of-type { margin-top: 0; }

.warning { background: var(--bg-error-light); border-color: var(--warn); }
.warning .ctitle { color: var(--warn); }
.caution { background: var(--bg-warning); border-color: var(--caution); }
.caution .ctitle { color: var(--caution); }
.note { background: #EBF4FF; border-color: var(--note); }
.note .ctitle { color: var(--note); }
.ok { background: var(--bg-ghost); border-color: var(--color-accent); }
.ok .ctitle { color: var(--color-accent); }

/* ─── Sub-headers inside phases ─── */
.subhead {
  padding: 0.75rem 1.35rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ─── Tables ─── */
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  margin: 0.5rem 0 0.25rem;
}
table.data th {
  text-align: left;
  padding: 0.5rem 0.7rem;
  background: var(--bg-light);
  border-bottom: 2px solid var(--border-default);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
table.data td {
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}
table.data tr:last-child td { border-bottom: none; }
table.data td.mono, table.data th.mono { font-family: var(--font-mono); font-size: 0.82rem; }
.tbl-scroll { overflow-x: auto; }

/* ─── Memory items hero ─── */
.memory {
  background: linear-gradient(135deg, #7B1F16 0%, #A32A1D 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-card);
}
.memory h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.07em;
  margin: 0 0 0.2rem;
}
.memory .msub {
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #F5C6C0;
  font-weight: 700;
  margin-bottom: 0.9rem;
}
.memory ol { margin: 0; padding-left: 1.4rem; }
.memory li { margin-bottom: 0.55rem; line-height: 1.5; font-size: 0.92rem; }
.memory li strong { color: #FFD9D3; }
.memory li:last-child { margin-bottom: 0; }

/* ─── Mission brief ─── */
.brief-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
  margin-top: 0.9rem;
}
.brief-cell {
  background: var(--bg-light);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--color-accent);
}
.brief-cell .bk {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.15rem;
}
.brief-cell .bv { font-weight: 700; color: var(--text-heading); font-size: 0.92rem; }
.brief-cell .bv small { display: block; font-weight: 500; color: var(--text-secondary); font-size: 0.8rem; margin-top: 0.1rem; }

/* ─── Buttons ─── */
.toolbar { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.btn {
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  padding: 0.55rem 1.05rem;
  cursor: pointer;
  transition: all 0.18s;
  border: 1px solid var(--color-accent);
  background: var(--bg-ghost);
  color: var(--color-accent);
  letter-spacing: 0.02em;
}
.btn:hover { background: var(--bg-ghost-hover); border-color: var(--color-accent-hover); color: var(--color-accent-hover); }
.btn.solid { background: var(--color-accent); color: #fff; }
.btn.solid:hover { background: var(--color-accent-hover); }
.btn.danger { border-color: var(--color-danger); background: var(--bg-error-light); color: var(--color-danger); }
.btn.danger:hover { background: #FFD6D6; }

/* ─── Misc ─── */
h2.sect {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  color: var(--text-heading);
  margin: 2rem 0 0.35rem;
}
h2.sect:first-child { margin-top: 0; }
p.sect-sub { color: var(--text-secondary); margin: 0 0 1rem; font-size: 0.9rem; }
.footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  font-size: 0.8rem;
  color: var(--text-dim, #AAA);
  font-family: var(--font-mono);
}
.footer a { color: var(--color-accent); text-decoration: none; }
.vin { font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.03em; }
.stamp {
  display: inline-block;
  border: 2px solid var(--color-accent);
  color: var(--color-accent);
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-sm);
  transform: rotate(-1.5deg);
  margin-top: 0.5rem;
}
.kv { display: flex; gap: 0.5rem; align-items: baseline; padding: 0.3rem 0; border-bottom: 1px solid var(--border-light); font-size: 0.87rem; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-secondary); min-width: 150px; flex: 0 0 auto; }
.kv .v { font-weight: 600; color: var(--text-heading); }

/* ─── Print ─── */
@media print {
  body { background: #fff; font-size: 11px; }
  .site-header, .tabbar, .toolbar, .header-progress { display: none !important; }
  .panel { display: block !important; }
  .wrap { padding: 0; max-width: 100%; }
  .phase, .card { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; margin-bottom: 0.7rem; }
  .phase-head { background: #eee !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .phase-title small { color: #555 !important; }
  .item input[type="checkbox"] { border-color: #000; }
  .memory { background: #fff !important; color: #000 !important; border: 2px solid #000; }
  .memory .msub, .memory li strong { color: #000 !important; }
  a { text-decoration: none; color: inherit; }
}

@media (max-width: 700px) {
  .wrap { padding: 1rem 0.9rem 4rem; }
  .header-inner { padding: 0.7rem 0.9rem; }
  .header-title { font-size: 1.25rem; }
  .header-progress { width: 100%; margin-left: 0; }
  .progress-track { flex: 1; }
  .tabbar { top: 88px; }
  .tabbar-inner { padding: 0 0.5rem; }
  .phase-title { font-size: 1.1rem; }
  .item { padding: 0.6rem 0.9rem; }
  .callout { margin: 0.75rem 0.9rem; }
  .kv .k { min-width: 110px; }
}

/* ═══════════════════════════════════════════
   Cross-page navigation (header)
   ═══════════════════════════════════════════ */
.site-nav {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
  align-items: center;
}
.site-nav a {
  color: #BFD6C8;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition: all 0.18s;
  white-space: nowrap;
}
.site-nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.site-nav a.active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.header-progress { margin-left: 1rem; }

/* ═══════════════════════════════════════════
   Where-to-Buy page
   ═══════════════════════════════════════════ */
.store-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1rem;
  border-left: 5px solid var(--color-accent);
}
.store-card.primary { border-left-color: var(--color-accent); background: linear-gradient(90deg, var(--bg-ghost) 0%, var(--bg-surface) 22%); }
.store-card.secondary { border-left-color: #94A3B8; }
.store-card.online { border-left-color: #6366F1; }
.store-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  color: var(--text-heading);
  margin: 0 0 0.1rem;
  line-height: 1.15;
}
.store-tag {
  display: inline-block;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.12rem 0.42rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.store-tag.alt { background: #6366F1; }
.store-tag.grey { background: #64748B; }
.store-meta { font-size: 0.85rem; color: var(--text-secondary); margin: 0.35rem 0 0.7rem; }
.store-meta strong { color: var(--text-heading); }
.store-meta a { color: var(--color-accent); text-decoration: none; }
.store-meta a:hover { text-decoration: underline; }

.shop-list { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.shop-list li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.42rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.87rem;
}
.shop-list li:last-child { border-bottom: none; }
.shop-list .qty {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  flex: 0 0 auto;
  min-width: 26px;
}
.shop-list .nm { flex: 1; }
.shop-list .nm code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  padding: 0.05em 0.3em;
  color: #33473B;
}
.shop-list .px {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent);
  white-space: nowrap;
  flex: 0 0 auto;
}
.shop-list a { color: var(--color-accent); }
.walk-note {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-accent);
  background: var(--bg-ghost);
  border: 1px dashed var(--color-accent);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.8rem;
  margin: 0.6rem 0;
  text-align: center;
}
.total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.7rem 1.1rem;
  margin-top: 0.5rem;
  background: var(--bg-light);
  border-radius: var(--radius-md);
  font-weight: 700;
}
.total-row .amt { font-family: var(--font-mono); color: var(--color-accent); font-size: 1.05rem; }
a.btn { text-decoration: none; display: inline-block; }
.crumb { font-size: 0.84rem; margin-bottom: 1.2rem; }
.crumb a { color: var(--color-accent); text-decoration: none; font-weight: 600; }
.crumb a:hover { text-decoration: underline; }

@media (max-width: 700px) {
  .site-nav { width: 100%; margin-left: 0; }
  .site-nav a { flex: 1; text-align: center; font-size: 0.76rem; padding: 0.4rem 0.5rem; }
  .header-progress { margin-left: 0; }
  .shop-list li { flex-wrap: wrap; }
}
@media print {
  .site-nav { display: none !important; }
}

/* Print-only titles (for pages whose header is hidden in print) */
.print-only { display: none; }
@media print {
  .print-only {
    display: block !important;
    font-family: var(--font-display);
    font-size: 1.6rem;
    letter-spacing: 0.04em;
    color: #000;
    margin: 0 0 0.2rem;
    border-bottom: 3px solid #000;
    padding-bottom: 0.3rem;
  }
  .print-only small {
    display: block;
    font-family: var(--font-body);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: #555;
    margin-top: 0.15rem;
  }
  .crumb { display: none !important; }
}

/* ═══════════════════════════════════════════
   Language toggle (i18n)
   ═══════════════════════════════════════════ */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(191, 214, 200, 0.4);
  background: transparent;
  border-radius: 999px;
  padding: 2px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
  white-space: nowrap;
  flex: 0 0 auto;
}
.lang-toggle .lang-opt {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  color: #BFD6C8;
  transition: background 0.18s, color 0.18s;
}
.lang-toggle .lang-opt.active {
  background: var(--color-accent);
  color: #fff;
}
.lang-toggle:hover .lang-opt:not(.active) { color: #fff; }
.lang-toggle:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

@media (max-width: 640px) {
  .lang-toggle { margin-left: 0; }
  .lang-toggle .lang-opt { padding: 0.3rem 0.5rem; font-size: 0.7rem; }
}

/* The toggle is a control, not content — it never belongs on paper. */
@media print {
  .lang-toggle { display: none !important; }
}
