:root {
  --bg:       #0f172a; --surface:  #1e293b; --surface2: #263348;
  --border:   #334155; --text:     #f1f5f9; --muted:    #94a3b8;
  --accent:   #f59e0b; --accent-h: #fbbf24; --success:  #22c55e;
  --danger:   #ef4444; --header-h: 56px;    --nav-h:    60px;
  --radius:   16px;    --radius-sm:10px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, sans-serif; font-size: 16px;
  line-height: 1.5; overscroll-behavior: none; }

/* Header */
.app-header { position: fixed; top: 0; left: 0; right: 0; height: var(--header-h);
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 1rem; gap: .75rem; z-index: 100; }
.back-btn { background: none; border: none; color: var(--accent); font-size: 1.5rem;
  cursor: pointer; padding: .2rem .4rem; line-height: 1; display: none; touch-action: manipulation; }
.has-back .back-btn { display: block; }
.header-title { font-size: 1rem; font-weight: 700; flex: 1; }
.icon-btn { background: none; border: none; color: var(--muted); cursor: pointer;
  padding: .4rem; border-radius: 8px; transition: color .15s, background .15s; touch-action: manipulation; }
.icon-btn:hover { color: var(--text); background: var(--surface2); }

/* Bottom nav */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: var(--nav-h);
  background: var(--surface); border-top: 1px solid var(--border);
  display: flex; z-index: 100; }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; background: none; border: none; color: var(--muted);
  font-family: inherit; cursor: pointer; gap: 2px; transition: color .15s; touch-action: manipulation; }
.nav-item.active { color: var(--accent); }
.nav-icon { font-size: 1.3rem; line-height: 1; }
.nav-label { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }

/* Views */
.view { display: none; padding-top: var(--header-h); min-height: 100vh; }
.view.active { display: block; }
.list-view { padding-bottom: calc(var(--nav-h) + 5rem); }
.sub-view  { padding-bottom: 5rem; }

/* Search + sort */
.search-wrap { padding: 1rem; background: var(--bg); position: sticky; top: var(--header-h); z-index: 50; }
.search-input { width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text); font-size: .95rem; padding: .6rem 1rem; font-family: inherit; }
.search-input:focus { outline: none; border-color: var(--accent); }
.search-input::placeholder { color: var(--muted); }
.sort-bar { display: flex; gap: .5rem; padding: 0 1rem .75rem; overflow-x: auto; scrollbar-width: none; }
.sort-bar::-webkit-scrollbar { display: none; }
.sort-pill { padding: .25rem .75rem; border: 1px solid var(--border); border-radius: 999px;
  background: transparent; color: var(--muted); font-size: .8rem; font-weight: 500;
  cursor: pointer; white-space: nowrap; font-family: inherit; transition: all .15s; touch-action: manipulation; }
.sort-pill.active { background: var(--accent); border-color: var(--accent); color: #000; }

/* Cards */
.entries-list { padding: 0 1rem; }
.entry-card { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; margin-bottom: .75rem;
  display: flex; gap: .75rem; cursor: pointer; transition: border-color .15s; touch-action: manipulation; }
.entry-card:hover { border-color: var(--accent); }
.entry-thumb { width: 64px; height: 64px; border-radius: 10px; flex-shrink: 0;
  background: var(--surface2); display: flex; align-items: center;
  justify-content: center; font-size: 1.8rem; overflow: hidden; }
.entry-thumb img { width: 100%; height: 100%; object-fit: cover; }
.entry-info { flex: 1; min-width: 0; }
.entry-name { font-weight: 600; font-size: .97rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-meta { font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.entry-badges { display: flex; gap: .35rem; margin-top: .4rem; flex-wrap: wrap; }
.badge { font-size: .68rem; font-weight: 700; padding: .15rem .5rem; border-radius: 4px; text-transform: uppercase; letter-spacing: .04em; }
.badge-homemade { background: rgba(245,158,11,.2); color: var(--accent); }
.badge-sessions { background: rgba(34,197,94,.15); color: var(--success); }
.entry-score { font-size: 1.5rem; font-weight: 800; flex-shrink: 0; align-self: center; }
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--muted); }
.empty-state .ei { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h2 { font-size: 1.2rem; color: var(--text); margin-bottom: .5rem; }

/* Stock indicator */
.stock-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: .35rem; }
.stock-ok   { background: var(--success); }
.stock-warn { background: var(--accent); }
.stock-low  { background: var(--danger); }

/* FAB */
.fab { position: fixed; bottom: calc(var(--nav-h) + 1rem); right: 1.5rem;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: #000; border: none; font-size: 1.8rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(245,158,11,.4); transition: transform .15s, background .15s;
  z-index: 50; touch-action: manipulation; }
.fab:hover { transform: scale(1.05); background: var(--accent-h); }

/* Form */
.form-view { padding-bottom: 6rem; }
.form-section { padding: 1.25rem 1rem 0; }
.section-title { font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--muted); margin-bottom: 1rem;
  padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.photo-upload { width: 100%; height: 180px; border: 2px dashed var(--border);
  border-radius: var(--radius); display: flex; flex-direction: column;
  align-items: center; justify-content: center; cursor: pointer;
  transition: border-color .2s; position: relative; overflow: hidden; background: var(--surface); }
.photo-upload:hover { border-color: var(--accent); }
.photo-upload img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pu-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5);
  display: flex; flex-direction: column; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; }
.photo-upload:hover .pu-overlay { opacity: 1; }
.pu-icon { font-size: 2rem; color: var(--muted); margin-bottom: .5rem; }
.pu-text { font-size: .85rem; color: var(--muted); }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .82rem; font-weight: 500; color: var(--muted); margin-bottom: .35rem; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: .95rem;
  padding: .6rem .75rem; font-family: inherit; transition: border-color .15s; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 80px; }
.field select option { background: var(--surface2); }
.field-row { display: flex; gap: .75rem; }
.field-row .field { flex: 1; min-width: 0; }
.toggle-row { display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .75rem 1rem; cursor: pointer; margin-bottom: 1rem; touch-action: manipulation; }
.toggle-label { font-size: .95rem; font-weight: 500; }
.toggle-sub { font-size: .78rem; color: var(--muted); margin-top: .1rem; }
.tog { width: 44px; height: 24px; border-radius: 12px; background: var(--border); position: relative; transition: background .2s; flex-shrink: 0; }
.tog::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: white; transition: transform .2s; }
.tog.on { background: var(--accent); }
.tog.on::after { transform: translateX(20px); }
.rating-item { margin-bottom: 1.25rem; }
.rating-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .15rem; }
.rating-label { font-size: .9rem; font-weight: 500; }
.rating-desc { font-size: .72rem; color: var(--muted); margin-bottom: .4rem; }
.rating-value { font-size: 1.1rem; font-weight: 700; color: var(--accent); min-width: 2ch; text-align: right; }
.rating-slider { width: 100%; height: 36px; -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; }
.rating-slider::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--border); }
.rating-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); margin-top: -8px; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.rating-slider::-moz-range-track { height: 6px; border-radius: 3px; background: var(--border); }
.rating-slider::-moz-range-thumb { width: 22px; height: 22px; border: none; border-radius: 50%; background: var(--accent); }
.avg-score-box { text-align: center; padding: 1rem; background: var(--surface2); border-radius: var(--radius-sm); margin-top: .5rem; }
.avg-score-num { font-size: 3rem; font-weight: 900; color: var(--accent); line-height: 1; }
.avg-score-lbl { font-size: .78rem; color: var(--muted); margin-top: .3rem; }

/* Blend builder */
.blend-item { display: flex; align-items: center; gap: .6rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .65rem .85rem; margin-bottom: .5rem; }
.blend-item-name { flex: 1; font-size: .9rem; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blend-item-brand { font-size: .75rem; color: var(--muted); }
.blend-pct-wrap { display: flex; align-items: center; gap: .3rem; flex-shrink: 0; }
.blend-pct { width: 54px; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: .9rem; font-weight: 700; padding: .3rem .4rem; text-align: center; font-family: inherit; }
.blend-pct:focus { outline: none; border-color: var(--accent); }
.blend-remove { background: none; border: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; padding: .1rem .3rem; line-height: 1; flex-shrink: 0; touch-action: manipulation; }
.blend-remove:hover { color: var(--danger); }
.blend-footer { display: flex; align-items: center; justify-content: space-between; margin-top: .5rem; padding: .5rem 0; }
.blend-total-txt { font-size: .85rem; color: var(--muted); }
.blend-total-num { font-weight: 700; color: var(--text); }
.blend-total-num.ok  { color: var(--success); }
.blend-total-num.bad { color: var(--danger); }

/* Save bar */
.save-bar { position: fixed; bottom: 0; left: 0; right: 0; padding: 1rem; background: linear-gradient(to top, var(--bg) 60%, transparent); }
.btn-full { width: 100%; padding: .85rem; border: none; border-radius: var(--radius-sm); font-size: 1rem; font-weight: 700; cursor: pointer; font-family: inherit; transition: all .15s; }
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-h); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

/* Detail */
.detail-photo { width: 100%; height: 220px; object-fit: cover; display: block; }
.detail-nophoto { width: 100%; height: 120px; background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 4rem; }
.detail-body { padding: 1rem; padding-bottom: 2rem; }
.detail-name { font-size: 1.5rem; font-weight: 700; }
.detail-brand { font-size: .85rem; color: var(--muted); margin-top: .2rem; }
.detail-badges { display: flex; gap: .5rem; margin-top: .75rem; flex-wrap: wrap; }
.score-hero { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; text-align: center; margin: 1rem 0; }
.score-hero-num { font-size: 3rem; font-weight: 900; line-height: 1; }
.score-hero-lbl { font-size: .78rem; color: var(--muted); margin-top: .3rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.card-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .75rem; }
.bar-row { display: flex; align-items: center; gap: .75rem; margin-bottom: .6rem; }
.bar-row:last-child { margin-bottom: 0; }
.bar-name { font-size: .85rem; width: 135px; flex-shrink: 0; }
.bar-track { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--accent); transition: width .4s ease; }
.recipe-row { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: .5rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.recipe-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.rk { color: var(--muted); }
.rv { font-weight: 500; text-align: right; max-width: 55%; }
.notes-text { font-size: .9rem; color: var(--muted); line-height: 1.7; }
.ai-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.ai-content { font-size: .9rem; line-height: 1.75; white-space: pre-wrap; }
.ai-ts { font-size: .72rem; color: var(--muted); margin-top: .75rem; }
.ai-empty { text-align: center; padding: 1.25rem; color: var(--muted); font-size: .88rem; }
.detail-actions { display: flex; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; }

/* Blend display in detail */
.blend-bar-row { display: flex; align-items: center; gap: .75rem; margin-bottom: .6rem; }
.blend-bar-row:last-child { margin-bottom: 0; }
.blend-bar-name { font-size: .85rem; min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blend-bar-pct { font-size: .85rem; font-weight: 700; color: var(--accent); flex-shrink: 0; width: 3.5ch; text-align: right; }
.blend-bar-track { width: 80px; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.blend-bar-fill { height: 100%; border-radius: 4px; background: var(--accent); }

/* Buttons */
.btn { padding: .5rem 1rem; border: none; border-radius: 8px; font-size: .85rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: all .15s; white-space: nowrap; touch-action: manipulation; }
.btn-sm { padding: .4rem .85rem; font-size: .8rem; }
.btn-accent { background: var(--accent); color: #000; }
.btn-accent:hover { background: var(--accent-h); }
.btn-ghost { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-red { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Settings */
#view-settings { padding: 1rem; padding-bottom: calc(var(--nav-h) + 2rem); }
.settings-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.settings-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 1rem; }
.settings-note { font-size: .8rem; color: var(--muted); line-height: 1.6; margin-top: .5rem; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.settings-row:last-child { border-bottom: none; }

/* Overlay / sheet */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 300; display: none; align-items: flex-end; }
.overlay.open { display: flex; }
.sheet { background: var(--surface); border-radius: 20px 20px 0 0; padding: 1.5rem; width: 100%; }
.sheet h3 { margin-bottom: .5rem; }
.sheet p { color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }
.sheet-btns { display: flex; gap: .75rem; }
.sheet-btns .btn { flex: 1; padding: .75rem; }
.btn-danger-full { background: var(--danger); color: #fff; border: none; }

/* Picker sheet */
.picker-sheet { background: var(--surface); border-radius: 20px 20px 0 0; padding: 1.5rem; width: 100%; max-height: 75vh; display: flex; flex-direction: column; }
.picker-list { overflow-y: auto; flex: 1; margin: .75rem 0; }
.picker-item { display: flex; align-items: center; gap: .75rem; padding: .75rem; border-radius: var(--radius-sm); cursor: pointer; transition: background .15s; touch-action: manipulation; }
.picker-item:hover { background: var(--surface2); }
.picker-thumb { width: 40px; height: 40px; border-radius: 8px; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; overflow: hidden; flex-shrink: 0; }
.picker-thumb img { width: 100%; height: 100%; object-fit: cover; }
.picker-info { flex: 1; min-width: 0; }
.picker-name { font-weight: 600; font-size: .9rem; }
.picker-brand { font-size: .75rem; color: var(--muted); }

/* AI suggestion overlay */
.ai-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.8); z-index: 400; display: none; align-items: flex-end; }
.ai-overlay.open { display: flex; }
.ai-sheet { background: var(--surface); border-radius: 20px 20px 0 0; padding: 1.5rem; width: 100%; max-height: 80vh; display: flex; flex-direction: column; }
.ai-sheet-body { overflow-y: auto; flex: 1; margin: .75rem 0; font-size: .9rem; line-height: 1.75; white-space: pre-wrap; color: var(--text); }

/* Spinner & Toast */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(245,158,11,.3); border-top-color: var(--accent); border-radius: 50%; animation: spin .6s linear infinite; vertical-align: middle; }
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
#toasts { position: fixed; bottom: calc(var(--nav-h) + 4.5rem); left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: .5rem; pointer-events: none; }
.toast { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .55rem 1.25rem; font-size: .85rem; box-shadow: 0 4px 20px rgba(0,0,0,.4); animation: tIn .2s ease; white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis; }
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
@keyframes tIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Favorites */
.fav-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: .75rem; }
.fav-name { font-weight: 600; font-size: .97rem; margin-bottom: .4rem; }
.fav-blend { font-size: .78rem; color: var(--muted); margin-bottom: .75rem; }
.fav-actions { display: flex; gap: .5rem; }

/* Statistics */
#view-stats { padding: 1rem; padding-bottom: calc(var(--nav-h) + 2rem); }
.stat-summary { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1rem; }
.stat-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; text-align: center; }
.stat-box-num { font-size: 2rem; font-weight: 900; color: var(--accent); line-height: 1; }
.stat-box-lbl { font-size: .72rem; color: var(--muted); margin-top: .25rem; text-transform: uppercase; letter-spacing: .05em; }
.stat-bar-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .55rem; }
.stat-bar-row:last-child { margin-bottom: 0; }
.stat-bar-label { font-size: .82rem; width: 120px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-bar-track { flex: 1; height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 5px; background: var(--accent); transition: width .5s ease; }
.stat-bar-fill.green { background: var(--success); }
.stat-bar-val { font-size: .82rem; font-weight: 700; color: var(--accent); width: 3ch; text-align: right; flex-shrink: 0; }
.trend-dots { display: flex; gap: .4rem; flex-wrap: wrap; padding: .5rem 0; }
.trend-dot { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; color: #000; flex-shrink: 0; }
.month-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .55rem; }
.month-label { font-size: .82rem; width: 55px; flex-shrink: 0; color: var(--muted); }
.month-bar { flex: 1; height: 22px; background: var(--border); border-radius: 4px; overflow: hidden; position: relative; }
.month-bar-fill { height: 100%; border-radius: 4px; background: var(--accent); opacity: .8; }
.month-bar-txt { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 .5rem; font-size: .72rem; font-weight: 700; color: var(--text); }

/* Recipe version history */
.version-item { padding: .65rem 0; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .75rem; }
.version-item:last-child { border-bottom: none; }
.version-num { font-size: .75rem; font-weight: 700; color: var(--muted); width: 2.5rem; flex-shrink: 0; }
.version-info { flex: 1; font-size: .82rem; color: var(--muted); }
.version-score { font-size: .95rem; font-weight: 700; flex-shrink: 0; }

/* Tags */
.tag-chip { display: inline-flex; align-items: center; gap: .3rem; background: rgba(245,158,11,.15); color: var(--accent); font-size: .72rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; white-space: nowrap; }
.tag-chip .tc-x { cursor: pointer; font-size: .85rem; line-height: 1; opacity: .7; }
.tag-chip .tc-x:hover { opacity: 1; }
.tag-chips-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.tag-filter-row { display: flex; gap: .35rem; flex-wrap: wrap; padding: 0 1rem .75rem; }
.tag-filter-pill { padding: .2rem .6rem; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--muted); font-size: .75rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: all .15s; white-space: nowrap; }
.tag-filter-pill.active { background: rgba(245,158,11,.2); border-color: var(--accent); color: var(--accent); }


/* Brand overview */
.brand-row { padding: .6rem 0; border-bottom: 1px solid var(--border); }
.brand-row:last-child { border-bottom: none; }
.brand-name { font-size: .88rem; font-weight: 600; margin-bottom: .25rem; }
.brand-meta { font-size: .75rem; color: var(--muted); }

/* Compact AI text */
.ai-cwrap { position: relative; }
.ai-cwrap.collapsed .ai-content { max-height: 110px; overflow: hidden; }
.ai-cfade { display: none; pointer-events: none; }
.ai-cwrap.collapsed .ai-cfade { display: block; position: absolute; bottom: 0; left: 0; right: 0; height: 48px; background: linear-gradient(transparent, var(--surface)); }

/* Add-rating overlay: compact sliders, minimal spacing */
#add-rating-overlay .ai-sheet { max-height: 70vh; }
#add-rating-overlay .rating-item { margin-bottom: .15rem; }
#add-rating-overlay .rating-desc { display: none; }
#add-rating-overlay .rating-header { margin-bottom: 0; }
#add-rating-overlay .rating-label { font-size: .82rem; }
#add-rating-overlay .rating-slider { height: 22px; margin: 0; }
#add-rating-overlay .rating-slider::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -6px; }
#add-rating-overlay .rating-slider::-moz-range-thumb { width: 18px; height: 18px; }
#add-rating-overlay .avg-score-box { padding: .5rem; margin-top: .25rem; }

/* Session timer */
.timer-bar { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .85rem 1rem; margin-bottom: 1rem; text-align: center; }
.timer-display { font-size: 2rem; font-weight: 900; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: .05em; line-height: 1; }
.timer-btns { display: flex; gap: .5rem; justify-content: center; margin-top: .65rem; }

/* Multi-user ratings table */
.user-ratings-table { width: 100%; border-collapse: collapse; font-size: .8rem; margin-top: .5rem; }
.user-ratings-table th { color: var(--muted); font-weight: 600; text-align: left; padding: .3rem .4rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.user-ratings-table td { padding: .35rem .4rem; border-top: 1px solid var(--border); vertical-align: middle; }
.user-ratings-table .score-cell { font-weight: 700; text-align: right; }
.mini-bars { display: flex; gap: 2px; align-items: flex-end; height: 20px; }
.mini-bar { width: 6px; border-radius: 2px; background: var(--accent); min-height: 3px; }

/* Occasion pills */
.occasion-pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.occasion-pill { padding: .3rem .75rem; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--muted); font-size: .82rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: all .15s; }
.occasion-pill.active { background: rgba(99,102,241,.2); border-color: #818cf8; color: #818cf8; }

/* Days-since banner */
.sess-since-banner { padding: .5rem 1rem; font-size: .82rem; color: var(--muted); background: var(--surface2); border-bottom: 1px solid var(--border); text-align: center; }

/* Score sparkline in tobacco detail */
.score-sparkline { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .5rem; }
.sparkline-dot { width: 2rem; height: 2rem; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; color: #fff; cursor: pointer; flex-shrink: 0; transition: transform .1s; }
.sparkline-dot:hover { transform: scale(1.15); }

/* Trend SVG dots */
#stats-trend-svg circle { transition: r .1s; }
#stats-trend-svg circle:hover { r: 5; }
