:root {
  color-scheme: light;
  --ink: #1f2925;
  --muted: #6c756e;
  --paper: #f4f1e9;
  --card: #fffdf7;
  --line: #ddd9ce;
  --moss: #5b755d;
  --moss-dark: #3e5743;
  --ochre: #c18b4a;
  --ochre-pale: #f0e4cf;
  --soft-accent: #e5eadc;
  --selected: #edf0e8;
  --header-glow: #e8e7d9;
  --highlight-muted: #d9e5d3;
  --accent-text: #fff;
  --shadow: 0 18px 50px rgba(48, 53, 43, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

html[data-theme="night"] {
  color-scheme: dark;
  --ink: #e8e5dc;
  --muted: #a5aaa2;
  --paper: #171b1a;
  --card: #202623;
  --line: #3a443e;
  --moss: #9ebd8f;
  --moss-dark: #bfd5ad;
  --ochre: #e3ad63;
  --ochre-pale: #493b2a;
  --soft-accent: #304034;
  --selected: #2c3a30;
  --header-glow: #29352e;
  --highlight-muted: #d6e8ca;
  --accent-text: #263229;
  --shadow: 0 18px 50px rgba(0, 0, 0, .24);
}

html[data-theme="clay"] {
  color-scheme: light;
  --ink: #332622;
  --muted: #806f68;
  --paper: #f5ebe2;
  --card: #fffaf4;
  --line: #e1cfc2;
  --moss: #a65d45;
  --moss-dark: #793e31;
  --ochre: #b27a38;
  --ochre-pale: #f2dfc5;
  --soft-accent: #f0ddd1;
  --selected: #f6e5da;
  --header-glow: #f0dcd0;
  --highlight-muted: #f2d9cc;
  --accent-text: #fff;
  --shadow: 0 18px 50px rgba(93, 52, 37, .1);
}

html[data-theme="night-fire"] {
  color-scheme: dark;
  --ink: #d0bca8;
  --muted: #a48e7b;
  --paper: #1c1715;
  --card: #29201b;
  --line: #49372c;
  --moss: #c56b3f;
  --moss-dark: #e6a074;
  --ochre: #e09a45;
  --ochre-pale: #4a2d22;
  --soft-accent: #4a2d22;
  --selected: #3b2922;
  --header-glow: #3b241c;
  --highlight-muted: #f0c39d;
  --accent-text: #2f1d18;
  --shadow: 0 18px 50px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 80% 0%, var(--header-glow) 0, transparent 32rem), var(--paper); }
a { color: var(--moss-dark); text-underline-offset: 3px; }
button, input { font: inherit; }
.site-header, .page-shell, .site-footer { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.site-header { display: flex; align-items: center; gap: 14px; padding: 34px 0 46px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: var(--accent-text); background: var(--moss); font-size: 21px; box-shadow: 0 8px 16px rgba(62, 87, 67, .18); }
.site-header h1 { margin: 2px 0 0; font-family: Georgia, serif; font-size: 20px; font-weight: 600; letter-spacing: -.03em; }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.theme-control { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.theme-control label { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.theme-control select { border: 1px solid var(--line); border-radius: 9px; padding: 9px 28px 9px 10px; color: var(--ink); background: var(--card); font-size: 11px; cursor: pointer; }
.theme-control select:focus-visible { outline: 3px solid rgba(193, 139, 74, .7); outline-offset: 3px; }
.site-header .button { margin-left: auto; }
.button { border: 1px solid var(--line); border-radius: 9px; padding: 10px 15px; cursor: pointer; color: var(--ink); background: var(--card); font-size: 12px; font-weight: 700; transition: .2s ease; }
.button:hover, .button:focus-visible { border-color: var(--moss); background: var(--card); transform: translateY(-1px); }
.eyebrow { margin: 0; color: var(--moss); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; align-items: center; padding-bottom: 76px; }
.intro-panel h2 { margin: 15px 0 18px; font-family: Georgia, serif; font-size: clamp(42px, 6vw, 68px); font-weight: 500; line-height: .96; letter-spacing: -.055em; }
.intro-panel h2 span { color: var(--moss); }
.intro-copy { max-width: 410px; color: var(--muted); font-size: 15px; line-height: 1.65; }
.source-note { display: inline-flex; align-items: center; gap: 8px; margin-top: 25px; color: var(--muted); font-size: 11px; }
.source-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ochre); }
.input-card, .panel, .tip-panel { border: 1px solid var(--line); border-radius: 15px; background: var(--card); box-shadow: var(--shadow); }
.input-card { padding: 28px; }
.hide-preview { display: flex; align-items: center; gap: 12px; margin: 22px 0 4px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 13px; color: var(--muted); font-size: 10px; }
.hide-preview img { width: 54px; height: 54px; object-fit: contain; }
.card-heading, .section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.card-heading h2, .section-heading h2 { margin: 6px 0 0; font-family: Georgia, serif; font-size: 24px; font-weight: 500; letter-spacing: -.03em; }
.step-badge { display: inline-grid; place-items: center; min-width: 29px; height: 29px; border-radius: 50%; color: var(--moss-dark); background: var(--soft-accent); font-size: 10px; font-weight: 800; }
fieldset { margin: 29px 0 23px; padding: 0; border: 0; }
legend, .quantity-label { display: block; margin-bottom: 10px; color: var(--muted); font-size: 11px; font-weight: 700; }
.size-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.size-option { position: relative; display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 9px; padding: 12px; cursor: pointer; transition: .2s ease; }
.size-option:hover { border-color: var(--moss); }
.size-option.selected { border-color: var(--moss); background: var(--selected); box-shadow: inset 0 0 0 1px var(--moss); }
.size-option input { position: absolute; opacity: 0; }
.size-name { font-size: 13px; font-weight: 800; }
.size-detail { color: var(--muted); font-size: 10px; }
.quantity-row { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--ink); padding-bottom: 7px; }
.quantity-row input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-family: Georgia, serif; font-size: 30px; }
.quantity-row span { white-space: nowrap; color: var(--muted); font-size: 11px; }
.form-error { margin: 10px 0 0; color: #a34d3e; font-size: 11px; }
.summary-section { border-top: 1px solid var(--line); padding: 31px 0 22px; }
.rounding-note, .side-note { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.summary-grid { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 10px; margin-top: 23px; }
.metric-card { display: flex; flex-direction: column; min-height: 126px; border: 1px solid var(--line); border-radius: 11px; padding: 19px; background: var(--card); }
.metric-card.metric-highlight { border-color: var(--moss); background: var(--moss); color: var(--accent-text); }
.metric-label, .resource-unit { margin-bottom: auto; font-size: 9px; font-weight: 800; letter-spacing: .12em; opacity: .72; }
.metric-card strong { margin-top: 12px; font-family: Georgia, serif; font-size: 37px; font-weight: 500; letter-spacing: -.05em; }
.metric-card span:last-child { color: var(--muted); font-size: 11px; }.metric-highlight span:last-child { color: var(--highlight-muted); }
.details-grid { display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; }
.panel { padding: 25px; box-shadow: none; }
.section-heading.compact h2 { font-size: 20px; }
.panel-icon { color: var(--ochre); font-size: 29px; line-height: 1; }
.resource-list { list-style: none; padding: 0; margin: 25px 0 0; }
.resource-list li { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding: 14px 0; font-size: 12px; }
.resource-icon { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 7px; color: var(--moss-dark); background: var(--soft-accent); font-size: 14px; }
.resource-tool-image { width: 42px; height: 42px; object-fit: contain; }
.resource-list li div { flex: 1; }.resource-list strong { font-size: 16px; }.resource-list small { color: var(--muted); font-size: 11px; }.resource-unit { margin: 0; color: var(--muted); }
.resource-footnote { margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.timeline { list-style: none; margin: 26px 0 0; padding: 0; }.timeline li { display: grid; grid-template-columns: 58px 29px 1fr auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }.process-image { width: 58px; height: 58px; object-fit: contain; }.timeline-number { color: var(--moss); font-size: 10px; font-weight: 800; }.timeline strong { font-size: 12px; }.timeline p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }.timeline time, .timeline-total { color: var(--ochre); font-size: 11px; font-weight: 800; }
.tannin-panel { margin-top: 10px; }.tannin-grid { display: grid; grid-template-columns: 1fr 45px 1fr; align-items: center; margin-top: 24px; }.tannin-step { display: flex; align-items: center; gap: 13px; }.tannin-image { width: 52px; height: 52px; object-fit: contain; }.tannin-step h3 { margin: 0 0 3px; font-family: Georgia, serif; font-size: 17px; font-weight: 500; }.tannin-step p { margin: 0; color: var(--muted); font-size: 10px; }.tannin-step strong { margin-left: auto; font-family: Georgia, serif; font-size: 23px; font-weight: 500; }.tannin-arrow { color: var(--ochre); text-align: center; font-size: 21px; }
.tip-panel { display: flex; gap: 14px; align-items: center; margin: 10px 0 48px; padding: 17px 20px; box-shadow: none; }.tip-icon { display: grid; place-items: center; flex: 0 0 23px; width: 23px; height: 23px; border-radius: 50%; color: var(--accent-text); background: var(--ochre); font-size: 12px; font-weight: 800; }.tip-panel p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }.tip-panel strong { color: var(--ink); }
.site-footer { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding: 20px 0 30px; color: var(--muted); font-size: 10px; }.site-footer p { margin: 0; }.toast { position: fixed; right: 20px; bottom: 20px; transform: translateY(20px); opacity: 0; border-radius: 8px; padding: 12px 16px; color: #fff; background: var(--ink); font-size: 12px; pointer-events: none; transition: .25s ease; }.toast.visible { transform: translateY(0); opacity: 1; }
@media (max-width: 760px) { .site-header, .page-shell, .site-footer { width: min(100% - 28px, 560px); }.site-header { padding: 22px 0 34px; flex-wrap: wrap; }.site-header .button { margin-left: auto; padding: 8px 10px; font-size: 10px; }.theme-control { margin-left: auto; }.tagline { display: none; }.hero-grid, .details-grid { grid-template-columns: 1fr; gap: 32px; }.hero-grid { padding-bottom: 45px; }.intro-panel h2 { font-size: 51px; }.summary-grid { grid-template-columns: 1fr 1fr; }.metric-card.metric-highlight { grid-column: span 2; min-height: 105px; }.tannin-grid { grid-template-columns: 1fr; gap: 15px; }.tannin-arrow { transform: rotate(90deg); }.site-footer { flex-direction: column; gap: 8px; } }
@media (max-width: 460px) { .timeline li { grid-template-columns: 48px 24px 1fr; gap: 8px; }.process-image { width: 48px; height: 48px; }.timeline time { grid-column: 3; }.tannin-step strong { font-size: 18px; } }
@media (max-width: 400px) { .size-options { grid-template-columns: 1fr; }.input-card, .panel { padding: 20px; } }
:focus-visible { outline: 3px solid rgba(193, 139, 74, .7); outline-offset: 3px; }
