:root {
  color-scheme: dark;
  --bg: #11110f;
  --bg-raised: #171714;
  --panel: #1b1a17;
  --panel-soft: #211f1b;
  --panel-hover: #27241f;
  --line: rgba(235, 222, 198, .11);
  --line-strong: rgba(235, 222, 198, .2);
  --text: #f1eadf;
  --text-soft: #c7bcae;
  --muted: #857d72;
  --accent: #c4916a;
  --accent-soft: #9f6748;
  --accent-wash: rgba(196, 145, 106, .13);
  --tea: #8fa38a;
  --tea-wash: rgba(143, 163, 138, .13);
  --danger: #bd6b5d;
  --amber: #d1a768;
  --shadow: 0 24px 80px rgba(0, 0, 0, .36);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, serif;
  --sans: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body[data-theme="wine"] { --accent: #c4916a; --accent-soft: #985f43; --accent-wash: rgba(196, 145, 106, .14); }
body[data-theme="tea"] { --accent: #91a58d; --accent-soft: #687d66; --accent-wash: rgba(145, 165, 141, .14); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 77% 0%, rgba(111, 82, 52, .08), transparent 27%),
    var(--bg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: fixed; width: 0; height: 0; overflow: hidden; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  width: 238px;
  flex-direction: column;
  padding: 31px 20px 24px;
  border-right: 1px solid var(--line);
  background: rgba(17, 17, 15, .96);
  backdrop-filter: blur(20px);
}
.brand { display: flex; align-items: center; gap: 13px; padding: 0 10px 33px; }
.brand-mark, .mobile-brand span {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 1px solid rgba(213, 173, 131, .38);
  background: linear-gradient(145deg, #3a2920, #1d1916);
  color: #d9ae83;
  font-family: var(--serif);
  font-size: 20px;
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, .15);
  transform: rotate(45deg);
}
.brand-mark::first-letter, .mobile-brand span { transform: rotate(45deg); }
.brand-mark { line-height: 39px; }
.brand-mark { writing-mode: horizontal-tb; }
.brand > span:last-child { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.brand b { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: .12em; }
.brand small { color: var(--muted); font-size: 8px; letter-spacing: .2em; }

.main-nav { display: grid; gap: 6px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 12px 13px;
  border-left: 2px solid transparent;
  background: transparent;
  color: #817a70;
  text-align: left;
  cursor: pointer;
  transition: .22s ease;
}
.nav-item:hover { color: var(--text-soft); background: rgba(255, 255, 255, .025); }
.nav-item.active { border-left-color: var(--accent); background: linear-gradient(90deg, var(--accent-wash), transparent); color: var(--text); }
.nav-item svg { width: 18px; height: 18px; }
.nav-item span { flex: 1; font-size: 14px; }
.nav-item em { min-width: 23px; padding: 2px 6px; border: 1px solid var(--line); color: var(--muted); font-size: 10px; font-style: normal; text-align: center; }

.side-note {
  position: relative;
  margin-top: auto;
  padding: 19px 16px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(140deg, rgba(143, 106, 72, .11), rgba(255, 255, 255, .012));
}
.side-note::after { position: absolute; width: 95px; height: 95px; right: -46px; bottom: -51px; border: 1px solid rgba(196, 145, 106, .18); border-radius: 50%; content: ""; }
.note-orbit { display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid rgba(196, 145, 106, .26); color: var(--accent); }
.note-orbit svg { width: 15px; }
.side-note p { margin: 14px 0 4px; color: var(--text-soft); font-size: 11px; }
.side-note strong { display: block; max-width: 150px; font-family: var(--serif); font-size: 13px; font-weight: 500; line-height: 1.65; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; margin-top: 19px; padding: 17px 8px 0; border-top: 1px solid var(--line); }
.avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border: 1px solid #504339; background: #27211d; color: #c6a788; font-family: var(--serif); font-size: 13px; }
.sidebar-foot div { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }
.sidebar-foot b { color: var(--text-soft); font-size: 11px; font-weight: 500; }
.sidebar-foot small { color: var(--muted); font-size: 9px; }
.sidebar-foot button, .icon-button { display: grid; place-items: center; background: transparent; color: var(--muted); cursor: pointer; }
.sidebar-foot button svg { width: 17px; }

.main { min-height: 100vh; margin-left: 238px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  height: 78px;
  align-items: center;
  gap: 17px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 17, 15, .91);
  backdrop-filter: blur(20px);
}
.mobile-brand { display: none; }
.search-box { display: flex; width: min(330px, 27vw); align-items: center; gap: 10px; color: var(--muted); }
.search-box svg { width: 17px; flex: 0 0 auto; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text-soft); font-size: 12px; }
.search-box input::placeholder { color: #706a62; }
.search-box kbd { padding: 3px 6px; border: 1px solid var(--line); color: #625d56; font-family: var(--sans); font-size: 9px; }
.mode-switch { display: flex; margin-left: auto; padding: 3px; border: 1px solid var(--line); background: #161512; }
.mode-switch button { min-width: 54px; padding: 7px 10px; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.mode-switch button.active { background: var(--accent-wash); color: var(--text); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .035); }
.weather-pill { display: flex; align-items: center; gap: 9px; padding-left: 16px; border-left: 1px solid var(--line); }
.weather-pill svg { width: 17px; color: var(--amber); }
.weather-pill span { display: flex; flex-direction: column; gap: 2px; }
.weather-pill b { color: var(--text-soft); font-size: 10px; font-weight: 500; }
.weather-pill small { color: var(--muted); font-size: 9px; }
.scan-button, .primary-button, .secondary-button, .text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.scan-button { padding: 11px 16px; background: var(--text); color: #15130f; font-size: 11px; font-weight: 600; }
.scan-button:hover, .primary-button:hover { transform: translateY(-1px); filter: brightness(1.05); }
.scan-button svg { width: 16px; }

.page-content { width: min(1440px, 100%); margin: 0 auto; padding: 28px 32px 55px; }
.hero {
  position: relative;
  display: grid;
  min-height: 410px;
  grid-template-columns: 1fr 340px;
  align-items: center;
  padding: 54px 52px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(13, 12, 10, .98) 0%, rgba(13, 12, 10, .82) 40%, rgba(13, 12, 10, .18) 74%, rgba(13, 12, 10, .08) 100%),
    linear-gradient(0deg, rgba(10, 9, 8, .55), transparent 45%),
    url("/static/assets/hero-cellar-tea.webp") center / cover no-repeat;
  box-shadow: var(--shadow);
}
.hero::before { position: absolute; inset: 14px; border: 1px solid rgba(230, 215, 190, .06); pointer-events: none; content: ""; }
.hero-copy { position: relative; z-index: 2; max-width: 540px; }
.eyebrow { color: #a49788; font-size: 9px; letter-spacing: .24em; }
.eyebrow i { display: inline-block; width: 24px; height: 1px; margin: 0 10px 3px 0; background: var(--accent); }
.hero h1 { margin: 18px 0 17px; font-family: var(--serif); font-size: clamp(36px, 4.4vw, 58px); font-weight: 400; line-height: 1.28; letter-spacing: .06em; text-shadow: 0 5px 22px rgba(0, 0, 0, .5); }
.hero-copy > p { max-width: 490px; margin: 0; color: #a59c91; font-size: 13px; line-height: 1.9; }
.hero-actions { display: flex; align-items: center; gap: 19px; margin-top: 29px; }
.primary-button { padding: 13px 19px; border: 1px solid var(--accent); background: var(--accent); color: #16120e; font-size: 12px; font-weight: 600; }
.primary-button svg, .secondary-button svg { width: 16px; }
.text-button { padding: 9px 0; background: transparent; color: #c2b8ab; font-size: 11px; }
.text-button:hover { color: var(--text); }
.text-button svg { width: 15px; transition: transform .2s; }
.text-button:hover svg { transform: translateX(3px); }
.hero-asset {
  position: relative;
  z-index: 2;
  align-self: end;
  margin-bottom: 5px;
  padding: 21px 22px;
  border: 1px solid rgba(235, 221, 196, .17);
  border-top: 2px solid var(--accent);
  background: rgba(12, 11, 9, .72);
  backdrop-filter: blur(15px);
}
.hero-asset-top { display: flex; align-items: center; gap: 7px; }
.status-dot, .live-pill i { width: 6px; height: 6px; border-radius: 50%; background: #9eb288; box-shadow: 0 0 0 4px rgba(158, 178, 136, .09); }
.hero-asset-top b { color: #aa9e90; font-size: 9px; font-weight: 500; letter-spacing: .12em; }
.hero-asset-top small { margin-left: auto; color: #766f66; font-size: 8px; letter-spacing: .12em; }
.hero-asset h2 { margin: 14px 0 6px; font-family: var(--serif); font-size: 19px; font-weight: 500; }
.hero-asset > p { margin: 0 0 17px; color: #8e8579; font-size: 10px; }
.hero-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); color: #847b70; font-size: 9px; }
.hero-meta span { display: flex; align-items: center; gap: 5px; }
.hero-meta svg { width: 13px; }
.hero-meta b { color: #c3a47e; font-weight: 500; }
.hero-index { position: absolute; right: 23px; top: 21px; color: rgba(220, 207, 187, .42); font-family: var(--serif); font-size: 10px; letter-spacing: .1em; }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 16px; border: 1px solid var(--line); background: var(--bg-raised); }
.stat-card { position: relative; display: flex; min-height: 112px; align-items: center; gap: 13px; padding: 23px; border-right: 1px solid var(--line); }
.stat-card:last-child { border-right: 0; }
.stat-icon { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); background: rgba(255,255,255,.02); color: var(--accent); }
.stat-icon svg { width: 18px; }
.stat-icon.amber { color: var(--amber); }
.stat-icon.green { color: var(--tea); }
.stat-icon.outline { border-style: dashed; color: var(--text-soft); }
.stat-card > div { min-width: 0; }
.stat-card small { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.stat-card strong { font-family: var(--serif); font-size: 24px; font-weight: 400; }
.stat-card em { margin-left: 4px; color: var(--muted); font-size: 9px; font-style: normal; }
.stat-trend { position: absolute; left: 74px; bottom: 18px; color: #727066; font-size: 8px; }
.stat-trend.warning { color: #a7835b; }
.stat-card.action { cursor: pointer; }
.stat-card.action:hover { background: var(--panel-hover); }
.stat-card.action b { display: block; color: var(--text-soft); font-family: var(--serif); font-size: 13px; font-weight: 500; }
.end-arrow { margin-left: auto; color: var(--muted); }

.collection-section { padding-top: 56px; scroll-margin-top: 90px; }
.section-heading, .panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-heading h2, .panel-heading h2 { margin: 7px 0 0; font-family: var(--serif); font-size: 25px; font-weight: 400; letter-spacing: .05em; }
.collection-tools { display: flex; align-items: center; gap: 12px; }
.filter-chips { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); background: var(--bg-raised); }
.filter-chips button { padding: 7px 11px; background: transparent; color: var(--muted); font-size: 9px; cursor: pointer; }
.filter-chips button.active { background: var(--panel-hover); color: var(--text-soft); }
.icon-button { width: 35px; height: 35px; border: 1px solid var(--line); }
.icon-button:hover { border-color: var(--line-strong); color: var(--text); }
.icon-button svg { width: 17px; }

.asset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-top: 22px; }
.grid-loading { grid-column: 1 / -1; padding: 80px 20px; border: 1px solid var(--line); color: var(--muted); text-align: center; }
.asset-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); background: var(--bg-raised); cursor: pointer; transition: transform .24s ease, border-color .24s ease, background .24s ease; }
.asset-card:hover { transform: translateY(-4px); border-color: var(--line-strong); background: var(--panel); }
.asset-visual { position: relative; height: 185px; overflow: hidden; background: radial-gradient(circle at 50% 55%, #33281f, #171512 62%); }
.asset-card[data-kind="tea"] .asset-visual { background: radial-gradient(circle at 50% 55%, #303129, #161714 63%); }
.asset-visual::after { position: absolute; inset: auto 10% 10px; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.14), transparent); content: ""; }
.asset-photo { width: 100%; height: 100%; object-fit: cover; filter: saturate(.7) contrast(1.07); transition: transform .5s ease; }
.asset-card:hover .asset-photo { transform: scale(1.035); }
.asset-bottle { position: absolute; left: 50%; bottom: 17px; width: 46px; height: 125px; border: 1px solid rgba(208, 183, 143, .25); border-radius: 8px 8px 12px 12px; background: linear-gradient(90deg, #191d13, #303821 45%, #11160f 76%); box-shadow: 13px 13px 28px rgba(0,0,0,.35); transform: translateX(-50%); }
.asset-bottle::before { position: absolute; left: 12px; top: -39px; width: 20px; height: 45px; border: 1px solid rgba(208, 183, 143, .2); background: #222519; content: ""; }
.asset-bottle::after { position: absolute; left: 4px; right: 4px; top: 47px; height: 42px; background: #d4c8b1; box-shadow: inset 0 0 0 1px rgba(61,40,27,.18); content: ""; }
.tea-disc { position: absolute; left: 50%; bottom: 26px; width: 118px; height: 118px; border: 7px solid #393226; border-radius: 50%; background: repeating-radial-gradient(ellipse at center, #766449 0 2px, #4a4030 3px 5px, #62543e 6px 7px); box-shadow: 18px 18px 36px rgba(0,0,0,.38); transform: translateX(-50%) rotate(-5deg); }
.tea-disc::after { position: absolute; inset: 28px; border: 1px solid rgba(218,201,170,.35); border-radius: 50%; background: rgba(219, 205, 178, .12); content: ""; }
.asset-badge { position: absolute; left: 13px; top: 13px; z-index: 2; padding: 5px 8px; border: 1px solid rgba(255,255,255,.13); background: rgba(13,12,10,.68); color: #c2b8aa; font-size: 8px; letter-spacing: .08em; backdrop-filter: blur(8px); }
.asset-badge.urgent { border-color: rgba(196, 105, 88, .35); color: #dc9386; }
.asset-badge.ready { border-color: rgba(167, 140, 95, .4); color: #d2ac70; }
.asset-badge.aging { color: #8ba59b; }
.asset-badge.fresh { color: #9bad8a; }
.asset-badge.opened { color: #d1937c; }
.asset-kind-chip { position: absolute; right: 13px; top: 13px; z-index: 2; display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid rgba(255,255,255,.12); background: rgba(13,12,10,.55); color: #aaa094; backdrop-filter: blur(8px); }
.asset-kind-chip svg { width: 13px; }
.asset-info { padding: 17px 18px 18px; }
.asset-info small { color: var(--muted); font-size: 8px; letter-spacing: .05em; }
.asset-info h3 { margin: 7px 0 6px; overflow: hidden; font-family: var(--serif); font-size: 15px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.asset-info > p { margin: 0; overflow: hidden; color: #827a71; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.asset-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; }
.asset-card-foot span { display: flex; align-items: center; gap: 4px; }
.asset-card-foot svg { width: 12px; }
.asset-card-foot b { color: #aa9680; font-weight: 500; }
.load-more { display: none; margin: 22px auto 0; padding: 10px 16px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.load-more.visible { display: flex; align-items: center; gap: 8px; }
.load-more svg { width: 14px; transform: rotate(90deg); }

.insight-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 15px; padding-top: 56px; scroll-margin-top: 90px; }
.priority-panel, .flavor-panel { min-height: 340px; padding: 27px; border: 1px solid var(--line); background: var(--bg-raised); }
.panel-heading { align-items: center; padding-bottom: 21px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { font-size: 19px; }
.live-pill { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 8px; }
.priority-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 13px; align-items: center; padding: 17px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.priority-item:last-child { border-bottom: 0; }
.priority-index { font-family: var(--serif); color: #5e5952; font-size: 16px; }
.priority-main { min-width: 0; }
.priority-main b { display: block; overflow: hidden; margin-bottom: 4px; color: var(--text-soft); font-family: var(--serif); font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.priority-main small { color: var(--muted); font-size: 9px; }
.priority-action { padding: 7px 9px; border: 1px solid var(--line); color: #aa8b69; font-size: 8px; transition: .2s; }
.priority-item:hover .priority-action { border-color: var(--accent); background: var(--accent-wash); }
.flavor-chart { display: grid; gap: 12px; padding: 24px 0 18px; }
.flavor-bar { display: grid; grid-template-columns: 56px 1fr 24px; align-items: center; gap: 9px; color: var(--muted); font-size: 9px; }
.flavor-track { height: 4px; background: #292722; }
.flavor-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-soft), var(--accent)); }
.flavor-bar em { color: #706960; font-size: 8px; font-style: normal; text-align: right; }
.flavor-summary { min-height: 42px; margin: 0 0 18px; color: #898176; font-family: var(--serif); font-size: 11px; line-height: 1.8; }
.secondary-button { width: 100%; padding: 11px 15px; border: 1px solid var(--line-strong); background: transparent; color: var(--text-soft); font-size: 10px; }
.secondary-button:hover { border-color: var(--accent); background: var(--accent-wash); }
.app-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 52px; padding-top: 21px; border-top: 1px solid var(--line); color: #6d665e; font-family: var(--serif); font-size: 10px; }
.app-footer small { max-width: 520px; font-family: var(--sans); font-size: 8px; text-align: right; }

.overlay { position: fixed; inset: 0; z-index: 100; display: grid; padding: 28px; place-items: center; visibility: hidden; background: rgba(7, 7, 6, .76); opacity: 0; backdrop-filter: blur(12px); transition: opacity .25s, visibility .25s; }
.overlay.open { visibility: visible; opacity: 1; }
.modal { position: relative; width: min(690px, 100%); max-height: calc(100vh - 56px); overflow: auto; padding: 38px; border: 1px solid var(--line-strong); background: #181714; box-shadow: var(--shadow); transform: translateY(12px); transition: transform .25s; }
.overlay.open .modal { transform: translateY(0); }
.modal::before { position: absolute; inset: 11px; border: 1px solid rgba(255,255,255,.025); pointer-events: none; content: ""; }
.modal-close { position: absolute; right: 18px; top: 18px; z-index: 4; display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); background: #1d1c19; color: var(--muted); cursor: pointer; }
.modal-close:hover { color: var(--text); }
.modal-close svg { width: 16px; }
.modal-kicker { display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: 8px; letter-spacing: .18em; }
.modal-kicker svg { width: 15px; }
.modal h2 { position: relative; margin: 12px 0 9px; font-family: var(--serif); font-size: 28px; font-weight: 400; }
.modal > p { position: relative; margin: 0 0 23px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.drop-zone { position: relative; display: grid; min-height: 245px; place-items: center; align-content: center; gap: 10px; overflow: hidden; border: 1px dashed rgba(215, 190, 158, .24); background: #121210; color: var(--muted); text-align: center; cursor: pointer; transition: .2s; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--accent); background: var(--accent-wash); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone img { position: absolute; inset: 0; display: none; width: 100%; height: 100%; object-fit: cover; opacity: .7; }
.drop-zone.has-image img { display: block; }
.drop-zone.has-image::after { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(11,10,8,.85), rgba(11,10,8,.16)); content: ""; }
.drop-zone > *:not(img):not(input) { position: relative; z-index: 2; }
.upload-orbit { display: grid; width: 47px; height: 47px; place-items: center; border: 1px solid var(--line-strong); background: rgba(19,18,15,.8); color: var(--accent); }
.upload-orbit svg { width: 20px; }
.drop-zone strong { color: var(--text-soft); font-family: var(--serif); font-size: 13px; font-weight: 400; }
.drop-zone small { font-size: 9px; }
.form-row { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 10px; margin-top: 13px; }
.form-row label { display: grid; gap: 7px; }
.form-row label > span { color: var(--muted); font-size: 9px; }
.form-row input, .form-row select, .guide-environment input, .guide-environment select, .tasting-form textarea { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--line); outline: 0; background: #121210; color: var(--text-soft); font-size: 10px; }
.form-row input:focus, .form-row select:focus, .guide-environment input:focus, .guide-environment select:focus, .tasting-form textarea:focus { border-color: var(--accent); }
.money-input { position: relative; }
.money-input i { position: absolute; left: 10px; top: 12px; color: var(--muted); font-size: 10px; font-style: normal; }
.money-input input { padding-left: 24px; }
.recognition-note { display: flex; gap: 10px; margin: 15px 0; padding: 12px 14px; border-left: 2px solid var(--accent); background: var(--accent-wash); color: var(--muted); font-size: 9px; line-height: 1.7; }
.recognition-note svg { width: 15px; flex: 0 0 auto; color: var(--accent); }
.recognition-note b { color: var(--text-soft); font-weight: 500; }
.wide { width: 100%; }

.drawer-shell { position: fixed; inset: 0; z-index: 90; visibility: hidden; }
.drawer-shell.open { visibility: visible; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(5,5,4,.68); opacity: 0; backdrop-filter: blur(8px); transition: opacity .28s; }
.drawer-shell.open .drawer-backdrop { opacity: 1; }
.detail-drawer { position: absolute; right: 0; top: 0; width: min(510px, 100%); height: 100%; overflow: auto; border-left: 1px solid var(--line-strong); background: #151512; box-shadow: var(--shadow); transform: translateX(100%); transition: transform .32s ease; }
.drawer-shell.open .detail-drawer { transform: translateX(0); }
.detail-visual { position: relative; height: 300px; overflow: hidden; background: radial-gradient(circle at 50% 60%, #3a2d22, #11100e 66%); }
.detail-visual.tea { background: radial-gradient(circle at 50% 60%, #3b3b2e, #11120f 66%); }
.detail-visual img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.74) contrast(1.06); }
.detail-visual .asset-bottle { bottom: 48px; transform: translateX(-50%) scale(1.35); }
.detail-visual .tea-disc { bottom: 60px; transform: translateX(-50%) rotate(-5deg) scale(1.28); }
.detail-visual::after { position: absolute; inset: auto 0 0; height: 50%; background: linear-gradient(transparent, #151512); content: ""; }
.detail-body { position: relative; margin-top: -29px; padding: 0 34px 40px; }
.detail-status { position: relative; z-index: 2; display: inline-flex; padding: 6px 9px; border: 1px solid rgba(203, 166, 112, .35); background: #1a1814; color: #caa773; font-size: 8px; letter-spacing: .08em; }
.detail-body h2 { margin: 17px 0 6px; font-family: var(--serif); font-size: 27px; font-weight: 400; }
.detail-subtitle { margin: 0; color: var(--muted); font-size: 10px; }
.detail-summary { margin: 20px 0; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #aea396; font-family: var(--serif); font-size: 12px; line-height: 1.9; }
.detail-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 17px 0; background: var(--line); }
.detail-metric { padding: 14px 11px; background: #191815; }
.detail-metric small { display: block; margin-bottom: 6px; color: var(--muted); font-size: 8px; }
.detail-metric b { color: var(--text-soft); font-size: 10px; font-weight: 500; }
.flavor-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 21px; }
.flavor-tags span, .tag-choice { padding: 6px 9px; border: 1px solid var(--line); color: #9d9387; font-size: 9px; }
.detail-label { margin-top: 23px; color: #766e64; font-size: 8px; letter-spacing: .15em; }
.detail-notes { display: grid; gap: 8px; margin: 12px 0 24px; padding: 0; list-style: none; }
.detail-notes li { display: flex; gap: 8px; color: var(--muted); font-size: 9px; line-height: 1.7; }
.detail-notes li::before { flex: 0 0 auto; color: var(--accent); content: "·"; }
.detail-actions { display: grid; grid-template-columns: 1.5fr 1fr; gap: 9px; }

.guide-modal { width: min(860px, 100%); padding: 0; }
.guide-head { position: relative; min-height: 235px; padding: 39px 43px 32px; overflow: hidden; background: linear-gradient(110deg, #171510, #222019); }
.guide-head::after { position: absolute; width: 310px; height: 310px; right: -110px; top: -130px; border: 1px solid rgba(210,184,145,.09); border-radius: 50%; box-shadow: 0 0 0 40px rgba(210,184,145,.025), 0 0 0 80px rgba(210,184,145,.018); content: ""; }
.guide-head h2 { max-width: 570px; margin: 15px 0 8px; font-size: 31px; }
.guide-head > p { max-width: 610px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.8; }
.guide-environment { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 8px; margin-top: 22px; }
.guide-environment label { display: grid; gap: 5px; color: var(--muted); font-size: 8px; }
.guide-environment input, .guide-environment select { height: 37px; background: rgba(11,11,9,.45); }
.guide-environment button { align-self: end; height: 37px; padding: 0 13px; border: 1px solid var(--line-strong); background: transparent; color: var(--text-soft); font-size: 9px; cursor: pointer; }
.guide-body { padding: 30px 43px 40px; }
.guide-parameters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.guide-param { min-height: 111px; padding: 15px; border: 1px solid var(--line); background: #1c1b17; }
.guide-param small { color: var(--muted); font-size: 8px; }
.guide-param b { display: block; margin: 9px 0 6px; color: var(--text); font-family: var(--serif); font-size: 15px; font-weight: 500; }
.guide-param p { margin: 0; color: #746d64; font-size: 8px; line-height: 1.55; }
.guide-columns { display: grid; grid-template-columns: 1.25fr 1fr; gap: 28px; margin-top: 30px; }
.guide-section h3 { margin: 0 0 15px; color: var(--text-soft); font-family: var(--serif); font-size: 15px; font-weight: 500; }
.guide-steps { margin: 0; padding: 0; list-style: none; counter-reset: steps; }
.guide-steps li { position: relative; min-height: 37px; padding: 0 0 14px 31px; color: #8e857a; font-size: 9px; line-height: 1.7; counter-increment: steps; }
.guide-steps li::before { position: absolute; left: 0; top: 0; display: grid; width: 20px; height: 20px; place-items: center; border: 1px solid var(--line); color: var(--accent); font-size: 8px; content: counter(steps, decimal-leading-zero); }
.guide-note { padding: 17px; border-left: 2px solid var(--accent); background: var(--accent-wash); color: #a59a8c; font-family: var(--serif); font-size: 11px; line-height: 1.85; }
.guide-caution { margin: 17px 0 0; color: #6f6961; font-size: 8px; line-height: 1.7; }
.guide-actions { display: flex; gap: 9px; margin-top: 26px; }
.guide-actions > * { flex: 1; }
.tasting-form { display: none; margin-top: 30px; padding-top: 27px; border-top: 1px solid var(--line); }
.tasting-form.open { display: block; }
.rating-row { display: flex; align-items: center; gap: 13px; margin-bottom: 15px; }
.rating-row > span { color: var(--muted); font-size: 9px; }
.stars { display: flex; gap: 3px; }
.stars button { padding: 2px; background: transparent; color: #514b43; cursor: pointer; }
.stars button.active { color: var(--amber); }
.stars svg { width: 20px; fill: currentColor; }
.tag-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 13px; }
.tag-choice { background: transparent; cursor: pointer; }
.tag-choice.active { border-color: var(--accent); background: var(--accent-wash); color: var(--text-soft); }
.tasting-form textarea { height: 90px; padding: 12px; resize: vertical; line-height: 1.7; }

.poster-modal { width: min(440px, 100%); text-align: center; }
.poster-preview { width: min(270px, 100%); max-height: 54vh; margin: 19px auto; overflow: auto; border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.poster-preview img { display: block; width: 100%; }
.poster-modal .primary-button { position: relative; }

.busy { position: fixed; inset: 0; z-index: 200; display: flex; visibility: hidden; align-items: center; justify-content: center; flex-direction: column; background: rgba(10,9,8,.9); opacity: 0; backdrop-filter: blur(12px); transition: .2s; }
.busy.open { visibility: visible; opacity: 1; }
.busy-ring { width: 54px; height: 54px; margin-bottom: 22px; border: 1px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
.busy b { font-family: var(--serif); font-size: 17px; font-weight: 400; }
.busy small { margin-top: 8px; color: var(--muted); font-size: 9px; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 35px; z-index: 300; display: flex; visibility: hidden; align-items: center; gap: 8px; padding: 11px 16px; border: 1px solid var(--line-strong); background: #25221e; color: var(--text-soft); font-size: 10px; opacity: 0; box-shadow: var(--shadow); transform: translate(-50%, 10px); transition: .2s; }
.toast.show { visibility: visible; opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 14px; color: var(--tea); }

@media (max-width: 1180px) {
  .sidebar { width: 205px; }
  .main { margin-left: 205px; }
  .weather-pill { display: none; }
  .hero { grid-template-columns: 1fr 300px; padding: 44px 39px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .stat-card:nth-child(2) { border-right: 0; }
  .stat-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .topbar { height: 68px; gap: 10px; padding: 0 15px; }
  .mobile-brand { display: grid; width: 34px; height: 34px; place-items: center; padding: 0; background: transparent; }
  .mobile-brand span { width: 27px; height: 27px; font-size: 13px; transform: rotate(45deg); }
  .search-box { flex: 1; width: auto; padding: 8px 10px; border: 1px solid var(--line); }
  .search-box kbd { display: none; }
  .mode-switch { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 70; margin: 0; box-shadow: 0 12px 40px rgba(0,0,0,.5); transform: translateX(-50%); }
  .scan-button { width: 38px; height: 38px; padding: 0; }
  .scan-button span { display: none; }
  .page-content { padding: 14px 14px 80px; }
  .hero { min-height: 530px; grid-template-columns: 1fr; align-items: end; padding: 32px 24px 25px; background: linear-gradient(0deg, rgba(12,11,9,.98) 0%, rgba(12,11,9,.7) 55%, rgba(12,11,9,.1) 100%), url("/static/assets/hero-cellar-tea.webp") 68% center / cover no-repeat; }
  .hero-copy { align-self: start; padding-top: 17px; }
  .hero h1 { margin-top: 13px; font-size: 38px; }
  .hero-copy > p { font-size: 11px; }
  .hero-asset { width: 100%; margin-top: 30px; }
  .hero-index { top: 16px; right: 17px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stat-card { min-height: 105px; gap: 10px; padding: 16px 13px; }
  .stat-icon { width: 32px; height: 32px; }
  .stat-card strong { font-size: 19px; }
  .stat-trend { left: 55px; bottom: 13px; }
  .stat-card.action b { font-size: 11px; }
  .collection-section, .insight-grid { padding-top: 42px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .collection-tools { width: 100%; }
  .filter-chips { flex: 1; overflow-x: auto; }
  .filter-chips button { flex: 0 0 auto; }
  .asset-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .asset-visual { height: 150px; }
  .asset-info { padding: 13px; }
  .asset-info h3 { font-size: 13px; }
  .asset-card-foot { align-items: flex-start; gap: 4px; flex-direction: column; }
  .insight-grid { grid-template-columns: 1fr; }
  .priority-panel, .flavor-panel { padding: 20px; }
  .app-footer { align-items: flex-start; flex-direction: column; }
  .app-footer small { text-align: left; }
  .overlay { padding: 10px; }
  .modal { max-height: calc(100vh - 20px); padding: 28px 20px 22px; }
  .form-row { grid-template-columns: 1fr; }
  .drop-zone { min-height: 205px; }
  .detail-body { padding: 0 22px 35px; }
  .detail-visual { height: 250px; }
  .detail-actions { grid-template-columns: 1fr; }
  .guide-head { min-height: 0; padding: 34px 22px 24px; }
  .guide-head h2 { padding-right: 30px; font-size: 25px; }
  .guide-environment { grid-template-columns: 1fr 1fr; }
  .guide-environment button { grid-column: 1 / -1; }
  .guide-body { padding: 22px; }
  .guide-parameters { grid-template-columns: 1fr 1fr; }
  .guide-columns { grid-template-columns: 1fr; gap: 15px; }
}

@media (max-width: 460px) {
  .asset-grid { grid-template-columns: 1fr; }
  .asset-visual { height: 190px; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 6px; }
  .stats-row { grid-template-columns: 1fr; }
  .stat-card { border-right: 0; border-bottom: 1px solid var(--line); }
  .stat-card:last-child { border-bottom: 0; }
  .stat-card:nth-child(3) { border-bottom: 1px solid var(--line); }
  .stat-trend { position: static; margin-left: auto; }
  .guide-parameters { grid-template-columns: 1fr; }
  .detail-metrics { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
