/* ============================================================
   Bottle Washer Pro — manual site
   Mobile-first · light & dark themes · no dependencies
   ============================================================ */

:root {
  color-scheme: light;
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --text: #0f172a;
  --muted: #5c6b82;
  --border: rgba(15, 23, 42, 0.09);
  --accent: #0d9488;
  --accent-soft: rgba(13, 148, 136, 0.12);
  --accent-text: #0f766e;
  --warn-bg: #fff8e7;
  --warn-border: #f0c96b;
  --warn-text: #7a5200;
  --danger-bg: #fef1f1;
  --danger-border: #f3b3b3;
  --danger-text: #9b1c1c;
  --info-bg: #eef5ff;
  --info-border: #b9d4f7;
  --info-text: #1d4ed8;
  --hero-bg: #0f172a;
  --hero-text: #f8fafc;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 3px 10px rgba(15, 23, 42, 0.06);
  --appbar-bg: rgba(243, 245, 249, 0.82);
  --tabbar-bg: rgba(255, 255, 255, 0.88);
  --lcd-bg: #0c1a12;
  --lcd-on: #7bf59c;
  --radius: 18px;
  --radius-sm: 12px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a111f;
  --surface: #121a2c;
  --surface-2: #0e1626;
  --text: #e8eef9;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.16);
  --accent: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, 0.14);
  --accent-text: #5eead4;
  --warn-bg: rgba(217, 150, 37, 0.12);
  --warn-border: rgba(217, 150, 37, 0.4);
  --warn-text: #f0c96b;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --danger-border: rgba(239, 68, 68, 0.4);
  --danger-text: #fca5a5;
  --info-bg: rgba(59, 130, 246, 0.12);
  --info-border: rgba(59, 130, 246, 0.4);
  --info-text: #93c5fd;
  --hero-bg: #101a30;
  --hero-text: #f8fafc;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 3px 10px rgba(0, 0, 0, 0.3);
  --appbar-bg: rgba(10, 17, 31, 0.8);
  --tabbar-bg: rgba(18, 26, 44, 0.9);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

/* smooth color swap only while toggling theme */
html.theme-anim, html.theme-anim body,
html.theme-anim .appbar, html.theme-anim .tabbar, html.theme-anim .card,
html.theme-anim .callout, html.theme-anim .acc, html.theme-anim .chip {
  transition: background-color .28s ease, color .28s ease, border-color .28s ease, box-shadow .28s ease;
}

img { max-width: 100%; height: auto; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; }
p { margin: 0 0 .8em; }
p:last-child { margin-bottom: 0; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 14px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* ---------- App bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--appbar-bg);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}
.appbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 960px; margin: 0 auto;
  padding: 10px 16px;
  min-height: 54px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-icon { border-radius: 9px; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; }
.brand-text span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.theme-toggle {
  position: relative;
  width: 42px; height: 42px; flex: none;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, background-color .2s ease;
  touch-action: manipulation;
}
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle .ic {
  position: absolute; width: 21px; height: 21px;
  transition: opacity .3s ease, transform .45s cubic-bezier(.2,.9,.3,1.4);
}
.ic-sun { opacity: 1; transform: rotate(0) scale(1); }
.ic-moon { opacity: 0; transform: rotate(-70deg) scale(0.5); }
[data-theme="dark"] .ic-sun { opacity: 0; transform: rotate(70deg) scale(0.5); }
[data-theme="dark"] .ic-moon { opacity: 1; transform: rotate(0) scale(1); }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex;
  background: var(--tabbar-bg);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px 7px;
  background: none; border: 0; cursor: pointer;
  color: var(--muted); font-family: inherit;
  font-size: 11px; font-weight: 600; letter-spacing: .01em;
  touch-action: manipulation;
  transition: color .2s ease;
}
.tab-ic { display: grid; place-items: center; width: 52px; height: 28px; border-radius: 999px; transition: background-color .2s ease; }
.tab-ic svg { width: 22px; height: 22px; }
.tab:active .tab-ic { transform: scale(0.94); }
.tab.active { color: var(--accent-text); }
.tab.active .tab-ic { background: var(--accent-soft); }

/* ---------- Main / panels ---------- */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 16px calc(92px + env(safe-area-inset-bottom));
}
.panel { animation: rise .3s cubic-bezier(.2,.7,.3,1); }
.panel[hidden] { display: none; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Hero ---------- */
.hero {
  display: flex; flex-direction: column-reverse; gap: 0;
  background: var(--hero-bg); color: var(--hero-text);
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 26px;
}
.hero-img {
  width: 100%; max-height: 300px; object-fit: cover; object-position: center 20%;
  display: block;
}
.hero-copy { padding: 20px 20px 22px; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #7dd3c8; margin-bottom: 6px; font-weight: 700; }
.hero h1 { font-size: clamp(26px, 7vw, 34px); letter-spacing: -0.02em; margin-bottom: 8px; }
.hero-sub { color: rgba(248, 250, 252, 0.75); font-size: 15px; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 12.5px; font-weight: 600;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e6f6f3;
}

/* ---------- Sections ---------- */
.sec-title {
  font-size: 20px; letter-spacing: -0.01em;
  margin: 30px 0 12px;
}
.sec-intro { color: var(--muted); margin-bottom: 16px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.card h3 { font-size: 16.5px; margin-bottom: 6px; }
.card.slim { padding: 16px 18px; }
.slim-title { font-size: 15px; margin-bottom: 8px; }

/* mode cards */
.mode-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.mode-card .mode-time {
  display: inline-block;
  font-size: 12.5px; font-weight: 700; color: var(--accent-text);
  background: var(--accent-soft);
  border-radius: 999px; padding: 4px 11px;
  margin-bottom: 10px;
}
.mode-card p:last-child { color: var(--muted); font-size: 14.5px; }
.mode-card.accent { border-color: var(--accent); }

/* rules list */
.rules { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 10px; }
.rule {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 15px;
  box-shadow: var(--shadow-sm);
  font-size: 14.5px;
}
.rule-ic { font-size: 20px; line-height: 1.3; flex: none; }

/* plain lists */
ul.plain { margin: 0; padding-left: 2px; list-style: none; font-size: 14.5px; }
ul.plain li { padding: 5px 0 5px 22px; position: relative; }
ul.plain li::before {
  content: ""; position: absolute; left: 4px; top: 12px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}
ul.flags { margin: 4px 0 0; padding: 0; list-style: none; font-size: 14.5px; }
ul.flags li { padding: 5px 0; }
ol.num-list { margin: 0 0 4px; padding-left: 20px; font-size: 14.5px; }
ol.num-list li { padding: 4px 0; }

/* ---------- CTA row / buttons ---------- */
.cta-row { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 20px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 4px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 15px; font-weight: 650;
  padding: 12px 18px; border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  touch-action: manipulation;
  transition: transform .15s ease, filter .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: linear-gradient(135deg, #0d9488, #0f766e);
  color: #fff; box-shadow: 0 6px 18px rgba(13, 148, 136, 0.35);
}
[data-theme="dark"] .btn.primary { background: linear-gradient(135deg, #14b8a6, #0d9488); color: #04211d; }
.btn.ghost { background: transparent; color: var(--accent-text); border-color: var(--accent); }
.btn.line { background: var(--surface); border-color: var(--border); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Steps ---------- */
.steps-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.step { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.step-ph {
  background: var(--surface-2);
  display: grid; place-items: center;
  padding: 14px 14px 8px;
}
.step-ph img { max-height: 210px; width: auto; max-width: 100%; }
.step-ph img.tiny { max-height: 90px; }
.step-ph.lcd-ph { padding: 22px 14px; }
.step-body { padding: 12px 16px 16px; display: flex; gap: 11px; align-items: flex-start; }
.step-body p { font-size: 14.5px; margin: 0; }
.step-num {
  flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-text);
  font-size: 13px; font-weight: 800;
  display: grid; place-items: center;
  margin-top: 1px;
}

/* notes row */
.notes-row { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 6px; }
.note { display: flex; gap: 13px; align-items: center; padding: 13px; }
.note img { width: 74px; height: 74px; object-fit: contain; border-radius: 10px; background: var(--surface-2); flex: none; padding: 4px; }
.note img.tiny { width: 52px; height: 62px; }
.note p { font-size: 13.8px; margin: 0; }

/* ---------- Callouts ---------- */
.callout {
  display: flex; gap: 12px; align-items: flex-start;
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  margin: 14px 0;
  font-size: 14.5px;
  border: 1px solid;
}
.callout.warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }
.callout.danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-text); }
.callout.info { background: var(--info-bg); border-color: var(--info-border); color: var(--info-text); }
.callout-img { width: 26px; height: auto; flex: none; border-radius: 4px; }

/* ---------- LCD mock ---------- */
.lcd {
  display: grid; grid-template-columns: 1fr auto;
  gap: 8px 14px; align-items: center;
  background: var(--lcd-bg);
  border: 1px solid rgba(123, 245, 156, 0.25);
  border-radius: 10px;
  padding: 12px 16px;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  min-width: 220px;
  box-shadow: inset 0 2px 10px rgba(0,0,0,.55), 0 0 18px rgba(123, 245, 156, 0.08);
}
.lcd-seg {
  font-size: 11px; letter-spacing: .12em; color: rgba(123, 245, 156, 0.4);
}
.lcd-time {
  grid-row: 1 / span 3; justify-self: end;
  font-size: 34px; font-weight: 700; color: var(--lcd-on);
  text-shadow: 0 0 12px rgba(123, 245, 156, 0.55);
}

/* ---------- Accordions ---------- */
.acc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.acc summary {
  list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px;
  font-size: 15px; font-weight: 650;
  cursor: pointer;
  touch-action: manipulation;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after {
  content: "";
  flex: none;
  width: 9px; height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .25s ease;
  margin-right: 3px;
}
.acc[open] summary::after { transform: rotate(-135deg); }
.acc[open] summary { color: var(--accent-text); }
.acc ul.plain { padding: 0 16px 14px 16px; }

/* ---------- Support / footer ---------- */
.support .btn-row .btn { flex: 1 1 auto; }
.footer {
  max-width: 960px; margin: 0 auto;
  padding: 8px 16px calc(96px + env(safe-area-inset-bottom));
  color: var(--muted); font-size: 12.5px;
}
.footer strong { color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: 12.8px; }

/* ---------- Responsive: ≥ 700px ---------- */
@media (min-width: 700px) {
  body { font-size: 17px; }
  main { padding: 26px 24px 60px; }
  .footer { padding: 8px 24px 60px; }

  /* tab bar becomes a sticky pill bar under the appbar */
  .tabbar {
    position: sticky; top: calc(54px + env(safe-area-inset-top));
    justify-content: center; gap: 6px;
    padding: 9px 16px;
    border-top: 0; border-bottom: 1px solid var(--border);
  }
  .tab {
    flex: 0 1 auto; flex-direction: row; gap: 8px;
    padding: 8px 16px; border-radius: 999px;
    font-size: 13.5px;
  }
  .tab-ic { width: 24px; height: 24px; }
  .tab-ic svg { width: 19px; height: 19px; }
  .tab.active { background: var(--surface); box-shadow: var(--shadow-sm); }
  .tab.active .tab-ic { background: transparent; }

  .hero { flex-direction: row; align-items: stretch; }
  .hero-img { width: 42%; max-height: none; object-fit: cover; }
  .hero-copy { padding: 34px 30px; display: flex; flex-direction: column; justify-content: center; }

  .mode-grid { grid-template-columns: repeat(3, 1fr); }
  .steps-grid { grid-template-columns: 1fr 1fr; }
  .steps-grid.two { grid-template-columns: 1fr 1fr; }
  .notes-row { grid-template-columns: repeat(3, 1fr); }
  .cta-row { flex-direction: row; }
  .cta-row .btn { flex: 1; }
}

@media (min-width: 1000px) {
  .steps-grid { grid-template-columns: 1fr 1fr 1fr; }
  .steps-grid.two { grid-template-columns: 1fr 1fr; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .panel { animation: none; }
  .theme-toggle .ic, .acc summary::after, .btn, .tab, .tab-ic { transition: none; }
}
