/* Jachega (MOS-023): one accent, system font, light + dark, mobile first. Every class used by app.js keeps its name
   (stage, overlay, rate, mode, opt, btn, card, thumb, cats, paste, tryon, notice ...) so the MOS-019..022 flows are untouched. */
:root {
  --bg: #faf7f3;
  --surface: #ffffff;
  --surface-2: #f3eee8;
  --ink: #1c1715;
  --muted: #6a5f58;
  --line: #e7dfd6;
  --accent: #9c1f55;
  --accent-ink: #ffffff;
  --accent-soft: #fbe9f0;
  --ok: #1f7a4d;
  --err: #b3261e;
  --badge-bg: rgba(28, 23, 21, 0.78);
  --shadow: 0 1px 2px rgba(28, 23, 21, .06), 0 8px 24px rgba(28, 23, 21, .06);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121010;
    --surface: #1c1818;
    --surface-2: #262020;
    --ink: #f4eee9;
    --muted: #b5a9a0;
    --line: #342c29;
    --accent: #ff8fb8;
    --accent-ink: #2a0b18;
    --accent-soft: #3a1726;
    --ok: #6fd39a;
    --err: #ff8a80;
    --badge-bg: rgba(0, 0, 0, 0.72);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121010;
  --surface: #1c1818;
  --surface-2: #262020;
  --ink: #f4eee9;
  --muted: #b5a9a0;
  --line: #342c29;
  --accent: #ff8fb8;
  --accent-ink: #2a0b18;
  --accent-soft: #3a1726;
  --ok: #6fd39a;
  --err: #ff8a80;
  --badge-bg: rgba(0, 0, 0, 0.72);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* the hidden attribute must win over display: flex rules below */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -48px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 20; text-decoration: none; }
.skip:focus { top: 8px; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; padding: 6px 16px; background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 19px; line-height: 1; flex: none; }
.wordmark { font-weight: 700; font-size: 19px; letter-spacing: -.01em; line-height: 1.1; }
.brand .line { display: block; font-weight: 400; font-size: 12px; color: var(--muted); line-height: 1.2; }
@media (max-width: 419px) { .brand .line { display: none; } }
.iconbtn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; padding: 0; }
.iconbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 2px 8px; }

main { max-width: 1120px; margin: 0 auto; padding: 16px; }
@media (min-width: 768px) { main { padding: 24px; } }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.015em; }
.hint { font-size: 13px; color: var(--muted); margin: 8px 0; }
.fitnote { font-size: 12px; color: var(--muted); margin: 0; }
.err { color: var(--err); font-weight: 600; }
.row { display: flex; gap: 8px; }
.row .btn { flex: 1; margin: 0; }
.big { font-size: 18px; font-weight: 600; margin: 24px 0 4px; text-align: center; }

/* ---------- buttons and chips ---------- */
.btn { display: block; width: 100%; min-height: 48px; margin: 0 0 10px; padding: 0 18px; border-radius: 12px; border: 0; font-weight: 600; background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; text-align: center; line-height: 48px; transition: transform .12s ease, filter .12s ease; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.inline { display: inline-block; width: auto; margin: 0; }
.btn.buy { display: block; text-align: center; text-decoration: none; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; min-height: 24px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { min-width: 48px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: border-color .12s ease, background .12s ease; }
.opt:hover { border-color: var(--muted); }
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--accent); }
.sw { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); }
.seg { display: inline-flex; padding: 4px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; gap: 2px; }
.seg .opt { border: 0; min-height: 40px; padding: 6px 20px; background: transparent; box-shadow: none; }
.seg .opt[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: none; }

/* ---------- home: hero ---------- */
.hero { display: grid; gap: 22px; padding: 10px 0 8px; align-items: center; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.05fr .95fr; gap: 40px; padding: 24px 0 16px; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.eyebrow .dev { font-size: 15px; color: var(--accent); font-weight: 700; }
.hero h1 { font-size: clamp(30px, 7vw, 50px); line-height: 1.05; letter-spacing: -.025em; margin: 0 0 12px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { font-size: 17px; color: var(--muted); margin: 0 0 18px; max-width: 46ch; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 6px; }
.cta .btn { width: auto; margin: 0; padding: 0 22px; }
.demo { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px; box-shadow: var(--shadow); }
.pair { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shot { position: relative; }
.shot img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 12px; background: var(--surface-2); }
.shot .lab { display: block; margin-top: 8px; font-size: 13px; color: var(--muted); text-align: center; }
.shot .lab strong { color: var(--ink); font-weight: 600; }
.pair .arrow { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; box-shadow: var(--shadow); z-index: 1; }
.demo .foot-note { margin: 10px 2px 0; font-size: 12px; color: var(--muted); }

.steps { display: grid; gap: 10px; margin: 22px 0 8px; }
@media (min-width: 640px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
.step-card { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.step-card .n { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; }
.step-card h2 { font-size: 16px; margin-bottom: 2px; }
.step-card p { margin: 0; font-size: 14px; color: var(--muted); }
.trust { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 26px; }
.trust span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: var(--surface); }
.trust span::before { content: "✓"; color: var(--ok); font-weight: 700; }

/* ---------- home: shop ---------- */
.shop { scroll-margin-top: 64px; }
.shop-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; }
.shop-head h2 { font-size: 24px; }
.prefs { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 14px; }
.shopfor { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.shopfor .label { font-weight: 600; font-size: 14px; min-width: 88px; }
.shopfor.body .opt { min-height: 40px; padding: 6px 12px; font-size: 13px; }
#body-note { margin: 0; }
.cats { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px 6px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats .opt { white-space: nowrap; flex: none; }
#catalog-note { margin: 0 0 12px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; } }
.card { display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card h3 { font-size: 14px; font-weight: 600; margin: 10px 10px 2px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card p { font-size: 13px; color: var(--muted); margin: 0 10px 6px; }
.card .price { font-size: 13px; color: var(--ink); margin: 0 10px 4px; font-weight: 600; }
.card .price span { color: var(--muted); font-weight: 400; }
.card .fitnote { margin: 0 10px 12px; }
.thumb { position: relative; aspect-ratio: 3 / 4; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.flatimg { background: #fff; }
.thumb.flatimg img { object-fit: contain; }
.badge { position: absolute; left: 8px; top: 8px; background: var(--badge-bg); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; }
.card .thumb .onme { position: absolute; right: 8px; bottom: 8px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; }

.paste { margin-top: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 14px; }
.paste summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.paste .row { gap: 8px; margin: 8px 0; }
.paste input { flex: 1; min-width: 0; min-height: 46px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; font: inherit; background: var(--bg); color: var(--ink); }
.paste .btn { flex: none; width: auto; padding: 0 16px; margin: 0; }
.pcard { display: flex; gap: 12px; align-items: flex-start; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 12px; }
.pcard img { width: 96px; height: 128px; object-fit: contain; background: #fff; border-radius: 8px; flex: none; }
.pcard .btn { display: inline-block; width: auto; padding: 0 14px; line-height: 40px; min-height: 40px; margin-top: 8px; text-decoration: none; }

/* ---------- category landing page ---------- */
.cat-intro { padding: 6px 0 14px; }
.cat-intro h1 { font-size: clamp(26px, 5vw, 36px); margin-bottom: 8px; }
.cat-intro p { color: var(--muted); margin: 0 0 8px; max-width: 70ch; }
.crumbs { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.crumbs a { text-decoration: none; }
.more-cats { margin: 26px 0 0; }
.more-cats h2 { font-size: 18px; margin-bottom: 8px; }
.more-cats .opt { text-decoration: none; }

/* ---------- product page ---------- */
.back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 4px; color: var(--muted); text-decoration: none; font-size: 14px; }
.pdp { display: grid; gap: 16px; }
@media (min-width: 880px) { .pdp { grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; } }
.pdp h1 { font-size: 20px; line-height: 1.25; margin: 0 0 2px; min-height: 50px; }
.meta { color: var(--muted); margin: 0 0 10px; font-size: 14px; min-height: 21px; }
.desc { color: var(--muted); margin: 0 0 14px; }
/* MOS-022: the preview is the page. The stage is capped at 70% of the screen height so that, with its top under the header,
   the Buy button and the rating bar fit below it on a 375 x 667 phone; after a fresh result the page scrolls to the stage. */
.stage { position: relative; margin: 0 auto 10px; border-radius: 16px; overflow: hidden; background: var(--surface-2); aspect-ratio: 2 / 3; width: min(100%, calc(70vh * 2 / 3)); scroll-margin-top: 64px; box-shadow: var(--shadow); }
.stage img { width: 100%; height: 100%; object-fit: cover; }
.stage.flatimg { background: #fff; }
.stage.flatimg img { object-fit: contain; }
.stage .fitnote { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 8px 10px; background: var(--badge-bg); color: #fff; }
.aff { font-size: 12px; color: var(--muted); margin: 0 0 6px; text-align: center; min-height: 18px; }
.aff.pending { visibility: hidden; }
.shown { font-size: 13px; color: var(--muted); margin: 0 0 10px; min-height: 39px; }
.mode { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.picker { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.picker legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.flat { margin-top: 16px; }
.flat p { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.flat img { max-width: 220px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.thanks { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; }

/* MOS-019 Addendum C: on-me state on the page */
.overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, .62); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; text-align: center; }
.overlay .big { color: #fff; margin: 0 0 6px; }
.overlay .hint { color: #eee; }
.overlay .row { width: 100%; max-width: 320px; margin-top: 12px; }
.overlay .btn.ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.4); }
/* MOS-022: slim rating bar under the Buy button, collapsed until tapped, shown 3 s after the image (space reserved: no jump) */
.rate { border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; margin: 0 0 10px; background: var(--surface); }
.rate summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; }
.rate summary::-webkit-details-marker { display: none; }
.rate[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.rate.pending { visibility: hidden; }
.rate .hint { margin: 0 0 8px; }
.rate .btn { margin-bottom: 12px; }
.rate-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; font-size: 14px; }
.rate-row .opt { min-width: 44px; padding: 6px 0; justify-content: center; }

/* MOS-019 "See it on me" dialog */
.tryon { width: min(100%, 480px); max-width: calc(100% - 24px); max-height: 92vh; overflow: auto; border: 0; border-radius: 18px; padding: 18px; background: var(--surface); color: var(--ink); position: relative; box-shadow: var(--shadow); }
.tryon::backdrop { background: rgba(0, 0, 0, .6); }
.tryon-close { position: absolute; right: 8px; top: 8px; margin: 0; z-index: 3; }  /* Addendum A */
.tryon .x { width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); font-size: 24px; line-height: 1; color: var(--ink); cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.tryon h2 { margin: 0 40px 8px 0; font-size: 20px; }
.tryon p { margin: 0 0 10px; font-size: 14px; }
.notice { padding-left: 18px; font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.notice li { margin-bottom: 6px; }
.notice a { color: var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 0 0 12px; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--accent); }

/* ---------- PWA: add to home screen bar ---------- */
.a2hs { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 6; display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow); }
.a2hs img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.a2hs p { margin: 0; font-size: 14px; flex: 1; }
.a2hs p small { display: block; color: var(--muted); font-size: 12px; }
.a2hs .btn { width: auto; margin: 0; min-height: 40px; line-height: 40px; padding: 0 14px; }
@media (min-width: 640px) { .a2hs { left: auto; max-width: 440px; } }

/* ---------- legal and simple pages ---------- */
.legal { max-width: 760px; }
.legal h1 { font-size: clamp(26px, 5vw, 36px); margin: 6px 0 14px; }
.legal h2 { font-size: 20px; margin: 26px 0 8px; }
.legal p, .legal li { font-size: 15px; }
.legal p { margin: 0 0 12px; }
.legal ul { padding-left: 20px; margin: 0 0 12px; }
.legal li { margin-bottom: 6px; }
.legal a { color: var(--accent); }
.legal .tablewrap { overflow-x: auto; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 12px; }
.legal table { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 560px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.legal th { background: var(--surface-2); font-weight: 600; }
.legal tr:last-child td { border-bottom: 0; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; }
.legal-nav a { text-decoration: none; }
.offline-box { text-align: center; padding: 60px 0; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 22px 16px 28px; font-size: 13px; color: var(--muted); }
.foot .in { max-width: 1120px; margin: 0 auto; display: grid; gap: 10px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.foot nav a { text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.foot nav a:hover { color: var(--ink); text-decoration: underline; }
.foot p { margin: 0; }
.foot .brandline { color: var(--ink); font-weight: 600; }
