:root {
  --bg: #f4f7f6; --card: #fff; --ink: #0f172a; --muted: #64748b; --line: #e2e8f0;
  --brand: #0f766e; --brand-2: #14b8a6; --brand-soft: #ccfbf1;
  --high: #dc2626; --high-soft: #fef2f2; --mod: #d97706; --mod-soft: #fffbeb; --low: #ca8a04; --low-soft: #fefce8; --ok: #16a34a; --ok-soft: #f0fdf4;
  --mind: #7c3aed; --mind-soft: #f5f3ff;
  --radius: 18px; --shadow: 0 1px 2px rgba(15,23,42,.05), 0 6px 20px rgba(15,23,42,.06);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background-color: var(--bg); color: var(--ink); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
.screen { padding: 18px 16px 24px; }
.screen.center { text-align: center; padding-top: 12vh; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 6px; }
.section-title { font-size: 18px; font-weight: 750; margin: 26px 2px 10px; display: flex; align-items: center; gap: 8px; }
.count { background: var(--line); color: var(--muted); font-size: 13px; padding: 1px 9px; border-radius: 99px; }
.muted { color: var(--muted); } .small { font-size: 14px; } .tiny { font-size: 12px; }
.grow { flex: 1; min-width: 0; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 10px 0; }
.card h3 { font-size: 16px; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; }
.link { color: var(--brand); text-decoration: none; font-weight: 600; font-size: 14px; }
.back { display: inline-block; color: var(--brand); text-decoration: none; font-weight: 600; margin-bottom: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 13px 18px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .08s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; box-shadow: 0 6px 16px rgba(15,118,110,.28); }
.btn.ghost { background: var(--card); color: var(--brand); border: 1.5px solid var(--brand-soft); }
.btn.danger { color: var(--high); border-color: #fecaca; }
.btn.block { display: flex; width: 100%; margin-top: 10px; }
.btn.big { padding: 17px; font-size: 18px; }
.btn.small { padding: 8px 12px; font-size: 14px; border-radius: 12px; }

.hero { text-align: center; padding: 18px 8px 4px; }
.hero h1 { font-size: 28px; font-weight: 800; margin: 10px 0; letter-spacing: -.02em; }
.hero p { color: var(--muted); margin: 0 auto; max-width: 420px; }
.logo { font-size: 52px; }
.form label, .form fieldset { display: block; margin: 0 0 16px; font-weight: 650; font-size: 15px; border: 0; padding: 0; }
.form legend { padding: 0; margin-bottom: 8px; }
input[type=number], input:not([type]), input[type=text] { width: 100%; margin-top: 6px; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 12px; font: inherit; background: var(--card); color: var(--ink); }
input:focus { outline: 2px solid var(--brand-2); border-color: transparent; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg-opt { margin: 0 !important; }
.seg-opt input { position: absolute; opacity: 0; }
.seg-opt span { display: block; text-align: center; padding: 12px 8px; border: 1.5px solid var(--line); border-radius: 12px; font-weight: 600; background: var(--card); color: var(--ink); }
.seg-opt input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--brand-2); }
.check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 500 !important; font-size: 14px !important; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brand); }
.error { color: var(--high); }

.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.top .muted { margin: 0; }
.chip { display: inline-block; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; font-size: 13px; color: #334155; text-decoration: none; white-space: nowrap; cursor: pointer; font-family: inherit; }
.banner { border-radius: 14px; padding: 12px 14px; font-size: 14px; margin: 12px 0; }
.banner.demo { background: #eef2ff; color: #3730a3; border: 1.5px dashed #a5b4fc; }
.banner.limit { background: #eef1ec; color: #3d4a42; border: 1.5px solid #c5d0c6; }
.msg.assistant.limit {
  background: #eef1ec; color: #3d4a42; border: 1.5px solid #c5d0c6;
  font-weight: 650; max-width: 100%;
}
.photo-remaining { font-size: 12px; color: var(--muted); text-align: center; margin: 6px 0 0; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; letter-spacing: .02em; }
.tag.demo { background: #e0e7ff; color: #3730a3; text-transform: uppercase; }
.tag.warn { background: var(--mod-soft); color: #92400e; margin-top: 6px; }

.scan-card { background: radial-gradient(120% 90% at 100% 0%, #d1fae5 0%, #fff 55%); border-radius: 24px; box-shadow: var(--shadow); padding: 22px 18px 16px; text-align: center; margin-top: 14px; }
.scan-illus { font-size: 46px; }
.scan-card h2 { font-size: 22px; margin: 6px 0; }
.scan-card p { color: var(--ink); margin: 0 0 8px; opacity: .85; }
.examples { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.example { background: var(--card); border: 0; border-radius: 16px; box-shadow: var(--shadow); padding: 12px 6px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.example span { font-size: 28px; }
.example small { color: #6366f1; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }

.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row-title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: var(--line); flex: none; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--ok); }
.dot.high { background: var(--high); } .dot.moderate { background: var(--mod); } .dot.low { background: var(--low); }

.analyzing h2 { margin-top: 24px; }
.scan-frame { position: relative; width: 210px; height: 210px; margin: 0 auto; border-radius: 28px; overflow: hidden; background: #e2e8f0; box-shadow: var(--shadow); }
.scan-frame img { width: 100%; height: 100%; object-fit: cover; }
.laser { position: absolute; left: 0; right: 0; height: 3px; background: var(--brand-2); box-shadow: 0 0 18px 4px rgba(20,184,166,.6); animation: scan 1.6s ease-in-out infinite alternate; }
@keyframes scan { from { top: 6%; } to { top: 92%; } }

.product { display: flex; gap: 14px; align-items: center; }
.pimg { width: 84px; height: 84px; border-radius: 16px; object-fit: cover; background: var(--line); flex: none; }
.pname { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.brand { margin: 2px 0 0; color: var(--muted); font-weight: 600; }
.product p { margin: 0; }
.verdict { border-radius: var(--radius); padding: 16px; color: #fff; margin: 12px 0; background: var(--ok); }
.verdict.high { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.verdict.moderate { background: linear-gradient(135deg, #f59e0b, #c2410c); }
.verdict.low { background: linear-gradient(135deg, #eab308, #a16207); }
.verdict.none,
.verdict.unknown { background: linear-gradient(135deg, #64748b, #334155); }
.card.unknown { background: var(--noinfo-soft); border: 1px solid var(--line); color: var(--ink); }
.card.unknown strong { color: var(--ink); }
.dot.unknown, .score-dot.unknown { background: #64748b; }
.verdict-level { font-size: 22px; font-weight: 800; }
.verdict .link { color: #fff; text-decoration: underline; }
.counts { display: flex; gap: 14px; margin-top: 10px; font-size: 13px; flex-wrap: wrap; }
.counts span { background: rgba(255,255,255,.18); padding: 4px 10px; border-radius: 99px; }
.logged { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.flag { border-left: 5px solid var(--low); }
.flag.high { border-left-color: var(--high); } .flag.moderate { border-left-color: var(--mod); }
.flag-head { display: flex; gap: 10px; align-items: flex-start; }
.flag-head p { margin: 2px 0 0; }
.badge { font-size: 11px; font-weight: 800; text-transform: uppercase; padding: 4px 8px; border-radius: 8px; flex: none; letter-spacing: .03em; }
.badge.high { background: var(--high-soft); color: var(--high); } .badge.moderate { background: var(--mod-soft); color: var(--mod); } .badge.low { background: var(--low-soft); color: var(--low); }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; color: var(--muted); margin: 12px 0 4px; }
.effects { margin: 0; padding-left: 20px; font-size: 14px; }
.effects li { margin: 2px 0; }
.foryou { background: var(--mod-soft); border-radius: 12px; padding: 4px 12px 8px; margin-top: 12px; font-size: 14px; color: var(--ink); }
.foryou .label { color: var(--mod); }
.foryou p { margin: 4px 0; }
.src { color: var(--muted); margin: 10px 0 0; }
.card.good { background: var(--ok-soft); color: var(--ok); }

.mh-intro { margin: -4px 2px 6px; }
.mh { border-left: 5px solid var(--mind); }
.mh .foryou { background: var(--mind-soft); } .mh .foryou .label { color: var(--mind); }
.mh-summary { background: var(--mind-soft); color: var(--mind); font-size: 14.5px; }
.mh-summary p { margin: 0; }
.ev { font-size: 11px; font-weight: 800; text-transform: uppercase; padding: 4px 8px; border-radius: 8px; flex: none; letter-spacing: .03em; background: var(--mind-soft); color: var(--mind); }
.ev.strong { background: var(--mind); color: #fff; } .ev.moderate { background: color-mix(in srgb, var(--mind) 75%, #fff); color: #fff; } .ev.anecdotal { background: var(--sev-grey-soft); color: var(--muted); }

.safe-list { list-style: none; margin: 0; padding: 0; }
.safe-list li { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--line); }
.safe-list li:last-child { border-bottom: 0; }
.sname { font-weight: 600; }
.sname::before { content: none; }
.full-list summary { font-weight: 700; cursor: pointer; }
.inci { font-size: 14px; color: var(--ink); }
.hl { font-weight: 700; padding: 0 3px; border-radius: 4px; }
.hl.high { background: var(--high-soft); color: var(--high); } .hl.moderate { background: var(--mod-soft); color: var(--mod); } .hl.low { background: var(--low-soft); color: var(--low); }
.alt { background: linear-gradient(160deg, #ecfdf5, #fff 60%); }
.alt h3 { font-size: 18px; margin-top: 6px; }
.alt p { margin: 6px 0; }
.ticks { list-style: none; padding: 0; margin: 8px 0; font-size: 14px; }
.ticks li::before { content: '✓ '; color: var(--ok); font-weight: 800; }

.chat .msgs { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; }
.msg { padding: 10px 12px; border-radius: 14px; font-size: 14.5px; max-width: 88%; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--bg2); color: var(--ink); border-bottom-left-radius: 4px; }
.msg .tag { display: block; width: fit-content; margin-bottom: 4px; }
.suggest { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: none; }
.ask { display: flex; gap: 8px; margin-top: 6px; }
.ask input { margin: 0; }
.ask .btn { padding: 0 18px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.stat { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 12px; text-align: center; }
.stat b { display: block; font-size: 24px; color: var(--brand); }
.stat span { font-size: 12px; color: var(--muted); }
.timeline { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 16px 12px; }
.tl-day h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 6px; }
.tl-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: inherit; text-decoration: none; font-size: 15px; }
.tl-time { width: 70px; flex: none; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; font-size: 14px; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand-2); box-shadow: 0 0 0 4px var(--brand-soft); flex: none; }
.empty p { color: var(--muted); }

.disclaimer { font-size: 12.5px; color: color-mix(in srgb, var(--ink) 72%, var(--muted)); background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 22px 0 8px; }
.about .disclaimer { margin: 10px 0 0; }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 8px 0 calc(8px + var(--safe-b)); z-index: 20; }
.tabbar[hidden] { display: none; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 650; min-width: 80px; }
.tabbar a .ti { font-size: 22px; filter: grayscale(1); opacity: .7; }
.tabbar a.active { color: var(--brand); }
.tabbar a.active .ti { filter: none; opacity: 1; }
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 20; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.logged .btn { white-space: nowrap; flex: none; }
.logged > div { min-width: 0; }

/* Health Canada citations */
.hc-line { font-size: 12.5px; color: var(--ink); background: color-mix(in srgb, var(--brand-soft) 55%, var(--card)); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.hc-line a { color: var(--brand); }
.hc-summary { margin: 8px 0 0; }
.hc-sources { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.hc-link {
  display: block; font-size: 12.5px; font-weight: 650; color: var(--brand); text-decoration: underline;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; line-height: 1.35;
}
.hc-link:active { background: var(--brand-soft); }

/* Use-time chips */
.slot-chips { display: grid; grid-template-columns: 1fr; gap: 8px; }
.slot-chip {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; padding: 12px 14px;
  font: inherit; cursor: pointer; text-align: left;
}
.slot-chip span { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.slot-chip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.slot-chip.on span { color: var(--brand); }

/* Multi-product picker */
.carousel { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x mandatory; }
.pcard-link { text-decoration: none; color: inherit; flex: none; scroll-snap-align: start; }
.pcard-mock {
  width: 168px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 14px; position: relative;
}
.pcard-mock .emoji {
  height: 88px; border-radius: 14px; background: linear-gradient(145deg,#ccfbf1,#99f6e4);
  display: flex; align-items: center; justify-content: center; font-size: 40px; margin-bottom: 10px;
}
.pcard-mock .name { font-size: 14px; font-weight: 750; line-height: 1.25; min-height: 36px; }
.pcard-mock .meta { font-size: 12px; color: var(--muted); margin: 4px 0; }
.score-dot { position: absolute; top: 20px; right: 20px; width: 14px; height: 14px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px #fff; }
.score-dot.high { background: var(--high); } .score-dot.moderate { background: var(--mod); } .score-dot.low { background: var(--low); }

/* Severity colour system (borders + dots; not colour-only) */
:root {
  --sev-red: #dc2626; --sev-red-soft: #fef2f2;
  --sev-yellow: #d97706; --sev-yellow-soft: #fffbeb;
  --sev-green: #16a34a; --sev-green-soft: #f0fdf4;
  --sev-grey: #94a3b8; --sev-grey-soft: #f8fafc;
}
.sev-card {
  background: var(--card); border-radius: 14px; margin: 8px 0;
  border: 2.5px solid var(--sev-grey); box-shadow: var(--shadow); overflow: hidden;
}
.sev-card.sev-serious, .sev-card.sev-red { border-color: var(--sev-red); }
.sev-card.sev-mild, .sev-card.sev-yellow { border-color: var(--sev-yellow); }
.sev-card.sev-none, .sev-card.sev-green { border-color: var(--sev-green); }
.sev-card.sev-no_info, .sev-card.sev-grey { border-color: var(--sev-grey); }
.product.sev-serious, .verdict-wrap.sev-serious { border: 2.5px solid var(--sev-red); border-radius: var(--radius); }
.product.sev-mild { border: 2.5px solid var(--sev-yellow); border-radius: var(--radius); }
.product.sev-none { border: 2.5px solid var(--sev-green); border-radius: var(--radius); }
.product.sev-no_info { border: 2.5px solid var(--sev-grey); border-radius: var(--radius); }
.sev-summary {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer;
  list-style: none; font-weight: 650; font-size: 14.5px;
}
.sev-summary::-webkit-details-marker { display: none; }
.sev-dot {
  width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: var(--sev-grey); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--sev-grey);
}
.sev-serious .sev-dot, .sev-red .sev-dot { background: var(--sev-red); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--sev-red); }
.sev-mild .sev-dot, .sev-yellow .sev-dot { background: var(--sev-yellow); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--sev-yellow); }
.sev-none .sev-dot, .sev-green .sev-dot { background: var(--sev-green); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--sev-green); }
.sev-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sev-tag {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
  padding: 3px 8px; border-radius: 8px; background: var(--sev-grey-soft); color: var(--muted); flex: none;
}
.sev-serious .sev-tag { background: var(--sev-red-soft); color: var(--sev-red); }
.sev-mild .sev-tag { background: var(--sev-yellow-soft); color: var(--sev-yellow); }
.sev-none .sev-tag { background: var(--sev-green-soft); color: var(--sev-green); }
.sev-chevron { color: var(--muted); transition: transform .15s; }
details[open] > .sev-summary .sev-chevron { transform: rotate(180deg); }
.sev-body { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.summary-count { margin: 8px 2px 4px; }
.banner.pregnancy { background: #fdf2f8; color: #9d174d; border: 1.5px solid #fbcfe8; }
.area-card { text-align: left; cursor: pointer; border: 0; width: 100%; font: inherit; }
.area-card .emoji { font-size: 28px; }
.area-card h2 { font-size: 18px; margin: 4px 0; }
.unknown-list .uname::before, .safe-list .sname::before { content: none !important; }
.unknown-list, .noinfo-list { list-style: none; margin: 0; padding: 0; }
.noinfo-list > li { border-bottom: 1px solid var(--line); padding: 6px 0; }
.noinfo-item summary { cursor: pointer; font-weight: 600; }
.why-box { margin-top: 6px; }
.disc-short { margin: 12px 0; }
.disc-short summary { cursor: pointer; }
.preg-link { display: block; text-decoration: none; color: inherit; font-weight: 650; }
.tag.ok { background: var(--sev-green-soft); color: var(--sev-green); }
.gentle-next { font-size: 13px; color: var(--muted); text-align: center; margin: 16px 0 8px; }

/* App header with hamburger */
.app-hdr { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.app-hdr .mode-label { flex: 1; min-width: 0; font-weight: 800; font-size: 15px; color: var(--brand); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-hdr .mode-pill {
  flex: none; font-weight: 800; font-size: 12px; color: var(--sage, var(--brand));
  background: var(--brand-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 12px; letter-spacing: .01em;
  white-space: nowrap; max-width: 42%; overflow: hidden; text-overflow: ellipsis;
}
.chip .chip-tag, .chip-tag {
  flex: none; display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .02em;
  color: #9d174d; background: #fdf2f8; border: 1px solid #fbcfe8;
  border-radius: 999px; padding: 2px 7px; margin-left: 2px; vertical-align: middle;
}
html[data-theme="dark"] .chip-tag { color: #f9a8d4; background: #3a1a2a; border-color: #7a3458; }
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .chip-tag,
  html:not([data-theme]) .chip-tag { color: #f9a8d4; background: #3a1a2a; border-color: #7a3458; }
}
.chip { max-width: 62%; display: inline-flex; align-items: center; gap: 6px; overflow: hidden; }
.menu-btn { flex: none; width: 42px; height: 42px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; cursor: pointer; padding: 0; }
.menu-btn:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.menu-btn .bar { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; }
.menu-btn[aria-expanded="true"] { border-color: var(--brand); background: var(--brand-soft); }

.menu-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 40; border: 0; padding: 0; cursor: pointer; }
.menu-panel { position: fixed; top: 0; left: 0; bottom: 0; width: min(320px, 88vw); background: var(--card); z-index: 41; box-shadow: 8px 0 32px rgba(15,23,42,.18); padding: calc(12px + env(safe-area-inset-top, 0px)) 0 24px; overflow-y: auto; display: flex; flex-direction: column; animation: menuIn .18s ease-out; }
@keyframes menuIn { from { transform: translateX(-12px); opacity: .6; } to { transform: none; opacity: 1; } }
.menu-panel h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 16px 6px; font-weight: 750; }
.menu-panel .menu-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; padding: 12px 16px; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; text-decoration: none; }
.menu-panel .menu-item:hover, .menu-panel .menu-item:focus-visible { background: var(--brand-soft); color: var(--brand); outline: none; }
.menu-panel .menu-item .check { width: 18px; color: var(--brand); font-weight: 800; flex: none; }
.menu-panel .menu-item .grow { flex: 1; }
.menu-panel .menu-note { margin: 0 16px 8px; font-size: 12px; color: var(--muted); }
.menu-panel .menu-close { align-self: flex-end; margin: 0 12px 4px; }
.menu-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.menu-toggle .toggle { position: relative; width: 48px; height: 28px; border-radius: 99px; border: 0; background: #cbd5e1; cursor: pointer; flex: none; padding: 0; transition: background .15s; }
.menu-toggle .toggle[aria-checked="true"] { background: var(--brand); }
.menu-toggle .toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.menu-toggle .toggle[aria-checked="true"]::after { transform: translateX(20px); }
.menu-toggle .toggle:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.menu-toggle.readonly .toggle { opacity: .55; cursor: not-allowed; }

/* ===== Sage & Organic (live) ===== */
:root {
  --bg: #F5F7F1; --bg2: #E6EFE4; --card: #FFFCFA; --ink: #1F2E24; --muted: #5F7366; --line: #C9D9C8;
  --brand: #5B8A6A; --brand-2: #7AA37E; --brand-soft: #D8E8D6; --sage: #4A7358;
  --high: #C62828; --high-soft: #FDECEA; --mod: #C47A12; --mod-soft: #FFF6E8; --low: #ca8a04; --low-soft: #fefce8;
  --ok: #0F766E; --ok-soft: #E6F7F5; --noinfo: #8A9088; --noinfo-soft: #F0F2EF;
  --mind: #7c3aed; --mind-soft: #f5f3ff;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(31,46,36,.05), 0 10px 28px rgba(31,46,36,.08);
  --nav-bg: rgba(232, 242, 230, 0.94);
  --organic-bg: url("/bg-organic.svg");
}
html[data-theme="dark"] {
  --bg: #152018; --bg2: #1a2a20; --card: #1c2c22; --ink: #e8f0ea; --muted: #9bb5a4; --line: #2f4336;
  --brand: #7AA37E; --brand-2: #5B8A6A; --brand-soft: #24382c; --sage: #9bc4a6;
  --high: #f87171; --high-soft: #3f1212; --mod: #fbbf24; --mod-soft: #3a2a0a; --low: #facc15; --low-soft: #3a2a0a;
  --ok: #5eead4; --ok-soft: #0f2a28; --noinfo: #9bb5a4; --noinfo-soft: #243028;
  --mind: #c4b5fd; --mind-soft: #2a2040;
  --sev-red: #f87171; --sev-red-soft: #3f1212;
  --sev-yellow: #fbbf24; --sev-yellow-soft: #3a2a0a;
  --sev-green: #4ade80; --sev-green-soft: #0f2a28;
  --sev-grey: #9bb5a4; --sev-grey-soft: #243028;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.35);
  --nav-bg: rgba(22, 34, 26, 0.94);
  --organic-bg: url("/bg-organic-dark.svg");
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"], html:not([data-theme]) {
    --bg: #152018; --bg2: #1a2a20; --card: #1c2c22; --ink: #e8f0ea; --muted: #9bb5a4; --line: #2f4336;
    --brand: #7AA37E; --brand-2: #5B8A6A; --brand-soft: #24382c; --sage: #9bc4a6;
    --high: #f87171; --high-soft: #3f1212; --mod: #fbbf24; --mod-soft: #3a2a0a; --low: #facc15; --low-soft: #3a2a0a;
    --ok: #5eead4; --ok-soft: #0f2a28; --noinfo: #9bb5a4; --noinfo-soft: #243028;
    --mind: #c4b5fd; --mind-soft: #2a2040;
    --sev-red: #f87171; --sev-red-soft: #3f1212;
    --sev-yellow: #fbbf24; --sev-yellow-soft: #3a2a0a;
    --sev-green: #4ade80; --sev-green-soft: #0f2a28;
    --sev-grey: #9bb5a4; --sev-grey-soft: #243028;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.35);
    --nav-bg: rgba(22, 34, 26, 0.94);
    --organic-bg: url("/bg-organic-dark.svg");
  }
}
html[data-theme="dark"] .btn.ghost,
html[data-theme="system"] .btn.ghost { background: var(--card); }
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .btn.ghost,
  html:not([data-theme]) .btn.ghost { background: var(--card); }
  html[data-theme="system"] .seg-opt span,
  html[data-theme="system"] input[type=number],
  html[data-theme="system"] input:not([type]),
  html[data-theme="system"] input[type=text],
  html[data-theme="system"] textarea,
  html:not([data-theme]) .seg-opt span,
  html:not([data-theme]) input[type=number],
  html:not([data-theme]) input:not([type]),
  html:not([data-theme]) input[type=text],
  html:not([data-theme]) textarea { background: #1a2a20; color: var(--ink); }
  html[data-theme="system"] .chip,
  html:not([data-theme]) .chip { background: var(--card); color: var(--muted); }
  html[data-theme="system"] .list,
  html[data-theme="system"] .scan-card,
  html:not([data-theme]) .list,
  html:not([data-theme]) .scan-card { background: var(--card); }
  html[data-theme="system"] .scan-card,
  html:not([data-theme]) .scan-card { background: radial-gradient(120% 90% at 100% 0%, var(--brand-soft) 0%, var(--card) 55%); }
  html[data-theme="system"] .tabbar,
  html:not([data-theme]) .tabbar { background: var(--nav-bg); }
  html[data-theme="system"] .banner.demo,
  html:not([data-theme]) .banner.demo { background: #1e1b4b; color: #c7d2fe; border-color: #6366f1; }
  html[data-theme="system"] .menu-panel,
  html:not([data-theme]) .menu-panel { background: var(--card); }
  html[data-theme="system"] .menu-backdrop,
  html:not([data-theme]) .menu-backdrop { background: rgba(0,0,0,.5); }
}
html[data-theme="dark"] .seg-opt span,
html[data-theme="dark"] input[type=number],
html[data-theme="dark"] input:not([type]),
html[data-theme="dark"] input[type=text],
html[data-theme="dark"] textarea { background: #1a2a20; color: var(--ink); }
html[data-theme="dark"] .chip { background: var(--card); color: var(--muted); }
html[data-theme="dark"] .list, html[data-theme="dark"] .scan-card { background: var(--card); }
html[data-theme="dark"] .scan-card { background: radial-gradient(120% 90% at 100% 0%, var(--brand-soft) 0%, var(--card) 55%); }
html[data-theme="dark"] .tabbar { background: var(--nav-bg); }
html[data-theme="dark"] .banner.demo { background: #1e1b4b; color: #c7d2fe; border-color: #6366f1; }
html[data-theme="dark"] .banner.limit { background: #1c2620; color: #c5d0c6; border-color: #3d4a42; }
html[data-theme="dark"] .msg.assistant.limit { background: #1c2620; color: #c5d0c6; border-color: #3d4a42; }
html[data-theme="dark"] .menu-panel { background: var(--card); }
html[data-theme="dark"] .menu-backdrop { background: rgba(0,0,0,.5); }

/* Organic SVG backdrop — fixed layer (NOT background-attachment:fixed; that breaks on iOS).
   Important: never use the `background:` shorthand after setting background-image — it clears the art. */
html, body {
  background-color: var(--bg);
  background-image: none;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  min-height: 100%;
  min-height: 100dvh;
}
body {
  overflow-x: hidden;
}
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: var(--bg);
  background-image: var(--organic-bg);
  background-repeat: no-repeat;
  background-position: top center;
  /* Cover the viewport like the 390×844 mockup on any phone size */
  background-size: cover;
}
#app {
  position: relative;
  z-index: 1;
  background: transparent;
  max-width: 560px;
  margin: 0 auto;
  padding-bottom: calc(84px + var(--safe-b));
}
.screen { background: transparent; }
.page-title { letter-spacing: -.03em; }
.card { border: 1px solid rgba(255,255,255,.04); }
.btn { border-radius: 16px; }
.btn.primary { box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 28%, transparent); }
.mode-label, .page-title { color: var(--sage, var(--brand)); }
.chip { background: var(--brand-soft); border-color: var(--line); color: var(--sage, var(--brand)); }
.tabbar { background: var(--nav-bg); border-top: 1.5px solid var(--line); }
.menu-btn { background: var(--brand-soft); border-color: var(--line); }
.logo-mark { box-shadow: 0 14px 32px color-mix(in srgb, var(--brand) 32%, transparent); }


.logo-mark {
  width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 24px;
  background: linear-gradient(145deg, var(--brand-2), var(--brand));
  display: grid; place-items: center; box-shadow: 0 14px 32px rgba(13,148,136,.32);
}
.logo-mark img, .logo-mark svg { width: 48px; height: 48px; }
.promise { color: var(--muted); font-size: 15px; max-width: 320px; margin: 0 auto 20px; }

.verdict-ring-card {
  display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: 24px;
  background: var(--card); box-shadow: var(--shadow); margin: 14px 0;
}
.vring {
  width: 88px; height: 88px; border-radius: 50%; flex: none; position: relative;
  display: grid; place-items: center;
  background: conic-gradient(var(--high) 0 var(--p1), var(--ok) var(--p1) var(--p2), var(--noinfo) var(--p2) 100%);
}
.vring::after { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: var(--card); }
.vring .vnum { position: relative; z-index: 1; font-size: 22px; font-weight: 850; }
.vcounts { font-size: 14px; line-height: 1.45; }
.vcounts strong { font-weight: 800; }

.cat-ico {
  width: 48px; height: 48px; border-radius: 14px; background: var(--brand-soft);
  display: grid; place-items: center; flex: none;
}
.cat-ico svg { width: 24px; height: 24px; stroke: var(--brand); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.thumb.cat { object-fit: contain; padding: 8px; background: var(--brand-soft); }

.scan-frame { position: relative; }
.scan-frame .shimmer {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.4) 50%, transparent 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

details.sev-card { transition: box-shadow .2s ease; }
details.sev-card[open] { box-shadow: 0 4px 16px rgba(28,43,42,.08); }
@media (prefers-reduced-motion: reduce) {
  .scan-frame .shimmer, .laser, .btn, details.sev-card { animation: none !important; transition: none !important; }
}

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 12px 0; }
.week .day {
  background: var(--card); border-radius: 14px; padding: 10px 4px; text-align: center;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.week .day .d { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.week .day .n { font-size: 16px; font-weight: 850; margin: 4px 0; }
.week .day .dots { display: flex; justify-content: center; gap: 3px; min-height: 8px; }
.week .day .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.week .day.today { border-color: var(--brand); background: var(--brand-soft); }

.scan-card-v2 {
  background: var(--card);
  background-image: radial-gradient(120% 90% at 100% 0%, var(--brand-soft) 0%, var(--card) 55%);
  text-align: center;
  padding: 20px 16px 18px;
}
.scan-card-v2 .scan-headline {
  font-size: 22px; font-weight: 850; letter-spacing: -.03em; margin: 0 0 4px; color: var(--ink);
}
.scan-card-v2 .scan-sub {
  margin: 0 0 14px; font-size: 13.5px; font-weight: 600; color: var(--muted); line-height: 1.35;
}
.cam-guide {
  position: relative; border-radius: 22px; overflow: hidden;
  background: linear-gradient(165deg, var(--brand-soft) 0%, var(--bg2, #efebe6) 100%);
  color: var(--ink);
  padding: 14px 12px 12px; margin: 0 0 14px;
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}
.cam-stage {
  position: relative; height: 148px; margin: 0 auto 12px; max-width: 220px;
  display: grid; place-items: center;
}
.cam-brackets { position: absolute; inset: 8px; pointer-events: none; }
.cam-brackets .br {
  position: absolute; width: 22px; height: 22px;
  border-color: var(--brand); border-style: solid; border-width: 0;
  opacity: .95;
}
.cam-brackets .tl { top: 0; left: 0; border-top-width: 3px; border-left-width: 3px; border-top-left-radius: 10px; }
.cam-brackets .tr { top: 0; right: 0; border-top-width: 3px; border-right-width: 3px; border-top-right-radius: 10px; }
.cam-brackets .bl { bottom: 0; left: 0; border-bottom-width: 3px; border-left-width: 3px; border-bottom-left-radius: 10px; }
.cam-brackets .brc { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; border-bottom-right-radius: 10px; }
.cam-pulse {
  position: absolute; inset: 18px; border-radius: 16px;
  border: 1.5px solid rgba(13,148,136,.28);
  animation: camPulse 2.4s ease-in-out infinite;
}
.cam-mark {
  width: 52px; height: 52px; color: var(--brand); opacity: .85; position: relative; z-index: 1;
}
.tip-chips {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.tip-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 11px; font-size: 12px; font-weight: 700;
  box-shadow: var(--shadow); max-width: 100%;
}
.tip-chip svg {
  width: 16px; height: 16px; flex: none;
  stroke: var(--brand); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.tip-chip span { white-space: nowrap; }
@keyframes camPulse {
  0%, 100% { opacity: .45; transform: scale(1); }
  50% { opacity: .9; transform: scale(1.02); }
}
@media (prefers-reduced-motion: reduce) {
  .cam-pulse { animation: none !important; opacity: .7; }
}
.blur-warn {
  background: #fff7ed; color: #9a3412; border: 1.5px solid #fed7aa; border-radius: 14px; padding: 12px 14px; margin: 10px 0; font-size: 14px;
}
html[data-theme="dark"] .blur-warn { background: #3a2a0a; color: #fde68a; border-color: #a16207; }
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .blur-warn,
  html:not([data-theme]) .blur-warn { background: #3a2a0a; color: #fde68a; border-color: #a16207; }
}

.tour-card {
  background: var(--card); border-radius: 24px; box-shadow: var(--shadow); padding: 28px 20px; text-align: center; min-height: 280px;
  display: flex; flex-direction: column; justify-content: center;
}
.tour-card .emoji { font-size: 48px; margin-bottom: 12px; }
.tour-dots { display: flex; gap: 8px; justify-content: center; margin: 16px 0; }
.tour-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.tour-dots span.on { background: var(--brand); }
.check-pop { animation: checkPop .35s ease; }
@keyframes checkPop { from { transform: scale(.8); opacity: .4; } to { transform: scale(1); opacity: 1; } }

.slot-chip .slot-ico { font-size: 18px; display: block; }

.vring { background: conic-gradient(var(--high) 0 var(--p1,0%), var(--ok) var(--p1,0%) var(--p2,0%), var(--noinfo) var(--p2,0%) 100%); }
.slot-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.slot-chip .slot-ico { font-size: 18px; line-height: 1; }
.welcome .promise { text-align: center; }
@media (prefers-color-scheme: dark) {
  .verdict-ring-card .vcounts { color: var(--ink); }
  .dot.high, .vring { /* severity stays saturated */ }
  .tag.warn { background: var(--mod-soft); color: #fde68a; }
  .banner.demo { background: #1e1b4b; color: #c7d2fe; border-color: #6366f1; }
}

@media (prefers-color-scheme: dark) {
  .cam-guide {
    background: linear-gradient(165deg, var(--brand-soft) 0%, var(--bg2) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  }
  .tip-chip { background: var(--card); }
  .cam-pulse { border-color: rgba(20,184,166,.35); }
}

#shareBtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
#shareBtn svg { flex: none; }

/* Appearance setting */
.appearance-seg { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin: 8px 0 4px; }
.appearance-seg button {
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 12px; padding: 10px 6px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.appearance-seg button[aria-pressed="true"] {
  border-color: var(--brand); background: var(--brand-soft); color: var(--sage, var(--brand));
}

/* Add to Home Screen tip */
.a2hs-card { text-align: left; max-width: 400px; margin: 0 auto; }
.a2hs-illus {
  width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 20px;
  background: var(--brand-soft); color: var(--sage, var(--brand));
  display: grid; place-items: center;
}
.a2hs-illus svg { width: 40px; height: 40px; }
.a2hs-steps { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 12px; }
.a2hs-steps li {
  display: flex; gap: 12px; align-items: flex-start;
  background: color-mix(in srgb, var(--card) 90%, var(--brand-soft));
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  font-size: 14px; font-weight: 600; color: var(--ink);
}
.a2hs-steps .n {
  flex: none; width: 28px; height: 28px; border-radius: 99px;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  font-size: 13px; font-weight: 800;
}
.a2hs-steps .ico { flex: none; width: 28px; height: 28px; color: var(--sage, var(--brand)); }
.a2hs-actions { display: grid; gap: 8px; margin-top: 8px; }


/* —— Dual home scan options (barcode + photo) —— */
.scan-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 4px 0 12px;
}
.scan-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  text-align: center;
  margin: 0;
  padding: 18px 12px 16px;
  min-height: 156px;
  border-radius: 20px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .15s, background .15s, transform .12s;
}
.scan-option:hover,
.scan-option:focus-visible {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand-soft) 70%, var(--card));
  outline: none;
}
.scan-option:active { transform: scale(.98); }
.scan-option-ico {
  width: 52px; height: 52px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: var(--brand-soft);
  color: var(--sage, var(--brand));
  flex: none;
}
.scan-option-ico svg { width: 30px; height: 30px; display: block; }
.scan-option-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
  line-height: 1.25;
}
.scan-option-hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
  max-width: 18ch;
}
.link-manual {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 2px 0 0;
  padding: 10px 8px;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-manual:hover,
.link-manual:focus-visible {
  color: var(--sage, var(--brand));
  outline: none;
}
@media (max-width: 360px) {
  .scan-options { grid-template-columns: 1fr; }
  .scan-option { min-height: 0; padding: 16px 14px; }
  .scan-option-hint { max-width: none; }
}
html[data-theme="dark"] .scan-option {
  background: color-mix(in srgb, var(--card) 92%, var(--brand-soft));
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .scan-option,
  html:not([data-theme]) .scan-option {
    background: color-mix(in srgb, var(--card) 92%, var(--brand-soft));
  }
}

.barcode-screen .scan-frame,
.barcode-stage {
  position: relative; width: 100%; max-width: 360px; margin: 12px auto;
  aspect-ratio: 3 / 4; border-radius: 24px; overflow: hidden;
  background: #0f172a; box-shadow: var(--shadow);
}
.barcode-stage video, #barcodeReader video, #barcodeReader {
  width: 100% !important; height: 100% !important; object-fit: cover;
}
#barcodeReader { position: relative; min-height: 280px; }
.barcode-overlay {
  pointer-events: none; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.barcode-overlay .bc-window {
  position: relative;
  width: 84%; height: 34%; border: 2.5px solid rgba(255,255,255,.92);
  border-radius: 14px; box-shadow: 0 0 0 999px rgba(15,23,42,.42);
}
.barcode-overlay .bc-window::after {
  content: ''; position: absolute; left: 8%; right: 8%; top: 50%; height: 2px;
  background: rgba(122,163,126,.85); transform: translateY(-50%);
  box-shadow: 0 0 10px rgba(122,163,126,.6);
  animation: bcScanLine 1.8s ease-in-out infinite alternate;
}
@keyframes bcScanLine { from { opacity: .35; } to { opacity: 1; } }
.bc-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px 12px; margin: 8px 0 4px;
}
.bc-focus-hint { margin: 0; text-align: center; opacity: .85; }
.bc-focus-hint.pulse { color: var(--brand); font-weight: 700; }
.bc-focus-ring {
  position: absolute; width: 72px; height: 72px; margin: -36px 0 0 -36px;
  border: 2.5px solid #7AA37E; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(75,115,88,.35), 0 0 18px rgba(91,138,106,.45);
  pointer-events: none; opacity: 0; z-index: 5;
  background: radial-gradient(circle, rgba(122,163,126,.18) 0%, transparent 70%);
}
.bc-focus-ring-anim {
  animation: bcFocusRing .85s ease-out forwards;
}
@keyframes bcFocusRing {
  0% { opacity: 0; transform: scale(1.45); }
  18% { opacity: 1; transform: scale(1); }
  70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(.92); }
}
@media (prefers-reduced-motion: reduce) {
  .bc-focus-ring-anim { animation: none; opacity: 1; }
}
.barcode-reader-live { touch-action: manipulation; }
.barcode-reader-live video { will-change: transform; }
.bc-trouble { margin-top: 8px; }
.bc-early-actions { margin-top: 4px; }
.barcode-reader-live { position: relative; width: 100%; height: 100%; min-height: 280px; }
.barcode-stage video { background: #0f172a; }
@media (prefers-reduced-motion: reduce) {
  .barcode-overlay .bc-window::after { animation: none !important; }
}
.barcode-manual input[type="text"], .barcode-manual input[inputmode] {
  font-size: 1.15rem; letter-spacing: .06em; text-align: center;
  font-variant-numeric: tabular-nums;
}
.barcode-note {
  background: var(--brand-soft, #e8f2ec); color: var(--ink);
  border-radius: 14px; padding: 10px 12px; font-size: 13px; margin: 10px 0;
}
html[data-theme="dark"] .barcode-note { background: var(--brand-soft); }
.barcode-attr { font-size: 11px; opacity: .75; margin-top: 8px; }
.scan-card-v2 .cam-mark.barcode-mark rect { stroke-dasharray: 4 3; }


/* —— Tidy home (approved mockup) —— */
.home-tidy .home-greet { margin-bottom: 4px; }
.home-tidy .page-title { margin: 2px 0 4px; }
.scan-sub-top {
  margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--muted); line-height: 1.35;
}
.home-tidy .scan-card-v2 { padding-top: 16px; }
.sources-line {
  margin: 14px 0 8px; font-size: 12.5px; line-height: 1.4; color: var(--sage, var(--brand));
  background: color-mix(in srgb, var(--brand-soft) 75%, var(--card));
  border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; font-weight: 600;
}
.sources-more-btn {
  color: var(--brand); font-weight: 800; background: none; border: 0; padding: 0;
  font: inherit; font-size: inherit; font-weight: 800; text-decoration: underline;
  text-underline-offset: 2px; cursor: pointer;
}
.sources-more-btn:hover, .sources-more-btn:focus-visible { color: var(--sage, var(--brand)); outline: none; }
.sources-more {
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line);
  font-size: 12px; font-weight: 550; color: var(--muted);
}
.sources-more[hidden] { display: none !important; }
.sources-more p { margin: 0 0 6px; }
.sources-more .sources-link { margin: 0; }
.sources-more a.link { color: var(--brand); font-weight: 800; }

/* About our sources (collapsible) */
.about-sources { display: flex; flex-direction: column; gap: 8px; }
.about-sources-disclaimer {
  margin: 0; font-size: 12.5px; font-weight: 700; line-height: 1.4;
  color: var(--ink);
}
.about-sources-toggle {
  align-self: flex-start; text-align: left;
  color: var(--brand); font-weight: 800; background: none; border: 0; padding: 0;
  font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.about-sources-toggle:hover, .about-sources-toggle:focus-visible { color: var(--sage, var(--brand)); outline: none; }
.about-sources.open .about-sources-toggle { text-decoration: none; }
.about-sources-group {
  margin: 10px 0 4px; font-size: 11px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
}
.about-sources-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.about-sources-item { display: flex; flex-direction: column; gap: 2px; }
.about-sources-name {
  color: var(--brand); font-weight: 800; font-size: 12.5px; text-decoration: none;
}
.about-sources-name:hover, .about-sources-name:focus-visible { text-decoration: underline; outline: none; }
.about-sources-use { font-size: 12px; font-weight: 550; color: var(--muted); line-height: 1.35; }
.about-sources-attr { margin: 10px 0 0; }
html[data-theme="dark"] .about-sources-disclaimer { color: var(--ink); }
html[data-theme="dark"] .about-sources-use { color: var(--muted); }
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .about-sources-disclaimer,
  html:not([data-theme]) .about-sources-disclaimer { color: var(--ink); }
}

html[data-theme="dark"] .sources-line {
  background: color-mix(in srgb, var(--brand-soft) 55%, var(--card));
  color: var(--sage, var(--brand));
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .sources-line,
  html:not([data-theme]) .sources-line {
    background: color-mix(in srgb, var(--brand-soft) 55%, var(--card));
    color: var(--sage, var(--brand));
  }
}


/* Dark-mode contrast: banners, tags, chips, soft surfaces that stayed light */
html[data-theme="dark"] .banner.pregnancy { background: #3a1a2a; color: #f9a8d4; border-color: #7a3458; }
html[data-theme="dark"] .tag.warn { background: var(--mod-soft); color: #fde68a; }
html[data-theme="dark"] .chip { background: var(--card); color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .suggest .chip { color: var(--ink); }
html[data-theme="dark"] .alt { background: linear-gradient(160deg, var(--ok-soft), var(--card) 60%); color: var(--ink); }
html[data-theme="dark"] .scan-card { background: radial-gradient(120% 90% at 100% 0%, var(--brand-soft) 0%, var(--card) 55%); }
html[data-theme="dark"] textarea { background: #1a2a20; color: var(--ink); }
html[data-theme="dark"] .sev-dot { box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--sev-grey); }
html[data-theme="dark"] .sev-serious .sev-dot, html[data-theme="dark"] .sev-red .sev-dot { box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--sev-red); }
html[data-theme="dark"] .sev-mild .sev-dot, html[data-theme="dark"] .sev-yellow .sev-dot { box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--sev-yellow); }
html[data-theme="dark"] .sev-none .sev-dot, html[data-theme="dark"] .sev-green .sev-dot { box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--sev-green); }
html[data-theme="dark"] .score-dot { box-shadow: 0 0 0 3px var(--card); }
html[data-theme="dark"] .msg.assistant { background: var(--bg2); color: var(--ink); }
html[data-theme="dark"] .card.unknown { background: var(--noinfo-soft); color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .card.unknown strong { color: var(--ink); }
html[data-theme="dark"] .disclaimer { background: var(--bg2); color: var(--muted); }
html[data-theme="dark"] .disc-short { color: var(--muted); }
html[data-theme="dark"] .summary-count { color: var(--muted); }
html[data-theme="dark"] .why-box { color: var(--ink); }
html[data-theme="dark"] .noinfo-item summary { color: var(--ink); }
html[data-theme="dark"] .sev-body { color: var(--ink); }
html[data-theme="dark"] .sev-body .muted { color: var(--muted); }

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .banner.pregnancy,
  html:not([data-theme]) .banner.pregnancy { background: #3a1a2a; color: #f9a8d4; border-color: #7a3458; }
  html[data-theme="system"] .tag.warn,
  html:not([data-theme]) .tag.warn { background: var(--mod-soft); color: #fde68a; }
  html[data-theme="system"] .chip,
  html:not([data-theme]) .chip { background: var(--card); color: var(--ink); border-color: var(--line); }
  html[data-theme="system"] .alt,
  html:not([data-theme]) .alt { background: linear-gradient(160deg, var(--ok-soft), var(--card) 60%); color: var(--ink); }
  html[data-theme="system"] .msg.assistant,
  html:not([data-theme]) .msg.assistant { background: var(--bg2); color: var(--ink); }
  html[data-theme="system"] .card.unknown,
  html:not([data-theme]) .card.unknown { background: var(--noinfo-soft); color: var(--ink); border-color: var(--line); }
  html[data-theme="system"] .card.unknown strong,
  html:not([data-theme]) .card.unknown strong { color: var(--ink); }
  html[data-theme="system"] .disclaimer,
  html:not([data-theme]) .disclaimer { background: var(--bg2); color: var(--muted); }
  html[data-theme="system"] .sev-dot,
  html:not([data-theme]) .sev-dot { box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--sev-grey); }
  html[data-theme="system"] .sev-serious .sev-dot,
  html[data-theme="system"] .sev-red .sev-dot,
  html:not([data-theme]) .sev-serious .sev-dot,
  html:not([data-theme]) .sev-red .sev-dot { box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--sev-red); }
  html[data-theme="system"] .sev-mild .sev-dot,
  html[data-theme="system"] .sev-yellow .sev-dot,
  html:not([data-theme]) .sev-mild .sev-dot,
  html:not([data-theme]) .sev-yellow .sev-dot { box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--sev-yellow); }
  html[data-theme="system"] .sev-none .sev-dot,
  html[data-theme="system"] .sev-green .sev-dot,
  html:not([data-theme]) .sev-none .sev-dot,
  html:not([data-theme]) .sev-green .sev-dot { box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--sev-green); }
}

.next-ing { background: var(--mod-soft); color: var(--ink); border: 1px solid var(--line); }
.next-ing strong { color: var(--ink); }


/* —— Usage log day browser —— */
.log-toolbar { align-items: center; gap: 8px; margin: 0 0 8px; }
.log-toolbar .log-hint { margin: 0; flex: 1; }
.log-view-toggle { flex: none; padding: 6px 12px; font-size: 13px; border-radius: 999px; }
.week-nav, .cal-nav {
  display: flex; align-items: center; justify-content: space-between; margin: 2px 0 8px;
}
.week-nav h2, .cal-nav h2 { margin: 0; font-size: 15px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; text-align: center; }
.nav-btn {
  width: 36px; height: 36px; border-radius: 12px; background: var(--card);
  border: 1px solid var(--line); display: grid; place-items: center;
  font-weight: 800; font-size: 18px; color: var(--brand); box-shadow: var(--shadow);
  cursor: pointer;
}
.nav-btn:active { transform: scale(.96); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 0 0 12px; }
.week .day {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 8px 4px 6px; text-align: center; box-shadow: var(--shadow);
  cursor: pointer; color: inherit; font: inherit;
}
.week .day .d { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.week .day .n { font-size: 16px; font-weight: 850; margin: 3px 0; color: var(--ink); }
.week .day .dots { display: flex; justify-content: center; gap: 3px; min-height: 7px; }
.week .day .dots i,
.week .day .dots .dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--brand); display: block;
}
.week .day.today { border-color: var(--brand); background: var(--brand-soft); }
.week .day.selected {
  background: var(--brand); border-color: var(--brand);
}
.week .day.selected .d, .week .day.selected .n { color: #fff; }
html[data-theme="dark"] .week .day.selected .d,
html[data-theme="dark"] .week .day.selected .n { color: #152018; }
.week .day.selected .dots i, .week .day.selected .dots .dot { background: #fff; }
html[data-theme="dark"] .week .day.selected .dots i,
html[data-theme="dark"] .week .day.selected .dots .dot { background: #152018; }

.cal-card {
  background: color-mix(in srgb, var(--card) 94%, var(--bg2, var(--bg)));
  border: 1.5px solid var(--line); border-radius: 20px; padding: 10px 8px 12px;
  box-shadow: var(--shadow); margin-bottom: 10px;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow {
  text-align: center; font-size: 10px; font-weight: 750; color: var(--muted);
  text-transform: uppercase; padding: 4px 0 6px;
}
.cal-day {
  aspect-ratio: 1; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--ink); position: relative;
  gap: 3px; background: transparent; border: 0; cursor: pointer; font: inherit; padding: 0;
}
.cal-day.mute { color: var(--muted); opacity: .4; cursor: default; }
.cal-day.today {
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1.5px var(--brand);
}
.cal-day.selected {
  background: var(--brand); color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 35%, transparent);
}
html[data-theme="dark"] .cal-day.selected { color: #152018; }
.cal-day .dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--brand);
}
.cal-day.selected .dot { background: #fff; }
html[data-theme="dark"] .cal-day.selected .dot { background: #152018; }
.cal-day.mute .dot { display: none; }
.cal-legend {
  display: flex; gap: 12px; margin: 10px 2px 0; font-size: 11.5px;
  font-weight: 650; color: var(--muted); align-items: center;
}
.cal-legend i {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand); margin-right: 5px; vertical-align: middle;
}

.day-sheet {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow); padding: 14px 14px 10px;
  display: flex; flex-direction: column;
}
.day-sheet-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; margin-bottom: 10px;
}
.day-sheet-head h3 {
  margin: 0; font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -.02em;
}
.day-sheet-head .count {
  font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap;
}
.day-list { display: flex; flex-direction: column; }
.day-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 2px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit;
}
.day-row:last-child { border-bottom: 0; }
.day-sheet .thumb {
  width: 48px; height: 48px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-size: 22px;
  background: var(--brand-soft); border: 1px solid var(--line); overflow: hidden;
}
.day-sheet .thumb img { width: 100%; height: 100%; object-fit: cover; }
.day-sheet .row-title {
  font-size: 14.5px; font-weight: 750; color: var(--ink); letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.day-sheet .row-meta { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.result-chip {
  flex: none; font-size: 10.5px; font-weight: 750; border-radius: 12px;
  padding: 5px 8px; max-width: 118px; line-height: 1.2;
  text-align: center; white-space: normal;
}
.result-chip.red { background: var(--sev-red-soft); color: var(--sev-red); }
.result-chip.yellow { background: var(--sev-yellow-soft); color: var(--sev-yellow); }
.result-chip.teal, .result-chip.green { background: var(--sev-green-soft); color: var(--sev-green); }
.result-chip.grey { background: var(--sev-grey-soft); color: var(--sev-grey); }
/* Dark: chips keep soft bg + saturated text for WCAG AA */
html[data-theme="dark"] .result-chip.red { color: #fecaca; }
html[data-theme="dark"] .result-chip.yellow { color: #fde68a; }
html[data-theme="dark"] .result-chip.teal,
html[data-theme="dark"] .result-chip.green { color: #bbf7d0; }
html[data-theme="dark"] .result-chip.grey { color: #d1e0d6; }
.empty-day {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 28px 16px; gap: 8px;
}
.empty-day .ico {
  width: 56px; height: 56px; border-radius: 18px; background: var(--brand-soft);
  display: grid; place-items: center; font-size: 26px; margin-bottom: 4px;
}
.empty-day p { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.empty-day .sub { font-size: 13px; font-weight: 600; color: var(--muted); max-width: 24ch; }

/* ===== Recall alerts (Sage & Organic) ===== */
.alert-banner {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 12px;
  padding: 11px 12px;
  border-radius: 16px;
  background: var(--mod-soft);
  border: 1.5px solid color-mix(in srgb, var(--mod) 28%, var(--line));
  box-shadow: var(--shadow);
}
.alert-banner .ab-ico {
  flex: none; width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--mod) 14%, var(--card));
  color: var(--mod);
}
.alert-banner .ab-ico svg { width: 20px; height: 20px; display: block; }
.alert-banner .ab-body { flex: 1; min-width: 0; }
.alert-banner .ab-title {
  font-size: 13.5px; font-weight: 750; color: #7a4a0a; line-height: 1.3;
}
html[data-theme="dark"] .alert-banner .ab-title { color: #fde68a; }
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .alert-banner .ab-title,
  html:not([data-theme]) .alert-banner .ab-title { color: #fde68a; }
}
.alert-banner .ab-cta {
  flex: none; font-size: 12.5px; font-weight: 800; color: #7a4a0a;
  background: var(--card); border: 1px solid color-mix(in srgb, var(--mod) 35%, var(--line));
  border-radius: 999px; padding: 7px 12px; text-decoration: none;
}
html[data-theme="dark"] .alert-banner .ab-cta { color: #fde68a; }
.tag-advisory {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; border-radius: 999px; padding: 3px 8px;
  background: var(--mod-soft); color: var(--mod);
  border: 1px solid color-mix(in srgb, var(--mod) 30%, var(--line));
}
.tag-recall {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; border-radius: 999px; padding: 3px 8px;
  background: var(--high-soft); color: var(--high);
  border: 1px solid color-mix(in srgb, var(--high) 28%, var(--line));
}
.detail-screen .product-hero {
  display: flex; gap: 14px; align-items: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); padding: 14px;
  margin: 0 0 12px;
}
.detail-screen .ph-img {
  width: 72px; height: 72px; border-radius: 16px; flex: none;
  background: linear-gradient(145deg, var(--brand-soft), color-mix(in srgb, var(--brand-soft) 60%, #c5d9c4));
  display: grid; place-items: center; color: var(--sage, var(--brand));
  overflow: hidden;
}
.detail-screen .ph-img svg { width: 34px; height: 34px; }
.detail-screen .ph-img-el, .detail-screen .ph-img img {
  width: 72px; height: 72px; object-fit: cover; border-radius: 16px; display: block;
}
.detail-screen .ph-name { font-size: 16px; font-weight: 850; color: var(--ink); letter-spacing: -.02em; }
.detail-screen .ph-meta { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-top: 3px; }
.detail-screen .ph-ex {
  display: inline-block; margin-top: 6px; font-size: 10px; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--sage, var(--brand)); background: var(--brand-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 7px;
}
.advisory-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); padding: 16px;
  margin: 0 0 12px;
}
.advisory-card .ac-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.advisory-card h2 {
  font-size: 17px; font-weight: 850; color: var(--ink); letter-spacing: -.02em;
  margin: 0 0 6px; line-height: 1.25;
}
.advisory-card .ac-date { font-size: 12.5px; font-weight: 650; color: var(--muted); margin: 0 0 10px; }
.advisory-card .ac-summary { font-size: 14px; font-weight: 550; color: var(--ink); line-height: 1.45; margin: 0 0 14px; }
.advisory-card .ac-source {
  font-size: 12.5px; font-weight: 650; color: var(--muted);
  background: color-mix(in srgb, var(--brand-soft) 55%, var(--card));
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.advisory-card .ac-source a { color: var(--brand); font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.detail-note { margin: 12px 0 0; font-size: 12px; font-weight: 550; color: var(--muted); line-height: 1.4; }
.menu-toggle .menu-toggle-text { flex: 1; min-width: 0; line-height: 1.35; }
.menu-recall-toggle { align-items: flex-start; }
.menu-recall-toggle .toggle { margin-top: 2px; }

/* ===== Daily check-in (Log) ===== */
.checkin-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 12px 12px 10px;
  margin: 0 0 12px;
}
.checkin-card .checkin-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin: 0 0 8px;
}
.checkin-card .checkin-title {
  margin: 0; font-size: 15px; font-weight: 850; color: var(--sage, var(--brand));
  letter-spacing: -.02em;
}
.checkin-card .checkin-hint {
  margin: 0; font-size: 12.5px; font-weight: 550; color: var(--muted); line-height: 1.4;
}
.checkin-list { display: flex; flex-direction: column; gap: 6px; }
.checkin-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  border: 1.5px solid var(--line); background: color-mix(in srgb, var(--brand-soft) 35%, var(--card));
  border-radius: 14px; padding: 8px 10px; cursor: pointer;
  font: inherit; color: var(--ink);
  transition: border-color .12s, background .12s, transform .08s;
}
.checkin-row:active { transform: scale(.98); }
.checkin-row.on {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand-soft) 70%, var(--card));
}
.checkin-row .ci-thumb {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: var(--brand-soft); overflow: hidden;
  display: grid; place-items: center;
}
.checkin-row .ci-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.checkin-row .ci-thumb .cat-ico { width: 22px; height: 22px; }
.checkin-row .ci-body { flex: 1; min-width: 0; }
.checkin-row .ci-name {
  font-size: 13.5px; font-weight: 750; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.checkin-row .ci-meta { font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 1px; }
.checkin-row .ci-mark {
  flex: none; width: 26px; height: 26px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card);
  display: grid; place-items: center; color: transparent; font-size: 14px; font-weight: 800;
}
.checkin-row.on .ci-mark {
  border-color: var(--brand); background: var(--brand); color: #fff;
}
.checkin-more {
  display: block; width: 100%; margin-top: 6px; padding: 8px;
  border: 0; background: transparent; color: var(--brand);
  font: inherit; font-size: 13px; font-weight: 800;
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}

/* —— Acne mode —— */
.menu-acne-toggle { align-items: flex-start; }
.menu-acne-toggle .toggle { margin-top: 2px; }
.acne-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow, 0 1px 3px rgba(31,46,36,.08));
  padding: 14px;
  margin: 0 0 12px;
}
.acne-card h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 850;
  color: var(--sage, #3d5a45);
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.acne-card h2 .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand-2, #6b9b7a);
  box-shadow: 0 0 0 3px var(--brand-soft, #d7e8db);
}
.acne-tier { margin: 0 0 12px; }
.acne-tier .tier-label,
.detail-card .tier-label {
  display: inline-block;
  font-size: 10px; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; border-radius: 999px; padding: 3px 8px; margin-bottom: 6px;
}
.acne-tier.official .tier-label,
.detail-card .tier-label.official {
  background: color-mix(in srgb, var(--brand-soft, #d7e8db) 80%, #fff);
  color: var(--sage, #3d5a45); border: 1px solid var(--line);
}
.acne-tier.derm .tier-label,
.detail-card .tier-label.derm {
  background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe;
}
.acne-tier.limited .tier-label,
.detail-card .tier-label.limited {
  background: var(--noinfo-soft, #F0F2EF); color: var(--muted); border: 1px solid var(--line);
}
.acne-tier.limited .acne-item .ing,
.acne-tier.limited .acne-item .note,
.acne-tier.limited .acne-item .src { color: var(--muted); }
button.acne-item {
  display: block; width: 100%; text-align: left;
  padding: 8px 0; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; font: inherit; color: inherit; cursor: pointer;
}
button.acne-item:last-child { border-bottom: 0; padding-bottom: 0; }
.acne-item .ing {
  font-size: 14px; font-weight: 800; color: var(--ink); margin: 0 0 3px;
}
.acne-item.tappable .ing::after { content: ' ›'; color: var(--brand); font-weight: 800; }
.acne-item .note {
  font-size: 13px; font-weight: 550; color: var(--ink); line-height: 1.4; margin: 0 0 4px;
}
.acne-item .src { font-size: 11.5px; font-weight: 650; color: var(--muted); }
.acne-item .src a { color: var(--brand); font-weight: 800; }
.acne-caveat {
  margin: 10px 0 0; font-size: 12px; font-weight: 550; color: var(--muted);
  background: color-mix(in srgb, var(--brand-soft, #d7e8db) 40%, var(--card));
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; line-height: 1.4;
}
.acne-detail-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(31,46,36,.35);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 12px;
}
.acne-detail-sheet {
  width: min(420px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  background: var(--bg, #f4f7f2);
  border-radius: 18px 18px 14px 14px;
  padding: 16px 14px 18px;
  box-shadow: 0 -8px 32px rgba(31,46,36,.18);
}
.acne-detail-sheet .detail-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 16px; margin: 0 0 12px;
}
.acne-detail-sheet .detail-card h2 {
  margin: 0 0 8px; font-size: 20px; font-weight: 850; color: var(--ink);
}
.acne-detail-sheet .detail-card .body {
  font-size: 14px; font-weight: 550; color: var(--ink); line-height: 1.45; margin: 0 0 12px;
}
.acne-detail-sheet .section-title {
  font-size: 13px; font-weight: 800; color: var(--muted);
  margin: 8px 2px 8px; text-transform: uppercase; letter-spacing: .04em;
}
.acne-detail-sheet .src-list {
  list-style: none; margin: 0 0 12px; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.acne-detail-sheet .src-list li {
  background: color-mix(in srgb, var(--brand-soft, #d7e8db) 45%, var(--card));
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.acne-detail-sheet .src-list .sn {
  font-size: 13px; font-weight: 800; color: var(--brand); text-decoration: underline;
}
.acne-detail-sheet .src-list .sn.muted-src { color: var(--muted); text-decoration: none; }
.acne-detail-sheet .src-list .su {
  display: block; font-size: 12px; font-weight: 550; color: var(--muted); margin-top: 2px;
}


/* Cloudflare Turnstile — inline under Ask / scan; never cover the tab bar */
.cl-turnstile-card {
  margin: 12px 0 4px;
  padding: 12px 14px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--brand-soft, #D8E8D6) 70%, #fff);
  border: 1.5px solid var(--line, #d7e0d8);
  box-shadow: 0 1px 2px rgba(31,46,36,.05);
  max-width: 100%;
  position: relative;
  z-index: 2;
}
.cl-turnstile-prompt {
  margin: 0 0 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--sage, #4A7358);
  line-height: 1.35;
}
.cl-turnstile-host,
#cl-turnstile-host {
  position: static;
  max-width: 100%;
  min-height: 65px;
  overflow: visible;
}
.cl-turnstile-host iframe,
#cl-turnstile-host iframe {
  max-width: 100%;
}
html[data-theme="dark"] .cl-turnstile-card {
  background: color-mix(in srgb, var(--brand-soft, #24382c) 80%, var(--card, #1a2420));
  border-color: var(--line, #2a3a30);
}
/* Keep the bar pinned to the viewport bottom. A later `position: relative`
   (for stacking) was taking it out of `fixed` and leaving leaf backdrop
   visible underneath it on short screens. */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding-bottom: calc(8px + var(--safe-b));
}

.hdr-brand {
  flex: 1; min-width: 0; font-weight: 850; font-size: 17px; letter-spacing: -.02em;
  color: var(--sage, #4A7358); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ===== Revamp: serif headlines, pill buttons, lighter cards; keep sage/green + leaves ===== */
:root {
  --sans: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --serif: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
}
html, body {
  font-family: var(--sans);
}
.bg-layer {
  opacity: 1;
}
.bg-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 18%, transparent) 0%, color-mix(in srgb, var(--bg) 42%, transparent) 100%);
  pointer-events: none;
}
h1, h2, .page-title, .hero h1, .welcome h1, .section-title {
  font-family: var(--serif);
  font-weight: 550;
  letter-spacing: -.03em;
}
.section-title { font-weight: 600; letter-spacing: -.02em; }
.card {
  background: color-mix(in srgb, var(--card) 92%, white);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  box-shadow: 0 1px 2px rgba(31,46,36,.04), 0 10px 28px rgba(31,46,36,.05);
}
.btn { border-radius: 999px; }
.btn.small { border-radius: 999px; }
.disclaimer, .result-info-only, .result-accuracy, .ask-accuracy {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink);
  background: color-mix(in srgb, var(--brand-soft) 55%, var(--card));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
}
.result-accuracy, .ask-accuracy { margin: 8px 0 12px; }
.legal-inline { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 16px 0 8px; font-size: 14px; font-weight: 650; }
.legal-inline a { color: var(--sage, var(--brand)); }
.kicker {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sage, var(--brand));
  margin: 0 0 8px;
}
.welcome-page { text-align: left; padding-bottom: 40px; }
.welcome-page .hero h1 { font-size: clamp(32px, 8vw, 48px); color: var(--ink); max-width: 14ch; }
.welcome-page .hero p { color: var(--muted); font-size: 17px; max-width: 38ch; margin: 12px 0 22px; }
.welcome-page .cta-row { display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.welcome-page .trust { margin: 18px 0 28px; color: var(--ink); font-size: 14px; display: grid; gap: 6px; }
.welcome-page .steps { display: grid; gap: 10px; margin-top: 8px; }
.welcome-page .step { padding: 16px 18px; }
.welcome-page .step .n { font-family: var(--serif); color: var(--sage); font-size: 22px; }
.welcome-page .step h3 { font-family: var(--sans); font-weight: 700; letter-spacing: 0; font-size: 16px; margin: 4px 0 6px; }
.welcome-page .step p { margin: 0; color: var(--muted); font-size: 14px; }
.welcome-page .site-foot { margin-top: 28px; font-size: 13px; color: var(--muted); }
.welcome-page .site-foot nav { display: flex; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 10px; font-weight: 650; }
@media (min-width: 880px) {
  #app:has(.welcome-page) { max-width: 1120px; }
  .welcome-page .hero h1 { font-size: 56px; }
  .welcome-page .cta-row { flex-direction: row; }
  .welcome-page .btn { width: auto; min-width: 200px; }
}

/* ===== Clean-green + original leafy backdrop ===== */
:root {
  --bg: #F5F7F1;
  --bg2: #E6EFE4;
  --card: #FFFCFA;
  --line: #C9D9C8;
  --shadow: 0 1px 2px rgba(31,46,36,.05), 0 10px 28px rgba(31,46,36,.08);
  --action: #1A4D36;
  --nav-bg: rgba(232, 242, 230, 0.94);
}
html, body {
  background-color: var(--bg);
  min-height: 100%;
  min-height: 100dvh;
}
.bg-layer {
  background-color: var(--bg);
  background-image: var(--organic-bg);
  background-repeat: no-repeat;
  background-position: top center;
  background-size: cover;
}
.bg-layer::after {
  content: "";
  display: block;
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 18%, transparent) 0%, color-mix(in srgb, var(--bg) 42%, transparent) 100%);
  pointer-events: none;
}
.card {
  background: var(--card);
  border: 0;
  box-shadow: var(--shadow);
}
.scan-card, .scan-card-v2, .list, .logged.card, .cal-card, .day-list, .chat.card, form.form, .menu-panel {
  background: var(--card);
}
.btn.primary {
  background: var(--action, #1A4D36);
  background-image: none;
  color: #fff;
  box-shadow: none;
}
.btn.ghost {
  background: transparent;
  color: var(--sage, var(--brand));
  border: 1.5px solid color-mix(in srgb, var(--sage, var(--brand)) 38%, transparent);
  box-shadow: none;
}
.btn.ghost.danger { color: var(--high); border-color: color-mix(in srgb, var(--high) 35%, transparent); }
.scan-card, .scan-card-v2, .scan-option {
  box-shadow: var(--shadow);
  border: 0;
}
.about-sources-disclaimer,
.about-sources [data-testid="info-only"] {
  background: none;
  border: 0;
  padding: 0;
  margin: 18px 2px 6px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}
.result-hero { margin: 4px 0 8px; }
.product-lead .product-row {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 2px 0 10px;
}
.product-lead { background: none; box-shadow: none; border: 0; padding: 0; margin: 0; }
.product-lead .pname {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 550;
  letter-spacing: -.03em;
  margin: 0;
  line-height: 1.15;
}
.product-lead .pimg {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: cover;
}
.product-lead .brand { margin: 4px 0 0; }
.verdict-ring-card {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 10px 0 6px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  margin: 4px 0 8px;
}
.vring {
  width: 128px;
  height: 128px;
}
.vring::after { inset: 14px; }
.vring .vnum { font-size: 36px; font-weight: 650; font-family: var(--serif); }
.vchips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: 1;
}
.vchip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  background: var(--card);
  box-shadow: var(--shadow);
}
.vchip strong { font-weight: 750; }
.vchip.concern { color: var(--high); background: color-mix(in srgb, var(--high-soft) 80%, var(--card)); }
.vchip.ok { color: var(--ok); background: color-mix(in srgb, var(--ok-soft) 80%, var(--card)); }
.vchip.noinfo { color: var(--muted); background: color-mix(in srgb, var(--noinfo-soft) 80%, var(--card)); }
.for-you-line { margin: 2px 0 10px; }
.result-legal {
  margin: 4px 0 16px;
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
}
.result-legal summary {
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
}
.result-legal summary::-webkit-details-marker { display: none; }
.result-legal-more {
  color: var(--sage, var(--brand));
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.result-legal-body {
  margin-top: 10px;
}
.result-legal-body .hc-line,
.result-legal-body .result-info-only,
.result-legal-body .result-accuracy,
.result-legal-body .barcode-attr {
  background: none;
  border: 0;
  padding: 0;
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}
.ask-accuracy {
  background: none;
  border: 0;
  padding: 0;
  margin: 10px 0 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.home-tidy .screen, .screen { padding-bottom: 16px; }
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding-bottom: calc(8px + var(--safe-b));
  background: var(--nav-bg);
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  box-shadow: none;
}
.tabbar a .ti {
  filter: none;
  opacity: 1;
  font-size: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: inherit;
}
.tabbar a .ti svg { width: 22px; height: 22px; display: block; }
.tabbar a.active { color: var(--sage, var(--brand)); }
.tour-ico {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  color: var(--sage, var(--brand));
  display: grid;
  place-items: center;
}
.tour-ico svg { width: 36px; height: 36px; }
.empty-day .ico {
  width: 40px;
  height: 40px;
  margin: 0 auto 8px;
  color: var(--sage, var(--brand));
  display: grid;
  place-items: center;
}
.empty-day .ico svg { width: 32px; height: 32px; }
.logged-when {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.logged-when svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--sage, var(--brand)); }
.cat-ico svg { stroke: var(--sage, var(--brand)); fill: none; }

.sources-line,
.about-sources.sources-line {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin: 16px 2px 8px;
  font-weight: 500;
  color: var(--muted);
}
.about-sources-disclaimer {
  background: none !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 0 4px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--muted) !important;
}
.product-lead,
.product-lead.sev-serious,
.product-lead.sev-mild,
.product-lead.sev-none,
.product-lead.sev-no_info,
.product-lead.sev-high {
  border: 0;
  box-shadow: none;
  background: none;
  border-radius: 0;
  padding: 0;
}
#app { padding-bottom: calc(96px + var(--safe-b)); }
.screen { padding-bottom: 28px; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; overflow: visible; }
.suggest .chip { max-width: 100%; }


/* First-launch legal consent + recall completeness note */
.btn.primary:disabled,
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
label.legal-ack {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.45;
}
label.legal-ack input {
  margin-top: 3px;
  flex-shrink: 0;
}
.alert-banner .ab-note {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.35;
}
