:root {
  font-family: "Hanken Grotesk", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #202321;
  background: #eef0ed;
  font-synthesis: none;
  --ink: #202321;
  --ink-soft: #626761;
  --rail: #1b1d1c;
  --rail-soft: #292c2a;
  --paper: #f7f8f5;
  --surface: #ffffff;
  --panel: #e9eee8;
  --panel-strong: #dde5dc;
  --line: #d7dbd5;
  --line-strong: #c1c8bf;
  --accent: #cfe85a;
  --accent-ink: #283000;
  --deep: #0a5346;
  --teal: #3f7768;
  --amber: #865310;
  --danger: #9d3827;
  --focus: #88a900;
  --radius-sm: 8px;
  --radius: 12px;
  --sidebar: 148px;
  --topbar: 82px;
}

* { box-sizing: border-box; }
html { max-width: 100%; overflow-x: clip; background: var(--rail); }
body { max-width: 100%; margin: 0; min-width: 320px; overflow-x: clip; background: var(--paper); }
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { color: var(--deep); text-decoration: none; }
button, a { touch-action: manipulation; }

button {
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
button:hover { background: #f0f3ee; border-color: #aeb6ac; }
button:active { transform: none; }
button:disabled { opacity: .55; cursor: wait; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.primary:hover { background: #bfdc3f; border-color: #bfdc3f; }
.danger { color: var(--danger); border-color: #d6afa7; }
.quiet { border-color: transparent; background: transparent; color: var(--deep); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.skip { position: fixed; top: -100px; left: 16px; padding: 14px; background: white; z-index: 50; }
.skip:focus { top: 12px; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  color: #eef1ec;
  background: var(--rail);
}
.brand { display: flex; align-items: center; gap: 10px; min-height: 46px; color: white; }
.brandmark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 1px solid #414541;
  border-radius: 11px;
  background: #242725;
  color: var(--accent);
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -.05em;
}
.brand-name { font-size: 14px; font-weight: 750; line-height: 1.1; }
.brand small { display: block; margin-top: 4px; color: #999f98; font-size: 10px; font-weight: 500; }
.sidebar nav { display: grid; gap: 7px; margin: 46px 0; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 9px;
  color: #b7bcb6;
  font-size: 12px;
  font-weight: 650;
  transition: background-color .18s ease, color .18s ease;
}
.sidebar nav a:hover { background: var(--rail-soft); color: white; }
.sidebar nav a.active { background: var(--accent); color: var(--accent-ink); }
.nav-icon { width: 24px; font-size: 19px; line-height: 1; text-align: center; }
.suite { margin-top: auto; display: grid; gap: 13px; padding: 16px 9px; border-top: 1px solid #373a38; font-size: 11px; }
.suite > a { display: flex; justify-content: space-between; color: var(--accent); }
.suite > span:not(.small) { color: #c5c9c3; }
.suite small { display: block; margin-top: 4px; color: #7f857f; font-size: 9px; }
.small { color: var(--ink-soft); font-size: 12px; }
.suite .small { color: #7f857f; font-size: 10px; }
.settings-link { display: flex; gap: 7px; padding: 14px 9px 8px; color: #c5c9c3; font-size: 11px; }
.settings-link:hover { color: white; }
.local-label { padding: 4px 9px; color: #787d78; font-size: 9px; }

.workspace { min-width: 0; min-height: 100vh; margin-left: var(--sidebar); background: var(--paper); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  min-height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(247,248,245,.96);
  backdrop-filter: blur(12px);
}
.topbar-title { margin-right: auto; display: grid; gap: 3px; }
.suite-wordmark { display: flex; align-items: center; gap: 10px; font-family: "Bricolage Grotesque", ui-sans-serif, sans-serif; font-size: 20px; line-height: 1.1; letter-spacing: -.03em; white-space: nowrap; }
.suite-logo, .suite-product { font-weight: 700; }
.suite-dot { color: #dd8b2b; }
.suite-divider { width: 1px; height: 22px; margin: 0 2px; background: var(--line-strong); }
.topbar-title span { color: var(--ink-soft); font-size: 11px; }
.topbar-title .suite-logo, .topbar-title .suite-product { color: var(--ink); font-size: inherit; }
.topbar-title .suite-dot { color: #dd8b2b; font-size: inherit; }
.save-status { min-height: 34px; padding: 7px 11px; border: 0; border-radius: 999px; background: var(--panel); color: var(--deep); font-size: 11px; }

main { width: 100%; max-width: 1420px; min-width: 0; min-height: calc(100vh - 145px); margin: auto; padding: 34px 38px 70px; }
h1, h2, h3 { color: var(--ink); text-wrap: balance; }
h1 { margin: 0 0 7px; font-size: 31px; line-height: 1.1; font-weight: 700; letter-spacing: -.035em; }
h2 { margin: 0 0 15px; font-size: 18px; line-height: 1.25; font-weight: 700; letter-spacing: -.025em; }
h3 { margin: 0 0 7px; font-size: 15px; line-height: 1.35; }
p { max-width: 72ch; margin: 7px 0 17px; line-height: 1.6; }
.muted { color: var(--ink-soft); }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.page-heading p { margin: 0; color: var(--ink-soft); font-size: 14px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; }
.section-heading a { font-size: 12px; font-weight: 650; }

.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; }
.metric-strip article { min-height: 146px; padding: 17px 18px; border-radius: var(--radius); background: var(--panel); }
.metric-strip article:nth-child(2) { background: #edf0e7; }
.metric-strip article:nth-child(3) { background: #e7ece5; }
.metric-strip article:nth-child(4) { background: #eef0e9; }
.metric-strip span { display: block; min-height: 34px; color: #50564f; font-size: 12px; font-weight: 650; }
.metric-strip strong { display: block; margin: 4px 0 12px; font-size: 35px; line-height: 1; font-weight: 500; letter-spacing: -.04em; }
.metric-strip small { color: #656b64; font-size: 10px; }
.metric-strip article::after { content: ""; display: block; width: 100%; height: 13px; margin-top: 12px; border-radius: 4px; background: linear-gradient(90deg, var(--ink) 0 18%, transparent 18% 22%, var(--ink) 22% 43%, transparent 43% 47%, #acb4aa 47% 66%, transparent 66% 70%, #cbd1c9 70% 100%); opacity: .9; }

.today-layout { display: grid; grid-template-columns: minmax(0, 1fr) 288px; gap: 18px; align-items: start; }
.monitor-panel { min-width: 0; padding: 22px; border-radius: var(--radius); background: var(--surface); }
.panel { padding: 21px; border-radius: var(--radius); background: var(--surface); }
.quick-panel { background: var(--rail); color: white; }
.quick-panel h2 { color: white; }
.quick-panel .quick-actions button { border-color: #3c403d; background: #242725; color: #eef1ec; }
.quick-panel .quick-actions button:hover { border-color: var(--accent); background: #2c302d; }
.signal-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(207,232,90,.12); }
.quick-actions { display: grid; gap: 8px; }
.quick-actions button { display: flex; align-items: center; justify-content: space-between; text-align: left; font-size: 12px; }
.aside-note { margin: 15px 8px 0; color: var(--ink-soft); font-size: 11px; line-height: 1.65; }
.aside-note a { font-weight: 700; }

.task-list { border-top: 1px solid var(--line); }
.task-row { display: flex; align-items: center; gap: 13px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.task-row .task-icon { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 16px; }
.task-row > div:nth-child(2) { flex: 1; min-width: 0; }
.task-row h3 { margin-bottom: 2px; font-size: 13px; }
.task-row p { margin: 0; color: var(--ink-soft); font-size: 11px; }
.task-row button { min-height: 34px; padding: 7px 10px; font-size: 10px; }
.batch-section { margin-top: 31px; }

.welcome { display: grid; grid-template-columns: 1.5fr 1fr; align-items: center; gap: 28px; margin: 0 0 22px; padding: 28px; border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); }
.welcome h2 { max-width: 460px; margin: 10px 0 10px; color: var(--accent-ink); font-size: 27px; }
.welcome p { margin-bottom: 18px; font-size: 13px; }
.welcome .primary { background: var(--rail); border-color: var(--rail); color: white; }
.welcome .primary:hover { background: #303330; }
.welcome button:not(.primary) { border-color: rgba(40,48,0,.3); background: transparent; }
.signal { display: inline-flex; padding: 5px 8px; border: 1px solid rgba(40,48,0,.24); border-radius: 999px; font-size: 10px; font-weight: 750; }
.culture-meter { height: 116px; display: flex; align-items: end; justify-content: center; gap: 7px; padding: 18px; border-radius: 10px; background: rgba(255,255,255,.45); }
.culture-meter span { width: 18px; border-radius: 8px 8px 3px 3px; background: var(--rail); }
.culture-meter span:nth-child(1) { height: 30%; }.culture-meter span:nth-child(2) { height: 48%; }.culture-meter span:nth-child(3) { height: 68%; }.culture-meter span:nth-child(4) { height: 82%; }.culture-meter span:nth-child(5) { height: 62%; }.culture-meter span:nth-child(6) { height: 92%; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }

.batch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 12px; }
.batch-card { display: block; overflow: hidden; border-radius: var(--radius); background: var(--panel); color: inherit; transition: background-color .18s ease, transform .18s ease; }
.batch-card:hover { background: var(--panel-strong); transform: none; }
.brew-art { position: relative; height: 116px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #dbe3da; }
.brew-art.variant-1 { background: #e7e2d6; }.brew-art.variant-2 { background: #e1e4e8; }
.jar { position: relative; width: 60px; height: 79px; border: 2px solid rgba(64,74,66,.42); border-radius: 6px 6px 14px 14px; background: rgba(255,255,255,.54); }
.jar::before { content: ""; position: absolute; inset: 17px 4px 5px; border-radius: 0 0 9px 9px; background: rgba(166,108,40,.68); }
.jar::after { content: ""; position: absolute; top: -7px; left: -4px; right: -4px; height: 13px; border: 1px solid #aeb4a9; border-radius: 3px; background: #e8e9e1; }
.jar-label { position: absolute; z-index: 1; top: 34px; left: 6px; right: 6px; padding: 6px 0; background: rgba(255,255,255,.9); color: #45483c; font-size: 8px; font-weight: 750; text-align: center; }
.brew-art .badge { position: absolute; top: 10px; right: 10px; }
.batch-body { padding: 15px; }
.batch-body h3 { margin-bottom: 4px; font-size: 15px; overflow-wrap: anywhere; }
.batch-body p { margin: 0; color: var(--ink-soft); font-size: 11px; }
.batch-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 13px; padding-top: 11px; border-top: 1px solid rgba(87,96,88,.2); font-size: 10px; }
.badge { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 999px; background: #e4ecdf; color: var(--deep); font-size: 10px; font-weight: 700; white-space: nowrap; }
.badge.warn { background: #f2e5c8; color: #754510; }.badge.danger { background: #f5dfda; color: var(--danger); }.badge.neutral { background: #e7eae6; color: #565c56; }

.empty { padding: 35px 25px; border: 1px dashed #afb8ad; border-radius: var(--radius); background: #fbfcfa; text-align: center; }
.empty p { margin: 7px auto 18px; color: var(--ink-soft); font-size: 13px; }
.detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 16px; }
.detail-heading p { color: var(--ink-soft); font-size: 13px; }
.tabs { display: flex; gap: 23px; margin: 20px 0 24px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { min-height: 42px; padding: 10px 0; border: 0; border-radius: 0; background: transparent; color: var(--ink-soft); font-size: 12px; }
.tabs button.active { border-bottom: 2px solid var(--ink); color: var(--ink); }
.detail-grid { display: grid; grid-template-columns: minmax(0,1fr) 285px; gap: 18px; }
.detail-grid > section { min-width: 0; padding: 23px; border-radius: var(--radius); background: var(--surface); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; margin-left: 7px; padding: 0 0 25px 27px; border-left: 1px solid var(--line-strong); }
.timeline li::before { content: ""; position: absolute; top: 4px; left: -5px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px white; }
.timeline time { color: var(--ink-soft); font-size: 10px; }
.timeline h3 { margin: 5px 0; font-size: 13px; }
.timeline p { margin: 7px 0; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline .entry-photo { display: block; max-width: 240px; max-height: 210px; margin-top: 12px; border-radius: 8px; object-fit: cover; }
.readings { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.reading { padding: 5px 8px; border-radius: 5px; background: var(--panel); font-size: 10px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin: 0; font-size: 13px; }
.facts > div { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--ink-soft); font-size: 10px; }.facts dd { margin: 4px 0 0; }
.notice { margin-bottom: 20px; padding: 16px 18px; border-radius: var(--radius-sm); background: #f1e5ce; color: #704414; font-size: 13px; }
.notice.concern { background: #f4e1dc; color: #842f20; }
.notice p { margin: 5px 0 9px; }.notice p:last-child { margin-bottom: 0; }

.library-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; }
.library-grid > section, .storage-row, main > section:not(.batch-section) { padding: 23px; border-radius: var(--radius); background: var(--surface); }
.record-row, .bottle-row { padding: 17px 0; border-bottom: 1px solid var(--line); }
.record-row { display: flex; align-items: center; gap: 12px; }
.record-row > div { flex: 1; min-width: 0; }
.record-row p, .bottle-row p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.record-row h3 { overflow-wrap: anywhere; }
.bottle-row header { display: flex; justify-content: space-between; gap: 20px; }
.bottle-row .button-row { margin-top: 12px; }.bottle-row .button-row button { min-height: 36px; font-size: 10px; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 12px; }
th, td { min-width: 105px; padding: 14px; border-bottom: 1px solid var(--line); text-align: left; }
th { background: var(--panel); color: var(--ink-soft); font-size: 10px; font-weight: 700; }
td:first-child { font-weight: 700; }
.search { width: min(320px,100%); }

input, textarea, select { width: 100%; min-height: 46px; padding: 11px 12px; border: 1px solid #acb5aa; border-radius: var(--radius-sm); background: white; color: inherit; }
input::placeholder, textarea::placeholder { color: #646b64; }
textarea { min-height: 92px; resize: vertical; }
label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 650; }
.field { margin-bottom: 16px; }.field small { display: block; margin-top: 6px; color: var(--ink-soft); font-size: 11px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.check-label, .checkbox-inline { display: flex; align-items: center; gap: 9px; min-height: 46px; cursor: pointer; }
.check-label input, .checkbox-inline input { width: 19px; min-height: 19px; accent-color: var(--deep); }
details { margin: 13px 0; } summary { min-height: 44px; padding: 12px 0; color: var(--deep); font-size: 12px; cursor: pointer; }
.ratings { display: flex; gap: 7px; }.ratings label { position: relative; flex: 1; cursor: pointer; }.ratings input { position: absolute; width: 1px; opacity: 0; }
.ratings span { min-height: 44px; display: grid; place-items: center; border: 1px solid #acb5aa; border-radius: var(--radius-sm); }
.ratings input:checked + span { border-color: var(--deep); background: var(--deep); color: white; }
.ratings input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.rating-ends { display: flex; justify-content: space-between; margin-top: 2px; color: var(--ink-soft); font-size: 10px; }
fieldset { margin: 0 0 18px; padding: 0; border: 0; } legend { margin-bottom: 9px; font-size: 12px; font-weight: 650; }

dialog { width: min(610px,calc(100% - 28px)); max-height: 90dvh; padding: 25px; border: 0; border-radius: var(--radius); color: var(--ink); background: var(--paper); }
dialog::backdrop { background: rgba(18,22,19,.58); backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.dialog-head h2 { margin: 0; }.icon-button { width: 42px; padding: 0; border: 0; background: transparent; font-size: 25px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; padding-top: 18px; border-top: 1px solid var(--line); }
#form-error { color: var(--danger); font-size: 13px; }
#toast { position: fixed; z-index: 40; bottom: 22px; left: 50%; display: none; max-width: 90vw; padding: 12px 18px; transform: translateX(-50%); border-radius: var(--radius-sm); background: var(--rail); color: white; font-size: 12px; }
#toast.visible { display: block; }
footer { display: flex; justify-content: space-between; padding: 20px 38px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 10px; }
.storage-row { margin: 14px 0; }.storage-row p { color: var(--ink-soft); font-size: 13px; }
.pending-row { margin: 11px 0; padding: 14px; border-radius: var(--radius-sm); background: #fff2da; }.pending-row p { margin: 0 0 10px; font-size: 12px; }
.inline-link { text-decoration: underline; text-underline-offset: 3px; }.help { color: var(--ink-soft); font-size: 11px; }.no-margin { margin: 0; }
#photo-preview { display: block; max-width: 180px; max-height: 140px; margin: 11px 0; border-radius: 8px; } #photo-preview[hidden] { display: none; }

.photo-workflow { margin: 20px 0 22px; padding: 18px; border: 1px solid rgba(14,107,91,.16); border-radius: 18px; background: #f1f7f4; }
.photo-workflow-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.photo-workflow-head h3 { margin: 0 0 3px; font-size: 15px; }
.photo-workflow-head p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.vision-chip { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; background: #d4ebe4; color: #0a5346; font-size: 9px; font-weight: 700; }
.photo-picker { position: relative; min-height: 74px; display: flex; align-items: center; gap: 12px; margin: 0; padding: 10px; border: 1px dashed #68a99d; border-radius: 15px; background: #fff; cursor: pointer; transition: border-color .2s ease, background-color .2s ease, transform .2s ease; }
.photo-picker:hover { border-color: #0e6b5b; background: #f8fbf9; transform: none; }
.photo-picker:focus-within { outline: 3px solid rgba(14,107,91,.55); outline-offset: 3px; }
.photo-picker input { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.photo-picker-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 13px; background: #d4ebe4; color: #0a5346; }
.photo-picker-icon svg, .vision-handoff-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.photo-picker-copy { min-width: 0; display: grid; gap: 3px; }
.photo-picker-copy strong { font-size: 12px; }
.photo-picker-copy small { color: var(--ink-soft); font-size: 10px; font-weight: 500; }
.photo-picker-action { margin-left: auto; padding: 8px 11px; border-radius: 999px; background: #0e6b5b; color: #fff; font-size: 10px; font-weight: 700; white-space: nowrap; }
.photo-preview-row { display: flex; align-items: center; gap: 12px; }
.photo-preview-row #photo-preview { width: 96px; height: 72px; flex: 0 0 96px; margin: 12px 0 0; border-radius: 12px; object-fit: cover; }
.photo-preview-row #photo-status { display: block; margin-top: 10px; line-height: 1.45; }
.photo-workflow.has-photo .photo-picker { border-style: solid; border-color: #68a99d; }
.vision-handoff { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 11px; margin-top: 14px; padding: 12px; border-radius: 15px; background: #0a5346; color: #fff; }
.vision-handoff-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.12); color: #d4ebe4; }
.vision-handoff strong { display: block; font-size: 11px; }
.vision-handoff p { margin: 2px 0 0; color: #d4ebe4; font-size: 9px; line-height: 1.4; }
.vision-handoff a { padding: 9px 11px; border-radius: 999px; background: #fff; color: #0a5346; font-size: 10px; font-weight: 700; white-space: nowrap; }
.vision-handoff a:hover { background: #f5e4cc; }
.measurement-details { border-top: 1px solid var(--line); }

@media (min-width: 1450px) { main { padding-top: 40px; } .batch-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 1100px) {
  :root { --sidebar: 112px; }
  .brand-name { display: none; }
  .brand { justify-content: center; }
  .sidebar nav a { flex-direction: column; gap: 3px; text-align: center; }
  .suite > :not(.small), .settings-link { font-size: 9px; }
  .topbar { padding: 0 25px; }
  main { padding: 28px 25px 50px; }
  .metric-strip { grid-template-columns: repeat(2,1fr); }
  .today-layout, .detail-grid { grid-template-columns: minmax(0,1fr) 250px; }
}
@media (max-width: 820px) {
  .today-layout, .detail-grid, .library-grid { grid-template-columns: 1fr; }
  .today-layout > aside { order: -1; }
  .quick-panel .quick-actions { grid-template-columns: 1fr 1fr; }
  .aside-note { display: none; }
  .detail-grid > aside { order: initial; }
  .facts { grid-template-columns: repeat(4,1fr); }
  .welcome { grid-template-columns: 1fr; }
  .culture-meter { display: none; }
}
@media (max-width: 767px) {
  :root { --topbar: 70px; }
  .sidebar { inset: auto 0 0 0; width: 100%; height: 70px; padding: 0; border-top: 1px solid #373a38; }
  .brand, .suite, .sidebar-tools, .settings-link, .local-label { display: none; }
  .sidebar nav { display: flex; height: 100%; margin: 0; }
  .sidebar nav a { flex: 1; justify-content: center; min-height: 70px; padding: 7px 4px; border-radius: 0; font-size: 10px; }
  .nav-icon { font-size: 18px; }
  .workspace { margin: 0; padding-bottom: 70px; }
  .topbar { padding: 0 16px; gap: 8px; }
  .suite-wordmark { gap: 7px; font-size: 16px; }
  .suite-divider { height: 18px; margin: 0 1px; }
  .topbar-title > #date { display: none; }
  .topbar .primary { min-height: 40px; padding: 8px 11px; font-size: 11px; }
  .save-status { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  main { padding: 22px 16px 34px; }
  h1 { font-size: 27px; }
  .page-heading { align-items: flex-start; flex-wrap: wrap; margin-bottom: 22px; }
  .metric-strip { gap: 8px; }
  .metric-strip article { min-height: 130px; padding: 14px; }
  .metric-strip strong { font-size: 31px; }
  .monitor-panel, .panel, .library-grid > section, .storage-row, main > section:not(.batch-section) { padding: 17px; }
  .quick-panel .quick-actions { grid-template-columns: 1fr 1fr; }
  .quick-actions button { padding: 9px; font-size: 10px; }
  .batch-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .brew-art { height: 105px; }.batch-body { padding: 12px; }.batch-body h3 { font-size: 13px; }.batch-foot { font-size: 9px; }
  .task-row { gap: 8px; }.task-row .task-icon { display: none; }.task-row button { padding: 6px; }
  .detail-heading { display: block; }.facts { grid-template-columns: 1fr 1fr; }
  .field-row { gap: 10px; }.field-row.triple { grid-template-columns: 1fr; }
  dialog { max-height: 92dvh; padding: 20px; }
  footer { display: block; padding: 18px 16px; line-height: 1.8; } footer span { display: block; }
  #toast { bottom: 82px; width: max-content; }
  .bottle-row header { flex-wrap: wrap; }
}
@media (max-width: 390px) {
  .batch-grid { grid-template-columns: 1fr; }
  .quick-panel .quick-actions { grid-template-columns: 1fr; }
}
@media (max-width: 350px) { .save-status { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; }
}

/* A visible search field keeps filtering discoverable and stable. */
.batch-search { width: min(320px,100%); flex: 0 1 320px; }
.batch-search label { display: block; margin-bottom: 6px; font-size: .875rem; }
.batch-search input { padding-inline: 14px; border-radius: 12px; background: #fff; }
.batch-search input::-webkit-search-cancel-button { cursor: pointer; }

/* Rounded material exploration: solid surfaces, concentric curves and tactile controls. */
:root {
  --ink: #1d1d1f;
  --ink-soft: #6e6e73;
  --rail: #ffffff;
  --rail-soft: #f5f5f7;
  --paper: #fbfbfd;
  --surface: #ffffff;
  --panel: #f5f5f7;
  --panel-strong: #d4ebe4;
  --line: #d2d2d7;
  --line-strong: #c7c7cc;
  --accent: #0e6b5b;
  --accent-ink: #ffffff;
  --deep: #0a5346;
  --focus: #0e6b5b;
  --radius-sm: 14px;
  --radius: 18px;
  --control-height: 44px;
  --control-compact: 36px;
  --control-radius: 14px;
  --surface-padding: 24px;
  --sidebar: 152px;
  --topbar: 72px;
  --surface-border: rgba(255, 255, 255, .72);
  --floating-shadow: 0 12px 28px rgba(34, 61, 41, .11), inset 0 1px 0 rgba(255, 255, 255, .8);
  --surface-shadow: 0 4px 8px rgba(40, 65, 46, .07);
}

html { background: #fbfbfd; }
body {
  min-height: 100vh;
  background-color: #fbfbfd;
  background:
    radial-gradient(circle at 9% 4%, rgba(14, 107, 91, .12), transparent 25rem),
    radial-gradient(circle at 94% 18%, rgba(221, 139, 43, .1), transparent 28rem),
    linear-gradient(145deg, #fbfbfd 0%, #f5f5f7 50%, #f8faf9 100%);
  background-attachment: fixed;
}
html, body { background-color: #fbfbfd; }

button {
  min-height: var(--control-height);
  padding: 9px 14px;
  border-color: rgba(63, 88, 69, .17);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 3px 8px rgba(33, 58, 40, .06);
  font-size: 13px;
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s cubic-bezier(.2,.8,.2,1);
}
button:hover { background: #f5f8f3; border-color: rgba(49, 95, 82, .3); box-shadow: inset 0 1px 0 white, 0 3px 8px rgba(33, 58, 40, .1); transform: none; }
button:active { transform: none; }
.primary { background: #0e6b5b; border-color: #0e6b5b; color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 3px 8px rgba(10,83,70,.18); }
.primary:hover { background: #0a5346; border-color: #0a5346; }
:focus-visible { outline: 3px solid rgba(14, 107, 91, .72); outline-offset: 3px; }

.sidebar {
  inset: 16px auto 16px 16px;
  height: auto;
  padding: 18px 12px 14px;
  color: var(--ink);
  border: 0;
  border-radius: 20px;
  background: var(--rail);
  box-shadow: var(--floating-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.brand { justify-content: center; color: var(--ink); }
.brandmark { border: 0; border-radius: 15px; background: #0e6b5b; box-shadow: 0 4px 8px rgba(10,83,70,.18); object-fit: cover; }
.brand small, .suite small { color: #86868b; }
.sidebar nav { gap: 8px; margin: 38px 0; }
.sidebar nav a { min-height: 50px; border: 1px solid transparent; border-radius: 16px; color: #6e6e73; }
.sidebar nav a:hover { border-color: #fff; background: #f5f5f7; color: var(--ink); }
.sidebar nav a.active { border-color: #0e6b5b; background: #0e6b5b; color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 3px 8px rgba(10,83,70,.18); }
.nav-icon { display: grid; place-items: center; }
.nav-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.suite { border-color: rgba(59,80,63,.12); }
.suite > a { color: var(--deep); }
.suite > span:not(.small) { color: #6e6e73; }

.sidebar-tools {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-top: 12px;
}
.sidebar-tool {
  position: relative;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(59,80,63,.12);
  border-radius: 50%;
  background: #f6f8f6;
  color: #6e6e73;
  box-shadow: inset 0 1px 0 #fff, 0 3px 8px rgba(33,58,40,.06);
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s cubic-bezier(.2,.8,.2,1);
}
a.sidebar-tool:hover, a.sidebar-tool:focus-visible {
  border-color: rgba(14,107,91,.24);
  background: #d4ebe4;
  color: #0a5346;
  transform: none;
}
.account-tool { cursor: default; }
.utility-icon, .utility-icon svg { width: 19px; height: 19px; }
.utility-icon { display: grid; place-items: center; }
.utility-icon svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.utility-label {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  z-index: 20;
  width: max-content;
  padding: 7px 10px;
  border-radius: 10px;
  background: #1d1d1f;
  color: #fff;
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(-4px,-50%);
  transition: opacity .16s ease, transform .16s ease;
}
.sidebar-tool:hover .utility-label, .sidebar-tool:focus-visible .utility-label { opacity: 1; transform: translate(0,-50%); }

/* Navigation uses stable geometry in every interaction state. */
@media (min-width: 768px) {
  .sidebar nav { width: 100%; margin: 38px auto; padding: 6px; gap: 6px; border: 0; border-radius: 16px; background: transparent; box-shadow: none; }
  .sidebar nav a { width: 100%; min-height: 64px; flex-direction: column; justify-content: center; gap: 5px; padding: 8px; border: 0; border-radius: 12px; color: var(--ink-soft); text-align: center; transition: color 150ms ease, background-color 150ms ease; }
  .sidebar nav a > span:last-child { position: static; font-size: .875rem; line-height: 1.25; color: inherit; }
  .sidebar nav .nav-icon { width: 26px; height: 26px; flex: 0 0 26px; }
  .sidebar nav a:hover { background: #eef4f2; color: var(--deep); }
  .sidebar nav a.active { background: var(--panel-strong); color: var(--deep); box-shadow: none; }
  .sidebar nav a.active:hover { background: #c3e2d9; }
  .sidebar nav a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
}

.workspace { margin-left: 184px; background: transparent; }
.topbar {
  top: 14px;
  min-height: var(--topbar);
  margin: 14px 22px 0;
  padding: 0 18px 0 22px;
  border: 0;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--floating-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.suite-divider { background: rgba(45, 63, 49, .2); }
.save-status { border: 1px solid #d4ebe4; background: #d4ebe4; color: #0a5346; box-shadow: inset 0 1px 0 rgba(255,255,255,.72); }

main { padding-top: 42px; }
main:focus, main:focus-visible { outline: none; }
h1 { font-size: clamp(30px, 2.6vw, 38px); letter-spacing: -.04em; }
h2 { letter-spacing: -.03em; }
.page-heading { margin-bottom: 30px; }

.metric-strip { gap: 14px; }
.metric-strip article {
  position: relative;
  overflow: hidden;
  min-height: 148px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: var(--radius);
  box-shadow: var(--surface-shadow), inset 0 1px 0 white;
}
.metric-strip article::before { content: ""; position: absolute; width: 110px; height: 110px; right: -40px; top: -45px; border-radius: 50%; background: rgba(255,255,255,.35); filter: blur(2px); }
.metric-strip article::after { height: 10px; border-radius: 999px; opacity: .72; }
.metric-strip strong { font-size: 36px; }
.metric-strip article:nth-child(1) { background: #d4ebe4; }
.metric-strip article:nth-child(2) { background: #f5f5f7; }
.metric-strip article:nth-child(3) { background: #f5e4cc; }
.metric-strip article:nth-child(4) { background: #f0f1f3; }
.metric-strip small { color: #55585a; }

.monitor-panel, .panel, .library-grid > section, .storage-row, main > section:not(.batch-section), .detail-grid > section, .table-wrap {
  border: 1px solid rgba(255,255,255,.82);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--surface-shadow), inset 0 1px 0 rgba(255,255,255,.9);
}
.monitor-panel, .panel, .library-grid > section, .storage-row, main > section:not(.batch-section), .detail-grid > section { padding: var(--surface-padding); }
.quick-panel { border-color: #0a3d34; background: linear-gradient(145deg, #0a5346, #0a3d34); box-shadow: 0 4px 8px rgba(10,61,52,.18), inset 0 1px 0 rgba(255,255,255,.1); }
.quick-panel .quick-actions { gap: 10px; }
.quick-panel .quick-actions button {
  min-height: 48px;
  gap: 10px;
  padding: 6px 7px 6px 13px;
  border-color: #2f7b6f;
  border-radius: var(--control-radius);
  background: #145f53;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: none;
}
.quick-panel .quick-actions button:hover { border-color: #83b9af; background: #1a7263; }
.quick-panel .quick-actions button:focus-visible { outline-color: #f2c184; }
.quick-action-copy { min-width: 0; }
.quick-action-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(212,235,228,.14);
  color: #d4ebe4;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.11);
  transition: color .2s ease, background-color .2s ease, transform .2s cubic-bezier(.2,.8,.2,1);
}
.quick-action-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.quick-panel .quick-actions button:hover .quick-action-icon { background: #d4ebe4; color: #0a5346; transform: none; }
.signal-dot { background: #dd8b2b; box-shadow: 0 0 0 5px rgba(221,139,43,.14), 0 0 20px rgba(221,139,43,.32); }

.welcome { padding: 24px; border: 1px solid #0e6b5b; border-radius: var(--radius); background: linear-gradient(135deg, #0e6b5b, #0a5346); color: #fff; box-shadow: 0 4px 8px rgba(10,83,70,.16), inset 0 1px 0 rgba(255,255,255,.16); }
.welcome h2 { font-size: 26px; }
.welcome h2 { color: #fff; }
.welcome .primary { border-color: #fff; background: #fff; color: #0a5346; }
.welcome .primary:hover { border-color: #f5f5f7; background: #f5f5f7; }
.welcome button:not(.primary) { border-color: rgba(255,255,255,.45); background: transparent; color: #fff; }
.welcome button:not(.primary):hover { background: rgba(255,255,255,.1); }
.signal { border-color: rgba(255,255,255,.4); color: #fff; }
.culture-meter { border: 1px solid #f2c184; border-radius: 16px; background: #f5e4cc; box-shadow: inset 0 1px 0 rgba(255,255,255,.45); }
.culture-meter span { border-radius: 999px; background: linear-gradient(#dd8b2b, #8f5115); }
.signal, .badge, .reading { border: 1px solid rgba(56,82,61,.08); border-radius: 999px; }
.badge { background: #d4ebe4; color: #0a5346; }
.badge.warn { background: #f5e4cc; color: #8f5115; }

.task-list { border-top-color: var(--line); }
.task-row .task-icon { border-radius: 12px; background: #d4ebe4; color: #0a5346; box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.batch-card { border: 1px solid rgba(255,255,255,.72); border-radius: var(--radius); box-shadow: var(--surface-shadow), inset 0 1px 0 rgba(255,255,255,.7); }
.batch-card:hover { box-shadow: 0 4px 8px rgba(40,65,46,.11), inset 0 1px 0 white; transform: none; }
.brew-art { height: 120px; }
.jar { border-radius: 10px 10px 18px 18px; box-shadow: 0 10px 18px rgba(72,72,50,.12); }
.jar::before { border-radius: 0 0 13px 13px; }
.jar-label { border-radius: 7px; }
.empty { border-color: rgba(75,99,79,.24); border-radius: var(--radius); background: #f8faf7; box-shadow: inset 0 1px 0 rgba(255,255,255,.72); }

.tabs { width: max-content; max-width: 100%; gap: 5px; padding: 5px; border: 1px solid var(--surface-border); border-radius: 999px; background: #f4f7f1; box-shadow: 0 8px 24px rgba(37,61,43,.07), inset 0 1px 0 white; }
.tabs button { min-height: var(--control-compact); padding: 7px 14px; border-radius: 999px; font-size: 11px; }
.tabs button.active { border: 0; background: rgba(255,255,255,.96); box-shadow: 0 5px 14px rgba(34,55,39,.1); }
.timeline li::before { box-shadow: 0 0 0 4px rgba(255,255,255,.95), 0 0 0 5px rgba(67,93,71,.12); }
.notice { border: 1px solid rgba(134,83,16,.09); border-radius: 18px; }
.notice.concern { border-color: rgba(157,56,39,.1); }

input, textarea, select { min-height: 46px; border-color: rgba(58,82,63,.18); border-radius: var(--control-radius); background: #fff; box-shadow: inset 0 1px 2px rgba(38,55,42,.04); font-size: 14px; }
input:hover, textarea:hover, select:hover { border-color: rgba(49,95,82,.35); }
input:focus, textarea:focus, select:focus { border-color: rgba(49,95,82,.5); background: #fff; box-shadow: 0 0 0 4px rgba(49,95,82,.08); outline: none; }
.ratings span { border-color: rgba(58,82,63,.18); border-radius: 14px; background: #fff; }

dialog { overflow-y: auto; padding: 24px; border: 0; border-radius: var(--radius); background: #f7faf5; box-shadow: 0 24px 64px rgba(18,35,23,.28), inset 0 1px 0 white; }
dialog::backdrop { background: rgba(24,34,27,.42); backdrop-filter: none; -webkit-backdrop-filter: none; }
#toast { border: 0; border-radius: 999px; box-shadow: 0 14px 40px rgba(15,25,18,.22); }
footer { border-top: 0; }

@media (max-width: 1200px) {
  .table-wrap { overflow: visible; }
  .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .responsive-table tbody { display: grid; gap: 12px; }
  .responsive-table tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 18px; padding: 14px 16px; border: 1px solid rgba(58,82,63,.12); border-radius: 14px; background: #f8faf7; }
  .responsive-table td { min-width: 0; padding: 9px 0; overflow-wrap: anywhere; }
  .responsive-table td::before { content: attr(data-label); display: block; margin-bottom: 3px; color: var(--ink-soft); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
  .responsive-table td:nth-last-child(-n+2) { border-bottom: 0; }
}

@media (max-width: 1100px) {
  :root { --sidebar: 112px; }
  .workspace { margin-left: 144px; }
}

@media (max-width: 767px) {
  :root { --topbar: 64px; }
  .sidebar { inset: auto 10px 10px; width: calc(100% - 20px); height: 64px; padding: 5px; border: 0; border-radius: 20px; background: #0a3d34; box-shadow: 0 16px 42px rgba(10,61,52,.25), inset 0 1px 0 rgba(255,255,255,.1); }
  .sidebar nav { height: 100%; margin: 0; gap: 0; }
  .sidebar nav a { min-height: 54px; border-radius: 19px; color: #bec7bf; }
  .sidebar nav a:hover { color: white; background: rgba(255,255,255,.08); }
  .sidebar nav a.active { color: #0a5346; background: #d4ebe4; border-color: #d4ebe4; }
  .workspace { margin: 0; padding-bottom: 86px; }
  h1 { font-size: 28px; }
  .topbar .primary { min-height: 40px; padding: 8px 11px; font-size: 12px; }
  .tabs { width: 100%; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); overflow: visible; }
  .tabs button { min-width: 0; padding-inline: 4px; font-size: 10px; }
  .responsive-table tr { grid-template-columns: 1fr; }
  .responsive-table td:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .photo-workflow { margin-inline: -4px; padding: 14px; }
  .photo-workflow-head { display: block; }
  .vision-chip { display: inline-flex; margin-top: 9px; }
  .photo-picker-action { display: none; }
  .vision-handoff { grid-template-columns: auto minmax(0,1fr); }
  .vision-handoff a { grid-column: 1 / -1; text-align: center; }
  .topbar { top: 10px; min-height: 64px; margin: 10px 10px 0; padding: 0 10px 0 14px; border-radius: 18px; }
  main { padding: 31px 14px 34px; }
  .metric-strip article { min-height: 128px; padding: 15px; border-radius: 16px; }
  .metric-strip strong { font-size: 32px; }
  .monitor-panel, .panel, .library-grid > section, .storage-row, main > section:not(.batch-section), .detail-grid > section { padding: 18px; border-radius: 16px; }
  .welcome { padding: 20px; border-radius: 16px; }
  .quick-panel .quick-actions button { min-height: 48px; padding: 6px 7px 6px 12px; border-radius: 14px; }
  .quick-action-icon { width: 34px; height: 34px; flex-basis: 34px; border-radius: 11px; }
  dialog { padding: 20px; border-radius: 16px; }
}

@media (max-width: 430px) { .save-status { display: none; } }

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


/* Journal usability: keep the work visible and the feedback legible. */
main > section.metric-strip {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  gap: 12px;
}
.metric-strip article { min-height: 112px; padding: 16px; box-shadow: none; border: 0; }
.metric-strip article::before, .metric-strip article::after { display: none; }
.metric-strip span { min-height: 0; font-size: .875rem; }
.metric-strip strong { margin: 10px 0 6px; font-size: 2rem; }
.metric-strip small { font-size: .75rem; }
label, legend, summary, button, .quick-actions button, .quick-panel .quick-actions button,
.section-heading a, .task-row h3, .tabs button, .batch-body h3 { font-size: .875rem; }
input, textarea, select,  .batch-search input { font-size: 1rem; }
.help, .small, .task-row p, .batch-body p, .batch-foot, .rating-ends,
.photo-workflow-head p, .photo-picker-copy small, .photo-picker-action,
.vision-handoff p, .vision-handoff a, .responsive-table td::before { font-size: .8125rem; }
.photo-picker-copy strong, .vision-handoff strong { font-size: .875rem; }
.task-row button, .tabs button, .save-status { min-height: 44px; }
.task-row button { font-size: .875rem; }
.task-row { flex-wrap: wrap; }
.task-row > div:nth-child(2) { flex-basis: 160px; }
.batch-body h3, .record-row h3, .detail-heading h1, .task-row h3 { overflow-wrap: anywhere; }
.field, .field-row > * { min-width: 0; }
.photo-details { border-top: 1px solid var(--line); }
.photo-details .photo-workflow { margin-top: 4px; }

#toast { background: var(--deep); color: #fff; border-radius: 14px; font-size: .875rem; }
.form-actions { position: sticky; bottom: -24px; margin-inline: -24px; padding: 16px 24px; background: #f7faf5; z-index: 3; }
#form-error:not(:empty) { padding: 12px; border: 1px solid currentColor; border-radius: 8px; }
@media (max-width: 767px) {
  .topbar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 8px; padding-block: 10px; }
  .topbar-title { grid-column: 1; grid-row: 1; }
  .topbar .primary { grid-column: 2; grid-row: 1; font-size: .875rem; }
  .topbar .save-status { display: block; grid-column: 1 / -1; grid-row: 2; max-width: none; width: 100%; min-height: 36px; padding: 6px 10px; font-size: .75rem; white-space: normal; }
  main { padding-top: 24px; }
  .page-heading { margin-bottom: 20px; }
  .metric-strip article { min-height: 104px; padding: 12px; }
  .metric-strip strong { font-size: 1.75rem; margin-block: 8px 4px; }
  .metric-strip small { display: none; }
  .quick-panel .quick-actions { grid-template-columns: 1fr 1fr; }
  .quick-panel .quick-actions button { min-height: 60px; padding: 10px; }
  .quick-action-icon { display: none; }
  .sidebar { bottom: max(10px,env(safe-area-inset-bottom)); }
  .sidebar-tools { display: none; }
  .sidebar nav a { font-size: .75rem; }
  .batch-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .form-actions { bottom: -20px; margin-inline: -20px; padding: 14px 20px; }
  .photo-preview-row { flex-wrap: wrap; }
  #toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
}


/* Shared visual and interaction system, informed by NN/g, W3C and USWDS. */
:root {
  --ink-soft: #59625f;
  --line: #d9e1dd;
  --line-strong: #a5b2ac;
  --radius: 16px;
  --control-radius: 12px;
  --surface-padding: 24px;
  --floating-shadow: 0 6px 20px rgba(25,52,43,.06);
  --surface-shadow: none;
}
body { background: #f5f7f7; color: var(--ink); }
html { scroll-padding-top: 112px; scroll-padding-bottom: 100px; }
button, input, select, textarea, summary, a { scroll-margin-block: 120px; }
button { border-radius: var(--control-radius); border-color: var(--line-strong); box-shadow: none; line-height: 1.35; transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
button:hover { box-shadow: none; background: #edf3f0; border-color: #6b8277; }
button:active { background: #deebe5; }
button:disabled, button:disabled:hover { cursor: not-allowed; opacity: .6; box-shadow: none; }
.primary { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: none; }
.primary:hover, .primary:active { background: var(--deep); border-color: var(--deep); }
button.danger { color: var(--danger); border-color: #b86b5d; }
button.danger:hover { background: #f8e8e4; border-color: var(--danger); }
button.primary.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
button.primary.danger:hover { background: #792819; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--focus); outline-offset: 2px; border-color: var(--focus); box-shadow: none; }
.sidebar, .topbar { background: #fff; }
.topbar { border-radius: 16px; }
.page-heading p { font-size: 1rem; }
h2 { font-size: 1.125rem; }
h3, .timeline h3 { font-size: 1rem; line-height: 1.4; }
.help, .small, .facts dt, .reading, .timeline time, .badge { font-size: .8125rem; line-height: 1.45; }
.timeline p, .record-row p, .bottle-row p, .storage-row p, .empty p, .detail-heading p { font-size: 1rem; line-height: 1.6; }
.record-row { flex-wrap: wrap; }
.record-row > div { flex-basis: 180px; }
.bottle-row .button-row button { min-height: 44px; font-size: .875rem; }
.monitor-panel, .panel, .library-grid > section, .storage-row, main > section:not(.batch-section), .detail-grid > section, .table-wrap { border: 1px solid var(--line); border-radius: 16px; box-shadow: none; }
main > section.metric-strip { border: 0; background: transparent; }
.metric-strip article { border-radius: 12px; }
.quick-panel { background: var(--deep); border-color: var(--deep); }
.quick-panel .quick-actions button { border-radius: 12px; box-shadow: none; }
.quick-action-icon { background: transparent; box-shadow: none; }
.quick-panel .quick-actions button:hover .quick-action-icon { background: transparent; color: #fff; }
.batch-card { border: 1px solid var(--line); background: #fff; box-shadow: none; }
.batch-card:hover { border-color: #6b9988; background: #fff; box-shadow: none; }
.batch-body { padding: 18px; }
.batch-body h3 { font-size: 1.125rem; }
.batch-foot { flex-wrap: wrap; }
.empty { background: #f8faf9; border: 1px dashed #a5b2ac; box-shadow: none; }
.tabs { background: #eaf0ed; box-shadow: none; border: 0; border-radius: 12px; }
.tabs button { color: var(--ink-soft); border-radius: 8px; box-shadow: none; }
.tabs button.active { background: #fff; color: var(--deep); box-shadow: 0 1px 3px rgba(25,52,43,.12); }
.tabs button:hover { background: #fff; }
.tabs button:focus-visible { outline-offset: 1px; }
.table-wrap table { font-size: .875rem; }
th { font-size: .875rem; }
.facts { gap: 16px; margin-bottom: 20px; font-size: 1rem; }
.notice.status-notice { background: #edf5f1; color: var(--deep); border-color: #bed5ca; }
.save-status { border-radius: 10px; box-shadow: none; }
.save-status[data-state="attention"] { background: #fff0d9; border-color: #c99b57; color: #71460d; }
.dialog-head { align-items: flex-start; }
dialog { background: #fff; scroll-padding-block: 24px 110px; }
#form-fields { padding-top: 2px; }
#form-fields .field-required { color: var(--ink-soft); font-size: .8125rem; font-weight: 400; }
.form-actions { background: #fff; padding-bottom: max(16px,env(safe-area-inset-bottom)); }
.photo-workflow { background: #f2f7f4; }
.vision-handoff { background: #e4f0e9; color: var(--deep); }
.vision-handoff p { color: var(--deep); }
.vision-handoff a { border: 1px solid #729883; border-radius: 10px; }
.icon-button { min-width: 44px; min-height: 44px; }
.utility-label { font-size: .8125rem; }
@media (max-width: 820px) { .library-grid { grid-template-columns: 1fr; } }
@media (max-width: 767px) {
  html { scroll-padding-top: 140px; }
  .sidebar { background: #0a3d34; }
  .topbar .primary { min-height: 44px; }
  .topbar .save-status { min-height: 44px; }
  .batch-search { width: 100%; flex-basis: 100%; }
  .form-actions { border-radius: 0; }
  .sidebar nav a:focus-visible { outline-color: #fff; outline-offset: -3px; }
  .notice { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}


/* Kitchen workflows: direct actions, independent bottle stages and mobile sheets. */
.journal-utilities { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.journal-utilities a { display: flex; align-items: center; min-height: 48px; padding: 10px; font-size: .875rem; font-weight: 650; border-radius: 10px; }
.journal-utilities a:hover, .journal-utilities a.active { background: var(--panel-strong); }
.journal-utilities p { padding: 0 10px; font-size: .8125rem; color: var(--ink-soft); }
.batch-card-link { display: block; color: inherit; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 14px 14px; }
.card-actions button { min-width: 0; padding: 10px 6px; font-size: .8125rem; }
.card-actions button:first-child { background: var(--panel-strong); color: var(--deep); border-color: #92b7a8; }
.lifecycle-section { margin-bottom: 24px; }
.bottle-stage-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(320px,100%),1fr)); gap: 18px; margin-bottom: 20px; }
.stage-record { padding-block: 16px; border-bottom: 1px solid var(--line); }
.stage-record:last-child { border-bottom: 0; padding-bottom: 0; }
.stage-record p { margin-block: 6px; overflow-wrap: anywhere; }
.stage-record .button-row { margin-top: 12px; }
.stage-record h3 { overflow-wrap: anywhere; }
.history-section > summary { font-size: 1rem; font-weight: 650; }
.journal-loading { min-height: 340px; }
.loading-placeholders { display: grid; gap: 16px; margin-top: 28px; }
.loading-placeholders span { display: block; height: 64px; border-radius: 12px; background: var(--panel); }
.loading-placeholders span:last-child { width: 65%; }
#dialog-title:focus { outline: none; }
@media (max-width: 767px) {
  .journal-utilities { display: none; }
  .sidebar nav a { min-height: 54px; }
  .card-actions button { min-height: 48px; font-size: .875rem; }
  dialog { position: fixed; inset: auto 0 var(--keyboard-inset,0px); margin: 0; width: 100%; max-width: none; max-height: var(--dialog-height,calc(100dvh - 12px)); padding: 20px; border-radius: 20px 20px 0 0; overscroll-behavior: contain; }
  .dialog-head { position: sticky; top: -20px; margin: -20px -20px 18px; padding: 20px 20px 12px; background: #fff; z-index: 4; border-bottom: 1px solid var(--line); }
  .form-actions { bottom: -20px; }
  dialog button, dialog summary, .ratings span { min-height: 48px; }
}

.taste-section { margin-bottom: 28px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.taste-picker { width: min(280px,100%); }
.taste-chart { display: block; width: 100%; max-height: 280px; }
.taste-chart text { font: 14px "Hanken Grotesk",sans-serif; fill: var(--ink-soft); }
.chart-gridline { stroke: var(--line); }
.sweetness-line, .tartness-line { fill: none; stroke-width: 2.5; }
.sweetness-line { stroke: #0e6b5b; }
.tartness-line { stroke: #8d4d16; stroke-dasharray: 7 5; }
.sweetness-point { fill: #0e6b5b; }
.tartness-point { fill: #8d4d16; }
.taste-legend, .chart-dates { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; margin-block: 12px; font-size: .875rem; }
.sweetness-key { color: #0a5346; }
.tartness-key { color: #8d4d16; }
.chart-dates { color: var(--ink-soft); }
.taste-section caption { text-align: left; padding: 12px; font-size: .875rem; }
@media (max-width: 767px) { .taste-section { padding: 18px; }.taste-section .section-heading { align-items: stretch; flex-direction: column; }.taste-picker { width: 100%; } }

/* Global entry and backup utilities share the journal's stable controls. */
.global-log { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; color: var(--deep); background: var(--panel-strong); }
.global-log[hidden] { display: none; }
.global-log svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
.privacy-chip { width: 100%; margin-top: 8px; padding: 10px; font-size: .875rem; text-align: left; color: var(--deep); background: var(--panel-strong); }
.privacy-chip[data-state=attention] { color: #754510; background: #fff1d9; }
.backup-panel, .onboarding { padding: 24px; margin-block: 0 28px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.backup-panel h2, .onboarding h2 { margin-top: 0; }
.backup-panel .primary { min-height: 48px; margin-block: 4px; }
.export-history { font-size: .875rem; font-weight: 650; }
.starter-options { display: flex; flex-wrap: wrap; gap: 12px; margin-block: 20px; }
.starter-options button { min-height: 52px; }
.onboarding-secondary { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
/* Scroll only the fields: header and actions remain available at any height. */
dialog { width: min(540px,calc(100% - 28px)); max-width: 540px; max-height: min(90dvh,var(--dialog-height,90dvh)); padding: 0; overflow: hidden; }
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.dialog-head { position: sticky; top: 0; flex: none; margin: 0; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); background: #fff; z-index: 4; }
#editor { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
#form-fields { overflow-y: auto; min-height: 0; padding: 20px 24px; scroll-padding-block: 20px; overscroll-behavior: contain; }
#form-error { flex: none; margin: 0; padding: 0 24px; }
#form-error:empty { display: none; }
.form-actions { position: sticky; bottom: 0; flex: none; margin: 0; padding: 16px 24px max(16px,env(safe-area-inset-bottom)); }
@media (max-width: 767px) {
  dialog { inset: auto 0 var(--keyboard-inset,0px); width: 100%; max-width: none; max-height: var(--dialog-height,calc(100dvh - 12px)); margin: 0; border-radius: 16px 16px 0 0; }
  .dialog-head { top: 0; margin: 0; padding: 16px 20px 12px; }
  #form-fields { padding: 18px 20px; }
  .form-actions { bottom: 0; margin: 0; padding: 12px 20px max(12px,env(safe-area-inset-bottom)); }
  .global-log { position: fixed; right: 16px; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 25; min-height: 52px; padding: 14px 18px; border: 0; background: var(--deep); color: #fff; box-shadow: 0 6px 20px rgba(10,50,40,.2); }
  .global-log:hover { background: #083f36; color: #fff; }
  .workspace > footer { padding-bottom: calc(164px + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(156px + env(safe-area-inset-bottom)); z-index: 40; }
  .starter-options { flex-direction: column; }
  .backup-panel, .onboarding { padding: 20px; }
  .backup-panel .primary { width: 100%; }
}

.startup-help { max-width: 60ch; font-size: .875rem; line-height: 1.6; }
.startup-help a { text-decoration: underline; text-underline-offset: 3px; }
#main h1:focus-visible { outline: 3px solid #0a5346; outline-offset: 5px; border-radius: 3px; }
input, select, textarea { border-color: #73877d; }

.vision-integrated { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.vision-integrated h4, .vision-result-card h4 { margin: 0 0 8px; font-size: 1rem; }
.vision-integrated .check-label { align-items: flex-start; margin-block: 16px; }
#vision-status { font-size: .875rem; line-height: 1.5; }
.vision-result-card { margin-block: 16px; padding: 16px; background: #edf5f1; border-radius: 12px; overflow-wrap: anywhere; }
.vision-result-card p:empty { display: none; }
.vision-result-card ul { padding-left: 20px; }
