@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@600;700&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --ink: #272520;
  --muted: #7c776d;
  --paper: #f6f2e9;
  --paper-2: #eee8dd;
  --card: #fffdf8;
  --line: #dfd8ca;
  --green: #526553;
  --green-dark: #354638;
  --sage: #a9b59e;
  --clay: #ae654b;
  --clay-soft: #e8c4b5;
  --gold: #c09b57;
  --shadow: 0 18px 45px rgba(73, 63, 43, .1);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% 0%, rgba(213, 198, 170, .22), transparent 32%),
    var(--paper);
  font-family: "DM Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: 248px;
  padding: 28px 18px 20px;
  border-right: 1px solid rgba(55, 50, 42, .1);
  background: rgba(241, 235, 224, .92);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 9px 26px; }
.brand-mark { width: 43px; height: 43px; border-radius: 15px; display: grid; place-items: center; background: var(--green); color: #f7f0df; box-shadow: 0 8px 20px rgba(53, 70, 56, .22); }
.brand-mark svg { width: 30px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand strong { display: block; font: 700 22px/1 "Noto Serif SC", serif; letter-spacing: .12em; }
.brand small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; letter-spacing: .16em; }

.main-nav { display: grid; gap: 5px; }
.nav-item, .quick-filter {
  width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 11px; border-radius: 12px; color: #625e56;
}
.nav-item { min-height: 46px; padding: 0 12px; font-weight: 600; }
.nav-item:hover, .nav-item.active { background: var(--card); color: var(--green-dark); box-shadow: 0 5px 18px rgba(77, 67, 49, .07); }
.nav-icon { width: 23px; text-align: center; font-size: 19px; font-weight: 400; }
.nav-item em { margin-left: auto; min-width: 23px; padding: 3px 6px; border-radius: 8px; background: rgba(82, 101, 83, .09); font-style: normal; font-size: 11px; text-align: center; }
.sidebar-section { margin-top: 30px; padding: 0 10px; }
.sidebar-section p { margin: 0 0 10px; color: #969086; font-size: 10px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.quick-filter { padding: 8px 2px; font-size: 13px; }
.quick-filter:hover { color: var(--green-dark); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.dot.western { background: var(--clay); }
.dot.dumpling { background: var(--gold); }
.sync-card { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid rgba(82, 101, 83, .13); border-radius: 14px; background: rgba(255, 253, 248, .55); }
.sync-icon { width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; background: #dce5d5; color: var(--green-dark); font-size: 12px; }
.sync-card strong, .sync-card small { display: block; }
.sync-card strong { font-size: 12px; }
.sync-card small { margin-top: 3px; color: var(--muted); font-size: 9px; }

.main-area { grid-column: 2; min-width: 0; }
.topbar { height: 78px; padding: 0 clamp(24px, 4vw, 62px); display: flex; align-items: center; gap: 20px; border-bottom: 1px solid rgba(55, 50, 42, .08); background: rgba(246, 242, 233, .78); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 30; }
.global-search { width: min(460px, 45vw); height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.55); }
.global-search:focus-within { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(82,101,83,.08); }
.global-search span { font-size: 22px; color: var(--muted); transform: rotate(-20deg); }
.global-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.global-search input::placeholder { color: #aaa399; }
kbd { padding: 3px 6px; border: 1px solid #d8d0c2; border-radius: 5px; color: #9b958c; background: #f4efe7; font: 10px/1.2 inherit; }
.top-actions { display: flex; gap: 9px; margin-left: auto; }
.primary-button, .ghost-button, .capture-button, .text-button { border: 0; cursor: pointer; }
.primary-button, .ghost-button { min-height: 40px; padding: 0 16px; border-radius: 12px; font-weight: 600; }
.primary-button { color: #fffaf0; background: var(--green); box-shadow: 0 8px 17px rgba(53,70,56,.16); }
.primary-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.ghost-button { border: 1px solid var(--line); background: rgba(255,255,255,.45); }
.ghost-button:hover { background: var(--card); }
.import-label { display: inline-flex; align-items: center; cursor: pointer; }
.import-label input { display: none; }
.icon-button, .menu-button { display: none; border: 0; background: transparent; cursor: pointer; }
.view { display: none; padding: 42px clamp(24px, 4vw, 62px) 70px; animation: view-in .25s ease both; }
.view.active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.page-head h1 { max-width: 780px; margin: 5px 0 9px; font: 700 clamp(29px, 3vw, 46px)/1.22 "Noto Serif SC", serif; letter-spacing: -.025em; }
.page-head p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--clay) !important; font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.dashboard-head { padding: 7px 0 4px; }
.capture-button { min-width: 235px; display: flex; align-items: center; gap: 12px; padding: 14px 17px; border: 1px solid rgba(82,101,83,.18); border-radius: 16px; text-align: left; background: #e4e8dd; color: var(--green-dark); }
.capture-button:hover { background: #dce3d4; transform: translateY(-2px); }
.capture-plus { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 12px; background: var(--green); color: white; font-size: 21px; }
.capture-button strong, .capture-button small { display: block; }
.capture-button small { margin-top: 3px; color: #708070; font-size: 10px; }
.compact-head h1 { font-size: clamp(32px, 4vw, 50px); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { position: relative; overflow: hidden; min-height: 126px; padding: 20px; border: 1px solid rgba(70,61,48,.09); border-radius: 18px; background: rgba(255,253,248,.72); }
.stat-card::after { content: ""; position: absolute; right: -23px; bottom: -35px; width: 95px; height: 95px; border-radius: 50%; background: var(--stat-color, #d8dfd1); opacity: .6; }
.stat-card span { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 600; }
.stat-card span i { color: var(--green); font-style: normal; }
.stat-card strong { display: block; margin-top: 16px; font: 700 31px/1 "Noto Serif SC", serif; }
.stat-card small { display: block; margin-top: 8px; color: #aaa297; font-size: 10px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr); gap: 18px; }
.panel { border: 1px solid rgba(70,61,48,.09); border-radius: var(--radius); background: rgba(255,253,248,.75); box-shadow: 0 8px 30px rgba(80,68,48,.035); }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 23px 24px 17px; }
.panel-head h2 { margin: 3px 0 0; font: 700 20px/1.3 "Noto Serif SC", serif; }
.section-kicker { color: var(--clay); font-size: 9px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; }
.section-kicker.sage { color: var(--green); }
.section-kicker.clay { color: var(--gold); }
.text-button { padding: 3px; color: var(--green); background: transparent; font-size: 11px; font-weight: 700; }
.text-button:hover { color: var(--clay); }
.trend-list { padding: 0 17px 17px; }
.trend-item { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 13px; padding: 14px 7px; border-top: 1px solid rgba(79,68,51,.08); cursor: pointer; }
.trend-item:first-child { border-top: 0; }
.trend-item:hover { background: rgba(237,231,219,.45); border-radius: 12px; }
.trend-rank { font: 700 18px/1 "Noto Serif SC", serif; color: #afa89b; text-align: center; }
.trend-item:nth-child(1) .trend-rank { color: var(--clay); }
.trend-main strong { display: block; font-size: 13px; }
.trend-main small { display: flex; gap: 7px; margin-top: 5px; color: var(--muted); font-size: 9px; }
.mini-tag, .tag { display: inline-flex; align-items: center; border-radius: 999px; background: var(--paper-2); color: #6f6a61; }
.mini-tag { padding: 2px 6px; }
.trend-score { text-align: right; }
.trend-score strong { display: block; color: var(--clay); font-size: 13px; }
.trend-score small { color: var(--muted); font-size: 9px; }

.focus-panel { overflow: hidden; }
.focus-visual { margin: 0 18px 18px; padding: 23px; min-height: 220px; border-radius: 16px; color: #f7f2e8; background:
  linear-gradient(150deg, rgba(44,63,48,.93), rgba(92,111,87,.88)),
  repeating-linear-gradient(45deg, transparent 0 12px, rgba(255,255,255,.03) 12px 13px); }
.focus-visual .focus-symbol { width: 47px; height: 47px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.25); border-radius: 15px; font: 700 22px/1 "Noto Serif SC", serif; }
.focus-visual h3 { margin: 27px 0 8px; font: 700 25px/1.3 "Noto Serif SC", serif; }
.focus-visual p { margin: 0; color: rgba(255,255,255,.68); font-size: 12px; line-height: 1.7; }
.focus-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,.16); font-size: 10px; }
.focus-meta button { border: 0; background: transparent; color: white; cursor: pointer; }

.recent-panel { margin-top: 18px; }
.data-note { color: #aaa297; font-size: 10px; }
.recent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; padding: 0 18px 18px; }
.recent-card { min-height: 150px; padding: 17px; border: 1px solid rgba(70,61,48,.08); border-radius: 15px; background: rgba(248,244,235,.66); cursor: pointer; }
.recent-card:hover { border-color: var(--sage); transform: translateY(-2px); }
.recent-card-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 9px; }
.recent-card h3 { margin: 20px 0 7px; font: 700 17px/1.35 "Noto Serif SC", serif; }
.recent-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.recent-card-footer { display: flex; justify-content: space-between; margin-top: 17px; color: #908a80; font-size: 9px; }

.filter-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 14px; border: 1px solid rgba(70,61,48,.09); border-radius: 17px; background: rgba(255,253,248,.55); }
.segmented { display: flex; align-items: center; padding: 3px; border-radius: 11px; background: #e9e3d8; }
.segmented button { min-width: 67px; height: 35px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 600; }
.segmented button.active { background: var(--card); color: var(--green-dark); box-shadow: 0 4px 12px rgba(74,64,47,.1); }
.select-wrap { min-width: 145px; display: grid; gap: 4px; }
.select-wrap span, .form-grid label > span, form > label > span { color: #8c867d; font-size: 9px; font-weight: 700; letter-spacing: .06em; }
.select-wrap select { height: 35px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; font-weight: 600; }
.result-meta { min-height: 45px; display: flex; align-items: center; justify-content: space-between; padding: 0 3px; color: var(--muted); font-size: 11px; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.recipe-card { overflow: hidden; border: 1px solid rgba(70,61,48,.1); border-radius: 18px; background: rgba(255,253,248,.82); cursor: pointer; transition: .2s ease; }
.recipe-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.recipe-cover { position: relative; min-height: 145px; padding: 17px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; background: var(--cover, #dfe4d8); }
.recipe-cover::after { content: attr(data-glyph); position: absolute; right: -3px; bottom: -23px; color: rgba(255,255,255,.37); font: 700 94px/1 "Noto Serif SC", serif; transform: rotate(-8deg); }
.recipe-cover-top { z-index: 1; display: flex; justify-content: space-between; }
.tag { padding: 5px 9px; font-size: 9px; font-weight: 600; }
.tag.light { background: rgba(255,255,255,.68); color: #5e5a53; backdrop-filter: blur(8px); }
.score-badge { z-index: 1; align-self: flex-end; min-width: 48px; padding: 6px 8px; border-radius: 10px; background: rgba(255,255,255,.73); text-align: center; backdrop-filter: blur(8px); }
.score-badge strong { display: block; font-size: 14px; }
.score-badge small { display: block; color: var(--muted); font-size: 7px; }
.recipe-body { padding: 17px; }
.recipe-body h3 { margin: 0 0 7px; font: 700 18px/1.35 "Noto Serif SC", serif; }
.recipe-body p { height: 36px; overflow: hidden; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.recipe-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 13px; }
.recipe-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; padding-top: 13px; border-top: 1px solid rgba(70,61,48,.08); color: #989188; font-size: 9px; }
.score-pair { display: flex; gap: 9px; }
.score-pair b { color: var(--green); }
.card-actions { position: relative; z-index: 2; display: flex; gap: 7px; margin-top: 13px; }
.card-actions .tiny-button { flex: 1; }
.compact-actions { justify-content: flex-end; }
.compact-actions .tiny-button { flex: 0 0 auto; margin-left: auto; }
.tiny-button.danger, .ghost-button.danger { color: #9a4f42; border-color: rgba(154,79,66,.28); }
.tiny-button.danger:hover, .ghost-button.danger:hover { background: #f8e7e2; }

.technique-list { display: grid; gap: 12px; }
.technique-card { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 18px; padding: 17px; border: 1px solid rgba(70,61,48,.09); border-radius: 17px; background: rgba(255,253,248,.75); cursor: pointer; }
.technique-card:hover { border-color: #b8c2ae; transform: translateX(3px); }
.tech-icon { width: 70px; height: 70px; display: grid; place-items: center; border-radius: 16px; background: var(--tech-color, #dfe4d8); color: rgba(54,68,55,.75); font: 700 25px/1 "Noto Serif SC", serif; }
.tech-main h3 { margin: 0 0 6px; font: 700 17px/1.3 "Noto Serif SC", serif; }
.tech-main p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.tech-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tech-action { min-width: 125px; text-align: right; }
.tech-action strong { display: block; color: var(--green); font-size: 12px; }
.tech-action small { color: var(--muted); font-size: 9px; }

.tiny-button { min-height: 31px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: transparent; cursor: pointer; color: var(--muted); font-size: 9px; }
.tiny-button.primary { color: white; background: var(--green); border-color: var(--green); }
.empty-state { padding: 50px 20px; color: var(--muted); text-align: center; }
.empty-state span { display: block; margin-bottom: 10px; font-size: 34px; }
.empty-state strong { display: block; color: var(--ink); font: 700 17px/1.3 "Noto Serif SC", serif; }
.empty-state p { margin: 8px 0 0; font-size: 10px; }

.trial-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-bottom: 20px; }
.trial-stat { padding: 19px; border-radius: 16px; background: rgba(255,253,248,.7); border: 1px solid rgba(70,61,48,.08); }
.trial-stat strong { display: block; font: 700 25px/1 "Noto Serif SC", serif; }
.trial-stat span { display: block; margin-top: 8px; color: var(--muted); font-size: 10px; }
.timeline { position: relative; display: grid; gap: 14px; padding-left: 23px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 1px; background: #d5cdc0; }
.trial-card { position: relative; padding: 19px; border: 1px solid rgba(70,61,48,.09); border-radius: 17px; background: rgba(255,253,248,.75); }
.trial-card::before { content: ""; position: absolute; left: -21px; top: 25px; width: 9px; height: 9px; border: 3px solid var(--paper); border-radius: 50%; background: var(--green); }
.trial-card-head { display: flex; justify-content: space-between; gap: 20px; }
.trial-card h3 { margin: 0; font: 700 17px/1.3 "Noto Serif SC", serif; }
.trial-card time, .trial-card small { color: var(--muted); font-size: 9px; }
.trial-card p { margin: 13px 0 0; color: #665f56; font-size: 11px; line-height: 1.7; }
.stars { color: var(--gold); letter-spacing: 2px; }

.drawer-backdrop, .modal-backdrop { position: fixed; inset: 0; z-index: 79; background: rgba(36,33,28,.38); backdrop-filter: blur(2px); opacity: 0; visibility: hidden; transition: .25s ease; }
.drawer-backdrop.open, .modal-backdrop.open { opacity: 1; visibility: visible; }
.detail-drawer { position: fixed; z-index: 80; inset: 0 0 0 auto; width: min(700px, 92vw); overflow-y: auto; background: var(--card); box-shadow: -20px 0 70px rgba(39,34,27,.19); transform: translateX(101%); transition: .3s cubic-bezier(.25,.85,.35,1); }
.detail-drawer.open { transform: translateX(0); }
.drawer-close, .modal-close { position: absolute; z-index: 3; right: 19px; top: 18px; width: 36px; height: 36px; border: 1px solid rgba(70,61,48,.12); border-radius: 50%; background: rgba(255,253,248,.8); cursor: pointer; font-size: 21px; }
.drawer-hero { min-height: 235px; padding: 46px 42px 30px; background: var(--drawer-color, #e0e4d8); }
.drawer-hero h2 { max-width: 510px; margin: 32px 0 10px; font: 700 34px/1.25 "Noto Serif SC", serif; }
.drawer-hero p { max-width: 520px; margin: 0; color: #6e685f; font-size: 12px; line-height: 1.75; }
.drawer-badges { display: flex; gap: 7px; }
.drawer-score-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 27px; }
.drawer-score { padding: 11px; border-radius: 12px; background: rgba(255,255,255,.5); }
.drawer-score strong { display: block; font-size: 15px; }
.drawer-score small { color: var(--muted); font-size: 8px; }
.drawer-body { padding: 29px 42px 55px; }
.drawer-section { margin-top: 31px; }
.drawer-section:first-child { margin-top: 0; }
.drawer-section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.drawer-section h3 { margin: 0; font: 700 19px/1.3 "Noto Serif SC", serif; }
.ingredient-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.ingredient-table th { padding: 9px 10px; color: var(--muted); border-bottom: 1px solid var(--line); text-align: left; font-size: 8px; letter-spacing: .06em; }
.ingredient-table td { padding: 11px 10px; border-bottom: 1px solid #eee9df; }
.ingredient-table td:nth-child(2), .ingredient-table td:nth-child(3) { white-space: nowrap; }
.flow-steps { display: grid; gap: 0; }
.flow-step { position: relative; display: grid; grid-template-columns: 35px 1fr; gap: 13px; padding-bottom: 20px; }
.flow-step::before { content: ""; position: absolute; left: 17px; top: 33px; bottom: 0; width: 1px; background: #d8d0c2; }
.flow-step:last-child::before { display: none; }
.step-index { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; background: var(--green); color: white; font-size: 10px; }
.step-copy { padding-top: 2px; }
.step-copy strong { display: block; font-size: 12px; }
.step-copy p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.step-copy small { display: inline-block; margin-top: 7px; padding: 4px 7px; border-radius: 7px; color: #75513f; background: #f1ded3; font-size: 8px; }
.source-box { display: grid; grid-template-columns: 1fr auto; gap: 15px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #f8f3ea; }
.source-box strong, .source-box small { display: block; }
.source-box small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.source-link { padding: 9px 12px; border-radius: 10px; background: var(--green); color: white; font-size: 10px; }
.source-link.disabled { background: #d9d2c6; color: #8b857c; cursor: not-allowed; }
.drawer-actions { display: flex; gap: 9px; margin-top: 24px; }
.note-box { padding: 15px; border-left: 3px solid var(--gold); background: #f7f0df; color: #655e53; font-size: 10px; line-height: 1.7; }
.related-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.related-chip { padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: transparent; cursor: pointer; font-size: 9px; }

.modal { position: fixed; z-index: 90; left: 50%; top: 50%; width: min(650px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto; padding: 28px; border-radius: 23px; background: var(--card); box-shadow: 0 30px 90px rgba(36,31,24,.26); opacity: 0; visibility: hidden; transform: translate(-50%, -47%) scale(.97); transition: .2s ease; }
.recipe-editor-modal { width: min(860px, calc(100vw - 32px)); }
.recipe-editor-modal textarea { resize: vertical; font-family: inherit; line-height: 1.6; }
.modal.open { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.modal-head { margin-bottom: 22px; }
.modal-head h2 { margin: 5px 0; font: 700 25px/1.3 "Noto Serif SC", serif; }
.modal-head p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.compact { margin: 14px 0; }
.form-grid label, form > label { display: grid; gap: 6px; }
.span-2 { grid-column: span 2; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 11px; outline: 0; color: var(--ink); background: #fbf8f1; }
input, select { height: 41px; padding: 0 11px; }
textarea { padding: 11px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(82,101,83,.08); }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.detected-source { margin-top: 12px; padding: 10px 12px; border-radius: 10px; color: var(--green-dark); background: #e8ecE3; font-size: 10px; }

.kitchen-mode { position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; color: #f8f3e8; background: #263128; opacity: 0; visibility: hidden; transition: .25s ease; }
.kitchen-mode.open { opacity: 1; visibility: visible; }
.kitchen-mode header { display: flex; justify-content: space-between; align-items: center; padding: 25px 6vw 18px; }
.kitchen-mode header h2 { margin: 3px 0 0; font: 700 25px/1.3 "Noto Serif SC", serif; }
.kitchen-mode header button { border: 1px solid rgba(255,255,255,.25); border-radius: 11px; padding: 9px 13px; color: white; background: transparent; cursor: pointer; }
.kitchen-progress { height: 3px; background: rgba(255,255,255,.1); }
.kitchen-progress i { display: block; width: 0; height: 100%; background: #ddbd7c; transition: .3s ease; }
.kitchen-mode main { flex: 1; display: grid; place-content: center; padding: 8vh 10vw; text-align: center; }
.kitchen-mode main .step-number { color: #c8d4c3; font-size: 12px; letter-spacing: .2em; }
.kitchen-mode main h3 { max-width: 850px; margin: 20px auto; font: 700 clamp(34px, 5vw, 66px)/1.25 "Noto Serif SC", serif; }
.kitchen-mode main p { max-width: 720px; margin: 0 auto; color: rgba(255,255,255,.7); font-size: clamp(16px, 2vw, 22px); line-height: 1.7; }
.kitchen-mode main small { display: inline-block; margin-top: 28px; padding: 9px 13px; border-radius: 10px; color: #f4d69d; background: rgba(255,255,255,.08); }
.kitchen-mode footer { display: flex; align-items: center; justify-content: space-between; padding: 22px 6vw 28px; }
.kitchen-mode footer button { min-width: 140px; padding: 13px; border: 1px solid rgba(255,255,255,.25); border-radius: 12px; color: white; background: transparent; cursor: pointer; }
.kitchen-mode footer button:last-child { color: #263128; background: #f1e7d0; border-color: #f1e7d0; }
.kitchen-mode footer button:disabled { opacity: .3; cursor: not-allowed; }

.toast { position: fixed; z-index: 150; left: 50%; bottom: 28px; padding: 11px 16px; border-radius: 11px; color: white; background: #27352b; box-shadow: 0 12px 40px rgba(0,0,0,.2); font-size: 11px; opacity: 0; visibility: hidden; transform: translate(-50%, 10px); transition: .2s ease; }
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

@media (max-width: 1100px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .focus-visual { min-height: 180px; }
  .recent-grid { grid-template-columns: repeat(2, 1fr); }
  .recent-card:last-child { display: none; }
  .top-actions .ghost-button { display: none; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { transform: translateX(-102%); transition: .25s ease; box-shadow: 20px 0 60px rgba(0,0,0,.16); }
  .sidebar.open { transform: translateX(0); }
  .main-area { width: 100%; }
  .topbar { height: 67px; padding: 0 15px; gap: 9px; }
  .menu-button { display: block; width: 35px; height: 35px; }
  .global-search { width: auto; flex: 1; }
  .global-search kbd { display: none; }
  .top-actions { margin-left: 0; }
  .top-actions .primary-button { width: 40px; padding: 0; font-size: 0; }
  .top-actions .primary-button span { font-size: 20px; }
  .view { padding: 28px 16px 55px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 18px; }
  .page-head h1 { font-size: 30px; }
  .dashboard-head .capture-button { width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { min-height: 112px; padding: 16px; }
  .stat-card strong { font-size: 25px; }
  .recent-grid, .card-grid { grid-template-columns: 1fr; }
  .recent-card:last-child { display: block; }
  .data-note { display: none; }
  .filter-toolbar { align-items: stretch; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; }
  .select-wrap { flex: 1; min-width: 125px; }
  .technique-card { grid-template-columns: 53px 1fr; gap: 12px; }
  .tech-icon { width: 53px; height: 53px; border-radius: 13px; }
  .tech-action { grid-column: 2; min-width: 0; text-align: left; }
  .capture-guide { grid-template-columns: 1fr 1fr; }
  .capture-guide b { display: none; }
  .trial-summary { grid-template-columns: 1fr; }
  .drawer-hero { padding: 60px 22px 25px; }
  .drawer-hero h2 { font-size: 27px; }
  .drawer-score-grid { grid-template-columns: repeat(2, 1fr); }
  .drawer-body { padding: 25px 22px 45px; }
  .modal { padding: 24px 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .kitchen-mode footer button { min-width: 100px; }
}

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