/* Tavvi Guides: generated into web/public/guides/guides.css by scripts/build_guides.mjs.
   Edit web/guides_src/template/guides.css, never the copy under web/public.
   Design: the app's warm coral-on-cream identity (DESIGN.md warm light) with the
   numbered-step language of KayoteeHowItWorksSheet, mobile-first because most reads
   happen inside the app's webview sheet (?embed=1). */

:root {
  --brand: #C96B58;
  --brand-deep: #B25B48;
  --brand-tint: #FDDDD6;
  --bg: #FAF5EF;
  --bg-tint: #FCF8F2;
  --surface: #FFFCF8;
  --text: #271F1B;
  --text-muted: #65564C;
  --text-soft: #65564C;
  --border: #D6CCC4;
  --border-strong: #A39282;
  --pill-text: #3B1106;
  --warn-bg: #FBEFE3;
  --warn-border: #E8B27D;
  --warn-text: #7A4A12;
  --good-bg: #EDF3EA;
  --good-border: #9DBE90;
  --good-text: #3D5C33;
  --chip-bg: #EFE2D2;
  --chip-border: #A39282;
  --shadow-card: 0 1px 2px rgba(39, 31, 27, 0.04), 0 8px 24px rgba(39, 31, 27, 0.06);
  --nav-bg: rgba(255, 252, 248, 0.82);
}

/* Dark palette. The in-app webview passes ?theme= (embedded_web_sheet.dart) so
   the page follows the APP's light/dark, NOT the device OS:
   - .theme-light (app in light) ALWAYS wins → light even on an OS-dark phone
     (the exact bug the owner flagged 2026-07-22).
   - .theme-dark (app in dark) forces dark even on an OS-light phone.
   - No class (public web visit) → prefers-color-scheme decides.
   The two dark selectors can't be merged (one lives inside @media, one doesn't),
   so the block is intentionally duplicated: keep the values in sync. */
@media (prefers-color-scheme: dark) {
  :root:not(.theme-light) {
    --brand: #DA8168;
    --brand-deep: #E2937D;
    --brand-tint: #5C2E20;
    --bg: #171110;
    --bg-tint: #1A1412;
    --surface: #2B2320;
    --text: #F5F0ED;
    --text-muted: #A39890;
    --text-soft: #A39890;
    --border: #3D352F;
    --border-strong: #524640;
    --pill-text: #FDDDD6;
    --warn-bg: #33270F;
    --warn-border: #8A6A33;
    --warn-text: #EFC98C;
    --good-bg: #1F2B1A;
    --good-border: #4E6B42;
    --good-text: #B4D0A6;
    --chip-bg: #382F2A;
    --chip-border: #524640;
    --shadow-card: none;
    --nav-bg: rgba(23, 17, 16, 0.82);
  }
}
:root.theme-dark {
  --brand: #DA8168;
  --brand-deep: #E2937D;
  --brand-tint: #5C2E20;
  --bg: #171110;
  --bg-tint: #1A1412;
  --surface: #2B2320;
  --text: #F5F0ED;
  --text-muted: #A39890;
  --text-soft: #A39890;
  --border: #3D352F;
  --border-strong: #524640;
  --pill-text: #FDDDD6;
  --warn-bg: #33270F;
  --warn-border: #8A6A33;
  --warn-text: #EFC98C;
  --good-bg: #1F2B1A;
  --good-border: #4E6B42;
  --good-text: #B4D0A6;
  --chip-bg: #382F2A;
  --chip-border: #524640;
  --shadow-card: none;
  --nav-bg: rgba(23, 17, 16, 0.82);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: 'ss01', 'cv02', 'cv11';
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* ── Site chrome (hidden in ?embed=1) ─────────────────────────────── */
.gnav {
  position: sticky; top: 0; z-index: 20;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.gnav-inner {
  max-width: 720px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 10px;
}
.gnav-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); font-size: 16px; }
.gnav-brand img { width: 24px; height: 24px; border-radius: 6px; }
.gnav-sep { color: var(--text-soft); font-weight: 400; }
.gnav-guides { color: var(--text-muted); font-weight: 600; font-size: 15px; }
.gnav-spacer { flex: 1; }
.lang-switch { display: flex; gap: 2px; background: var(--bg-tint); border: 1px solid var(--border); border-radius: 999px; padding: 2px; }
.lang-switch a {
  padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: var(--text-muted);
}
.lang-switch a:hover { text-decoration: none; color: var(--text); }
.lang-switch a[aria-current="true"] { background: var(--surface); color: var(--pill-text); box-shadow: var(--shadow-card); }

html.embed .gnav, html.embed .gfoot, html.embed .crumbs, html.embed .app-cta { display: none; }
html.embed .guide-head { padding-top: 8px; }

/* ── Breadcrumbs ──────────────────────────────────────────────────── */
.crumbs { padding: 18px 0 0; font-size: 13.5px; color: var(--text-soft); }
.crumbs a { color: var(--text-soft); }
.crumbs a:hover { color: var(--brand-deep); }

/* ── Guide header ─────────────────────────────────────────────────── */
.guide-head { padding: 22px 0 6px; }
.guide-kicker {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--pill-text);
  background: var(--brand-tint); border-radius: 999px; padding: 4px 12px; margin-bottom: 14px;
}
.guide-head h1 { font-size: 28px; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
.guide-summary { margin-top: 10px; font-size: 16.5px; color: var(--text-muted); }
.guide-meta { margin-top: 14px; font-size: 13px; color: var(--text-soft); display: flex; gap: 14px; flex-wrap: wrap; }

/* ── Article body ─────────────────────────────────────────────────── */
.guide-body { padding: 10px 0 32px; }
.guide-body h2 {
  font-size: 20px; font-weight: 700; letter-spacing: -0.01em;
  margin: 34px 0 12px; padding-top: 18px; border-top: 1px solid var(--border);
}
.guide-body h2:first-child { border-top: none; margin-top: 12px; padding-top: 0; }
.guide-body h3 { font-size: 16.5px; font-weight: 650; margin: 22px 0 8px; }
.guide-body p { margin: 12px 0; }
.guide-body ul { margin: 12px 0 12px 22px; }
.guide-body ul li { margin: 6px 0; }
.guide-body hr { border: none; border-top: 1px solid var(--border); margin: 26px 0; }
.guide-body strong { font-weight: 650; }

/* Numbered steps: the app's HowItWorks step-card language */
.steps { list-style: none; margin: 16px 0; counter-reset: step; }
.steps > li {
  counter-increment: step;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px 14px 58px;
  margin: 10px 0;
  box-shadow: var(--shadow-card);
}
.steps > li::before {
  content: counter(step);
  position: absolute; left: 14px; top: 13px;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--brand-tint); color: var(--pill-text);
  font-weight: 700; font-size: 14.5px;
  display: flex; align-items: center; justify-content: center;
}
.steps > li p { margin: 6px 0 0; }
.steps > li p:first-child { margin: 0; }

/* Callouts */
.callout {
  display: flex; gap: 12px; align-items: flex-start;
  border-radius: 14px; padding: 13px 16px; margin: 16px 0;
  font-size: 15px; line-height: 1.55;
  background: var(--bg-tint); border: 1px solid var(--border-strong); color: var(--text-muted);
}
.callout .co-ico { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.callout-tip { background: var(--good-bg); border-color: var(--good-border); color: var(--good-text); }
.callout-warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }
.callout-need { background: var(--brand-tint); border-color: var(--brand); color: var(--pill-text); }
.callout strong { font-weight: 700; }

/* UI chip: an exact in-app label, resolved from the app's own translations */
.ui {
  display: inline-block; padding: 1px 8px 2px; border-radius: 7px;
  background: var(--chip-bg); border: 1px solid var(--chip-border);
  font-size: 0.92em; font-weight: 600; color: var(--text); white-space: nowrap;
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em; background: var(--chip-bg); border: 1px solid var(--chip-border);
  border-radius: 6px; padding: 1px 6px 2px;
}

/* ── Hub / index pages ────────────────────────────────────────────── */
.hub-hero { padding: 34px 0 8px; }
.hub-hero h1 { font-size: 30px; font-weight: 750; letter-spacing: -0.015em; line-height: 1.2; }
.hub-hero p { margin-top: 10px; font-size: 16.5px; color: var(--text-muted); max-width: 560px; }
.aud-toggle { display: flex; gap: 8px; margin: 22px 0 4px; }
.aud-toggle a {
  padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  border: 1px solid var(--border-strong); color: var(--text-muted); background: var(--surface);
}
.aud-toggle a:hover { text-decoration: none; border-color: var(--brand); color: var(--brand-deep); }
.aud-toggle a[aria-current="true"] { background: var(--brand); border-color: var(--brand); color: #FFFDFA; }

.cat-section { padding: 22px 0 4px; }
.cat-section h2 { font-size: 14px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-soft); margin-bottom: 12px; }
.gcards { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .gcards { grid-template-columns: 1fr 1fr; } }
.gcard {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 16px; box-shadow: var(--shadow-card);
  color: var(--text); transition: border-color 120ms ease, transform 120ms ease;
}
.gcard:hover { text-decoration: none; border-color: var(--brand); transform: translateY(-1px); }
.gcard h3 { font-size: 16px; font-weight: 650; line-height: 1.35; }
.gcard p { margin-top: 6px; font-size: 14px; color: var(--text-muted); line-height: 1.5; }
.gcard .gmin { display: inline-block; margin-top: 10px; font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
/* Platform badge: flags guides whose content only applies on one platform
   (e.g. Tap to Pay on iPhone), on hub cards and in the guide meta row. */
.gplatform { display: inline-block; margin-top: 10px; margin-left: 8px; padding: 2px 8px; font-size: 11.5px; font-weight: 650; color: var(--brand); border: 1px solid var(--brand); border-radius: 999px; }
.guide-meta .gplatform { margin-top: 0; }

/* ── Prev / next + app CTA + footer ───────────────────────────────── */
.pn { display: flex; gap: 10px; margin: 8px 0 26px; }
.pn a {
  flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 14px; color: var(--text); font-size: 14px;
}
.pn a:hover { text-decoration: none; border-color: var(--brand); }
.pn .pn-label { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-soft); margin-bottom: 3px; }
.pn .pn-next { text-align: right; }

.app-cta {
  background: var(--brand-tint); border: 1px solid var(--brand); border-radius: 16px;
  padding: 18px; margin: 6px 0 30px; text-align: center;
}
.app-cta p { color: var(--pill-text); font-weight: 600; font-size: 15px; }
.app-cta a {
  display: inline-block; margin-top: 10px; background: var(--brand); color: #FFFDFA;
  font-weight: 650; font-size: 14.5px; padding: 9px 22px; border-radius: 999px;
}
.app-cta a:hover { text-decoration: none; background: var(--brand-deep); }

.gfoot { border-top: 1px solid var(--border); padding: 22px 0 34px; margin-top: 10px; }
.gfoot-inner { max-width: 720px; margin: 0 auto; padding: 0 20px; font-size: 13.5px; color: var(--text-soft); display: flex; gap: 16px; flex-wrap: wrap; }
.gfoot-inner a { color: var(--text-soft); }
.gfoot-inner a:hover { color: var(--brand-deep); }

@media (min-width: 700px) {
  .guide-head h1 { font-size: 32px; }
  .hub-hero h1 { font-size: 36px; }
}
