/* liquor.dev - IDE-styled cocktail repo. One stylesheet, system monospace stack, no web fonts. */

:root {
  color-scheme: dark;
  --editor: #14110F;
  --well: #100D0B;
  --panel: #1D1916;
  --panel-2: #26211D;
  --panel-3: #312B26;
  --amber: #E8A33D;
  --amber-hi: #F4B958;
  --mint: #7FD6A8;
  --rose: #F07178;
  --sky: #82AAFF;
  --sky-hi: #A9C3FF;
  --text: #EDE6DA;
  --dim: #A79E92;
  --ink: #14110F;
  --line: #3A342E;
  --edge: #70675B;

  --font: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;
  --fs: clamp(0.875rem, 0.84rem + 0.18vw, 1rem);
  --lh: 1.75;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;

  --head-h: 80px;
  --tabbar-h: 56px;
  --status-h: 28px;
  --side-w: clamp(250px, 19vw, 300px);
  --map-w: 104px;
  --liq: var(--amber);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 16px); }
body {
  margin: 0;
  background: var(--editor);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs);
  line-height: var(--lh);
  overflow-x: clip;
  padding-bottom: var(--status-h);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--sky); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--sky-hi); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; border-radius: 3px; }
::selection { background: rgba(232, 163, 61, 0.35); color: var(--text); }
h1, h2, h3, p, ul, ol, figure, pre { margin: 0; }
strong { color: var(--text); font-weight: 700; }
code { font-family: inherit; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -80px; z-index: 200; background: var(--amber); color: var(--ink);
  padding: 10px 16px; border-radius: 6px; font-weight: 700; text-decoration: none;
}
.skip:focus { top: 8px; outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- title bar + tabs ---------- */
.site-head {
  position: sticky; top: 0; z-index: 60; background: var(--panel);
  box-shadow: 0 1px 0 var(--line), 0 8px 20px -12px #000;
}
.titlebar {
  height: 38px; display: flex; align-items: center; gap: 14px; padding: 0 14px; position: relative;
  background: linear-gradient(180deg, #221D19, var(--panel)); border-bottom: 1px solid var(--line);
}
.dots { display: inline-flex; gap: 7px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--panel-3); box-shadow: inset 0 0 0 1px var(--edge); }
.dots i:nth-child(1) { background: var(--rose); box-shadow: none; }
.dots i:nth-child(2) { background: var(--amber); box-shadow: none; }
.dots i:nth-child(3) { background: var(--mint); box-shadow: none; }
.brand {
  color: var(--amber); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  min-height: 38px; letter-spacing: 0.01em;
}
.brand:hover { color: var(--amber-hi); text-decoration: underline; }
.brand-mark { color: var(--mint); font-weight: 700; }
.title-file { position: absolute; left: 50%; transform: translateX(-50%); color: var(--dim); font-size: 0.8125rem; white-space: nowrap; }
.explorer-btn {
  display: none; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; background: var(--panel-2);
  color: var(--text); border: 1px solid var(--edge); border-radius: 6px; font: inherit; font-size: 0.8125rem; cursor: pointer;
}
.explorer-btn:hover { background: var(--panel-3); }

.tabs { display: flex; height: 42px; background: var(--panel); overflow: hidden; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 0 18px; min-height: 42px; color: var(--dim);
  text-decoration: none; border-right: 1px solid var(--line); border-top: 2px solid transparent; font-size: 0.875rem;
  white-space: nowrap;
}
.tab:hover { background: var(--panel-2); color: var(--text); }
.tab.is-active { background: var(--editor); color: var(--text); border-top-color: var(--amber); font-weight: 700; }
.tab-ext { color: var(--dim); font-weight: 400; }
.is-active .tab-ext { color: var(--dim); }
.ico { flex: none; }
.t-sky { color: var(--sky); } .t-amber { color: var(--amber); } .t-mint { color: var(--mint); }
.t-rose { color: var(--rose); } .t-dim { color: var(--dim); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); align-items: start; }
.sidebar {
  position: sticky; top: var(--head-h); height: calc(100vh - var(--head-h) - var(--status-h)); overflow: auto;
  background: var(--panel); border-right: 1px solid var(--line); padding: 12px 8px 16px;
  scrollbar-width: thin; scrollbar-color: var(--edge) transparent;
}
.side-title {
  font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); padding: 4px 10px 8px; font-weight: 700;
}
.tree ul, .outline ul { list-style: none; margin: 0; padding: 0; }
.tree ul ul { margin-left: 16px; border-left: 1px solid var(--line); }
.tree-row {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 0 10px; color: var(--text);
  text-decoration: none; border-radius: 6px; background: none; border: 0; font: inherit; font-size: 0.8125rem;
  text-align: left; cursor: pointer; line-height: 1.2; overflow-wrap: anywhere;
}
.tree-row:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.tree-row.is-active { background: var(--editor); box-shadow: inset 3px 0 0 var(--amber); font-weight: 700; }
.tree-row.sub { padding-left: 8px; }
.chev { transition: transform 0.15s ease; flex: none; color: var(--dim); }
[aria-expanded="true"] > .chev { transform: rotate(90deg); }
.outline { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 12px; }
.outline-row { color: var(--sky); text-decoration: none; font-size: 0.8125rem; display: flex; }
.outline-row:hover { color: var(--sky-hi); text-decoration: underline; }
.side-note { margin: 20px 10px 0; font-size: 0.75rem; line-height: 1.5; color: var(--dim); border-top: 1px dashed var(--line); padding-top: 12px; }

.stage { min-width: 0; display: flex; flex-direction: column; min-height: calc(100vh - var(--head-h) - var(--status-h)); }
.editor {
  container-type: inline-size; container-name: ed; flex: 1 0 auto;
  width: 100%; max-width: 1080px; margin-inline: auto; padding: 20px clamp(16px, 3vw, 48px) 64px; outline: none;
  background-image: repeating-linear-gradient(0deg, rgba(237, 230, 218, 0.014) 0 1px, transparent 1px 4px);
}
.pathbar { font-size: 0.8125rem; color: var(--dim); display: flex; gap: 8px; padding: 0 0 18px; flex-wrap: wrap; }
.pathbar span:last-child { color: var(--text); }
.pathbar .sep { color: var(--edge); }

.minimap {
  display: none; position: sticky; top: var(--head-h); width: var(--map-w); height: calc(100vh - var(--head-h) - var(--status-h));
  background: var(--well); border-left: 1px solid var(--line); overflow: hidden; cursor: pointer; touch-action: none; align-self: start;
}
.minimap canvas { display: block; }
.mm-view {
  position: absolute; left: 0; right: 0; top: 0; height: 40px; background: rgba(232, 163, 61, 0.16);
  border-top: 1px solid var(--amber); border-bottom: 1px solid var(--amber); pointer-events: none;
}

/* ---------- code lines ---------- */
.file { counter-reset: ln; font-size: 1em; }
.l {
  counter-increment: ln; display: grid; grid-template-columns: 3.4ch minmax(0, 1fr); column-gap: 18px;
  align-items: baseline; margin: 0; padding: 0 8px 0 0; min-height: calc(var(--lh) * 1em); position: relative;
}
.l::before {
  content: counter(ln); text-align: right; color: var(--dim); font-size: var(--fs); font-weight: 400; font-style: normal;
  font-variant-numeric: tabular-nums; user-select: none; -webkit-user-select: none;
}
.l:hover { background: rgba(237, 230, 218, 0.035); }
.l:hover::before { color: var(--text); }
.l .t { --ind: 0ch; --hang: 0ch; display: block; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; padding-left: calc(var(--ind) + var(--hang)); text-indent: calc(var(--hang) * -1); }
.l.i1 { --ind: 2ch; } .l.i2 { --ind: 4ch; }
.l.i1 .t { --ind: 2ch; } .l.i2 .t { --ind: 4ch; }
.l.hang .t, .l.cl .t { --hang: 3ch; }
.blank { min-height: calc(var(--lh) * 1em); }

.kw { color: var(--rose); }
.st { color: var(--mint); }
.nu { color: var(--amber); }
.id { color: var(--sky); }
.cm { color: var(--dim); font-style: italic; }
.pn { color: var(--dim); }
.est { color: var(--amber); font-weight: 700; font-style: normal; }

.md-mark { color: var(--dim); font-weight: 400; }
.md-h1 .t, .md-h2 .t, .md-h3 .t { font-weight: 700; }
.md-h1 { margin: 0; line-height: 1.25; min-height: 0; }
.md-h1 .t { color: var(--amber); font-size: clamp(1.7rem, 1.1rem + 2.6vw, 3rem); letter-spacing: -0.01em; }
.md-h1 .md-mark { color: var(--dim); }
.md-h2 { margin: 0; line-height: 1.4; }
.md-h2 .t { color: var(--sky); font-size: clamp(1.15rem, 1rem + 0.8vw, 1.6rem); }
.md-h3 { margin: 0; }
.md-h3 .t { color: var(--mint); font-size: clamp(1rem, 0.95rem + 0.3vw, 1.2rem); }
.md-p .t { color: var(--text); }
.md-quote .t { color: var(--text); }
.md-quote::before { color: var(--dim); }
.md-code { color: var(--mint); background: var(--panel-2); padding: 0 6px; border-radius: 4px; }
.md-list { list-style: none; padding: 0; margin: 0; }
.fence .t, .md-lang { color: var(--dim); }
.md-lang { margin-left: 0; }
.sh .t { color: var(--text); }
.prompt { color: var(--mint); }

.lint {
  margin: 8px 0 0 calc(3.4ch + 18px); padding: 14px 16px; background: var(--panel); border: 1px solid var(--line);
  border-left: 4px solid var(--amber); border-radius: 0 8px 8px 0; box-shadow: 0 10px 24px -16px #000;
}
.lint .l { display: block; grid-template-columns: none; padding: 4px 0; }
.lint .l::before { display: none; counter-increment: none; }
.lint .l { counter-increment: none; }
.lint .t { padding-left: 0; text-indent: 0; }
.lint-tag { display: inline-block; font-weight: 700; padding: 0 8px; margin-right: 6px; border-radius: 4px; background: var(--amber); color: var(--ink); font-size: 0.8125rem; letter-spacing: 0.04em; }

/* ---------- caret + typed ---------- */
.typed-wrap { display: inline-grid; vertical-align: baseline; }
.typed-wrap > * { grid-area: 1 / 1; }
.typed-ghost { visibility: hidden; }
.caret {
  display: inline-block; width: 0.55ch; height: 1.05em; margin-left: 2px; vertical-align: -0.12em; background: var(--amber);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }
.svg-caret { fill: #E8A33D; animation: blink 1.1s steps(1) infinite; }

/* ---------- buttons, fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--edge); border-radius: 8px; font: inherit;
  font-size: 0.9375rem; font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 2px 0 #0a0807, 0 8px 16px -8px rgba(0, 0, 0, 0.7);
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--panel-3); border-color: var(--amber); color: var(--text); text-decoration: none; }
.btn:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 1px 0 #0a0807; }
.btn-primary { background: var(--amber); color: var(--ink); border-color: #F3C06F; }
.btn-primary:hover { background: var(--amber-hi); color: var(--ink); border-color: #FFD8A0; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 0.8125rem; }
.cta .t { display: flex; flex-wrap: wrap; gap: 12px; padding: 4px 0; }

.field { margin: 0 0 var(--s4); padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend, .searchbox > label {
  display: block; font-size: 0.8125rem; color: var(--dim); margin-bottom: 6px; padding: 0; letter-spacing: 0.04em; font-weight: 700;
}
input[type="text"], input[type="search"], select, textarea {
  width: 100%; min-height: 44px; padding: 0 12px; background: var(--editor); color: var(--text); border: 1px solid var(--edge);
  border-radius: 8px; font: inherit; font-size: 0.9375rem; box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45);
}
textarea { padding: 10px 12px; resize: vertical; line-height: 1.5; min-height: 140px; }
input::placeholder, textarea::placeholder { color: var(--dim); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--dim); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: calc(100% - 19px) 20px, calc(100% - 14px) 20px; background-size: 5px 5px; background-repeat: no-repeat;
}
[aria-invalid="true"] { border-color: var(--rose); box-shadow: 0 0 0 2px var(--rose); }
.hint { font-size: 0.8125rem; color: var(--dim); margin-top: 6px; line-height: 1.5; }
.err { font-size: 0.875rem; color: var(--rose); margin-top: 8px; line-height: 1.5; font-weight: 700; }
.err::before { content: "error: "; }
.stepper { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 8px; }
.stepper input { text-align: center; font-weight: 700; font-size: 1.125rem; }
.step {
  min-height: 44px; background: var(--panel-2); color: var(--text); border: 1px solid var(--edge); border-radius: 8px;
  font: inherit; font-size: 1.25rem; cursor: pointer; font-weight: 700;
}
.step:hover { background: var(--panel-3); border-color: var(--amber); }
.step:active { transform: translateY(1px); }

.seg { display: inline-flex; position: relative; background: var(--editor); border: 1px solid var(--edge); border-radius: 9px; padding: 3px; gap: 3px; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.seg label {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; min-width: 76px; padding: 0 16px;
  color: var(--dim); cursor: pointer; border-radius: 6px; font-weight: 700; font-size: 0.9375rem; letter-spacing: 0;
}
.seg label:hover { color: var(--text); background: var(--panel-2); }
.seg input:checked + label { background: var(--amber); color: var(--ink); }
.seg input:checked + label::before { content: "\2713"; }
.seg input:focus-visible + label { outline: 2px solid var(--sky); outline-offset: 3px; }

.chipset { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 0 14px; background: var(--panel); color: var(--dim); border: 1px solid var(--edge); border-radius: 999px;
  font: inherit; font-size: 0.8125rem; font-weight: 700; cursor: pointer;
}
.chip:hover { color: var(--text); border-color: var(--text); }
.chip[aria-pressed="true"] { background: var(--sky); color: var(--ink); border-color: var(--sky); }
.chip[aria-pressed="true"]::before { content: "\2713\00a0"; }

.status { font-size: 0.875rem; color: var(--mint); margin-top: 10px; min-height: 1.4em; line-height: 1.5; }
.count { font-size: 0.8125rem; color: var(--dim); margin-left: auto; }
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 14px 16px; margin: 0 0 var(--s5);
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}

/* ---------- panels ---------- */
.panel {
  background: linear-gradient(180deg, var(--panel), #191512); border: 1px solid var(--line); border-radius: 12px; padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 2px 4px rgba(0, 0, 0, 0.4), 0 18px 36px -22px #000;
  min-width: 0;
}
.panel-title { font-size: 1rem; font-weight: 700; color: var(--mint); margin-bottom: 18px; display: flex; align-items: center; gap: 10px; letter-spacing: 0.02em; }
.jigger { color: var(--amber); }

/* ---------- hero (index) ---------- */
.hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px 32px; align-items: center; padding-bottom: 8px; }
.hero-copy { min-width: 0; }
.hero-art { margin: 0 auto; width: 100%; max-width: 380px; }
.hero-svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 24px 24px rgba(0, 0, 0, 0.45)); }
.f-rose { fill: #F07178; } .f-mint { fill: #7FD6A8; } .f-sky { fill: #82AAFF; } .f-amber { fill: #E8A33D; } .f-dim { fill: #A79E92; } .f-text { fill: #EDE6DA; }
.svg-ln text { fill: #A79E92; font-family: var(--font); }

/* ---------- footer ---------- */
.site-footer { margin-top: 24px; background: var(--panel); border-top: 1px solid var(--line); padding: 32px clamp(16px, 3vw, 48px) 36px; }
.foot-grid { max-width: 1080px; margin-inline: auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 28px 40px; font-size: 0.875rem; line-height: 1.6; }
.foot-brand { color: var(--amber); font-weight: 700; margin-bottom: 8px; font-size: 1rem; }
.foot-h { color: var(--dim); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700; margin-bottom: 8px; }
.foot-links { list-style: none; padding: 0; margin: 0; }
.foot-links a { display: inline-flex; align-items: center; min-height: 40px; }
.foot-col p + p { margin-top: 8px; }
.foot-col > p:nth-of-type(2) a { display: inline-flex; align-items: center; min-height: 40px; }
.honest { color: var(--mint); }
.rd { color: var(--dim); }

/* ---------- status bar ---------- */
.statusbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; height: var(--status-h); display: flex; align-items: stretch;
  background: var(--amber); color: var(--ink); font-size: 0.75rem; font-weight: 700; line-height: 1;
}
.sb-item { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; white-space: nowrap; color: var(--ink); }
.sb-link { text-decoration: underline; text-underline-offset: 3px; }
.sb-link:hover { background: var(--amber-hi); color: var(--ink); }
.sb-fill { flex: 1; }
.statusbar :focus-visible { outline: 2px solid var(--ink); outline-offset: -3px; }

/* ---------- recipes page ---------- */
.jump { margin: var(--s4) 0 var(--s4); display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: 0.875rem; }
.jump-h { color: var(--dim); }
.jump ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0 14px; }
.jump a { display: inline-flex; align-items: center; min-height: 40px; }
.cards { display: grid; gap: var(--s5); margin-bottom: var(--s7); }
.filecard {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: clip;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 2px 4px rgba(0, 0, 0, 0.4), 0 22px 40px -26px #000;
}
.filehead {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; align-items: center; padding: 14px 16px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border-bottom: 1px solid var(--line);
}
.glass { color: var(--text); --liq: var(--amber); }
.tone-rose { --liq: var(--rose); } .tone-mint { --liq: var(--mint); } .tone-sky { --liq: var(--sky); } .tone-amber { --liq: var(--amber); }
.filetitle { min-width: 0; }
.filetitle h2 { font-size: clamp(1.1rem, 1rem + 0.6vw, 1.45rem); line-height: 1.3; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.hname { color: var(--text); font-weight: 700; }
.fname { color: var(--dim); font-size: 0.8125rem; font-weight: 400; }
.chips { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-size: 0.75rem; color: var(--dim); border: 1px solid var(--edge); border-radius: 999px; padding: 1px 10px; }
.chips li:last-child { color: var(--amber); border-color: var(--amber); }
.fileactions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.code { background: var(--well); padding: 14px 0 14px 8px; overflow: hidden; }
.foldnote { padding: 14px 16px; color: var(--dim); background: var(--well); font-style: italic; font-size: 0.875rem; }
.guide { margin-top: 8px; }
.sprite { position: absolute; }

/* ---------- compiler page ---------- */
.cgrid { display: grid; gap: var(--s5); margin: var(--s5) 0 var(--s7); align-items: start; }
.cfg { padding-bottom: 8px; }
.adv { border: 1px dashed var(--edge); border-radius: 8px; margin: 0 0 var(--s4); }
.adv summary {
  display: flex; align-items: center; min-height: 44px; padding: 0 14px; cursor: pointer; font-weight: 700; color: var(--sky);
  font-size: 0.875rem; list-style: none;
}
.adv summary::-webkit-details-marker { display: none; }
.adv summary::before { content: "+"; display: inline-block; width: 1.6ch; color: var(--amber); }
.adv[open] summary::before { content: "-"; }
.adv summary:hover { color: var(--sky-hi); }
.adv-body { padding: 4px 14px 14px; }
.adv-body .btn { margin-top: 4px; }
.out-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 4px; }
.out-head .panel-title { margin-bottom: 0; }
.out-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 16px 0; }
.stat {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--well); border: 1px solid var(--line);
  border-radius: 10px; min-width: 0;
}
.stat.big { grid-column: 1 / -1; border-color: var(--amber); background: linear-gradient(180deg, #1c1610, var(--well)); }
.stat-label { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); font-weight: 700; }
.stat-val { font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.7rem); font-weight: 700; color: var(--amber); line-height: 1.2; overflow-wrap: anywhere; }
.stat.big .stat-val { font-size: clamp(2.1rem, 1.6rem + 2vw, 3.2rem); color: var(--amber); }
.stat-note { font-size: 0.8125rem; color: var(--dim); }
.gauge { position: relative; padding: 6px 0 22px; margin-top: 4px; }
.gauge-track {
  position: relative; height: 12px; border-radius: 6px; border: 1px solid var(--edge);
  background: linear-gradient(90deg, rgba(127, 214, 168, 0.35), rgba(232, 163, 61, 0.45), rgba(240, 113, 120, 0.55));
}
.gauge-marker {
  position: absolute; top: -8px; width: 4px; height: 26px; margin-left: -2px; background: var(--text); border-radius: 2px;
  box-shadow: 0 0 0 2px var(--editor); transition: left 0.35s ease;
}
.gauge-ticks { list-style: none; margin: 0; padding: 0; position: absolute; left: 0; right: 0; bottom: 0; height: 18px; font-size: 0.75rem; color: var(--dim); }
.gauge-ticks li { position: absolute; transform: translateX(-50%); }
.gauge-ticks li:first-child { transform: none; }
.gauge-ticks li:last-child { transform: translateX(-100%); }
.gauge-cap { font-size: 0.8125rem; color: var(--dim); margin-bottom: 12px; }
.gauge-cap span { color: var(--text); font-weight: 700; }
.mix { margin: 8px 0 16px; }
.mix-h { font-size: 0.8125rem; color: var(--dim); margin-bottom: 8px; font-weight: 700; }
.mix-bar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; border: 1px solid var(--edge); background: var(--well); }
.mix-seg { flex-basis: 0; min-width: 2px; border-right: 2px solid var(--well); transition: flex-grow 0.35s ease; }
.mix-seg:last-child { border-right: 0; }
.m0 { background: var(--amber); } .m1 { background: var(--sky); } .m2 { background: var(--mint); }
.m3 { background: var(--rose); } .m4 { background: var(--text); } .m5 { background: var(--dim); }
.mix-water { background-image: repeating-linear-gradient(135deg, rgba(20, 17, 15, 0.55) 0 3px, transparent 3px 7px); }
.mix-legend { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.8125rem; }
.mix-legend li { display: inline-flex; align-items: center; gap: 8px; min-height: 24px; }
.mix-sw { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--editor); flex: none; }
.mix-pct { color: var(--amber); font-weight: 700; }
.out-file { background: var(--well); border: 1px solid var(--line); border-radius: 10px; padding: 12px 0; margin-top: 8px; }
.o .t { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; white-space: normal; padding-left: 0; text-indent: 0; }
.o-c { grid-column: 1 / -1; font-size: 0.8125rem; padding-left: 2ch; line-height: 1.5; }
.o-c:empty { display: none; }
.o-b { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.o-wide { grid-column: 1 / -1; }
.fallback { margin-top: 10px; min-height: 160px; font-size: 0.8125rem; line-height: 1.5; }
.warn-line { margin-top: 14px; font-size: 0.8125rem; color: var(--text); border-left: 3px solid var(--amber); padding: 6px 12px; background: var(--well); border-radius: 0 6px 6px 0; line-height: 1.5; }
.notes { margin-top: 8px; }

/* ---------- pantry page ---------- */
.shelf { margin: 8px 0 var(--s5); padding: 18px 18px 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 36px -24px #000; }
.shelf-svg { display: block; width: 100%; max-width: 640px; height: auto; margin: 0 auto; }
.shelf figcaption { font-size: 0.8125rem; color: var(--dim); text-align: center; padding: 8px 0 8px; }
.pantry-tools { align-items: end; }
.searchbox { flex: 1 1 280px; min-width: 0; }
.searchrow { display: flex; gap: 8px; }
.searchrow input { flex: 1; min-width: 0; }
.empty { padding: 20px; border: 1px dashed var(--edge); border-radius: 10px; color: var(--text); background: var(--panel); margin-bottom: var(--s5); line-height: 1.6; }
.pantry-file section { margin: 0; }
.tbl-wrap { margin: 8px 0 0; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--well); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 0.875rem; counter-reset: row; }
.tbl th, .tbl td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); line-height: 1.55; }
.tbl thead th { background: var(--panel-2); color: var(--dim); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.tbl tbody th { color: var(--sky); font-weight: 700; }
.tbl tr:last-child th, .tbl tr:last-child td { border-bottom: 0; }
.tbl td:nth-child(2), .tbl td:nth-child(3) { white-space: nowrap; }
.tbl tbody tr:hover { background: rgba(237, 230, 218, 0.04); }
.yaml-list { list-style: none; padding: 0; margin: 4px 0 0; }
.yaml .t { color: var(--text); }

/* ---------- contact page ---------- */
.mailbox .hdr { display: grid; grid-template-columns: 6ch minmax(0, 1fr); gap: 12px; align-items: center; margin-bottom: var(--s4); min-height: 44px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.hdr-k { color: var(--rose); font-weight: 700; }
.hdr-v a, .hdr-note a { display: inline-flex; align-items: center; min-height: 40px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.preview-wrap { margin-top: 20px; }
.preview { background: var(--well); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font-family: inherit; font-size: 0.8125rem; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); line-height: 1.6; max-height: 300px; overflow: auto; }
.faq-art figure { margin: 0; text-align: center; }
.env-svg { display: block; width: 100%; max-width: 280px; height: auto; margin: 0 auto; filter: drop-shadow(0 14px 14px rgba(0, 0, 0, 0.45)); }
.faq-art figcaption { font-size: 0.8125rem; color: var(--dim); padding-top: 10px; }
.hdr-note { margin-top: 14px; font-size: 0.875rem; text-align: center; }

/* ---------- breakpoints ---------- */
@media (min-width: 1100px) {
  .shell { grid-template-columns: var(--side-w) minmax(0, 1fr) var(--map-w); }
  .minimap { display: block; }
}

@container ed (min-width: 860px) {
  .cgrid { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); }
  .contact-grid { grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); }
  .filehead { grid-template-columns: auto minmax(0, 1fr) auto; }
  .fileactions { grid-column: auto; }
}
@container ed (max-width: 640px) {
  .tbl, .tbl tbody, .tbl tr, .tbl td, .tbl th { display: block; }
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .tbl tr:last-child { border-bottom: 0; }
  .tbl th, .tbl td { border: 0; padding: 3px 14px; }
  .tbl td:nth-child(2), .tbl td:nth-child(3) { white-space: normal; }
  .tbl td::before { content: attr(data-label) ": "; color: var(--dim); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
}

@media (max-width: 859px) {
  :root { --head-h: 48px; --status-h: 40px; }
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  .titlebar { height: 48px; padding: 0 12px; }
  .dots, .title-file { display: none; }
  .explorer-btn { display: inline-flex; }
  .brand { margin-left: auto; }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; height: auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    border-top: 1px solid var(--edge); padding-bottom: env(safe-area-inset-bottom, 0px); box-shadow: 0 -10px 24px -12px #000;
  }
  .tab {
    flex-direction: column; justify-content: center; gap: 3px; padding: 6px 2px; min-height: var(--tabbar-h); font-size: 0.75rem;
    border-right: 0; border-top: 3px solid transparent; text-align: center;
  }
  .tab-ext { display: none; }
  .shell { display: block; }
  .sidebar {
    position: fixed; top: var(--head-h); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); left: 0; height: auto;
    width: min(86vw, 330px); z-index: 75; transform: translateX(-102%); visibility: hidden;
    transition: transform 0.2s ease, visibility 0s linear 0.2s; box-shadow: 12px 0 30px -10px #000;
  }
  .explorer-open .sidebar { transform: none; visibility: visible; transition-delay: 0s; }
  .statusbar { position: static; height: auto; min-height: var(--status-h); flex-wrap: wrap; }
  .sb-long { display: none; }
  .editor { padding-top: 14px; }
  .lint { margin-left: 0; }
  .l { column-gap: 12px; grid-template-columns: 3ch minmax(0, 1fr); }
  .stage { min-height: 0; }
}
@media (max-width: 480px) {
  .btn-row .btn, .cta .btn, .out-actions .btn { flex: 1 1 100%; }
  .toolbar { padding: 12px; }
  .count { margin-left: 0; }
  .panel { padding: 16px; }
}

/* ---------- print ---------- */
@media print {
  :root { --editor: #fff; --well: #fff; --panel: #fff; --panel-2: #f2f2f2; --panel-3: #e8e8e8; --text: #000; --dim: #444; --amber: #7a4a00; --mint: #0b5a36; --rose: #a01824; --sky: #1a3f9c; --line: #bbb; --edge: #888; }
  body { background: #fff; color: #000; padding: 0; font-size: 11pt; }
  .skip, .site-head, .sidebar, .minimap, .statusbar, .toolbar, .fileactions, .out-actions, .btn-row, .cta, .jump, .explorer-btn, .shelf, .caret, .adv, .hero-art { display: none !important; }
  .shell, .stage { display: block; }
  .editor { max-width: none; padding: 0; background: none; }
  .filecard, .panel, .tbl, .stat, .out-file { box-shadow: none; background: #fff; break-inside: avoid; }
  .l:hover { background: none; }
  a { color: #000; text-decoration: underline; }
  .site-footer { background: #fff; border-top: 1px solid #888; padding: 12px 0; }
  .pantry-file section { break-inside: avoid-page; }
  .mix-bar, .mix-seg { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

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