:root {
  color-scheme: light;
  font-family: "Nimbus Sans", "DejaVu Sans", Arial, sans-serif;
  color: #20201c;
  background: #f3f1ea;
  font-synthesis: none;
  --ink: #171713;
  --paper: #f3f1ea;
  --white: #fffefa;
  --line: #d5d1c5;
  --muted: #69675f;
  --gold: #e8ac50;
  --gold-dark: #b87922;
  --gold-ink: #8b5715;
  --lime: #b9d87b;
  --yellow: #f2c85b;
  --blue: #7cb3c6;
  --danger: #e2775e;
  --status-color: var(--lime);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); }
.academy-boot { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: #090908; color: #efd99e; }
.academy-boot img { display: block; }
.academy-boot p { margin: 0; font-size: 18px; }
.academy-boot span { font-size: 13px; color: #bcae92; }
.access-gate { min-height: 100vh; padding: 32px 16px; display: grid; place-items: center; background: var(--ink); }
.access-card { width: min(460px, 100%); padding: 30px; border-radius: 12px; background: var(--white); box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.access-card > img { display: block; width: 150px; height: 55px; object-fit: cover; margin-bottom: 24px; background: #090908; }
.access-card h1 { font-size: 30px; }
.access-card h2 { font-size: 21px; }
.access-card p { color: var(--muted); line-height: 1.5; }
.access-card form { display: grid; gap: 14px; margin-top: 24px; }
.access-card label { display: block; }
.access-card input { width: 100%; min-height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.access-card input[aria-invalid="true"] { border-color: #a53625; }
.access-card .primary-button { justify-content: center; }
.access-card .text-button { justify-self: start; }
#resendSignedInConfirmation { margin-top: 18px; }
#academySignOut { margin-top: 18px; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid rgba(232, 172, 80, .32); outline-offset: 2px; }

.app-shell { min-height: 100vh; }
.topbar {
  height: 72px;
  padding: 0 max(20px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #3b2b16;
  background: rgba(9, 9, 8, .96);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}
.brand { height: 64px; display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--gold); }
.brand img { width: 128px; height: 47px; display: block; object-fit: cover; object-position: center; }
.product-name { padding-left: 12px; border-left: 1px solid #5b492d; font: 700 10px/1 "Manrope", sans-serif; letter-spacing: 2px; color: var(--gold); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.network-status { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #bcb6aa; }
.network-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #4b4132; border-radius: 50%; background: transparent; color: var(--gold); cursor: pointer; transition: background .2s, transform .2s; }
.icon-button:hover { background: #242018; transform: translateY(-1px); }
.icon-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.install-button { background: var(--gold); color: var(--ink); border-color: var(--gold); }

main { width: min(1180px, 100%); margin: 0 auto; padding: 0 32px; }
.intro-band { min-height: 260px; padding: 52px 0 46px; display: flex; align-items: end; justify-content: space-between; gap: 40px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.6px; color: var(--gold-ink); }
h1 { margin: 0; max-width: 740px; font: 800 clamp(38px, 4.6vw, 58px)/1.05 "Manrope", sans-serif; letter-spacing: -.025em; text-wrap: balance; }
.intro-copy { max-width: 340px; margin: 0 0 5px; color: var(--muted); font-size: 17px; line-height: 1.55; }
.experience-switch { display: flex; align-items: center; gap: 7px; padding: 16px 0 20px; }
.experience-switch > span { margin-right: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.experience-switch button { min-height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 5px; background: var(--white); cursor: pointer; font-size: 12px; font-weight: 800; }
.experience-switch button[aria-pressed="true"] { background: var(--gold); border-color: var(--ink); }
body[data-experience="home"] .pro-only { display: none !important; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(390px, .9fr); border-bottom: 1px solid var(--line); }
.recipe-panel { padding: 46px 52px 52px 0; border-right: 1px solid var(--line); }
.result-panel { padding: 46px 0 52px 52px; color: var(--ink); position: relative; }
.result-panel::before { content: ""; position: absolute; z-index: -1; inset: 24px -32px 24px 24px; background: var(--gold); border-radius: 8px 0 0 8px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 34px; }
.section-heading > div { display: flex; align-items: center; gap: 12px; }
.step-number { color: var(--gold-ink); font: 700 12px/1 "Manrope", sans-serif; }
.section-heading h2 { margin: 0; font: 700 24px/1.15 "Manrope", sans-serif; }
.section-heading.inverse .step-number { color: var(--ink); }
.text-button { padding: 8px 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; }

fieldset { margin: 0; padding: 0; border: 0; }
legend, label > span:first-child, .micro-label { margin-bottom: 9px; display: block; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; }
.segmented { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.segmented button { min-height: 48px; border: 0; border-right: 1px solid var(--line); background: transparent; cursor: pointer; font-weight: 700; transition: color .2s, background .2s; }
.segmented button:last-child { border-right: 0; }
.segmented button.active { color: var(--ink); background: var(--gold); }
.segmented button { padding: 6px; font-size: 12px; }
.inline-custom { margin: 14px 0 34px; display: flex; align-items: center; justify-content: space-between; }
.inline-custom > span:first-child { margin: 0; text-transform: none; letter-spacing: 0; font-weight: 500; }
.input-with-prefix { display: flex; align-items: baseline; gap: 3px; }
.input-with-prefix b { color: var(--muted); font-size: 18px; }
.input-with-prefix input { width: 66px; padding: 3px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; font-size: 20px; font-weight: 700; text-align: right; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.input-with-unit { min-height: 62px; padding: 0 16px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--white); transition: border-color .2s, box-shadow .2s; }
.input-with-unit:focus-within { border-color: var(--gold-dark); box-shadow: 0 0 0 3px rgba(232,172,80,.16); }
.input-with-unit input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 700 27px/1 "Manrope", sans-serif; }
.input-with-unit b { color: var(--muted); font-size: 14px; }
.time-row { margin-top: 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: end; }
.timer-button { height: 62px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--ink); border-radius: 6px; background: transparent; font-weight: 700; cursor: pointer; }
.timer-button.running { color: var(--ink); background: var(--gold); border-color: var(--gold); }
.timer-button svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.advanced-settings { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); }
.advanced-settings summary { color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.advanced-settings summary span { float: right; color: var(--ink); }
.compact-fields { margin-top: 20px; }
.compact-fields .input-with-unit { min-height: 50px; }
.compact-fields .input-with-unit input { font-size: 20px; }
.filter-method-label, .filter-strength-label { display:block; margin-bottom:24px; }
.filter-method-label select, .filter-strength-label select, .filter-observations select { width:100%; min-height:62px; padding:0 14px; border:1px solid var(--line); border-radius:6px; background:var(--white); color:var(--ink); font:700 18px/1.2 "Nimbus Sans", Arial, sans-serif; }
.filter-observations { margin-top:24px; margin-bottom:24px; }
.filter-observations select { font-size:14px; }
.filter-reference { padding:15px 17px; border-left:4px solid var(--gold-dark); background:#fff9ed; color:#554632; font-size:13px; line-height:1.55; }
.filter-ratio-result { display:grid; gap:4px; padding:12px 0 22px; border-bottom:1px solid rgba(23,23,19,.3); }
.filter-ratio-result span, .filter-target > span { color:#4b3a21; font-size:11px; font-weight:800; letter-spacing:.6px; text-transform:uppercase; }
.filter-ratio-result strong { font:800 43px/1.1 "Manrope",sans-serif; }
.filter-ratio-result small { font-weight:700; }
.filter-target { padding:22px 0 0; }
.filter-target strong { display:block; margin:5px 0; font:800 32px/1.1 "Manrope",sans-serif; }
.filter-target p { margin:0; font-size:13px; line-height:1.45; }
.filter-direction { margin:24px 0; }
.history-main small { color:var(--gold-ink); font-size:11px; }

.manual-workspace { padding: 46px 0 54px; border-bottom: 1px solid var(--line); }
#manualTitle { max-width: 620px; text-wrap: balance; }
.manual-intro { max-width: 680px; margin: -18px 0 26px; color: var(--muted); line-height: 1.55; }
.manual-method-label { display: block; max-width: 720px; margin-bottom: 8px; padding: 20px; border: 2px solid var(--gold); border-radius: 8px; background: var(--ink); }
.manual-method-label > span:first-child { color: var(--gold); font-size: 14px; }
.manual-method-label select { width: 100%; min-height: 68px; padding: 0 16px; border: 2px solid var(--gold); border-radius: 6px; background: var(--white); color: var(--ink); font: 800 21px/1.2 "Manrope", sans-serif; cursor: pointer; }
.manual-method-label select:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.manual-selector-help { margin: 0 0 28px; color: var(--muted); font-size: 13px; }
.manual-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: 22px; align-items: start; }
.manual-layout.linked-method { grid-template-columns: 1fr; }
.manual-layout.linked-method .manual-recipe { max-width: 760px; }
.manual-recipe, .manual-calibration { padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.manual-recipe { border-top: 5px solid var(--gold); }
.manual-recipe h3 { margin: 0 0 8px; font: 800 30px/1.15 "Manrope", sans-serif; }
.manual-recipe > p:not(.eyebrow) { color: var(--muted); line-height: 1.5; }
.manual-recipe-metrics { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 26px; }
.manual-recipe-metrics span { padding: 9px 11px; border-radius: 5px; background: #f8e5c2; font-size: 13px; font-weight: 800; }
.manual-recipe h4 { margin: 0 0 12px; font: 800 16px/1.3 "Manrope", sans-serif; }
.manual-recipe ol { margin: 0 0 18px; padding-left: 23px; }
.manual-recipe li { margin-bottom: 12px; padding-left: 5px; line-height: 1.5; }
.manual-reference { margin-top: 20px; padding: 16px 18px 4px; border-left: 4px solid var(--gold); background: #fff8e9; }
.manual-reference h4 { margin-bottom: 8px; }
.manual-recipe-note { margin: 0; font-size: 14px; line-height: 1.55; }
.manual-recipe a { display: inline-block; margin: 4px 0 16px; color: var(--gold-ink); font-size: 13px; font-weight: 800; }
.secondary-button { min-height: 48px; padding: 0 18px; display: block; border: 1px solid var(--ink); border-radius: 6px; background: var(--ink); color: var(--gold); font-weight: 800; cursor: pointer; }
.back-to-method { margin: -20px 0 26px; color: var(--gold-ink); }
.manual-calibration h3 { margin: 0 0 8px; font: 800 23px/1.2 "Manrope", sans-serif; }
.manual-calibration-intro, .manual-advice { color: var(--muted); font-size: 13px; line-height: 1.5; }
.manual-fields, .manual-taste-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 22px 0; }
.manual-fields label, .manual-taste-fields label { min-width: 0; }
.manual-fields input:not([type="checkbox"]), .manual-fields select, .manual-taste-fields select, .manual-advanced textarea, .save-fields select { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); color: var(--ink); }
.manual-fields input[type="checkbox"] { width: 25px; height: 25px; accent-color: var(--gold-dark); }
.machine-lookup { margin: 20px 0 8px; }
.machine-lookup label { display: block; font-weight: 800; }
.machine-lookup input { width: 100%; min-height: 48px; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); color: var(--ink); }
.machine-lookup > p { margin: 8px 0 12px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.machine-matches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.machine-matches button { padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); color: var(--ink); font: inherit; font-size: 13px; font-weight: 700; text-align: left; cursor: pointer; }
.machine-matches button[aria-pressed="true"] { border-color: var(--gold-dark); background: #f8e5c2; }
.machine-guide { padding: 18px; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 6px; background: #fffaf0; }
.machine-guide h4 { margin: 0 0 10px; font-size: 16px; }
.machine-guide p { margin: 0 0 10px; line-height: 1.5; }
.machine-guide ol { margin: 0 0 12px; padding-left: 22px; }
.machine-guide li { margin-bottom: 8px; line-height: 1.45; }
.machine-guide a { display: inline-block; margin: 4px 14px 0 0; color: var(--gold-ink); font-weight: 800; }
.manual-full { grid-column: 1 / -1; }
.manual-advanced { padding-top: 18px; border-top: 1px solid var(--line); }
.manual-advanced summary { color: var(--ink); font-size: 13px; font-weight: 800; cursor: pointer; }
.manual-advanced textarea { resize: vertical; }
.manual-feedback { margin: 22px 0 0; padding: 18px; border-radius: 6px; background: #f8e5c2; }
.manual-feedback strong { font: 800 18px/1.2 "Manrope", sans-serif; }
.manual-feedback p { margin: 8px 0 0; font-size: 13px; line-height: 1.5; }
.espresso-tasting { margin: 10px 0 22px; padding: 18px; border: 2px solid var(--ink); border-radius: 6px; background: rgba(255,255,255,.32); }
.espresso-tasting label span { color: var(--ink); font-weight: 900; }
.espresso-tasting select { width: 100%; min-height: 46px; margin-bottom: 14px; padding: 8px 10px; border: 1px solid var(--ink); border-radius: 5px; background: var(--white); }
.espresso-tasting strong { display: block; font: 800 18px/1.25 "Manrope", sans-serif; }
.espresso-tasting p { margin: 8px 0 0; font-size: 13px; line-height: 1.45; }
.espresso-tasting .espresso-next { margin-top: 12px; font-weight: 800; }
.espresso-comparison { margin: 0 0 18px; }
.espresso-comparison .text-button { color: var(--ink); }
.espresso-comparison p { margin: 10px 0 0; padding: 12px; border-left: 4px solid var(--ink); background: rgba(255,255,255,.3); font-size: 12px; line-height: 1.5; }
.coffee-context > p { color: var(--muted); font-size: 12px; line-height: 1.5; }

.status-badge { padding: 7px 10px; border: 2px solid var(--ink); border-radius: 4px; background: var(--lime); color: var(--ink); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; }
.result-focus { display: grid; grid-template-columns: 170px 1fr; gap: 26px; align-items: center; }
.ratio-gauge { width: 170px; aspect-ratio: 1; display: grid; place-items: center; position: relative; border-radius: 50%; background: conic-gradient(var(--status-color) calc(var(--progress) * 1%), #3b3b35 0); transition: background .4s; }
.ratio-gauge::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--ink); }
.ratio-gauge > div { z-index: 1; display: grid; place-items: center; text-align: center; }
.ratio-gauge span { color: #aaa99e; font-size: 11px; text-transform: uppercase; letter-spacing: .7px; }
.ratio-gauge strong { margin: 5px 0 2px; font: 800 28px/1 "Manrope", sans-serif; }
.ratio-gauge small { color: #aaa99e; font-size: 11px; }
.target-yield > span { color: #3f321e; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px; }
.target-yield strong { display: block; margin: 3px 0 8px; font: 800 44px/1 "Manrope", sans-serif; }
.target-yield strong small { font-size: 18px; color: #473820; }
.target-yield p { margin: 0; color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.4; }
.grind-direction { margin-top: 34px; padding: 24px 18px; display: grid; grid-template-columns: 52px 1fr; gap: 18px; border: 2px solid var(--ink); border-radius: 6px; background: rgba(255,255,255,.28); }
.direction-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--status-color); color: var(--ink); transition: transform .35s, background .35s; }
.direction-icon.up svg { transform: rotate(180deg); }
.direction-icon.steady svg { transform: rotate(-90deg); }
.direction-icon svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s; }
.result-panel .micro-label { margin: 0 0 3px; color: #3f321e; font-weight: 800; }
.grind-direction h3 { margin: 0; font: 700 24px/1.15 "Manrope", sans-serif; }
.grind-direction p { margin: 5px 0 0; color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.45; }
.metrics-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 23px 0 19px; }
.metrics-strip div { display: grid; gap: 3px; }
.metrics-strip span { color: #4b3a21; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.metrics-strip strong { font-size: 16px; }
.action-list { margin: 0; padding: 0; list-style: none; }
.action-list { margin-top: 8px; border-top: 2px solid var(--ink); }
.action-list li { min-height: 48px; padding: 12px 8px; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; border-bottom: 1px solid rgba(23,23,19,.32); }
.action-list li > span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--gold); font-size: 11px; font-weight: 800; }
.action-list p { margin: 3px 0 0; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.45; }
.action-list p strong { font-weight: 900; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
.caution { margin: 17px 0 0; padding: 12px; border-left: 4px solid var(--ink); background: rgba(255,255,255,.32); color: var(--ink); font-size: 11px; font-weight: 600; line-height: 1.45; }

.save-band { padding: 54px 0; border-bottom: 1px solid var(--line); }
.save-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.save-fields input, .save-fields select { width: 100%; height: 50px; padding: 0 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); color: var(--ink); }
.save-fields input:focus { border-color: var(--gold-dark); outline: 0; }
.primary-button { min-height: 52px; margin-top: 24px; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 6px; background: var(--gold); color: var(--ink); font-weight: 800; cursor: pointer; transition: background .2s, transform .2s; }
.primary-button:hover { background: var(--gold-dark); transform: translateY(-1px); }
.primary-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.storage-note { display: inline-block; margin: 0 0 0 14px; color: var(--muted); font-size: 12px; }

.history-section { padding: 54px 0 72px; }
.history-list { display: grid; gap: 1px; background: var(--line); }
.history-item { padding: 18px 16px; display: grid; grid-template-columns: minmax(170px, 1.3fr) repeat(3, minmax(80px, .6fr)) 42px; gap: 16px; align-items: center; background: var(--paper); animation: recordIn .35s ease both; }
.history-item h3 { margin: 0 0 4px; font-size: 15px; }
.history-item p { margin: 0; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-metric { display: grid; gap: 3px; }
.history-metric span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .6px; }
.history-metric strong { font-size: 14px; }
.delete-button { width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.delete-button:hover { color: var(--gold-dark); }
.delete-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.empty-state { min-height: 180px; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--muted); }
.empty-state svg { width: 34px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.empty-state p { margin: 0; font-size: 13px; }

footer { min-height: 130px; padding: 40px max(32px, calc((100vw - 1180px) / 2 + 32px)); display: flex; justify-content: space-between; align-items: start; background: #090908; color: var(--gold); border-top: 3px solid var(--gold); }
footer span { font: 800 18px/1 "Manrope", sans-serif; }
footer p { margin: 0; font-size: 13px; }
.toast { max-width: calc(100% - 32px); padding: 12px 16px; position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); z-index: 40; border-radius: 6px; background: var(--ink); color: white; font-size: 13px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes recordIn { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

@media (max-width: 860px) {
  main { padding: 0 22px; }
  .intro-band { min-height: 230px; padding: 38px 0; align-items: start; flex-direction: column; justify-content: center; gap: 20px; }
  .intro-copy { max-width: 520px; }
  .workspace { display: block; border-bottom: 0; }
  .recipe-panel { padding: 40px 0; border-right: 0; }
  .result-panel { margin: 0 -22px; padding: 40px 22px 44px; }
  .result-panel::before { inset: 0; border-radius: 0; }
  .save-band { padding-top: 46px; }
  .manual-layout { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .experience-switch { flex-wrap: wrap; }
  .experience-switch > span { flex-basis: 100%; }
  .manual-workspace { padding: 34px 0 42px; }
  .manual-method-label { max-width: none; padding: 14px; }
  .manual-method-label select { min-height: 64px; font-size: 19px; }
  .manual-recipe, .manual-calibration { padding: 20px; }
  .manual-fields, .manual-taste-fields { grid-template-columns: 1fr; }
  .filter-observations { grid-template-columns:1fr; }
  .topbar { height: 64px; padding: 0 16px; }
  .brand { min-width: 0; gap: 6px; }
  .brand img { width: 92px; height: 34px; }
  .product-name { padding-left: 6px; font-size: 9px; letter-spacing: 1px; }
  .top-actions { gap: 6px; }
  .icon-button { width: 36px; height: 36px; }
  .network-status span { display: none; }
  main { padding: 0 16px; }
  .intro-band { min-height: 210px; padding: 32px 0; }
  h1 { font-size: 36px; line-height: 1.08; }
  .intro-copy { font-size: 15px; }
  .recipe-panel { padding: 34px 0 38px; }
  .section-heading { margin-bottom: 28px; }
  .section-heading h2 { font-size: 21px; }
  .field-grid { gap: 10px; }
  .input-with-unit { min-height: 58px; padding: 0 12px; }
  .input-with-unit input { font-size: 24px; }
  .time-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .timer-button { height: 58px; padding: 0 8px; font-size: 13px; }
  .result-panel { margin: 0 -16px; padding: 34px 16px 38px; }
  .result-focus { grid-template-columns: 142px 1fr; gap: 18px; }
  .ratio-gauge { width: 142px; }
  .ratio-gauge strong { font-size: 24px; }
  .target-yield strong { font-size: 36px; }
  .grind-direction h3 { font-size: 22px; }
  .save-fields { grid-template-columns: 1fr; gap: 14px; }
  .primary-button { width: 100%; }
  .storage-note { display: block; margin: 10px 0 0; text-align: center; }
  .history-item { grid-template-columns: 1fr 1fr 38px; gap: 12px; }
  .history-main { grid-column: 1 / 4; }
  .history-metric:nth-of-type(3) { display: none; }
  footer { min-height: 110px; padding: 34px 18px; }
  footer p { max-width: 150px; text-align: right; }
}

@media (max-width: 360px) {
  .segmented button { font-size: 12px; }
  .result-focus { grid-template-columns: 128px 1fr; gap: 12px; }
  .ratio-gauge { width: 128px; }
  .target-yield strong { font-size: 32px; }
}

/* Membership permissions come from the authenticated server, not the selector. */
body:not([data-plan="professional"]) [data-professional-feature] { display: none !important; }
.membership-cards { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin: 22px 0; text-align: left; }
.membership-cards article { border: 1px solid #76623c; border-radius: 16px; padding: 18px; background: #171713; }
.membership-cards article > span { font-size: 10px; letter-spacing: .1em; color: #dbc184; }
.membership-cards h2 { font-size: 17px; margin: 8px 0; }
.membership-cards strong { font-size: 30px; color: #efd99e; }
.membership-cards small { font-size: 13px; font-weight: 400; }
.membership-cards p, .membership-note { font-size: 12px; line-height: 1.5; }
.membership-badge { font-size: 11px; color: var(--gold); border: 1px solid #76623c; border-radius: 20px; padding: 7px 10px; }
.experience-switch button:disabled { opacity: .4; cursor: default; }
@media(max-width: 420px) { .membership-cards { grid-template-columns: 1fr; } .membership-badge { max-width: 100px; } }
