:root {
  --bg: #f6f7f8; --surface: #fff; --surface-2: #eef0f2; --ink: #101214; --muted: #667079; --line: #e2e5e8;
  --primary: #101214; --on-primary: #fff; --accent: #d9480f; --pointer: #d9480f;
  --shadow: 0 1px 2px rgba(16, 18, 20, .05), 0 12px 28px -18px rgba(16, 18, 20, .28);
  --sans: Inter, "SF Pro Text", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bar-h: 58px; --nav-h: 64px; --gutter: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0d0f; --surface: #15171a; --surface-2: #1c1f23; --ink: #f3f4f6; --muted: #98a1aa; --line: #272b30;
    --primary: #f3f4f6; --on-primary: #101214; --accent: #ff8a4c; --pointer: #ff8a4c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 28px -18px #000;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-weight: 650; margin: 0; line-height: 1.15; letter-spacing: -.02em; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.eyebrow { margin: 0 0 6px; font-size: 13px; color: var(--muted); font-weight: 550; }
.approx { color: var(--accent); font-weight: 700; }

.brand { position: sticky; top: 0; z-index: 15; height: calc(var(--bar-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) var(--gutter) 0; display: flex; align-items: center; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.brand a { display: flex; align-items: center; gap: 5px; }
.brand img { display: block; border-radius: 50%; margin-right: 5px; }
.brand span { color: var(--muted); font-weight: 500; }
main { max-width: 1200px; margin: auto; }

.hero { padding: 26px var(--gutter) 12px; }
.hero h1 { font-size: clamp(28px, 7vw, 42px); letter-spacing: -.03em; }
.search { display: flex; align-items: center; gap: 10px; margin-top: 16px; height: 50px; padding: 0 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); max-width: 640px; transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 10%, transparent); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: 0; color: var(--ink); font: 16px var(--sans); }
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: var(--muted); }
.clear[hidden] { display: none; }
.clear { width: 36px; height: 36px; display: grid; place-items: center; margin-right: -6px; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px var(--gutter); scrollbar-width: none; position: sticky; top: calc(var(--bar-h) + env(safe-area-inset-top)); z-index: 5; background: var(--bg); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 38px; padding: 0 14px; border-radius: 10px; color: var(--muted); font-weight: 550; font-size: 14px; white-space: nowrap; transition: background .15s, color .15s; }
.chip[aria-selected="true"] { background: var(--primary); color: var(--on-primary); }
@media (hover: hover) { .chip:hover:not([aria-selected="true"]) { background: var(--surface-2); color: var(--ink); } }
.subrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px var(--gutter) 14px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.tags { display: flex; gap: 6px; }
.tag { min-height: 32px; padding: 0 10px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--muted); border: 1px solid var(--line); }
.tag[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; padding: 0 var(--gutter) 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 18px; } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { display: flex; flex-direction: column; min-width: 0; }
.card:active { opacity: .85; }
.thumb { padding: 12px 12px 6px; aspect-ratio: 720 / 908; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); border-radius: 14px; overflow: hidden; }
.thumb .diagram { height: 100%; width: 100%; }
/* Cards match the usual 720x908 photo. Other shapes show whole over a blurred copy of themselves. */
.thumb.photo { position: relative; padding: 0; }
.thumb.photo img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; transition: transform .35s ease; }
.thumb.photo .fill { object-fit: cover; filter: blur(16px); transform: scale(1.15); }
.thumb.photo .whole { object-fit: contain; }
@media (hover: hover) { .card:hover .whole { transform: scale(1.025); } }
.card-body { padding: 10px 2px 0; }
.card h3 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.card p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.empty { grid-column: 1 / -1; color: var(--muted); padding: 30px 8px; text-align: center; }

.detail { padding: 0 0 12px; }
.topbar { display: flex; justify-content: space-between; padding: 12px var(--gutter); }
.iconbtn { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); }
.iconbtn.on { color: var(--accent); } .iconbtn.on .ic { fill: currentColor; }
.art { margin: 0 var(--gutter); padding: 18px 12px; background: var(--surface-2); border-radius: 18px; }
.figure { max-width: 460px; margin: auto; }
.figures { display: grid; grid-auto-flow: column; grid-auto-columns: 88%; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.figures::-webkit-scrollbar { display: none; }
.figures figure { margin: 0; scroll-snap-align: center; min-width: 0; }
figcaption { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
figcaption span { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); font-size: 12px; }
@media (min-width: 620px) { .figures { grid-auto-flow: row; grid-template-columns: 1fr 1fr; grid-auto-columns: auto; overflow: visible; } }
.diagram { display: block; width: 100%; height: auto; font-family: var(--sans); color: var(--ink); }
.info { padding: 22px var(--gutter) 0; }
.info h1 { font-size: clamp(26px, 6vw, 36px); letter-spacing: -.03em; }
.desc { color: var(--muted); margin: 8px 0 18px; }
.info h2, .guide-page h2 { font-size: 18px; margin: 26px 0 6px; letter-spacing: -.01em; }
@media (min-width: 900px) {
  .detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; padding: 0 var(--gutter); align-items: start; }
  .art { position: sticky; top: calc(var(--bar-h) + 14px); margin: 0; padding: 26px; }
  .art:has(.figures) { position: static; }
  .figures { grid-template-columns: 1fr; }
  .info { padding: 0; }
}

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; background: var(--surface-2); border-radius: 12px; margin-bottom: 18px; }
.seg button { padding: 8px 6px; border-radius: 10px; font-weight: 600; font-size: 15px; line-height: 1.25; color: var(--muted); }
.seg small { display: block; font-weight: 450; font-size: 12px; color: var(--muted); }
.seg [aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

.sizes { display: flex; gap: 8px; margin-bottom: 4px; }
.sizes button { flex: 1; min-width: 0; max-width: 112px; height: 60px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); line-height: 1.15; }
.sizes b { font-weight: 650; font-size: 18px; letter-spacing: -.02em; display: block; } .sizes small { font-size: 11px; white-space: nowrap; color: var(--muted); }
.sizes [aria-checked="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.sizes [aria-checked="true"] small { color: inherit; opacity: .75; }

.ing { list-style: none; margin: 0; padding: 0; }
.ing span, .steps .txt { min-width: 0; overflow-wrap: anywhere; }
.ing li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.ing li:last-child { border-bottom: 0; }
.ing strong { text-align: right; font-weight: 600; }
.ing strong small { display: block; font-weight: 450; font-size: 12.5px; color: var(--muted); }
.steps { list-style: none; margin: 0; padding: 0; }
.steps label { display: flex; gap: 12px; padding: 9px 0; cursor: pointer; align-items: flex-start; }
.steps input { position: absolute; opacity: 0; }
.num { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 600; font-size: 14px; background: var(--surface-2); margin-top: -2px; }
.steps input:checked ~ .num { background: var(--primary); color: var(--on-primary); }
.steps input:checked ~ .txt { color: var(--muted); text-decoration: line-through; }
.steps input:focus-visible ~ .num { outline: 2px solid var(--accent); outline-offset: 2px; }
.note { display: block; margin: 16px 0 0; padding: 12px 14px; background: var(--surface-2); border-radius: 12px; font-size: 15px; }
.note.link { font-weight: 600; }
.serves { color: var(--muted); margin: 0; font-size: 14px; }
.wake { width: 100%; min-height: 48px; margin-top: 22px; border-radius: 12px; border: 1px solid var(--line); color: var(--muted); font-weight: 550; font-size: 15px; }
.wake.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

.page { padding: 24px var(--gutter); }
.page h1 { font-size: clamp(28px, 7vw, 40px); letter-spacing: -.03em; margin-bottom: 18px; }
.page .grid { padding: 0; }
.stack { display: grid; gap: 8px; max-width: 720px; }
.fold { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
.fold summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; align-items: center; min-height: 56px; font-weight: 600; }
.fold summary::-webkit-details-marker { display: none; }
.fold small { font-weight: 400; font-size: 13px; color: var(--muted); text-align: right; }
.fold[open] { padding-bottom: 10px; }
.guide { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.panel h2 { font-size: 17px; margin-bottom: 4px; letter-spacing: -.01em; } .panel p { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 16px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.switch-row b { display: block; font-weight: 600; }
.switch-row small { color: var(--muted); font-size: 13px; }
.switch { flex: none; width: 48px; height: 28px; border-radius: 99px; background: var(--line); padding: 3px; transition: background .15s; }
.switch span { display: block; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"] span { transform: translateX(20px); }

.sect { font-size: 20px; margin: 30px 0 12px; }
.glist { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.glist a { display: flex; align-items: center; min-height: 52px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-weight: 550; font-size: 15px; }
@media (hover: hover) { .glist a:hover { border-color: var(--ink); } }
.guide-page { max-width: 720px; margin: auto; }
.guide-page h1 { margin: 6px 0 10px; }
.guide-page .iconbtn { margin-bottom: 16px; }
.gsteps { list-style: none; margin: 0; padding: 0; }
.gsteps li { display: flex; gap: 12px; padding: 10px 0; }
.gsteps h3 { font-size: 16px; font-weight: 600; margin: 2px 0 4px; letter-spacing: -.01em; } .gsteps p { margin: 4px 0 0; color: var(--muted); }

.nav { position: fixed; inset: auto 0 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11.5px; font-weight: 550; color: var(--muted); }
.nav a[aria-current="page"] { color: var(--ink); }
@media (min-width: 900px) {
  :root { --gutter: 24px; }
  .brand { padding-inline: max(24px, calc((100vw - 1200px) / 2 + 24px)); }
  .nav { inset: 0 max(24px, calc((100vw - 1200px) / 2 + 24px)) auto auto; display: flex; gap: 2px; align-items: center; width: auto; height: var(--bar-h); padding: 0; background: none; backdrop-filter: none; border: 0; }
  .nav a { flex-direction: row; gap: 7px; height: 38px; padding: 0 12px; border-radius: 10px; font-size: 14px; }
  .nav a[aria-current="page"] { background: var(--surface-2); }
  .nav .ic { width: 18px; height: 18px; }
  .chips { flex-wrap: wrap; overflow: visible; }
  body { padding-bottom: 40px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
