:root {
  --ink: #19352a;
  --muted: #687b73;
  --green: #173d2b;
  --green-2: #286044;
  --mint: #d8efdf;
  --lime: #ddef86;
  --cream: #f7f5ed;
  --paper: #fffef9;
  --line: #dde4dd;
  --danger: #a64132;
  --warning: #8b6514;
  --shadow: 0 18px 50px rgba(25, 53, 42, .09);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
}
* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 90% 0, #e7f2dc 0, transparent 28rem), var(--cream); }
body, input, select, textarea, button { font: inherit; }
a { color: var(--green-2); text-decoration: none; }
a:hover { color: var(--green); }
button, .button { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); padding: .72rem 1rem; font-weight: 750; cursor: pointer; display: inline-flex; justify-content: center; align-items: center; gap: .45rem; }
button:hover, .button:hover { border-color: var(--green-2); transform: translateY(-1px); }
button.primary, .button.primary { background: var(--green); border-color: var(--green); color: white; }
button.soft, .button.soft { background: var(--mint); border-color: transparent; color: var(--green); }
button.danger, .danger { color: var(--danger); border-color: #ebcbc4; background: #fff7f5; }
button.link { border: 0; background: transparent; padding: .25rem; color: var(--green-2); }
button.link.danger { color: var(--danger); }
.full { width: 100%; }
.skip-link { position: fixed; left: 1rem; top: -4rem; background: white; padding: 1rem; z-index: 100; }
.skip-link:focus { top: 1rem; }
.topbar { height: 78px; display: flex; align-items: center; gap: 2rem; padding: 0 max(2rem, calc((100vw - 1440px)/2)); background: rgba(255,254,249,.88); border-bottom: 1px solid rgba(221,228,221,.8); backdrop-filter: blur(20px); position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); }
.brand-mark { width: 40px; height: 40px; border-radius: 13px 5px 13px 5px; display: grid; place-items: center; color: var(--lime); background: var(--green); font-family: Georgia, serif; font-size: 1.45rem; font-weight: 900; }
.brand span:last-child { display: flex; flex-direction: column; line-height: 1.05; }
.brand small { color: var(--muted); margin-top: .25rem; font-size: .68rem; font-weight: 600; }
.brand.large .brand-mark { width: 54px; height: 54px; font-size: 2rem; }
.brand.large strong { font-size: 1.2rem; }
.desktop-nav { display: flex; gap: .15rem; margin: auto; }
.desktop-nav a { color: var(--muted); padding: .65rem .8rem; border-radius: 10px; font-weight: 700; font-size: .9rem; }
.desktop-nav a:hover { color: var(--ink); background: var(--mint); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: var(--green); font-weight: 900; }
.page { max-width: 1440px; margin: 0 auto; padding: 2rem; padding-bottom: 6rem; }
.page-auth { min-height: 100vh; max-width: none; display: grid; place-items: center; padding: 1rem; }
.toast { border-radius: 14px; padding: .9rem 1rem; margin-bottom: 1rem; font-weight: 700; box-shadow: var(--shadow); }
.toast.success { background: #e0f3e6; border: 1px solid #b9ddc5; }
.toast.error { background: #fff0ed; border: 1px solid #e7bdb5; color: #7a2f23; }
.eyebrow { font-size: .7rem; letter-spacing: .18em; font-weight: 900; color: var(--green-2); margin: 0 0 .45rem; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.1rem, 4vw, 4rem); line-height: .98; letter-spacing: -.04em; margin-bottom: .75rem; }
h2 { font-size: 1.15rem; letter-spacing: -.02em; }
.muted { color: var(--muted); line-height: 1.55; }
.legal, .hint { color: var(--muted); font-size: .76rem; }
.hero, .page-heading { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin: 1rem 0 2rem; }
.hero.compact h1 { font-size: clamp(2.3rem, 4.5vw, 4.7rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.page-heading h1 { font-size: clamp(2.2rem, 4vw, 3.7rem); }
.page-heading > div:first-child { max-width: 760px; }
.panel { background: rgba(255,254,249,.94); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: 0 5px 20px rgba(25,53,42,.035); }
.accent-panel { background: var(--green); color: white; border: none; }
.accent-panel .eyebrow, .accent-panel a { color: var(--lime); }
.accent-panel .muted, .accent-panel small { color: #c8d7cf; }
.warning-panel { background: #fff8e7; border-color: #eed9a1; }
.grid { display: grid; gap: 1.25rem; margin-bottom: 1.25rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.two-thirds { grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr); }
.grid.sidebar-layout { grid-template-columns: minmax(0, 2fr) minmax(300px, .78fr); align-items: start; }
.grid.three-equal { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.metrics { display: grid; gap: 1rem; margin-bottom: 1.25rem; }
.metrics.four { grid-template-columns: repeat(4, 1fr); }
.metrics article { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 1.1rem; }
.metrics span { display: block; color: var(--muted); font-size: .77rem; font-weight: 700; margin-bottom: .6rem; }
.metrics strong { font-size: 1.5rem; }
.metrics strong small { color: var(--muted); font-size: .8rem; font-weight: 600; }
.meter { height: 5px; background: #e8ede9; border-radius: 5px; margin-top: .7rem; overflow: hidden; }
.meter i { height: 100%; background: var(--green-2); display: block; border-radius: 5px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-head h2, .section-head p { margin-bottom: 0; }
.section-head a { font-size: .82rem; font-weight: 800; }
.pill { display: inline-flex; border-radius: 99px; padding: .3rem .65rem; background: var(--mint); color: var(--green); font-size: .7rem; font-weight: 850; white-space: nowrap; }
.pills, .macro-line { display: flex; flex-wrap: wrap; gap: .5rem; }
.macro-line span { flex: 1; min-width: 70px; background: rgba(216,239,223,.55); border-radius: 10px; padding: .5rem; text-align: center; font-size: .78rem; font-weight: 800; }
.macro-line.large span { padding: .75rem; }
.timeline, .card-list { display: flex; flex-direction: column; gap: .65rem; }
.meal-row { display: grid; grid-template-columns: 85px 1fr auto; align-items: center; gap: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 16px; }
.meal-row small, .mini-row small, td small, .stock-card small, .batch-row small { display: block; color: var(--muted); margin-top: .25rem; }
.meal-slot { font-size: .72rem; color: var(--muted); font-weight: 800; text-transform: uppercase; }
.status-eaten { opacity: .65; }
.status-eaten strong { text-decoration: line-through; }
.mini-row, .ingredient-row, .batch-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid rgba(221,228,221,.65); }
.accent-panel .mini-row { border-color: rgba(255,255,255,.15); }
.empty { text-align: center; padding: 2.4rem 1rem; color: var(--muted); border: 1px dashed #cbd6ce; border-radius: 16px; }
.empty strong { display: block; color: var(--ink); margin-bottom: .4rem; }
.auth-card { width: min(440px, 100%); background: var(--paper); border: 1px solid var(--line); border-radius: 30px; padding: clamp(1.5rem, 5vw, 2.8rem); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 1.8rem; }
label { display: flex; flex-direction: column; gap: .38rem; font-size: .76rem; color: var(--muted); font-weight: 750; }
input, select, textarea { width: 100%; border: 1px solid #cad5cd; background: #fff; color: var(--ink); border-radius: 11px; padding: .72rem .8rem; outline: none; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(40,96,68,.11); }
.check { flex-direction: row; align-items: center; gap: .55rem; }
.check input { width: 1.1rem; height: 1.1rem; }
.check.warning { color: var(--warning); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; align-items: end; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-grid.four { grid-template-columns: repeat(4, 1fr); }
.form-grid.six { grid-template-columns: repeat(5, 1fr); }
.compact-form { gap: .75rem; }
.inline, .search-row { display: flex; gap: .55rem; align-items: end; }
.inline > input, .search-row input { flex: 1; }
.tiny { width: 82px; display: inline-block; padding: .35rem; }
.icon-button { padding: .7rem; }
.sticky { position: sticky; top: 96px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 680px; }
th { text-align: left; color: var(--muted); font-size: .69rem; text-transform: uppercase; letter-spacing: .1em; }
th, td { padding: .85rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.dim { opacity: .5; }
details { margin-top: .75rem; }
summary { cursor: pointer; font-weight: 800; color: var(--green-2); }
.stock-card { display: grid; grid-template-columns: minmax(160px, 1fr) 100px 100px 100px auto; align-items: center; gap: 1rem; border: 1px solid var(--line); padding: 1rem; border-radius: 16px; }
.stock-card.overdue { border-color: #e4a89c; background: #fff9f7; }
.stock-qty { font-size: 1.35rem; font-weight: 900; }
.recipe-grid { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 1rem; }
.recipe-card { background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; padding: 1.1rem; min-height: 220px; display: flex; flex-direction: column; box-shadow: 0 4px 14px rgba(25,53,42,.03); }
.recipe-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.recipe-top, .recipe-card footer { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; }
.recipe-card h2 { font-family: Georgia, serif; font-size: 1.45rem; margin: 1.2rem 0 .4rem; }
.recipe-card footer { margin-top: auto; padding-top: 1rem; }
.back { display: inline-block; margin-bottom: 1rem; font-weight: 800; }
.recipe-hero { background: var(--green); color: white; border-radius: 30px; padding: clamp(1.5rem, 5vw, 3.5rem); display: flex; justify-content: space-between; align-items: end; margin-bottom: 1rem; }
.recipe-hero h1 { max-width: 760px; }
.recipe-hero .muted { color: #c8d7cf; }
.recipe-score { text-align: right; }
.recipe-score strong { display: block; font: 700 clamp(3rem, 8vw, 6rem)/.85 Georgia, serif; color: var(--lime); }
.recipe-score span { color: #c8d7cf; }
.steps { padding-left: 1.4rem; }
.steps li { padding: .4rem 0 .8rem .4rem; line-height: 1.5; }
.add-inline { margin-top: 1rem; padding-top: .75rem; border-top: 1px dashed var(--line); }
.batch-row { flex-wrap: wrap; }
.cook-panel hr { width: 100%; border: 0; border-top: 1px solid var(--line); }
.week-nav { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: .65rem; overflow-x: auto; padding-bottom: .5rem; }
.day-column { min-width: 150px; background: rgba(255,254,249,.8); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.day-column.today { border: 2px solid var(--green-2); }
.day-column > header { padding: .8rem; display: flex; justify-content: space-between; background: #eef3ec; }
.day-meals { padding: .55rem; min-height: 300px; display: flex; flex-direction: column; gap: .5rem; }
.plan-meal { border-radius: 12px; padding: .7rem; background: var(--paper); border: 1px solid var(--line); display: flex; flex-direction: column; gap: .25rem; }
.plan-meal > small { color: var(--green-2); font-weight: 850; text-transform: uppercase; font-size: .62rem; }
.plan-meal > span { color: var(--muted); font-size: .7rem; }
.meal-actions { margin-top: .3rem; border-top: 1px solid var(--line); padding-top: .35rem; }
.meal-actions form { display: flex; justify-content: space-between; }
.empty-slot { color: #9baba2; font-size: .75rem; text-align: center; padding: 1rem 0; }
.add-meal-panel { margin-top: 1rem; }
.code-input { font-family: "Cascadia Code", Consolas, monospace; font-size: .76rem; white-space: pre; }
.warning-text { color: #ffe08d; font-size: .78rem; }
.shopping-row { display: grid; grid-template-columns: 1fr auto minmax(80px, auto); gap: 1rem; align-items: center; border-bottom: 1px solid var(--line); padding: .9rem 0; }
.shop-check { flex-direction: row; align-items: center; color: var(--ink); }
.shop-check input { width: 1.2rem; height: 1.2rem; }
.target-number { font: 700 clamp(2.6rem, 6vw, 4.4rem)/1 Georgia, serif; margin: .5rem 0 1rem; }
.target-number small { font: 700 .9rem Inter, sans-serif; color: inherit; }
.weight-bars { height: 250px; display: flex; align-items: end; gap: .25rem; padding-top: 1rem; }
.weight-bars > div { height: 100%; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: end; min-width: 10px; }
.weight-bars i { width: 70%; min-height: 8px; background: linear-gradient(var(--green-2), var(--lime)); border-radius: 4px 4px 1px 1px; }
.weight-bars small { font-size: .55rem; transform: rotate(-55deg); transform-origin: center; margin-top: 1rem; white-space: nowrap; }
.tool-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.tool-links a { display: grid; grid-template-columns: 46px 1fr; grid-template-rows: auto auto; column-gap: .8rem; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 18px; padding: 1rem; }
.tool-links a > span { grid-row: 1/3; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--mint); font-size: 1.2rem; }
.tool-links small { color: var(--muted); }
.import-hero { position: relative; overflow: hidden; min-height: 310px; margin: 1rem 0 1.25rem; padding: clamp(1.6rem, 5vw, 4rem); border-radius: 34px; background: linear-gradient(135deg, #132d24 0%, #184d38 58%, #28734e 100%); color: white; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.import-hero::after { content: ""; position: absolute; inset: auto -12% -60% 35%; height: 310px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; transform: rotate(-9deg); }
.import-hero > div:first-child { position: relative; z-index: 2; max-width: 740px; }
.import-hero h1 { font-size: clamp(2.6rem, 6vw, 5.7rem); line-height: .92; margin-bottom: 1.2rem; }
.import-hero p:not(.eyebrow) { max-width: 650px; color: #d7e6dc; }
.import-orbit { position: relative; z-index: 2; flex: 0 0 180px; height: 180px; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; display: grid; place-items: center; }
.import-orbit::before, .import-orbit::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; }
.import-orbit::before { inset: 20px; }.import-orbit::after { inset: 45px; }
.import-orbit span { position: relative; z-index: 2; width: 62px; height: 62px; display: grid; place-items: center; padding-left: 4px; background: var(--lime); color: var(--green); border-radius: 50%; font-size: 1.35rem; box-shadow: 0 10px 35px rgba(0,0,0,.24); }
.import-orbit i, .import-orbit b { position: absolute; width: 13px; height: 13px; border-radius: 50%; background: #fff; }.import-orbit i { top: 12px; left: 24px; }.import-orbit b { right: 8px; bottom: 44px; background: var(--lime); }
.import-box { padding: clamp(1.3rem, 4vw, 2.2rem); }
.import-box h2 { font-size: 2rem; }
.import-box input[type="url"] { padding: 1rem; font-size: 1rem; background: #f9fbf8; }
.import-submit { min-height: 52px; display: flex; align-items: center; justify-content: space-between; font-size: .9rem; }
.import-submit span { font-size: 1.35rem; }
.import-flow { margin-top: .45rem; padding-top: 1.2rem; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); gap: .55rem; }
.import-flow span { color: var(--muted); font-size: .7rem; font-weight: 750; }.import-flow b { display: block; margin-bottom: .2rem; color: var(--green-2); font-size: .62rem; }
.import-rules ul { margin: 1rem 0 0; padding-left: 1.2rem; color: #6b5a2c; }.import-rules li { margin: .4rem 0; }
.import-history { display: flex; flex-direction: column; }.import-history > a { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: .8rem; padding: .9rem 0; color: var(--ink); border-bottom: 1px solid var(--line); }.import-history > a:last-child { border-bottom: 0; }.import-history small { display: block; margin-top: .25rem; color: var(--muted); }
.source-dot { width: 38px; height: 38px; display: grid; place-items: center; padding-left: 2px; border-radius: 50%; background: #151515; color: white; font-size: .72rem; }
.missing-banner { display: flex; align-items: center; gap: 1rem; padding: .9rem 1rem; margin-bottom: 1.25rem; border: 1px solid #edcf83; border-radius: 16px; background: #fff8e7; }.missing-banner > strong { color: #795c13; white-space: nowrap; }.missing-banner div { display: flex; flex-wrap: wrap; gap: .45rem; }.missing-banner span { border-radius: 99px; padding: .25rem .55rem; background: white; color: #795c13; font-size: .7rem; font-weight: 750; }
.evidence-editor textarea { min-height: 220px; line-height: 1.65; }.evidence-editor .section-head small { color: var(--muted); }
.source-card { padding: 0; overflow: hidden; }.source-card-head { display: flex; align-items: center; gap: .75rem; padding: 1rem 1rem 0; }.source-card-head small { display: block; color: var(--muted); font-size: .65rem; }.source-card .tiktok-embed { margin: .75rem auto 0 !important; }
.save-import-panel p { line-height: 1.5; }.source-evidence p, .source-evidence li { font-size: .82rem; line-height: 1.55; color: var(--muted); }.source-evidence h3 { margin: 1rem 0 .35rem; font-size: .85rem; }
.comment-evidence { margin: .7rem 0; padding: .75rem; border-left: 3px solid var(--green-2); background: #f6faf6; border-radius: 0 12px 12px 0; }.comment-evidence span { display: block; color: var(--green-2); font-size: .62rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }.comment-evidence p { margin: .2rem 0 .65rem; color: var(--ink); }.comment-evidence p:last-child { margin-bottom: 0; }
.imported-source-summary { margin-bottom: 1.25rem; display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; }.imported-source-summary ul { columns: 2; margin-bottom: 0; padding-left: 1.1rem; }.imported-source-summary li { margin: .35rem 1rem .35rem 0; }.imported-source-link { min-width: 190px; display: flex; align-items: center; gap: .7rem; padding: .85rem; background: var(--mint); border-radius: 16px; }.imported-source-link a { display: block; margin-top: .2rem; font-size: .72rem; font-weight: 800; }
.bottom-nav { display: none; }
.offline-card { text-align: center; align-items: center; }

@media (max-width: 1050px) {
  .desktop-nav { display: none; }
  .topbar { justify-content: space-between; padding: 0 1.2rem; }
  .recipe-grid { grid-template-columns: repeat(2, 1fr); }
  .grid.sidebar-layout { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .tool-links { grid-template-columns: repeat(2, 1fr); }
  .form-grid.six { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .topbar { height: 66px; }
  .page { padding: 1rem; padding-bottom: 7rem; }
  .hero, .page-heading, .recipe-hero { flex-direction: column; align-items: stretch; }
  .recipe-score { text-align: left; }
  .hero-actions .button { flex: 1; }
  .metrics.four { grid-template-columns: repeat(2, 1fr); }
  .grid.two, .grid.two-thirds, .grid.three-equal { grid-template-columns: 1fr; }
  .form-grid, .form-grid.three, .form-grid.four, .form-grid.six { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .recipe-grid { grid-template-columns: 1fr; }
  .meal-row { grid-template-columns: 60px 1fr; }
  .meal-row .pill { grid-column: 2; justify-self: start; }
  .stock-card { grid-template-columns: 1fr auto; }
  .stock-card form { grid-column: 1/3; display: flex; justify-content: end; }
  .shopping-row { grid-template-columns: 1fr auto; }
  .shopping-row details, .shopping-row > .pill { grid-column: 1/3; }
  .tool-links { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .import-hero { min-height: 360px; align-items: flex-end; }.import-orbit { position: absolute; right: -22px; top: -24px; width: 150px; height: 150px; opacity: .75; }.import-flow { grid-template-columns: repeat(2, 1fr); }.missing-banner { align-items: flex-start; flex-direction: column; }.imported-source-summary { grid-template-columns: 1fr; }.imported-source-summary ul { columns: 1; }.imported-source-link { min-width: 0; }
  .tool-links a { grid-template-columns: 36px 1fr; padding: .75rem; }
  .tool-links a > span { width: 36px; height: 36px; }
  .bottom-nav { position: fixed; display: grid; grid-template-columns: repeat(5,1fr); bottom: 0; left: 0; right: 0; z-index: 25; background: rgba(255,254,249,.96); border-top: 1px solid var(--line); padding: .45rem max(.35rem, env(safe-area-inset-right)) calc(.4rem + env(safe-area-inset-bottom)) max(.35rem, env(safe-area-inset-left)); backdrop-filter: blur(20px); }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: .15rem; font-size: .6rem; font-weight: 800; color: var(--muted); padding: .25rem; }
  .bottom-nav span { font-size: 1.25rem; color: var(--green); line-height: 1; }
  h1 { font-size: 2.4rem; }
}
@media (max-width: 440px) {
  .metrics.four { gap: .6rem; }
  .metrics article { padding: .8rem; }
  .metrics strong { font-size: 1.2rem; }
  .form-grid, .form-grid.three, .form-grid.four, .form-grid.six { grid-template-columns: 1fr; }
  .week-nav strong { display: none; }
  .tool-links { grid-template-columns: 1fr; }
}
