/* Minimal Apricot: shared presentation; report and matching data stay unchanged. */
:root {
  --apricot: #f0b681; --classification-high: #aa5149; --classification-medium: #a46c16; --classification-none: #4d7747;
  --classification-high-fill: #f3dfd9; --classification-medium-fill: #f2e5c6; --classification-none-fill: #dce9d1;
  --bg-primary: #f3f4ec; --bg-surface: #f8f9f2; --bg-surface-elevated: #fffef9; --bg-muted: #e0e7da;
  --bottom-nav-height: calc(94px + env(safe-area-inset-bottom, 0px));
}
[data-theme="dark"] {
  --classification-high: #ed9e94; --classification-medium: #e0b366; --classification-none: #a9cd95;
  --classification-high-fill: #603e39; --classification-medium-fill: #59492d; --classification-none-fill: #40573b;
  --bg-primary: #24332b; --bg-surface: #2e3d34; --bg-surface-elevated: #35443c; --bg-muted: #435640;
}
.sage-dino { width:29px; height:27px; border-radius:15px 18px 12px 7px; }
.sage-dino::before { width:10px; height:10px; top:6px; right:5px; }
.sage-dino::after { width:4px; height:5px; top:8px; right:6px; box-shadow:-17px -10px 0 2px var(--apricot), -10px -12px 0 2px var(--apricot); }
.brand-title { font-size:1.1rem; }
.app-header { padding-block:22px; background:var(--bg-surface-elevated); border-bottom:1px solid var(--border-subtle); }
.header-actions { display:flex; }
.header-actions .btn-icon { width:44px; height:44px; border-radius:16px; background:var(--bg-muted); }
#pdf-status-banner { display:none !important; }
.main-content { padding-top:24px; }
.view-section { gap:16px; }
#view-search { gap:0; }
.home-companion-panel { background:#dfe6d9; color:#29392f; padding:25px 22px; border-radius:30px 30px 12px 30px; margin:0 0 28px; }
.home-companion-panel h1 { font-size:clamp(1.65rem,6.8vw,2.2rem); line-height:1.18; letter-spacing:-.7px; margin:22px 0 18px; }
.home-companion-panel p { color:#4a5c4c; line-height:1.6; font-size:.95rem; margin:0 0 22px; }
.home-companion-panel .sage-kicker { color:#4a5c4c; font-size:.65rem; letter-spacing:1.8px; }
.home-companion-panel .sage-kicker span { background:var(--apricot); }
.home-companion-panel .btn-primary { min-height:60px; font-size:.95rem; background:var(--primary); color:var(--text-inverse); }
[data-theme="dark"] .home-companion-panel { background:#405344; color:#f1f4e9; }
[data-theme="dark"] .home-companion-panel p, [data-theme="dark"] .home-companion-panel .sage-kicker { color:#dae3ce; }
.view-section > h1, .minimal-home-heading h1, .sage-settings-intro h1 { font-size:clamp(1.8rem,7vw,2.25rem); line-height:1.14; letter-spacing:-1px; margin:12px 0; }
.minimal-home-heading { margin:20px 0 32px; }
.minimal-home-heading p, .page-intro { color:var(--text-secondary); font-size:.95rem; line-height:1.6; margin-bottom:24px; }
.apricot-primary { width:100%; display:flex; align-items:center; justify-content:center; gap:12px; min-height:68px; padding:14px 18px; border-radius:18px; box-shadow:none; font-weight:600; }
.btn-primary { border:0; }
.apricot-icon { display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; flex:0 0 auto; border-radius:11px; background:var(--apricot); color:#56341f; font-size:23px; }
.minimal-row { display:flex; width:100%; align-items:center; gap:14px; padding:22px 4px; color:var(--text-primary); background:transparent; border:0; border-bottom:1px solid var(--border-subtle); font-weight:600; text-align:left; min-height:64px; }
.minimal-row > span:last-child { margin-left:auto; }
.manual-barcode-link { display:block; margin:12px auto 32px; min-height:44px; font-size:.78rem; }
.search-container { border:1px solid var(--border-subtle); background:var(--bg-surface-elevated); border-radius:20px; padding:20px 16px; margin-top:12px; }
#search-count-badge { display:none; }
.search-label label { font-size:.9rem; font-weight:600; }
.search-input { font-size:16px; min-height:54px; }
#view-history > .search-input { margin:12px 0; width:100%; padding:12px; }
.bottom-nav { display:flex; justify-content:space-around; align-items:stretch; gap:8px; height:auto; min-height:var(--bottom-nav-height); padding:10px 12px calc(18px + env(safe-area-inset-bottom, 0px)); background:var(--bg-muted); border-top:1px solid var(--border-subtle); box-shadow:0 -6px 20px #2035240a; }
.nav-item { flex:1; height:auto; min-height:56px; padding:7px 4px; gap:6px; border-radius:15px; color:var(--text-secondary); }
.nav-item.active { background:var(--primary-subtle); color:var(--text-primary); }
.nav-barcode-button { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; border:0; background:transparent; color:var(--text-primary); padding:0 2px; min-width:0; }
.nav-barcode-icon { display:grid; place-items:center; width:56px; height:56px; margin-top:-25px; margin-bottom:3px; border-radius:20px; background:#e9934b; color:#29392f; box-shadow:0 0 0 7px var(--bg-surface); }
.nav-icon { width:24px; height:24px; display:block; flex-shrink:0; }
.nav-label { font-size:.75rem; line-height:1.2; }
.sage-settings-intro { margin-bottom:28px; }
.settings-header-banner { display:none; }
.settings-group { margin-top:24px; }
.settings-group-title { font-size:.8rem; letter-spacing:.02em; }
.settings-list { box-shadow:none; border-radius:16px; }
.setting-item { padding:18px 14px; gap:14px; flex-wrap:wrap; }
.setting-info { min-width:0; flex:1 1 145px; }
.setting-desc { line-height:1.5; }
.sensitivity-card { border:1px solid var(--border-subtle); padding:18px; background:var(--bg-surface-elevated); box-shadow:none; }
.sensitivity-header { flex-wrap:wrap; gap:12px; }
#sensitivity-card-title { overflow-wrap:anywhere; }
.sensitivity-counts-row { gap:10px; margin:22px 0; }
.count-box { appearance:none; flex:1; min-width:0; border:3px solid; padding:14px 6px; border-radius:15px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; min-height:104px; font:inherit; cursor:pointer; }
.count-box.high { border:3px solid var(--classification-high); background:transparent; color:var(--text-primary); }
.count-box.medium { border:3px solid var(--classification-medium); background:transparent; color:var(--text-primary); }
.count-box.none { border:3px solid var(--classification-none); background:transparent; color:var(--text-primary); }
.count-box.high[aria-pressed="true"] { background:var(--classification-high-fill); }
.count-box.medium[aria-pressed="true"] { background:var(--classification-medium-fill); }
.count-box.none[aria-pressed="true"] { background:var(--classification-none-fill); }
.count-box[aria-pressed="true"] { outline:0; }
.count-box[aria-pressed="true"] .count-label::after { content:' ✓'; font-weight:800; }
.count-box .count-label { font-size:.68rem; line-height:1.4; text-transform:none; letter-spacing:0; overflow-wrap:anywhere; }
.count-box .count-num { font-size:1.7rem; font-weight:650; }
.food-pill { background:var(--bg-surface) !important; color:var(--text-primary) !important; border:2px solid; border-radius:10px; padding:8px 10px; min-height:36px; }
.food-pill.high { border-color:var(--classification-high); }
.food-pill.medium { border-color:var(--classification-medium); }
.food-pill.none { border-color:var(--classification-none); }
.pdf-actions-row { flex-wrap:wrap; margin-top:22px; }
.pdf-actions-row > button { flex:1 1 130px; }
.product-panel { margin-top:24px; padding:0; background:transparent; border:0; border-radius:0; }
.product-panel textarea { margin-top:10px; }
.product-panel #product-confirm { position:sticky; bottom:calc(var(--bottom-nav-height) + 12px); z-index:2; box-shadow:0 0 0 8px var(--bg-surface); }
#view-label-source #btn-hero-scan { background:var(--primary); color:var(--text-inverse); border-radius:18px; margin-top:24px; width:100%; }
#view-label-source #btn-hero-scan > svg { background:var(--apricot); color:#56341f; border-radius:10px; padding:7px; width:34px; height:34px; }
#product-confirm::before { content:'▤'; display:inline-grid; place-items:center; width:30px; height:30px; margin-right:10px; background:var(--apricot); color:#56341f; border-radius:10px; }
#view-label-source .camera-sub-actions { display:block; margin:14px 0; }
#view-label-source .photo-library-action { display:flex; min-height:56px; justify-content:center; border:1px solid var(--border-color); border-radius:16px; padding:16px; }
#view-results #btn-result-scan { margin-top:24px; }
.label-ocr-sheet, .modal-content { border-radius:22px; }
.label-ocr-footer .btn-primary { display:flex; justify-content:center; align-items:center; gap:12px; }
.label-ocr-footer .btn-primary::before { content:'▤'; display:inline-grid; place-items:center; background:var(--apricot); color:#56341f; width:30px; height:30px; border-radius:10px; }
.label-ocr-footer { padding-bottom:max(12px, env(safe-area-inset-bottom)); }
button:focus-visible, [role="button"]:focus-visible, a:focus-visible { outline:3px solid var(--border-focus); outline-offset:4px; }
.count-box:focus-visible { outline:3px solid var(--border-focus); outline-offset:4px; }
[data-contrast="high"] .count-box, [data-contrast="high"] .food-pill { border-width:3px; }
@media(max-width:380px) { .main-content { padding-inline:18px; } .sensitivity-card { padding:12px; } .sensitivity-counts-row { gap:6px; } .count-box { padding:12px 3px; } .count-box .count-label { font-size:.63rem; } .apricot-primary { font-size:.9rem; padding-inline:12px; } }

.safety-result-note { background:var(--bg-muted); color:var(--text-primary); border-left:3px solid var(--apricot); border-radius:12px; padding:14px 16px; margin:16px 0; font-size:.82rem; line-height:1.6; }
.safety-result-note p { margin:8px 0 0; }
.safety-result-note .btn-link-action { min-height:44px; text-decoration:underline; text-underline-offset:3px; }
.safety-long-copy { font-size:.9rem; line-height:1.7; color:var(--text-secondary); overflow-wrap:anywhere; }
.safety-long-copy h2, .safety-long-copy h3 { color:var(--text-primary); line-height:1.35; margin:24px 0 10px; }
.safety-long-copy h2 { font-size:1.3rem; }
.safety-long-copy h3 { font-size:1rem; }
.safety-long-copy p { margin:10px 0; }
.safety-long-copy ul { padding-left:20px; }
.safety-long-copy li { margin:10px 0; }
.safety-long-copy a { color:var(--primary); text-decoration:underline; }
.safety-version { font-size:.75rem; }
#safety-ack-dialog { width:min(560px, calc(100% - 28px)); max-height:calc(100dvh - 32px); margin:auto; padding:0; border:1px solid var(--border-subtle); border-radius:24px; background:var(--bg-surface-elevated); color:var(--text-primary); }
#safety-ack-dialog[open] { display:flex; flex-direction:column; }
#safety-ack-dialog::backdrop { background:#15251c99; }
.safety-dialog-body { padding:24px; overflow-y:auto; overscroll-behavior:contain; min-height:0; }
.safety-dialog-body > h2 { font-size:1.4rem; line-height:1.25; margin-bottom:16px; }
.safety-dialog-body > p { font-size:.9rem; line-height:1.6; margin-bottom:14px; color:var(--text-secondary); }
.safety-dialog-body summary { font-size:.85rem; padding:10px 0; min-height:44px; cursor:pointer; }
.safety-ack-label { display:flex; align-items:flex-start; gap:12px; margin-top:18px; font-size:.9rem; line-height:1.5; min-height:44px; cursor:pointer; }
.safety-ack-label input { width:24px; height:24px; flex-shrink:0; accent-color:var(--primary); }
.safety-dialog-actions { border-top:1px solid var(--border-subtle); padding:14px 24px max(14px, env(safe-area-inset-bottom)); display:flex; flex-direction:column; gap:10px; flex-shrink:0; }
.safety-dialog-actions button { width:100%; min-height:48px; }
.safety-dialog-actions button:disabled { opacity:.45; cursor:not-allowed; }
#safety-ack-error:empty { display:none; }
