:root {
  /* G2 — eucalyptus · sand · terracotta on warm cream */
  --bg-1: #f5eee1;
  --bg-2: #f1e9d8;
  --bg-3: #e8dcc6;
  --card: #fffdf8;
  --ink: #2c3a34;
  --muted: #8a8478;
  --line: #e7dcc6;

  /* eucalyptus = primary brand / products */
  --coral-1: #4f7286;
  --coral-2: #3a5666;       /* accent ink: links, active text, focus */
  --grad: #4f7286;          /* solid primary for filled buttons/pills */
  --acc-soft: #e0e8ec;

  --prod: #4f7286;        /* products: eucalyptus  */
  --prod-bg: #e0e8ec;
  --food: #c79a4e;        /* food: sand / gold     */
  --food-bg: #f6ead2;
  --symp: #8a6a55;        /* skin: soft clay (calm, not alarming) */
  --symp-bg: #efe7e0;
  --symp-ink: #6f5544;    /* readable text on --symp-bg */
  --alert: #d2694e;       /* reserved: strong breakout / high risk */
  --alert-bg: #f6e1da;

  --serif: "Lora", Georgia, "Times New Roman", "Noto Serif", serif;
  --radius: 18px;
  /* layered, low-opacity shadows read as “premium” depth, not a hard drop */
  --shadow:
    0 1px 1px rgba(70,55,35,.04),
    0 4px 10px rgba(70,55,35,.05),
    0 16px 34px rgba(70,55,35,.06);
  --shadow-hover:
    0 2px 4px rgba(70,60,40,.06),
    0 10px 22px rgba(79,114,134,.12),
    0 24px 48px rgba(79,114,134,.13);
  --hairline: rgba(70,55,35,.07);   /* crisp 1px edge on top of shadow */
}

* { box-sizing: border-box; }

/* crisp hairline on every raised surface — pairs with the soft layered shadow */
.card, .home-today, .day-card, .product-item, .summary, .finding,
.nav-card, .hstep, .progress-card, .modal, .onb-card, .prod-results {
  border: 1px solid var(--hairline);
}
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--ink);
  letter-spacing: -.005em;
  line-height: 1.5;
  background: var(--bg-1);
  background-image:
    radial-gradient(1200px 600px at 100% -10%, rgba(79,114,134,.06), transparent 60%),
    radial-gradient(900px 500px at -10% 0%, rgba(79,114,134,.05), transparent 55%),
    linear-gradient(180deg, #faf5ea, var(--bg-1) 240px);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* serif headings: tighter optical tracking + richer ink reads editorial/premium */
.brand, .diary-title, .home-hero h1, h2, .section-title,
.welcome-title, .onb-head h2, .ht-day, .day-weekday, .wc-num {
  letter-spacing: -.01em;   /* Lora is warmer/wider than Playfair — less tightening */
}

/* ---------------- top bar ---------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 20px 12px;
  background: var(--grad); color: #fff; position: sticky; top: 0; z-index: 20;
}
.brand { font-family: var(--serif); font-size: 20px; font-weight: 700; color: #fff; letter-spacing: .1px; display: flex; align-items: center; gap: 9px; }
.brand .brand-mark { color: #fff; }
.lang-select {
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.14); color: #fff;
  font-weight: 700; font-size: 13px; padding: 6px 24px 6px 11px; border-radius: 999px; cursor: pointer;
  -webkit-appearance: none; appearance: none; font-family: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 12px;
}
.top-actions { display: flex; align-items: center; gap: 8px; }
.menu-btn { border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.14); color: #fff; width: 36px; height: 32px;
  border-radius: 999px; cursor: pointer; display: grid; place-items: center; }
.menu-btn .ico { width: 19px; height: 19px; }

/* diary hero (calm header) — continues the blue topbar */
.diary-hero { background: var(--grad); color: #fff; padding: 2px 22px 16px; border-radius: 0 0 26px 26px; }
.diary-hero.hidden { display: none; }
.hero-date { font-size: 12.5px; opacity: .8; }
.hero-h { font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.2; margin: 3px 0; max-width: 300px; color: #fff; opacity: .95; }
.hero-sub { font-size: 12.5px; opacity: .68; line-height: 1.4; max-width: 330px; margin-bottom: 2px; }
.hero-sub.hidden { display: none; }
.hero-cta { display: inline-flex; align-items: center; gap: 8px; background: #fff; color: #3a5666;
  border: none; border-radius: 14px; padding: 13px 20px; font-size: 14.5px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.hero-cta .ico { width: 18px; height: 18px; }

/* bottom tab bar (app-like) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom)); }
.tab { border: none; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 4px 18px; transition: .15s; }
.tab .ico { width: 21px; height: 21px; }
.tab.active { color: var(--coral-2); }

/* insight card on the diary home */
#diary-insight:empty { display: none; }
.insight-card {
  width: 100%; margin-top: 14px; display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; cursor: pointer; text-align: left;
  color: var(--muted); animation: riseIn .3s cubic-bezier(.22,.61,.36,1) both;
}
.insight-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.insight-ico { flex: none; display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 11px; background: var(--acc-soft); color: var(--coral-2); }
.insight-ico .ico { width: 20px; height: 20px; }
.insight-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.insight-body b { color: var(--ink); font-size: 14.5px; }
.insight-verdict { font-size: 12.5px; font-weight: 700; }
.insight-verdict.r4 { color: #a8412c; } .insight-verdict.r3 { color: #8a5e1f; }

/* first-run coach tip — fixed dark bubble so white text is readable in BOTH themes
   (var(--ink) flips light in dark mode, which made it white-on-light) */
.coach {
  position: absolute; z-index: 85; background: #243029; color: #fff;
  border-radius: 14px; padding: 13px 15px; box-shadow: 0 12px 32px rgba(0,0,0,.3);
  animation: popIn .22s ease both;
}
.coach-text { font-size: 13.5px; font-weight: 600; line-height: 1.4; margin-bottom: 10px; }
.coach-ok { border: none; background: rgba(255,255,255,.16); color: #fff; border-radius: 9px;
  padding: 7px 14px; font-size: 13px; font-weight: 700; cursor: pointer; }
.coach-ok:hover { background: rgba(255,255,255,.26); }
.coach-arrow { position: absolute; bottom: -7px; width: 14px; height: 14px;
  background: #243029; transform: rotate(45deg); border-radius: 2px; }
.coach-glow { animation: coachGlow 1.4s ease-in-out infinite; }
@keyframes coachGlow {
  0%,100% { box-shadow: var(--shadow); }
  50% { box-shadow: 0 0 0 3px rgba(79,114,134,.35), var(--shadow); }
}

/* continuity chip */
.streak-chip {
  display: flex; width: fit-content; align-items: center; gap: 6px; margin: 14px 0 16px;
  background: var(--acc-soft); color: var(--coral-2);
  border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 700;
  letter-spacing: .2px; animation: popIn .25s ease both;
}
.streak-chip.hidden { display: none; }
.streak-chip .ico { width: 14px; height: 14px; }

/* milestone celebration popup */
.celebrate { text-align: center; padding: 8px 6px 4px; }
.celebrate-mark {
  width: 66px; height: 66px; margin: 0 auto 16px; border-radius: 20px;
  display: grid; place-items: center; color: #fff; background: var(--grad);
  box-shadow: 0 10px 26px rgba(79,114,134,.32); animation: pop .3s ease both;
}
.celebrate-mark .ico { width: 32px; height: 32px; stroke-width: 1.7; }
.celebrate-title { font-family: var(--serif); font-size: 21px; font-weight: 700; margin: 0 0 8px; }
.celebrate-text { color: var(--muted); font-size: 14.5px; line-height: 1.5; margin: 0 auto 22px; max-width: 340px; }
.celebrate-go { width: 100%; padding: 14px; font-size: 15px; }

/* diary header (motto, was the home hero) */
.diary-head { margin: 8px 0 26px; }
.diary-title { font-family: var(--serif); font-size: 32px; font-weight: 700; line-height: 1.12; margin: 0 0 10px; color: var(--ink); }
.diary-tagline { font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--muted); margin: 0; max-width: 560px; line-height: 1.5; }

/* topbar menu modal */
.menu-list { display: flex; flex-direction: column; gap: 2px; }
.menu-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: none;
  background: none; padding: 14px 12px; border-radius: 12px; font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer; }
.menu-row:hover { background: var(--bg-3); }
.menu-row span { display: inline-flex; color: var(--coral-2); }
.menu-row-state { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: lowercase; }
.menu-hint { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 10px 2px 0; }
.menu-theme { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.menu-theme-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink); }
.menu-theme-label .ico { color: var(--coral-2); }
.menu-legal { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.menu-legal a { color: var(--muted); text-decoration: none; }
.menu-legal a:hover { color: var(--coral-2); text-decoration: underline; }
.theme-seg { display: inline-flex; background: var(--bg-3); border-radius: 10px; padding: 3px; gap: 2px; }
.theme-seg button { border: none; background: none; cursor: pointer; padding: 6px 11px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); }
.theme-seg button.on { background: var(--card); color: var(--coral-2); box-shadow: var(--shadow); }
.acc-profile { border: 1.5px solid var(--line); margin-bottom: 14px; }

/* ---------------- icons ---------------- */
.ico {
  width: 1.05em; height: 1.05em; stroke: currentColor; stroke-width: 1.9; fill: none;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.16em; flex: none;
}
.ico-sm { width: .95em; height: .95em; vertical-align: -0.12em; }
.ico-x { width: .8em; height: .8em; vertical-align: -0.04em; }
.ico-g { width: 15px; height: 15px; vertical-align: -0.2em; }
.ico-lg { width: 26px; height: 26px; vertical-align: middle; }
.brand-mark { width: 22px; height: 22px; vertical-align: -0.2em; color: var(--coral-2); stroke: var(--coral-2); stroke-width: 1.9; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 3px; vertical-align: 0; }
.dot-hi { background: #d2694e; }
.dot-mid { background: #d9a441; }
.dot-low { background: #22c55e; }
.dot-unk { background: #b8b0c2; }
.comedo-head.unknown { color: #8d8597; }

main { max-width: 1120px; margin: 0 auto; padding: 22px 18px 90px; }
.view { display: none; }
.view.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------------- onboarding hero ---------------- */
.hero {
  background: var(--grad); color: #fff; border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 20px; position: relative;
  box-shadow: 0 10px 30px rgba(79,114,134,.28); overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(255,255,255,.25), transparent 70%); border-radius: 50%;
}
.hero h1 { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
.hero p { margin: 0; font-size: 14.5px; opacity: .95; max-width: 640px; }
.hero .steps { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.hero .step {
  background: rgba(255,255,255,.2); border-radius: 12px; padding: 8px 12px; font-size: 13px;
  font-weight: 600; backdrop-filter: blur(4px);
}
.hero .step b { display: block; font-size: 12px; opacity: .8; font-weight: 600; }
.hero-close {
  position: absolute; top: 12px; right: 14px; border: none; background: rgba(255,255,255,.25);
  color: #fff; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 14px;
}
.hero-close:hover { background: rgba(255,255,255,.4); }

/* ---------------- home / landing ---------------- */
.home-hero {
  padding: 8px 2px 4px; margin-bottom: 16px;
}
.home-hero h1 { margin: 0 0 10px; font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.14; color: var(--ink); }
.home-hero p { margin: 0; font-size: 15px; color: var(--muted); max-width: 560px; line-height: 1.5; }
.hero-tagline { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--ink) !important; max-width: 520px; }
.hiw-link { margin-top: 12px; border: none; background: none; padding: 0; color: var(--coral-2); font-weight: 700; font-size: 14px; cursor: pointer; }
.hiw-link:hover { text-decoration: underline; }

/* how it works modal */
.hiw-step { display: flex; gap: 12px; margin-bottom: 16px; }
.hiw-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--acc-soft); color: var(--coral-2); font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.hiw-step b { font-size: 14.5px; }
.hiw-step p { margin: 3px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.hiw-honest { margin-top: 6px; background: var(--bg-3); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: #5a6b5f; line-height: 1.5; }

.home-today {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 18px;
}
.ht-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ht-day { font-family: var(--serif); font-weight: 700; text-transform: capitalize; font-size: 18px; }
.ht-date { color: var(--muted); font-size: 14px; margin-left: 9px; }
.ht-link { border: none; background: none; color: var(--coral-2); font-weight: 700; font-size: 14px; cursor: pointer; }
.ht-summary { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 16px; color: var(--muted); font-size: 14px; }
.ht-summary b { color: var(--ink); }
.ht-actions { display: flex; flex-direction: column; gap: 8px; }
.ht-actions .act-row { display: flex; gap: 8px; }

.home-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 18px; }
.hstep {
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 14px 16px;
  display: flex; align-items: flex-start; gap: 12px;
}
.hs-num {
  flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--grad); color: #fff;
  font-weight: 800; font-size: 14px; display: grid; place-items: center;
}
.hstep b { display: block; font-size: 14.5px; }
.hstep span { font-size: 13px; color: var(--muted); }

.nav-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.nav-card {
  background: var(--card); border: none; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; text-align: left; cursor: pointer; transition: .18s; display: flex; flex-direction: column; gap: 3px;
}
.nav-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.nav-card .nc-ico { font-size: 24px; margin-bottom: 4px; }
.nav-card b { font-size: 15px; }
.nav-card span { font-size: 12.5px; color: var(--muted); }

/* ---------------- week nav ---------------- */
.week-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.week-label { font-weight: 700; font-size: 16px; flex: 1; text-align: center; }
.nav-btn {
  border: none; background: #fff; padding: 9px 15px; border-radius: 12px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--ink); box-shadow: var(--shadow);
}
.nav-btn:hover { color: var(--coral-2); }
.nav-btn.ghost { background: rgba(255,255,255,.6); color: var(--coral-2); }

/* ---------------- week grid ---------------- */
.week-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.day-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; display: flex; flex-direction: column; min-height: 190px; transition: .18s;
}
.day-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.day-card.today { box-shadow: var(--shadow); }
.day-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.day-weekday { font-family: var(--serif); font-weight: 700; text-transform: capitalize; font-size: 16px; }
.day-date { color: var(--muted); font-size: 13px; margin-left: 8px; }
.today-pill { background: none; color: var(--coral-2); font-size: 10.5px; font-weight: 700; padding: 0; border-radius: 0; letter-spacing: 1px; text-transform: uppercase; box-shadow: none; }

.day-body { flex: 1; display: flex; flex-direction: column; gap: 9px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 5px; align-items: flex-start; }
/* group icon was decorative and orphaned above wrapping full-width chips;
   the chip colour + section label already convey product vs food vs skin */
.g-icon { display: none; }
.empty-hint { color: #aebcb3; font-size: 13px; padding: 14px 0; text-align: center; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: 999px; font-size: 12.5px; font-weight: 600; letter-spacing: .2px;
  background: var(--prod-bg); color: #3a5666; white-space: normal; min-width: 0; max-width: 100%;
}
.chip.food { background: var(--food-bg); color: #8a5e1f; }
.chip.symptom { background: var(--symp-bg); color: var(--symp-ink); }
.chip.good { background: #dceee4; color: #2f7a5e; }
.chip.symptom.sev3 { background: var(--alert-bg); color: #a8412c; box-shadow: inset 0 0 0 1.5px var(--alert); }
.chip.tappable { cursor: pointer; }
.chip.tappable:active { transform: scale(.97); }
/* the × looks tiny but needs a real finger target: pad the hit area and pull it
   back with negative margins so the chip itself doesn't grow */
.chip .x { cursor: pointer; opacity: .55; font-size: 11px; display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 10px 10px 6px; margin: -10px -10px -10px -4px; }
.chip .x:hover { opacity: 1; }

.day-actions { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.act-primary {
  border: none; background: var(--grad); color: #fff; border-radius: 12px; padding: 11px;
  font-size: 14px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 12px rgba(79,114,134,.28);
}
.act-primary:hover { filter: brightness(1.05); }
.act-row { display: flex; gap: 7px; }
.act-ghost {
  flex: 1; border: 1.5px solid var(--line); background: #fff; border-radius: 11px; padding: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted);
}
.act-ghost:hover { border-color: var(--coral-2); color: var(--coral-2); }

/* day card split: input (care + food) → output (skin) */
.io-label { font-size: 11.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 9px; display: flex; align-items: center; gap: 6px; }
.io-label-skin { color: var(--symp); }
.io-label-skin .ico { width: 14px; height: 14px; }
.io-in .day-body { margin-bottom: 12px; }
.act-routine { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; padding: 13px; margin-bottom: 7px; }
.io-actions { display: flex; gap: 7px; }
.io-actions .act-primary { flex: 2; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.act-food { color: #8a5e1f; background: var(--food-bg); border-color: #e6cf9c; }
.act-food:hover { border-color: var(--food); color: #8a5e1f; filter: brightness(.99); }

.io-divider { height: 1px; background: var(--line); margin: 18px 2px; }
.catchup-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.catchup-row:empty { display: none; }
.catchup-btn { display: inline-flex; align-items: center; gap: 6px; border: none; background: none;
  cursor: pointer; color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 4px 2px; }
.catchup-btn:hover { color: var(--coral-2); }
.catchup-btn .ico { width: 14px; height: 14px; }
.period-toggle { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 13px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); }
.period-toggle .pt-dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #c06b7a; background: none; }
.period-toggle:hover { border-color: #c06b7a; color: #a24e5d; }
.period-toggle.on { background: #f7e6ea; border-color: #e7c2cb; color: #a24e5d; }
.period-toggle.on .pt-dot { background: #c06b7a; border-color: #c06b7a; }

.io-out { background: var(--bg-2); border: none; border-radius: 14px; padding: 14px 14px 4px; }
.io-out .day-body { margin-bottom: 12px; }
.act-skin {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1.5px solid var(--symp); background: var(--symp-bg); color: var(--symp-ink);
  border-radius: 12px; padding: 11px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.act-skin:hover { filter: brightness(.99); transform: translateY(-1px); }
.all-usual {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid #bcdfca; background: #dceee4; color: #2f7a5e;
  border-radius: 14px; padding: 13px; font-size: 14.5px; font-weight: 700; cursor: pointer;
  margin: 4px 0 2px;
}
.all-usual:hover { filter: brightness(.99); transform: translateY(-1px); }
.all-usual-hint { font-size: 11.5px; color: var(--muted); text-align: center; margin: 0 0 8px; }

/* ---------------- catalog actions + add sheet ---------------- */
.catalog-sub { color: var(--muted); margin: -4px 0 0; font-size: 14px; }
.catalog-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 20px; }
.add-cta { flex: 2 1 200px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; padding: 14px 18px; }
.scan-cta {
  flex: 1 1 160px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px dashed var(--prod); background: var(--prod-bg); color: #3a5666;
  border-radius: 12px; padding: 13px 16px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.scan-cta:hover { filter: brightness(.98); transform: translateY(-1px); }
.scan-cta.full { width: 100%; flex: none; margin-top: 2px; }
.ps-hint { color: var(--muted); font-size: 12.5px; margin: 7px 0 14px; line-height: 1.4; }
/* pause test (C) — calm experiment cards + optional invitation */
.exp-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.exp-card { background: var(--card); border: 1px solid var(--hairline); border-left: 3px solid var(--coral-2);
  border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.exp-card.tone-better { border-left-color: #2f7a5e; }
.exp-card.tone-worse, .exp-card.tone-same { border-left-color: var(--muted); }
.exp-card.ended { opacity: .92; }
.exp-head { display: flex; align-items: center; gap: 10px; }
.exp-ico { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--acc-soft); color: var(--coral-2); }
.exp-meta { display: flex; flex-direction: column; line-height: 1.3; }
.exp-meta b { font-size: 14.5px; color: var(--ink); }
.exp-meta span { font-size: 12px; color: var(--muted); font-weight: 600; }
.exp-read { font-size: 13.5px; color: var(--ink); line-height: 1.5; margin: 10px 0 0; }
.exp-actions { margin-top: 10px; }
.exp-actions:empty { display: none; }
.ghost-mini { border: 1.5px solid var(--line); background: #fff; color: var(--muted); cursor: pointer;
  border-radius: 999px; padding: 6px 13px; font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.ghost-mini:hover { border-color: var(--coral-2); color: var(--coral-2); }
.ghost-mini .ico { width: 14px; height: 14px; }
.ghost-mini.accent { border-color: var(--acc-soft); background: var(--acc-soft); color: var(--coral-2); }
.ghost-mini.accent:hover { filter: brightness(.98); }

.pause-wrap { margin: 22px 0 4px; }
.pause-wrap-title { display: flex; align-items: center; gap: 7px; font-family: var(--serif); font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.pause-wrap-title .ico { width: 17px; height: 17px; color: var(--coral-2); }
.pause-suggest { background: var(--bg-2); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; }
.pause-suggest .ps-lead { font-size: 14px; font-weight: 700; color: var(--ink); }
.pause-suggest .ps-sub { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 5px 0 11px; }

/* gentle daily reminder banner on the diary */
.day-reminder { display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  background: var(--acc-soft); border-radius: 14px; padding: 11px 13px;
  animation: riseIn .3s cubic-bezier(.22,.61,.36,1) both; }
.day-reminder .dr-ico { flex: none; display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--card); color: var(--coral-2); }
.day-reminder .dr-ico .ico { width: 15px; height: 15px; }
.day-reminder .dr-text { flex: 1; font-size: 13.5px; color: var(--coral-2); font-weight: 500; line-height: 1.4; }
.day-reminder .dr-x { flex: none; border: none; background: none; cursor: pointer; color: var(--coral-2);
  opacity: .55; padding: 4px; display: grid; place-items: center; }
.day-reminder .dr-x:hover { opacity: 1; }
.day-reminder.as-link { width: 100%; text-align: left; border: none; font: inherit; cursor: pointer; }
.day-reminder.as-link:hover { filter: brightness(.99); }

/* early reflections + positive reframe — calm, descriptive */
.reflect { background: var(--bg-2); border-radius: 16px; padding: 15px 16px; margin: 14px 0; }
.reflect-title { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 16px; font-weight: 700; color: var(--ink); }
.reflect-title .ico { color: var(--coral-2); }
.reflect-note { font-size: 12px; color: var(--muted); font-style: italic; margin: 4px 0 10px; line-height: 1.45; }
.reflect-row { font-size: 14px; color: var(--ink); line-height: 1.5; padding: 6px 0; border-top: 1px solid var(--line); }
.reflect-row:first-of-type { border-top: none; }
.reflect-row b { color: var(--coral-2); font-weight: 600; }
.reframe { background: var(--acc-soft); border-radius: 16px; padding: 16px; margin: 6px 0 14px; }
.reframe-title { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 17px; font-weight: 700; color: var(--coral-2); margin-bottom: 6px; }
.reframe-text { font-size: 14px; color: var(--ink); line-height: 1.55; }
.insight-reflect { font-size: 14px; color: var(--ink); line-height: 1.4; }
.insight-reflect b { color: var(--coral-2); }

/* pause test (C) — calm, low-noise */
.exp-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.exp-card { display: flex; align-items: flex-start; gap: 11px; background: var(--bg-2);
  border-radius: 14px; padding: 12px 13px; }
.exp-ico { flex: none; display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--card); color: var(--coral-2); }
.exp-ico .ico { width: 15px; height: 15px; }
.exp-body { flex: 1; min-width: 0; }
.exp-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.exp-top b { font-size: 14.5px; }
.exp-day { font-size: 11.5px; font-weight: 700; letter-spacing: .2px; color: var(--muted); text-transform: lowercase; }
.exp-read { font-size: 13px; color: var(--muted); line-height: 1.45; margin-top: 3px; }
.exp-end { flex: none; border: none; background: none; cursor: pointer; color: var(--muted); opacity: .5; padding: 2px; }
.exp-end:hover { opacity: 1; }
.exp-end .ico { width: 15px; height: 15px; }

.pause-zone { margin: 18px 0 4px; border-top: 1px solid var(--line); padding-top: 12px; }
.pause-zone > summary { font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer;
  list-style: none; display: inline-flex; align-items: center; gap: 7px; padding: 4px 0; }
.pause-zone > summary::-webkit-details-marker { display: none; }
.pause-zone > summary .ico { width: 15px; height: 15px; color: var(--coral-2); }
.pause-zone[open] > summary { color: var(--ink); }
.pz-note { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 8px 0 12px; font-style: italic; }
.pz-result { font-size: 13.5px; line-height: 1.5; padding: 10px 12px; border-radius: 12px;
  background: var(--bg-2); margin-bottom: 8px; }
.pz-result.tone-better b { color: #2f7a5e; }
.pz-suggest { display: flex; flex-direction: column; gap: 9px; background: var(--acc-soft);
  border-radius: 12px; padding: 12px 13px; margin-bottom: 8px; }
.pz-text { font-size: 13px; color: var(--ink); line-height: 1.5; }
.ghost-mini { align-self: flex-start; border: 1px solid var(--line); background: var(--card);
  border-radius: 10px; padding: 7px 13px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink);
  display: inline-flex; align-items: center; gap: 6px; }
.ghost-mini:hover { border-color: var(--coral-2); }
.ghost-mini.accent { color: var(--coral-2); border-color: var(--coral-2); background: var(--card); }
.ghost-mini .ico { width: 14px; height: 14px; }

/* compact live suggestions under the name field */
.ps-name-wrap { position: relative; }
/* in-flow (not absolute) so it can't spill outside the modal — the modal grows
   and scrolls to contain it */
.ps-suggest {
  margin-top: 6px; background: var(--bg-2); border: 1px solid var(--hairline); border-radius: 12px;
  overflow: hidden auto; padding: 4px; max-height: 340px;
  display: flex; flex-direction: column; gap: 4px;
}
.ps-suggest[hidden] { display: none; }
.ps-sug-row {
  width: 100%; display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  border: none; background: none; cursor: pointer; text-align: left;
  padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--ink);
}
.ps-sug-row:hover, .ps-sug-row.active { background: var(--bg-3); }
.ps-sug-main { font-weight: 500; }
.ps-suggest mark { background: none; color: var(--coral-2); font-weight: 700; }
.ps-sug-sub { flex: none; font-size: 11px; font-weight: 600; letter-spacing: .2px; }
.ps-sug-sub.brand { color: var(--coral-2); }
.ps-sug-sub.type { color: var(--muted); text-transform: lowercase; }
/* the diary quick-add lives inside .add-own, whose `.add-own button { font-size:18px }`
   would otherwise blow up these rows — win with a more specific selector.
   Rows are comfortably tappable (min 44px) while the text stays phone-sized. */
.ps-suggest .ps-sug-row { font-size: 13.5px; min-height: 44px; padding: 10px 12px; }
.ps-suggest .ps-sug-main { font-size: 13.5px; }
.ps-suggest .ps-sug-sub { font-size: 11.5px; }
.ps-when { display: flex; gap: 8px; margin-bottom: 4px; }
.ps-when .rt { flex: 1; justify-content: center; padding: 10px; font-size: 14px; }
.ps-more { margin-top: 14px; }
.ps-more > summary { font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; padding: 6px 0; list-style: none; }
.ps-more > summary::-webkit-details-marker { display: none; }
.ps-more > summary::before { content: "＋ "; color: var(--coral-2); font-weight: 700; }
.ps-more[open] > summary::before { content: "－ "; }

/* ---------------- forms / catalog ---------------- */
h2 { font-family: var(--serif); font-weight: 700; }
/* page titles match the diary's editorial scale */
#view-catalog > h2, .analysis-head h2 { font-size: 28px; line-height: 1.14; margin: 6px 0 2px; }
.catalog-sub { margin-top: 4px; line-height: 1.5; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; margin-bottom: 22px; }
.form-grid input, .form-grid select, .form-grid textarea, .modal input, .modal select, .modal textarea {
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 14px;
  font-family: inherit; background: #fbfdfc; color: var(--ink); width: 100%; transition: .15s;
}
.form-grid input:hover, .modal input:hover, .form-grid textarea:hover, .modal textarea:hover { border-color: #d2e3da; }
.form-grid input:focus, .modal input:focus, .form-grid select:focus, .modal select:focus {
  outline: none; border-color: var(--coral-2); box-shadow: 0 0 0 3px rgba(79,114,134,.12);
}
.form-grid .full { grid-column: 1 / -1; }
.routine-pick { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; }
.routine-pick label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.primary {
  background: var(--grad); color: #fff; border: none; padding: 12px 20px; border-radius: 12px;
  min-height: 44px; box-sizing: border-box;
  font-size: 14.5px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 8px rgba(79,114,134,.18);
}
.primary:hover { filter: brightness(1.05); }

/* ---------------- ingredients / comedogenicity ---------------- */
.ingredients-field { display: flex; flex-direction: column; gap: 8px; }
.if-row { display: flex; gap: 8px; align-items: stretch; }
.if-row textarea {
  flex: 1; resize: vertical; min-height: 44px; font-family: inherit; line-height: 1.4;
}
.lookup-btn {
  flex: none; border: none; background: var(--prod-bg); color: #3a5666; border-radius: 12px;
  padding: 0 16px; font-size: 13.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.lookup-btn:hover { filter: brightness(.97); }
.lookup-btn:disabled { opacity: .55; cursor: default; }

.prod-search-wrap { position: relative; }
.prod-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  background: #fff; border-radius: 12px; box-shadow: 0 12px 32px rgba(40,80,60,.18);
  border: 1px solid var(--line); max-height: 280px; overflow-y: auto; padding: 5px;
}
.prod-opt {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; width: 100%;
  text-align: left; border: none; background: none; cursor: pointer; padding: 9px 11px; border-radius: 9px;
}
.prod-opt:hover { background: var(--bg-3); }
.po-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.po-brand { font-size: 12.5px; color: var(--coral-2); font-weight: 600; }
.po-has { font-size: 11px; color: #2f7a5e; background: #dceee4; padding: 2px 7px; border-radius: 999px; margin-left: auto; }

.add-comp-label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: -2px; }
.scan-row { display: flex; gap: 8px; flex-wrap: wrap; }
.scan-btn {
  flex: 1 1 30%; min-width: 110px; display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px dashed var(--prod); background: var(--prod-bg); color: #3a5666;
  border-radius: 12px; padding: 11px; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.scan-btn:hover { filter: brightness(.98); }
.scan-tip { color: var(--muted); font-size: 12.5px; margin: -4px 0 0; }
.ing-adv summary { font-size: 13px; color: var(--muted); cursor: pointer; font-weight: 600; }
.ing-adv textarea { width: 100%; margin-top: 8px; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 12px; font-family: inherit; font-size: 13px; resize: vertical; }
.ing-adv textarea:focus { outline: none; border-color: var(--coral-2); box-shadow: 0 0 0 3px rgba(79,114,134,.12); }
.comedo-warn { font-size: 12.5px; color: #8a5e1f; margin: 4px 0 2px; }
.scanner-wrap { position: relative; border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 4/3; }
.scanner-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 18% 12%; border: 2px solid rgba(255,255,255,.9); border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0,0,0,.25); }

.comedo-preview:empty { display: none; }
.comedo-loading, .comedo-src { font-size: 13px; color: var(--muted); }
.comedo-src { font-weight: 600; color: #2f7a5e; display: inline-flex; align-items: center; gap: 5px; }
.comedo-src.miss { color: var(--food); }
.comedo-src.approx { color: var(--muted); }
.approx-note { color: var(--muted); font-style: italic; margin-bottom: 6px; }
.comedo-head { font-size: 13px; font-weight: 700; margin: 6px 0 4px; }
.comedo-head.high { color: #a8412c; }
.comedo-head.mid { color: #8a5e1f; }
.comedo-head.low { color: #2f7a5e; }
.cb-row { display: flex; flex-wrap: wrap; gap: 5px; }
.cb { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.cb-high { background: var(--alert-bg); color: #a8412c; }
.cb-mid { background: var(--food-bg); color: #8a5e1f; }
.cb-irr { background: #efeaff; color: #7a52d6; }
.comedo-mini { margin-top: 10px; }
.comedo-mini .comedo-head { font-size: 12px; margin: 0 0 5px; }
.ping-wrap { margin-top: 8px; }
.ping-wrap summary { font-size: 12.5px; color: var(--muted); cursor: pointer; font-weight: 600; }
.ping-wrap .ping { font-size: 12px; margin-top: 5px; color: #6b6276; line-height: 1.45; }

.product-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px,1fr)); gap: 13px; }
.product-item { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 15px; position: relative; }
.product-item .pname { font-weight: 700; padding-right: 52px; }
.product-item .pmeta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.product-item .ping { font-size: 12.5px; margin-top: 6px; color: #3a5666; }
.pi-actions { position: absolute; top: 12px; right: 12px; display: flex; gap: 4px; }
.pi-actions button { cursor: pointer; color: #b7c0ba; border: none; background: none; font-size: 15px;
  display: grid; place-items: center; padding: 4px; border-radius: 8px; }
.pi-actions button:hover { background: var(--bg-3); }
.pi-actions .edit:hover { color: var(--coral-2); }
.pi-actions .del:hover { color: var(--alert); }
.pi-actions .ico { width: 17px; height: 17px; }
.routine-toggles { display: flex; gap: 7px; margin-top: 11px; }
.rt {
  border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 11px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--muted);
}
.rt.on { background: var(--prod-bg); border-color: var(--prod); color: #3a5666; }

/* ---------------- quick-add sheet ---------------- */
.segmented { display: flex; background: var(--prod-bg); border-radius: 12px; padding: 4px; margin-bottom: 14px; border: 1px solid var(--hairline); }
.segmented button {
  flex: 1; border: none; background: transparent; padding: 9px; border-radius: 9px;
  font-size: 14px; font-weight: 700; cursor: pointer; color: var(--muted);
}
.segmented button.on { background: #fff; color: var(--coral-2); box-shadow: 0 2px 6px rgba(0,0,0,.08); }

.routine-all {
  width: 100%; border: 1.5px dashed var(--prod); background: var(--prod-bg); color: #3a5666;
  border-radius: 12px; padding: 10px; font-size: 13.5px; font-weight: 700; cursor: pointer; margin-bottom: 14px;
}
.routine-all:hover { filter: brightness(.98); }

.pick-grid { display: flex; flex-wrap: wrap; gap: 8px; max-height: 320px; overflow-y: auto; padding: 2px; }
.pick {
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 10px 15px;
  min-height: 44px; box-sizing: border-box;
  font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--ink); transition: .12s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.pick:hover { border-color: var(--coral-2); }
.pick .star { color: #d9a441; font-size: 12px; }

/* ---- skin calendar (month heatmap) ---- */
.skin-cal { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 18px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-month { font-family: var(--serif); font-size: 16px; text-transform: capitalize; color: var(--ink); }
.cal-nav { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer; }
.cal-nav:hover { border-color: var(--coral-2); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-wdrow { margin-bottom: 5px; }
.cal-wd { text-align: center; font-size: 11px; color: var(--muted); }
.cal-cell { position: relative; aspect-ratio: 1; border-radius: 7px; display: flex; align-items: flex-end; padding: 3px 4px; cursor: pointer; }
.cal-cell.cal-empty { cursor: default; }
.cal-cell.cal-empty { background: transparent; padding: 3px 4px; }
.cal-n { font-size: 11px; color: var(--muted); }
.cal-mark { position: absolute; top: 2px; right: 3px; color: var(--prod); display: inline-flex; }
.cal-mark .ico { width: 11px; height: 11px; }
.cs-none { background: #f1ece2; }
.cs-clear { background: #d3ebdf; } .cal-cell.cs-clear .cal-n { color: #2f7a5e; }
.cs-mild { background: #ecc59a; }
.cs-strong { background: #e7a98f; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; font-size: 12px; color: var(--muted); align-items: center; }
.cal-leg { display: inline-flex; align-items: center; gap: 5px; }
.cal-leg .ico { width: 13px; height: 13px; color: var(--prod); }
.cal-sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.cal-insight { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 12px 0 0; }
.pick.sel { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 3px 10px rgba(79,114,134,.3); }
/* severity ramp: mild stays calm, severe reads as a signal (red) */
:root .pick.sev-pick.sel.sev2 { background: var(--symp); box-shadow: 0 3px 10px rgba(138,106,85,.3); }
:root .pick.sev-pick.sel.sev3 { background: var(--alert); box-shadow: 0 3px 10px rgba(210,105,78,.35); }
.pick.gsel { background: #dceee4; color: #2f7a5e; border-color: #22c55e; }
.pick.done { background: var(--prod-bg); color: #3a5666; border-color: var(--prod); cursor: default; }
.pick.done::before { content: "✓ "; font-weight: 800; }
.pick.state-more { background: none; border-style: dashed; color: var(--coral-2); font-weight: 700; }
.pick.state-more:hover { background: var(--acc-soft); }

.add-own { display: flex; gap: 8px; margin-top: 14px; }
.add-own input { flex: 1; }
.add-own .ps-name-wrap input { width: 100%; box-sizing: border-box; }
.ps-sug-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-addrow { margin-top: 8px; }
.q-addrow:empty { display: none; }
.add-this {
  width: 100%; justify-content: center; gap: 6px;
  border: 1.5px dashed var(--prod); background: var(--prod-bg); color: #3a5666; font-weight: 700;
}
.add-this:disabled { opacity: .7; cursor: default; }
.add-own button {
  border: none; background: var(--prod-bg); color: #3a5666; border-radius: 11px; padding: 0 16px;
  font-weight: 800; font-size: 18px; cursor: pointer;
}

/* ---------------- analysis ---------------- */
.analysis-head { position: relative; display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.analysis-motif { position: absolute; right: -10px; top: -6px; width: 150px; height: 90px; opacity: .06; pointer-events: none; z-index: 0; }
.analysis-head h2, .analysis-head .primary { position: relative; z-index: 1; }
.summary {
  background: var(--card); border-radius: var(--radius); padding: 16px 18px 16px 22px;
  box-shadow: var(--shadow); border: 1px solid var(--hairline); margin-bottom: 16px; font-size: 15.5px; font-weight: 600;
  position: relative; overflow: hidden;
}
.summary::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad); }
.finding { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); border: 1px solid var(--hairline); padding: 14px 16px; margin-bottom: 10px; }
/* sample finding: clearly a preview — dashed, dimmed, corner-tagged */
.finding.sample { position: relative; border: 1.5px dashed var(--line); box-shadow: none; opacity: .8; margin-bottom: 18px; }
.sample-tag { position: absolute; top: -9px; right: 14px; background: var(--bg-3); color: var(--muted);
  font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  padding: 2px 9px; border-radius: 999px; }
.finding .fhead { display: flex; align-items: center; gap: 10px; }
.finding .fname { font-weight: 700; }
.badge { font-size: 11px; padding: 4px 11px; border-radius: 999px; font-weight: 700; white-space: nowrap; letter-spacing: .2px; text-transform: uppercase; }
.badge.r4 { background: var(--alert-bg); color: #a8412c; }
.badge.r3 { background: var(--food-bg); color: #8a5e1f; }
.badge.r2 { background: #e7eee9; color: #6c7a71; }
.badge.r1 { background: var(--prod-bg); color: #3a5666; }
.finding .fexp { color: var(--ink); font-size: 13.5px; margin-top: 7px; }
.section-title { margin: 24px 0 10px; font-family: var(--serif); font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.section-title .ico { color: var(--coral-2); width: 17px; height: 17px; }
.comp-note { font-size: 13px; color: var(--muted); margin: -4px 0 12px; }
.finding .cb-row { margin-top: 9px; }
.notes { margin-top: 16px; }
.notes .note { font-size: 13.5px; color: var(--muted); padding: 8px 0; border-top: 1px solid var(--line); }
.disclaimer { margin-top: 18px; font-size: 12.5px; color: var(--muted); font-style: italic; }
.empty { color: var(--muted); padding: 44px 28px; text-align: center; background: none; border-radius: var(--radius);
  font-family: var(--serif); font-size: 16px; line-height: 1.5; }
/* editorial empty state: no white box — blends into the page */
.empty-state { grid-column: 1 / -1; text-align: center; padding: 48px 24px; }
.empty-ico { width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 16px;
  display: grid; place-items: center; background: var(--acc-soft); color: var(--coral-2); }
.empty-ico .ico { width: 24px; height: 24px; }
.empty-lead { font-family: var(--serif); font-size: 18px; color: var(--ink); margin: 0; }

/* ---------------- onboarding survey ---------------- */
.onboarding {
  position: fixed; inset: 0; z-index: 60; background: linear-gradient(160deg, var(--bg-1), var(--bg-2) 45%, var(--bg-3));
  display: flex; align-items: flex-start; justify-content: center; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(24px + env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom));
}
.onb-card {
  background: var(--card); border-radius: 24px; box-shadow: 0 24px 70px rgba(40,80,60,.18);
  width: 100%; max-width: 600px; padding: 26px 24px; animation: pop .22s ease;
}
.onb-head h2 { margin: 0 0 6px; font-family: var(--serif); font-size: 23px; font-weight: 700; }
.onb-head p { margin: 0 0 8px; color: var(--muted); font-size: 14.5px; }
.onb-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 22px;
  position: sticky; bottom: -40px; }
.ghost-btn { border: none; background: none; color: var(--muted); font-weight: 700; font-size: 14.5px; cursor: pointer; padding: 12px 14px; }
.ghost-btn:hover { color: var(--ink); }

/* welcome splash */
.welcome-card { text-align: center; max-width: 460px; padding: 40px 28px 32px; }
.welcome-mark {
  width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 20px;
  display: grid; place-items: center; color: #fff; background: var(--grad);
  box-shadow: 0 10px 26px rgba(79,114,134,.32);
}
.welcome-mark { margin-bottom: 12px; }
.welcome-mark .ico { width: 32px; height: 32px; stroke-width: 1.7; }
.welcome-brand { font-family: var(--serif); font-weight: 700; font-size: 17px; color: var(--ink); letter-spacing: .2px; margin-bottom: 14px; }
.welcome-title { margin: 0 0 8px; font-family: var(--serif); font-size: 26px; font-weight: 700; line-height: 1.18; }
.welcome-sub { margin: 0 auto 22px; font-size: 14.5px; color: var(--muted); max-width: 360px; line-height: 1.45; }
.welcome-steps { text-align: left; display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.wstep { display: flex; align-items: center; gap: 12px; }
.wstep .ws-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.wstep .ws-ico .ico { width: 19px; height: 19px; }
.ws-in { background: var(--prod-bg); color: #3a5666; }
.ws-skin { background: var(--symp-bg); color: var(--symp); }
.ws-out { background: var(--acc-soft); color: var(--coral-2); }
.wstep b { display: block; font-size: 14.5px; color: var(--ink); }
.wstep span:last-child { font-size: 12.5px; color: var(--muted); }
.welcome-honest { display: flex; gap: 7px; align-items: flex-start; text-align: left;
  background: var(--bg-3); border-radius: 12px; padding: 11px 13px; margin: 0 0 18px;
  font-size: 12.5px; color: #5a6b5f; line-height: 1.45; }
.welcome-honest .ico { flex: none; color: var(--coral-2); margin-top: 1px; }
.welcome-btn { width: 100%; padding: 15px; font-size: 16px; }
/* personalised, honest pull: a concrete date for the first ANSWERS (not a cure) */
.welcome-promise { background: var(--acc-soft); color: #3a5666; border-radius: 12px;
  padding: 11px 14px; font-size: 13.5px; line-height: 1.45; margin: 0 0 12px; }
.welcome-promise .wp-date { font-family: var(--serif); font-size: 15px; white-space: nowrap; }
.welcome-trust { margin: 12px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.welcome-survey { width: 100%; margin-top: 6px; font-size: 13.5px; }

.prof-field { margin-top: 16px; }
.prof-field > label { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.prof-field textarea { width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 12px;
  font-family: inherit; font-size: 14px; resize: vertical; }
.prof-field textarea:focus { outline: none; border-color: var(--coral-2); box-shadow: 0 0 0 3px rgba(79,114,134,.12); }
.prof-pick { font-size: 13.5px; }
.modal-prof { max-height: 60vh; overflow-y: auto; }

.prof-banner { background: var(--acc-soft); color: #2a6b53; border-radius: 12px; padding: 10px 14px;
  font-size: 13.5px; margin-bottom: 14px; }
.prof-banner b { color: var(--coral-2); }

.sync-row { display: flex; gap: 8px; }
.sync-row input { flex: 1; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 13px; font-family: inherit; }
.sync-row input:focus { outline: none; border-color: var(--coral-2); box-shadow: 0 0 0 3px rgba(79,114,134,.12); }

/* ---------------- modal ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(22,38,31,.46); display: flex;
  align-items: center; justify-content: center; z-index: 50; backdrop-filter: blur(2px);
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}
.modal {
  background: #fff; border-radius: 22px; width: 100%; max-width: 460px;
  box-shadow: 0 24px 70px rgba(0,0,0,.28); animation: pop .18s ease;
  display: flex; flex-direction: column; max-height: 100%; overflow: hidden;
}
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.modal-head { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 800; font-size: 16px; }
#modal-body { padding: 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal label { display: block; font-size: 12.5px; color: var(--muted); margin: 12px 0 5px; font-weight: 600; }
.modal label:first-child { margin-top: 0; }
.modal-hint { margin: 0 0 14px; font-size: 13px; color: var(--muted); background: var(--bg-3); padding: 10px 12px; border-radius: 11px; }
.modal .row { display: flex; gap: 11px; }
.modal .row > * { flex: 1; }
.modal .actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 8px; }
.modal .actions.wide { justify-content: stretch; }
.modal .actions.wide .primary { width: 100%; }
.icon-btn { border: none; background: none; cursor: pointer; font-size: 17px; color: var(--muted); }
.hidden { display: none !important; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 600; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: pop .2s ease;
}
.toast-undo { background: none; border: none; color: inherit; font: inherit; font-weight: 800;
  text-decoration: underline; cursor: pointer; margin-left: 12px; padding: 6px 2px; }

/* ---------------- responsive ---------------- */
@media (max-width: 640px) {
  /* compact 2-row topbar: [brand .... actions] / [tabs full width] */
  .topbar { flex-wrap: wrap; row-gap: 10px; padding: max(10px, env(safe-area-inset-top)) 14px 10px; }
  .brand { font-size: 18px; order: 0; }
  .top-actions { order: 1; margin-left: auto; }
  .tabs { order: 2; width: 100%; justify-content: space-between; gap: 4px; }
  .tab { padding: 9px 8px; font-size: 14px; flex: 1; text-align: center; }

  main { padding: 16px 14px calc(80px + env(safe-area-inset-bottom)); }
  .home-hero { padding: 20px 18px; }
  .home-hero h1 { font-size: 22px; }
  .home-hero p { font-size: 14px; }
  .week-grid { gap: 12px; }
  h2 { font-size: 22px; }

  /* modal: snug on small screens */
  .modal-backdrop { padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)); }
  #modal-body { padding: 16px; }
  .modal-head { padding: 14px 16px; }
  .onb-card { padding: 20px 16px 16px; }

  /* iOS zooms in when a focused input is < 16px — pin all fields to 16px so the
     page never auto-zooms/jumps on tap. */
  input, select, textarea,
  .form-grid input, .form-grid select, .form-grid textarea,
  .modal input, .modal select, .modal textarea,
  #ps-name, #ps-brand, #ps-category, #ingredients-input, #q-new { font-size: 16px; }

  /* roomier tap targets */
  .act-ghost { padding: 11px 8px; }
  .pick { padding: 11px 14px; }
  .tab { padding: 11px 8px; }
  .menu-row { padding: 14px 12px; }
  .catchup-btn { padding: 11px 4px; }
  .nav-btn { min-height: 42px; }
  .menu-btn { width: 42px; height: 38px; }
  .period-toggle { padding: 10px 15px; }
}

/* ===================== life: micro-interactions ===================== */
button, .nav-card, .day-card, .product-item, .pick, .chip, .tab,
.act-primary, .act-ghost, .scan-btn, .primary, .btn, .nav-btn, .menu-row, .lookup-btn, .rt {
  transition: transform .13s ease, box-shadow .2s ease, background-color .16s ease,
              border-color .16s ease, filter .16s ease, color .16s ease;
}
/* tactile press */
.primary:active, .act-primary:active, .act-ghost:active, .scan-btn:active, .nav-btn:active,
.lookup-btn:active, .pick:active, .menu-row:active, .rt:active, .tab:active, button:active { transform: scale(.96); }

/* lively primary buttons: vertical sheen + inner highlight + hover lift/glow */
.primary, .act-primary, .btn {
  background-image: linear-gradient(180deg, rgba(255,255,255,.22), rgba(0,0,0,.07));
  box-shadow: 0 6px 16px rgba(79,114,134,.26), inset 0 1px 0 rgba(255,255,255,.28);
}
.primary:hover, .act-primary:hover, .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(79,114,134,.34), inset 0 1px 0 rgba(255,255,255,.32);
  filter: brightness(1.04);
}
.act-ghost:hover, .scan-btn:hover, .nav-btn:hover, .rt:hover { transform: translateY(-1px); }
.product-item { transition: transform .15s ease, box-shadow .2s ease; }
.product-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }

/* gentle entrance for cards */
@keyframes riseIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
.day-card, .product-item, .finding, .summary, .prof-banner { animation: riseIn .34s cubic-bezier(.22,.61,.36,1) both; }
.day-card:nth-child(1){animation-delay:.02s} .day-card:nth-child(2){animation-delay:.06s}
.day-card:nth-child(3){animation-delay:.10s} .day-card:nth-child(4){animation-delay:.14s}
.day-card:nth-child(5){animation-delay:.18s} .day-card:nth-child(6){animation-delay:.22s}
.day-card:nth-child(7){animation-delay:.26s}
.finding:nth-child(odd){animation-delay:.04s} .finding:nth-child(even){animation-delay:.08s}

/* chips pop in */
@keyframes popIn { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: none; } }
.chip, .cb { animation: popIn .2s ease both; }

/* today card: a calm rise-in, no pulsing ring (editorial restraint) */
.day-card.today { animation: riseIn .34s ease both; }

/* analysis: low-data progress card */
.progress-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.pc-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: var(--ink); margin-bottom: 12px; }
.pc-bar { height: 10px; border-radius: 999px; background: var(--acc-soft); overflow: hidden; }
.pc-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4f7286, #3a5666);
  transition: width .6s cubic-bezier(.22,.61,.36,1); min-width: 6px; }
.pc-note { margin-top: 12px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.pc-note b { color: var(--coral-2); }
.pc-ring-card { display: flex; align-items: center; gap: 14px; }
.pc-ring { width: 58px; height: 58px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--prod) calc(var(--pct, 0) * 1%), var(--acc-soft) 0);
  display: grid; place-items: center; }
.pc-ring-inner { width: 44px; height: 44px; border-radius: 50%; background: #fff;
  display: grid; place-items: center; font-size: 15px; font-weight: 700; color: var(--ink); }
.pc-ring-main { font-size: 15px; color: var(--ink); }
.pc-ring-sub { font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 3px; }

/* week strip (compact day previews) + selected-day detail card */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 22px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; }
.wstrip-cell {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 2px;
  border: none; background: transparent; border-radius: 12px; cursor: pointer; transition: .15s;
}
.wstrip-cell:hover { background: rgba(70,55,35,.04); }
.wc-dow { font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: .6px; text-transform: uppercase; }
.wc-num { font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--ink); line-height: 1; }
.wc-dots { display: flex; gap: 3px; height: 6px; align-items: center; }
.wc-dot { width: 5px; height: 5px; border-radius: 50%; }
.d-prod { background: var(--prod); }
.d-food { background: var(--food); }
.d-symp { background: var(--symp); }
.d-empty { background: var(--line); }
.wstrip-cell.today .wc-num { color: var(--coral-2); }
.wstrip-cell.today .wc-dow { color: var(--coral-2); }
.wstrip-cell.sel { background: var(--acc-soft); box-shadow: none; }
.wstrip-cell.sel .wc-num, .wstrip-cell.sel .wc-dow { color: var(--coral-2); }
/* detail card re-renders on every edit — no entrance animation, or it "jumps"
   each time you log something. (chips still pop in subtly.) */
.detail-card { animation: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===================== PWA install banner ===================== */
#install-banner {
  position: fixed; left: 0; right: 0; margin: 0 auto;   /* center w/o transform (riseIn uses transform) */
  bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 80;
  width: min(560px, calc(100% - 24px));
  display: flex; align-items: center; gap: 12px;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--hairline); border-radius: 16px;
  box-shadow: var(--shadow-hover); padding: 12px 14px;
  animation: riseIn .3s cubic-bezier(.22,.61,.36,1) both;
}
#install-banner .ib-ico { flex: none; display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 11px; background: var(--acc-soft); color: var(--coral-2); }
#install-banner .ib-ico .ico { width: 20px; height: 20px; }
#install-banner .ib-text { flex: 1; font-size: 13.5px; font-weight: 600; line-height: 1.35; }
#install-banner .ib-go { flex: none; border: none; background: var(--grad); color: #fff;
  border-radius: 11px; padding: 9px 16px; font-size: 13.5px; font-weight: 700; cursor: pointer; }
#install-banner .ib-x { flex: none; border: none; background: none; color: var(--muted);
  cursor: pointer; display: grid; place-items: center; padding: 4px; }
#install-banner .ib-x .ico { width: 18px; height: 18px; }

/* ===================== RTL (Arabic) ===================== */
/* dir="rtl" on <html> mirrors flex/text automatically; these fix the few
   places that use physical left/right and wouldn't flip on their own. */
[dir="rtl"] .summary { padding: 16px 20px 16px 18px; }
[dir="rtl"] .summary::before { left: auto; right: 0; }
[dir="rtl"] .product-item .pname { padding-right: 0; padding-left: 24px; }
[dir="rtl"] .product-item .del { right: auto; left: 12px; }
[dir="rtl"] .ht-date, [dir="rtl"] .day-date { margin-left: 0; margin-right: 9px; }
[dir="rtl"] .po-has { margin-left: 0; margin-right: auto; }
[dir="rtl"] .lang-select { padding: 7px 12px 7px 26px; background-position: left 8px center; }
[dir="rtl"] .hero::after { right: auto; left: -40px; }
[dir="rtl"] .hero-close { right: auto; left: 14px; }

/* ===================== dark theme (auto, follows the OS) ===================== */
/* Dark theme — applied via [data-theme="dark"] on <html>, which JS sets from the
   user's choice (light / dark / system). System mode resolves prefers-color-scheme. */
:root[data-theme="dark"] {
    --bg-1: #14130e; --bg-2: #191711; --bg-3: #23201a;
    --card: #1d1b15; --ink: #efe9df; --muted: #9c9384; --line: #2e2a20;
    --coral-1: #7da8be; --coral-2: #9ac3d6;   /* brighter accents read on dark */
    --grad: #4f7286; --acc-soft: #1c2a31;
    --prod: #7da8be; --prod-bg: #16262e;
    --food: #d9a24f; --food-bg: #2e2410;
    --symp: #c2a78f; --symp-bg: #2b241e; --symp-ink: #d9c3ad;
    --alert: #e0805f; --alert-bg: #331c14;
    --shadow: 0 1px 1px rgba(0,0,0,.3), 0 6px 16px rgba(0,0,0,.35), 0 20px 40px rgba(0,0,0,.4);
    --shadow-hover: 0 4px 10px rgba(0,0,0,.4), 0 16px 36px rgba(0,0,0,.5);
    --hairline: rgba(255,255,255,.05);

  body {
    background: var(--bg-1);
    background-image:
      radial-gradient(1200px 600px at 100% -10%, rgba(79,114,134,.14), transparent 60%),
      radial-gradient(900px 500px at -10% 0%, rgba(217,162,79,.06), transparent 55%),
      linear-gradient(180deg, #1a1812, var(--bg-1) 240px);
  }
  /* topbar + hero stay blue in dark too (brand) — only re-skin neutral surfaces */
  .nav-btn, .act-ghost, .segmented button.on,
  .modal, .summary, .finding, .empty, .progress-card, .prod-results,
  .form-grid input, .form-grid select, .form-grid textarea,
  .modal input, .modal select, .modal textarea, .ing-adv textarea, .prof-field textarea, .sync-row input {
    background: var(--card); color: var(--ink);
  }
  .form-grid input, .form-grid select, .form-grid textarea,
  .modal input, .modal select, .modal textarea { background: #16140f; }
  .nav-btn.ghost { background: var(--acc-soft); }
  .rt, .pick { background: var(--card); }
  /* selected pick must stay clearly filled — the generic .pick bg above was hiding it */
  .pick.sel { background: var(--grad); color: #fff; border-color: transparent; }
  /* skin calendar: re-skin neutral surfaces + cell states for dark */
  .skin-cal, .cal-nav { background: var(--card); }
  .cs-none { background: #1d1a14; }
  .cs-clear { background: #173026; } .cal-cell.cs-clear .cal-n { color: #7fcfa8; }
  .cs-mild { background: #463620; }
  .cs-strong { background: #4f2a1f; }
  .all-usual { background: #173026; color: #7fcfa8; border-color: #2c5a44; }
  .pc-ring-inner { background: var(--card); }
  .rt.on { border-color: transparent; }
  /* pills/chips: dark tint + brightened ink */
  .chip { background: var(--prod-bg); color: #9ac3d6; }
  .chip.food { background: var(--food-bg); color: #f0c074; }
  .act-food { background: var(--food-bg); color: #f0c074; border-color: #5a4a1f; }
  .chip.symptom { background: var(--symp-bg); color: var(--symp-ink); }
  .chip.symptom.sev3 { background: var(--alert-bg); color: #f3a07f; }
  .chip.good { background: #143026; color: #6fd6a0; }
  .lookup-btn, .scan-btn, .add-own button, .routine-all { background: var(--prod-bg); color: #9ac3d6; }
  .badge.r4 { background: var(--alert-bg); color: #f3a07f; }
  .badge.r3 { background: var(--food-bg); color: #f0c074; }
  .badge.r2 { background: #232c27; color: #9fb0a6; }
  .badge.r1 { background: var(--prod-bg); color: #9ac3d6; }
  .cb-high { background: var(--alert-bg); color: #f3a07f; }
  .cb-mid  { background: var(--food-bg); color: #f0c074; }
  .cb-irr  { background: #241b3a; color: #b79bf0; }
  .po-has, .pick.gsel, .pick.done, .rt.on { background: #143026; color: #6fd6a0; }
  .po-brand { color: var(--coral-2); }
  .po-name { color: var(--ink); }
  /* toast inverts in light mode; keep it readable on dark */
  .toast { background: #e7efe9; color: #11201a; }
  .empty-hint { color: #5d6f64; }
  .modal-backdrop { background: rgba(0,0,0,.6); }
  .prof-banner { background: var(--acc-soft); color: #9fe0c2; }
  .prof-banner b { color: var(--coral-2); }
  .act-skin { color: #f3a07f; }
  .period-toggle.on { background: #2e1c20; border-color: #5a3a40; color: #e3a9b3; }
  .io-out { background: #16140f; }
  .welcome-honest { color: #9aa9a0; }
  .welcome-promise { color: #9ac3d6; }
}

/* horizontal nav inside the top bar (shown on desktop only) */
.topnav { display: none; }
.topnav .tab { flex-direction: row; gap: 6px; font-size: 14.5px; color: rgba(255,255,255,.72);
  padding: 7px 14px; border-radius: 999px; }
.topnav .tab .ico { width: 16px; height: 16px; }
.topnav .tab.active { color: #fff; background: rgba(255,255,255,.16); }

/* ===================== desktop: real wide web layout (concept B) ===================== */
@media (min-width: 760px) {
  .topbar { padding-top: 14px; padding-bottom: 14px;
    padding-inline: max(24px, calc((100% - 860px) / 2)); }
  .topnav { display: flex; gap: 4px; }
  .tabbar { display: none; }                 /* bottom tabs are mobile-only */
  main { padding-bottom: 48px; }

  /* hero becomes a compact header row on the cream content (no big blue block) */
  .diary-hero { background: transparent; color: var(--ink); border-radius: 0;
    max-width: 800px; margin: 0 auto; padding: 22px 0 6px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .diary-hero .hero-h, .diary-hero .hero-sub { display: none; }
  .hero-date { font-family: var(--serif); font-size: 23px; font-weight: 700; color: var(--ink); opacity: 1; }
  .hero-cta { background: var(--grad); color: #fff; box-shadow: none; padding: 11px 18px; flex: none; }

  #view-week, #view-catalog, #view-analysis { max-width: 800px; margin: 0 auto; }

  /* the day card opens into two balanced columns: input | output */
  .detail-card { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; align-items: stretch; }
  .detail-card .day-head { grid-column: 1 / -1; margin-bottom: 4px; }
  .detail-card .io-divider { display: none; }
  /* both columns are equal sub-panels so nothing looks lopsided */
  .detail-card .io-in, .detail-card .io-out {
    grid-column: auto; background: var(--bg-2); border-radius: 14px; padding: 14px;
    display: flex; flex-direction: column; }
  .detail-card .io-in .day-body { margin-bottom: 10px; }
  .detail-card .io-out .act-skin { margin-top: auto; }
  .detail-card .catchup-row { margin-top: auto; padding-top: 10px; }
  /* leading group icon has no room beside a near-full-width chip here — chip
     colour + section label already convey the type */
  .detail-card .g-icon { display: none; }
}
