/* Học nghề bếp — hệ thống giao diện */

/* ---------- Tokens ---------- */
:root {
  --bg: #f6efe3;
  --bg-2: #efe5d3;
  --surface: #fffbf4;
  --surface-2: #faf3e7;
  --ink: #2a231e;
  --ink-2: #5a4f45;
  --ink-3: #85786b;
  --line: #e4d7c3;
  --line-2: #d6c6ad;

  --green: #2f5d3a;
  --green-2: #3d7449;
  --green-soft: #e2ecdd;
  --on-green: #fffbf4;
  --terra: #ad4f27;
  --terra-soft: #f5e1d4;
  --saffron: #a8700f;
  --saffron-soft: #f7ebcd;
  --turq: #1d6a6e;
  --turq-soft: #dcecec;
  --plum: #8e3446;
  --plum-soft: #f3dfe2;
  --red: #b3261e;
  --red-soft: #f9e1de;

  --c-vn: var(--terra);
  --c-au: var(--green);
  --c-a: var(--plum);
  --c-batu: var(--turq);

  --font-display: "Noto Serif", "Times New Roman", Georgia, serif;
  --font-body: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(70, 45, 20, .06), 0 6px 20px rgba(70, 45, 20, .07);
  --shadow-lg: 0 10px 40px rgba(50, 30, 10, .18);
  --fs: 16px;
  --sidebar: 248px;
  --topbar: 64px;
  --bottombar: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16120e; --bg-2: #1d1813; --surface: #221c17; --surface-2: #29221c;
    --ink: #f1e8db; --ink-2: #cbbdaa; --ink-3: #978a78; --line: #3a3128; --line-2: #4a3f34;
    --green: #8fc29c; --green-2: #a8d4b3; --green-soft: #213228; --on-green: #10200f;
    --terra: #e89a74; --terra-soft: #3a2519; --saffron: #e5b65a; --saffron-soft: #382c15;
    --turq: #74c3c6; --turq-soft: #163130; --plum: #e18c9c; --plum-soft: #3a1e24;
    --red: #f28b81; --red-soft: #3d1c19;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16120e; --bg-2: #1d1813; --surface: #221c17; --surface-2: #29221c;
  --ink: #f1e8db; --ink-2: #cbbdaa; --ink-3: #978a78; --line: #3a3128; --line-2: #4a3f34;
  --green: #8fc29c; --green-2: #a8d4b3; --green-soft: #213228; --on-green: #10200f;
  --terra: #e89a74; --terra-soft: #3a2519; --saffron: #e5b65a; --saffron-soft: #382c15;
  --turq: #74c3c6; --turq-soft: #163130; --plum: #e18c9c; --plum-soft: #3a1e24;
  --red: #f28b81; --red-soft: #3d1c19;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: var(--fs); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green-2); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.005em; }
h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 1.1rem + .9vw, 1.65rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 .8em; }
ul, ol { margin: 0 0 .8em; padding-left: 1.3em; }
li { margin: .2em 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--green) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.nowrap { white-space: nowrap; }
.serif { font-family: var(--font-display); }
.icon { width: 1.25em; height: 1.25em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon.fill { fill: currentColor; stroke: none; }

/* ---------- Shell ---------- */
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--green); color: var(--on-green); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

.shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 14px 16px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 42px; height: 42px; flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.22rem; line-height: 1.1; }
.brand-sub { display: block; font-family: var(--font-body); font-weight: 500; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--terra); margin-top: 3px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--ink-2); text-decoration: none; font-weight: 500;
}
.nav a .icon { width: 22px; height: 22px; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--green-soft); color: var(--green); font-weight: 600; }
.nav-sep { height: 1px; background: var(--line); margin: 12px 8px; }
.side-progress { margin-top: auto; padding: 14px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.side-progress .bar { margin: 8px 0 4px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar);
  display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .brand { display: none; padding: 0; }
.search {
  flex: 1; min-width: 0; max-width: 560px; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; height: 42px;
}
.search:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.search input { flex: 1; border: 0; background: transparent; outline: none; min-width: 0; height: 100%; }
.search .icon { color: var(--ink-3); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 999px; border: 1px solid transparent; background: transparent;
  display: inline-grid; place-items: center; color: var(--ink-2); cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--terra); color: #fff; font-size: .65rem; font-weight: 700; display: grid; place-items: center; }

.content { width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 28px 64px; flex: 1; }
.footer { border-top: 1px solid var(--line); padding: 20px 28px 28px; color: var(--ink-3); font-size: .85rem; display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: space-between; max-width: 1180px; margin: 0 auto; width: 100%; }
.footer a { color: var(--ink-2); }

.bottombar { display: none; }

@media (max-width: 899px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 0 14px; gap: 8px; }
  .topbar .brand { display: flex; }
  .topbar .brand-name { font-size: 1.05rem; }
  .topbar .brand-sub, .topbar .brand-text { display: none; }
  .topbar .brand-mark { width: 36px; height: 36px; }
  .top-actions { gap: 0; }
  .top-actions .icon-btn { width: 38px; height: 38px; }
  .search { padding: 0 12px; }
  .content { padding: 16px 16px calc(var(--bottombar) + 40px); }
  .footer { padding: 16px 16px calc(var(--bottombar) + 24px); }
  .bottombar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    height: calc(var(--bottombar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .bottombar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--ink-3); font-size: .7rem; font-weight: 500; }
  .bottombar a .icon { width: 23px; height: 23px; }
  .bottombar a[aria-current="page"] { color: var(--green); font-weight: 600; }
}

/* ---------- Page heads ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin: 6px 0 22px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 6px 0 0; color: var(--ink-2); max-width: 64ch; }
.eyebrow { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--terra); margin-bottom: 6px; display: block; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .85rem; color: var(--ink-3); margin-bottom: 10px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.section { margin: 34px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.section-head a { font-size: .9rem; font-weight: 500; text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; }
.section-head a .icon { width: 1em; height: 1em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: .92rem;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--green); border-color: var(--green); color: var(--on-green); }
.btn.primary:hover { background: var(--green-2); border-color: var(--green-2); color: var(--on-green); }
.btn.terra { background: var(--terra); border-color: var(--terra); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface); border-color: var(--line); }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: .85rem; }
.btn.lg { min-height: 52px; padding: 0 24px; font-size: 1rem; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.on { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Chips / badges ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: .88rem; font-weight: 500; cursor: pointer; user-select: none;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip[aria-pressed="true"], .chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip .n { font-size: .75rem; opacity: .7; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; line-height: 1.6; }
.badge .icon { width: 13px; height: 13px; }
.badge.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge.terra { background: var(--terra-soft); color: var(--terra); border-color: transparent; }
.badge.saffron { background: var(--saffron-soft); color: var(--saffron); border-color: transparent; }
.badge.turq { background: var(--turq-soft); color: var(--turq); border-color: transparent; }
.badge.plum { background: var(--plum-soft); color: var(--plum); border-color: transparent; }
.badge.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Cards / grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card.pad-lg { padding: 26px; }
.card.flat { box-shadow: none; }
.card.raise { box-shadow: var(--shadow); border-color: transparent; }
.card h3 { margin-bottom: .35em; }
a.card { text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s, border-color .15s; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); color: inherit; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid.auto-sm { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
@media (max-width: 1100px) { .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; } }

/* ---------- Home ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 30px 32px; margin-bottom: 22px;
  background: var(--green); color: var(--on-green);
}
:root[data-theme="dark"] .hero { background: #1f3626; color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero { background: #1f3626; color: var(--ink); } }
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 220, 160, .28), transparent 60%);
}
.hero-art { position: absolute; right: 24px; bottom: -8px; width: 230px; opacity: .95; pointer-events: none; }
.hero .eyebrow { color: #f2c48a; }
.hero h1 { color: inherit; max-width: 22ch; margin-bottom: 8px; }
.hero p { max-width: 52ch; opacity: .9; }
.hero .btn { border-color: transparent; }
.hero .btn.light { background: #fffbf4; color: #24402c; }
.hero .btn.outline { background: transparent; border-color: rgba(255, 251, 244, .45); color: inherit; }
@media (max-width: 760px) { .hero { padding: 22px 20px 26px; } .hero-art { width: 130px; right: 6px; bottom: auto; top: 10px; opacity: .35; } }

.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-family: var(--font-display); font-size: 1.6rem; line-height: 1.1; }
.stat span { font-size: .82rem; color: var(--ink-3); }
@media (max-width: 760px) { .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

:where(a.card) { display: block; }
.feature { display: flex; gap: 16px; align-items: flex-start; }
.feature > .icon:last-child { align-self: center; }
.feature .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--green-soft); color: var(--green); }
.feature .ico .icon { width: 24px; height: 24px; }
.feature.terra .ico { background: var(--terra-soft); color: var(--terra); }
.feature.saffron .ico { background: var(--saffron-soft); color: var(--saffron); }
.feature.turq .ico { background: var(--turq-soft); color: var(--turq); }

/* ---------- Progress ---------- */
.bar { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--green); transition: width .4s; }
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--green) calc(var(--p) * 1%), var(--bg-2) 0); }
.ring > span { width: 50px; height: 50px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }

/* ---------- Curriculum ---------- */
.stage { margin: 30px 0 10px; display: flex; align-items: center; gap: 12px; }
.stage .num { font-family: var(--font-display); font-weight: 700; font-size: .85rem; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); flex: none; }
.stage h2 { margin: 0; font-size: 1.25rem; }
.stage .line { flex: 1; height: 1px; background: var(--line); }
.module-card { display: flex; flex-direction: column; gap: 10px; position: relative; }
.module-card .top { display: flex; align-items: center; gap: 12px; }
.module-card .mico { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--green); flex: none; }
.module-card .mico .icon { width: 24px; height: 24px; }
.module-card .mnum { font-size: .74rem; color: var(--ink-3); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.module-card h3 { margin: 0; font-size: 1.08rem; }
.module-card p { color: var(--ink-2); font-size: .9rem; margin: 0; }
.module-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; font-size: .82rem; color: var(--ink-3); }
.module-card.locked { opacity: .72; }
.module-card.done .mico { background: var(--green); color: var(--on-green); border-color: var(--green); }

.lesson-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.lesson-item a { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; }
.lesson-item a:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.lesson-item .st { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 2px solid var(--line-2); color: var(--ink-3); font-weight: 700; font-size: .85rem; }
.lesson-item.done .st { background: var(--green); border-color: var(--green); color: var(--on-green); }
.lesson-item.read .st { border-color: var(--saffron); color: var(--saffron); }
.lesson-item .t { flex: 1; min-width: 0; }
.lesson-item .t b { display: block; font-weight: 600; }
.lesson-item .t span { font-size: .85rem; color: var(--ink-3); }

/* ---------- Article (lesson) ---------- */
.article { max-width: 760px; }
.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.layout-side > aside { position: sticky; top: calc(var(--topbar) + 16px); display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 1060px) { .layout-side { grid-template-columns: 1fr; } .layout-side > aside { position: static; } }
.lead { font-size: 1.12rem; color: var(--ink-2); }
.objectives { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.objectives h4 { margin-bottom: 6px; font-family: var(--font-body); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.lesson-sec { margin: 28px 0; }
.lesson-sec h2 { font-size: 1.35rem; display: flex; gap: 10px; align-items: baseline; }
.lesson-sec h2 .n { font-size: .9rem; color: var(--terra); font-family: var(--font-body); font-weight: 700; }
.more { margin-top: 10px; border-left: 3px solid var(--saffron); background: var(--saffron-soft); border-radius: 0 10px 10px 0; }
.more > summary { cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: .9rem; color: var(--saffron); list-style: none; display: flex; align-items: center; gap: 8px; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary .icon { transition: transform .2s; width: 16px; height: 16px; }
.more[open] > summary .icon { transform: rotate(90deg); }
.more > div { padding: 0 16px 14px; color: var(--ink); }
.keypoints { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.keypoints li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; background: var(--green-soft); border-radius: 10px; margin: 0; }
.keypoints li .icon { color: var(--green); margin-top: 3px; }

.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid; margin: 14px 0; }
.callout .icon { margin-top: 2px; width: 22px; height: 22px; }
.callout > div > :last-child { margin-bottom: 0; }
.callout h4 { margin-bottom: 4px; font-family: var(--font-body); font-size: .95rem; }
.callout.safety { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.callout.safety > .icon, .callout.safety h4 { color: var(--red); }
.callout.info { background: var(--turq-soft); border-color: color-mix(in srgb, var(--turq) 25%, transparent); }
.callout.info > .icon, .callout.info h4 { color: var(--turq); }
.callout.tip { background: var(--saffron-soft); border-color: color-mix(in srgb, var(--saffron) 25%, transparent); }
.callout.tip > .icon, .callout.tip h4 { color: var(--saffron); }
.callout.green { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.callout.green > .icon, .callout.green h4 { color: var(--green); }
.callout ul { margin-bottom: 0; }

/* Quiz */
.quiz { display: flex; flex-direction: column; gap: 18px; }
.q { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.q > p { font-weight: 600; margin-bottom: 12px; }
.q .opts { display: grid; gap: 8px; }
.opt { display: flex; align-items: flex-start; gap: 12px; text-align: left; width: 100%; padding: 11px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface-2); cursor: pointer; }
.opt:hover { border-color: var(--line-2); }
.opt .k { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-2); display: grid; place-items: center; font-size: .8rem; font-weight: 700; flex: none; }
.opt.sel { border-color: var(--ink-2); }
.opt.sel .k { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.opt.right { border-color: var(--green); background: var(--green-soft); }
.opt.right .k { background: var(--green); color: var(--on-green); border-color: var(--green); }
.opt.wrong { border-color: var(--red); background: var(--red-soft); }
.opt.wrong .k { background: var(--red); color: #fff; border-color: var(--red); }
.opt[disabled] { cursor: default; }
.explain { margin-top: 10px; font-size: .92rem; color: var(--ink-2); padding: 10px 12px; border-radius: 8px; background: var(--surface-2); }
.result-box { display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }

/* ---------- Filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .search { max-width: 380px; height: 40px; }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; display: grid; gap: 12px; }
.filter-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: start; }
.filter-row > label, .filter-row > span { font-size: .8rem; font-weight: 600; color: var(--ink-3); padding-top: 8px; text-transform: uppercase; letter-spacing: .06em; }
.filter-row .chip { min-height: 32px; padding: 0 12px; font-size: .84rem; }
@media (max-width: 640px) { .filter-row { grid-template-columns: 1fr; gap: 6px; } .filter-row > label, .filter-row > span { padding-top: 0; } .chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; } .chips.scroll::-webkit-scrollbar { display: none; } .chips.scroll .chip { flex: none; } }
.filters-toggle { display: none; }
@media (max-width: 760px) { .filters-toggle { display: inline-flex; } .filters.collapsed { display: none; } }
.result-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; color: var(--ink-3); font-size: .9rem; flex-wrap: wrap; }
select.input, input.input, textarea.input {
  border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 9px 12px; min-height: 42px; width: 100%;
}
select.input { width: auto; padding-right: 30px; }
textarea.input { min-height: 90px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-weight: 600; font-size: .88rem; }
.field .hint { font-size: .8rem; color: var(--ink-3); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- Recipe cards ---------- */
.rcard { display: flex; flex-direction: column; overflow: hidden; padding: 0 !important; height: 100%; }
.rcard .art { position: relative; height: 128px; display: grid; place-items: center; border-bottom: 1px solid var(--line); background-color: var(--surface-2); }
.rcard .art .plate { width: 86px; height: 86px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; box-shadow: 0 0 0 6px color-mix(in srgb, var(--cc) 18%, var(--surface)), 0 6px 18px rgba(0,0,0,.1); color: var(--cc); }
.rcard .art .plate .icon { width: 40px; height: 40px; stroke-width: 1.4; }
.rcard .art .lvl { position: absolute; left: 12px; top: 12px; z-index: 1; }
.rcard .art.has-img { height: 160px; overflow: hidden; background: var(--surface-2); }
.rcard .art.has-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
a.rcard:hover .art.has-img img { transform: scale(1.04); }
.rcard .art.has-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.18), transparent 38%); pointer-events: none; }
.rcard .art.has-img .lvl { background: rgba(255,251,244,.92); color: #2a231e; border-color: transparent; }
.rcard .art .art-tag { position: absolute; right: 10px; bottom: 8px; z-index: 1; font-size: .68rem; font-weight: 600; color: #5a4f45; background: rgba(255,251,244,.85); padding: 1px 8px; border-radius: 99px; }
.rcard .art .fav { z-index: 1; }
.rcard .art .fav { position: absolute; right: 10px; top: 10px; color: var(--terra); }
.rcard .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.rcard .body h3 { font-size: 1.05rem; margin: 0; }
.rcard .body .sub { font-size: .8rem; color: var(--ink-3); font-weight: 500; }
.rcard .body p { font-size: .87rem; color: var(--ink-2); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rcard .meta { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; gap: 10px; font-size: .8rem; color: var(--ink-3); align-items: center; }
.rcard .meta span { display: inline-flex; align-items: center; gap: 4px; }
.rcard .meta .icon { width: 14px; height: 14px; }

.cz-vn { --cc: var(--c-vn); }
.cz-au { --cc: var(--c-au); }
.cz-a { --cc: var(--c-a); }
.cz-batu { --cc: var(--c-batu); }
/* Hoạ tiết nền theo nền bếp */
.pat-vn { background-image: repeating-linear-gradient(90deg, color-mix(in srgb, var(--c-vn) 10%, transparent) 0 2px, transparent 2px 22px), repeating-linear-gradient(0deg, transparent 0 34px, color-mix(in srgb, var(--c-vn) 12%, transparent) 34px 36px); }
.pat-au { background-image: linear-gradient(45deg, color-mix(in srgb, var(--c-au) 9%, transparent) 25%, transparent 25% 75%, color-mix(in srgb, var(--c-au) 9%, transparent) 75%), linear-gradient(45deg, color-mix(in srgb, var(--c-au) 9%, transparent) 25%, transparent 25% 75%, color-mix(in srgb, var(--c-au) 9%, transparent) 75%); background-size: 28px 28px; background-position: 0 0, 14px 14px; }
.pat-a { background-image: radial-gradient(circle at 50% 100%, transparent 9px, color-mix(in srgb, var(--c-a) 14%, transparent) 10px 11px, transparent 12px 15px, color-mix(in srgb, var(--c-a) 12%, transparent) 16px 17px, transparent 18px); background-size: 36px 18px; }
.pat-batu { background-image: radial-gradient(circle, color-mix(in srgb, var(--c-batu) 18%, transparent) 2px, transparent 3px), linear-gradient(45deg, transparent 46%, color-mix(in srgb, var(--c-batu) 12%, transparent) 47% 53%, transparent 54%), linear-gradient(-45deg, transparent 46%, color-mix(in srgb, var(--c-batu) 12%, transparent) 47% 53%, transparent 54%); background-size: 26px 26px; }

/* ---------- Recipe detail ---------- */
.rhead { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; padding: 26px; border-radius: 20px; border: 1px solid var(--line); margin-bottom: 20px; position: relative; overflow: hidden; background-color: var(--surface); }
.rhead .art-plate { width: 140px; height: 140px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--cc); box-shadow: 0 0 0 10px color-mix(in srgb, var(--cc) 16%, var(--surface)), var(--shadow); }
.rhead .art-plate .icon { width: 64px; height: 64px; stroke-width: 1.3; }
.rhead h1 { margin-bottom: 4px; }
.rhead .alt { color: var(--ink-3); font-style: italic; margin-bottom: 10px; font-family: var(--font-display); }
.rhead .summary { color: var(--ink-2); max-width: 66ch; margin: 10px 0 14px; }
.rhead .bg { position: absolute; inset: 0; opacity: .7; pointer-events: none; }
.rhead.has-media { grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); align-items: start; gap: 28px; }
.rphoto { margin: 0; }
.rphoto img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; box-shadow: var(--shadow); background: var(--surface-2); }
.rphoto.art img { object-fit: contain; background: #f6ecd9; }
.rphoto figcaption { font-size: .72rem; color: var(--ink-3); margin-top: 6px; line-height: 1.4; }
.rphoto figcaption a { color: inherit; }
.rhead > * { position: relative; }
@media (max-width: 700px) { .rhead, .rhead.has-media { grid-template-columns: 1fr; padding: 20px; } .rhead .art-plate { display: none; } .rhead.has-media .rphoto { order: -1; margin: -20px -20px 4px; } .rhead.has-media .rphoto img { border-radius: 20px 20px 0 0; box-shadow: none; aspect-ratio: 16 / 10; } .rhead.has-media .rphoto figcaption { padding: 0 20px; } }
.rhead.ihead { grid-template-columns: auto minmax(0, 1fr); }
@media (max-width: 520px) { .rhead.ihead { grid-template-columns: 1fr; } .rhead.ihead .ii { width: 56px !important; height: 56px !important; font-size: 1.4rem !important; border-radius: 16px !important; } }
.facts { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .9rem; color: var(--ink-2); margin-bottom: 14px; }
.facts span { display: inline-flex; align-items: center; gap: 6px; }
.facts .icon { width: 17px; height: 17px; color: var(--ink-3); }
.outcome { display: flex; gap: 14px; padding: 16px 18px; border-radius: var(--radius); background: var(--green-soft); margin-bottom: 20px; }
.outcome .icon { color: var(--green); width: 24px; height: 24px; margin-top: 2px; }
.outcome h4 { margin-bottom: 4px; color: var(--green); font-family: var(--font-body); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; }
.outcome p { margin: 0; }
.status-note { display: flex; gap: 10px; align-items: flex-start; font-size: .84rem; color: var(--ink-3); border: 1px dashed var(--line-2); border-radius: 10px; padding: 10px 12px; }
.status-note .icon { width: 18px; height: 18px; margin-top: 1px; }

.recipe-grid { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 28px; align-items: start; }
.recipe-grid > .ing-col { position: sticky; top: calc(var(--topbar) + 14px); }
@media (max-width: 980px) { .recipe-grid { grid-template-columns: 1fr; } .recipe-grid > .ing-col { position: static; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel + .panel { margin-top: 14px; }
.grid > .panel + .panel { margin-top: 0; }
.kv .k .icon { display: inline-block; vertical-align: -2px; width: 14px; height: 14px; margin-right: 2px; }
.panel h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.stepper button { width: 38px; height: 38px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--ink-2); }
.stepper button:hover { background: var(--surface); color: var(--ink); }
.stepper output { min-width: 64px; text-align: center; font-weight: 700; font-size: .92rem; }
.ing-group { margin-top: 14px; }
.ing-group h4 { font-family: var(--font-body); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--terra); margin-bottom: 4px; }
.ing-list { list-style: none; padding: 0; margin: 0; }
.ing-list li { margin: 0; border-bottom: 1px dashed var(--line); }
.ing-list li:last-child { border-bottom: 0; }
.ing-list label { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: baseline; padding: 8px 0; cursor: pointer; }
.ing-list input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--green); transform: translateY(3px); }
.ing-list .q { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; background: none; border: 0; padding: 0; text-align: right; }
.ing-list .nm a { color: inherit; text-decoration-color: var(--line-2); }
.ing-list .note { display: block; font-size: .8rem; color: var(--ink-3); }
.ing-list .conv { display: block; font-size: .75rem; color: var(--ink-3); font-weight: 500; text-align: right; }
.ing-list li.checked .nm, .ing-list li.checked .q { text-decoration: line-through; color: var(--ink-3); }

.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; display: flex; flex-direction: column; gap: 14px; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 0; }
.step .sn { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; }
.step h3 { margin: 6px 0 6px; font-size: 1.05rem; }
.step .chips-mini { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.step .cue { display: flex; gap: 8px; font-size: .9rem; margin-top: 8px; padding: 9px 12px; background: var(--green-soft); border-radius: 9px; }
.step .cue .icon { color: var(--green); width: 18px; height: 18px; margin-top: 2px; }
.step .why { display: flex; gap: 8px; font-size: .9rem; margin-top: 6px; padding: 9px 12px; background: var(--surface-2); border-radius: 9px; color: var(--ink-2); }
.step .why .icon { color: var(--saffron); width: 18px; height: 18px; margin-top: 2px; }
@media (max-width: 520px) { .step { grid-template-columns: 1fr; gap: 6px; } .step .sn { width: 32px; height: 32px; font-size: .9rem; } }

.fault-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.fault-table th, .fault-table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.fault-table th { font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; background: var(--surface-2); }
.fault-table td:first-child { font-weight: 600; }
@media (max-width: 700px) {
  .fault-table thead { display: none; }
  .fault-table tr { display: block; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 6px 0; background: var(--surface); }
  .fault-table td { display: block; border: 0; padding: 4px 14px; }
  .fault-table td::before { content: attr(data-l); display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; }
}
.criteria { list-style: none; padding: 0; margin: 0; }
.criteria li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.criteria li .icon { color: var(--green); margin-top: 3px; }
.kv { display: grid; grid-template-columns: 1fr; gap: 0; }
.kv > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.kv > div:last-child { border-bottom: 0; }
.kv dt, .kv .k { font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; margin-bottom: 3px; }
.kv dd { margin: 0; }

/* ---------- Ingredient ---------- */
.icard { display: flex; gap: 14px; align-items: center; }
.icard .ii { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; background: var(--gc-soft, var(--surface-2)); color: var(--gc, var(--ink-2)); }
.icard h3 { font-size: 1rem; margin: 0; }
.icard p { margin: 0; font-size: .82rem; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.g-thit-trung { --gc: var(--terra); --gc-soft: var(--terra-soft); }
.g-thuy-san { --gc: var(--turq); --gc-soft: var(--turq-soft); }
.g-dau-hat { --gc: var(--saffron); --gc-soft: var(--saffron-soft); }
.g-nam-rong { --gc: var(--ink-2); --gc-soft: var(--bg-2); }
.g-tinh-bot { --gc: var(--saffron); --gc-soft: var(--saffron-soft); }
.g-rau-cu { --gc: var(--green); --gc-soft: var(--green-soft); }
.g-rau-thom { --gc: var(--green); --gc-soft: var(--green-soft); }
.g-gia-vi { --gc: var(--plum); --gc-soft: var(--plum-soft); }
.g-len-men { --gc: var(--terra); --gc-soft: var(--terra-soft); }
.g-qua { --gc: var(--saffron); --gc-soft: var(--saffron-soft); }
.g-beo-sua { --gc: var(--turq); --gc-soft: var(--turq-soft); }
.sub-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface-2); }
.sub-card h4 { margin-bottom: 8px; }
.sub-card .row { display: flex; gap: 8px; font-size: .9rem; margin-top: 4px; }
.sub-card .row .icon { width: 17px; height: 17px; margin-top: 3px; }
.sub-card .row.keep .icon { color: var(--green); }
.sub-card .row.change .icon { color: var(--terra); }

/* ---------- Tools ---------- */
.tool-tile { display: flex; flex-direction: column; gap: 10px; }
.tool-tile .ico { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); }
.tool-tile .ico .icon { width: 26px; height: 26px; }
.tool-tile h3 { margin: 0; }
.tool-tile p { margin: 0; color: var(--ink-2); font-size: .9rem; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 600; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl input.input { min-height: 36px; padding: 6px 9px; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tbl-wrap .tbl tr:last-child td { border-bottom: 0; }
.bigout { font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1.1; }

.shop-group h3 { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--terra); font-family: var(--font-body); margin: 18px 0 6px; }
.shop-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.shop-list li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); margin: 0; }
.shop-list li:last-child { border-bottom: 0; }
.shop-list li.checked .nm { text-decoration: line-through; color: var(--ink-3); }
.shop-list .nm { flex: 1; min-width: 0; }
.shop-list .nm small { display: block; color: var(--ink-3); font-size: .78rem; }
.shop-list .q { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.shop-list input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--green); }

.pick-grid { display: flex; flex-wrap: wrap; gap: 8px; max-height: 340px; overflow-y: auto; padding: 4px; }

/* ---------- Timers ---------- */
.timer-dock { position: fixed; right: 18px; bottom: 18px; z-index: 40; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; max-width: calc(100vw - 36px); }
@media (max-width: 899px) { .timer-dock { right: 12px; bottom: calc(var(--bottombar) + 12px + env(safe-area-inset-bottom)); } }
.tpill { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 999px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-size: .88rem; max-width: 100%; }
.tpill .lbl { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .8; }
.tpill .tm { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1rem; }
.tpill button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: inherit; cursor: pointer; display: grid; place-items: center; }
:root[data-theme="dark"] .tpill button { background: rgba(0,0,0,.12); }
.tpill button .icon { width: 16px; height: 16px; }
.tpill.done { background: var(--terra); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.04); } }
.timer-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.timer-card .tm { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 120px; }
.timer-card .lbl { flex: 1; min-width: 0; }
.timer-card.done { border-color: var(--terra); background: var(--terra-soft); }
.timer-card.paused .tm { color: var(--ink-3); }
@media (max-width: 520px) { .timer-card { flex-wrap: wrap; } .timer-card .tm { min-width: 0; } }

/* ---------- Cook mode ---------- */
.cook { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; font-size: 1.15rem; }
.cook-top { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.cook-top .ttl { flex: 1; min-width: 0; }
.cook-top .ttl b { display: block; font-family: var(--font-display); font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cook-top .ttl span { font-size: .8rem; color: var(--ink-3); }
.cook-prog { height: 5px; background: var(--bg-2); }
.cook-prog > i { display: block; height: 100%; background: var(--green); transition: width .3s; }
.cook-body { flex: 1; overflow-y: auto; padding: 28px 22px; }
.cook-step { max-width: 820px; margin: 0 auto; }
.cook-step .num { font-size: .9rem; font-weight: 700; color: var(--terra); letter-spacing: .12em; text-transform: uppercase; }
.cook-step h2 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); margin: 6px 0 14px; }
.cook-step .txt { font-size: clamp(1.2rem, 1rem + .8vw, 1.5rem); line-height: 1.55; }
.cook-step .cue { font-size: 1.05rem; }
.cook-foot { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.cook-foot .btn { min-height: 60px; font-size: 1.05rem; }
.cook-foot .next { justify-self: end; }
.cook-drawer { position: fixed; inset: 0; z-index: 70; background: rgba(20, 14, 8, .45); display: flex; justify-content: flex-end; }
.cook-drawer > div { width: min(440px, 100%); height: 100%; overflow-y: auto; background: var(--surface); padding: 20px; box-shadow: var(--shadow-lg); }

/* ---------- Journal ---------- */
.jentry { display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; align-items: center; }
.jentry .ph { width: 84px; height: 84px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; color: var(--ink-3); }
.jentry .ph img { width: 100%; height: 100%; object-fit: cover; }
.jentry h3 { margin: 0 0 2px; font-size: 1.02rem; }
.jentry .score { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; text-align: right; }
.jentry .score small { display: block; font-family: var(--font-body); font-size: .7rem; color: var(--ink-3); font-weight: 500; }
@media (max-width: 520px) { .jentry { grid-template-columns: 64px 1fr; } .jentry .ph { width: 64px; height: 64px; } .jentry .score { display: none; } }
.rating { display: flex; gap: 6px; flex-wrap: wrap; }
.rating button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 700; }
.rating button.on { background: var(--saffron); border-color: var(--saffron); color: #fff; }
.photo-drop { border: 2px dashed var(--line-2); border-radius: 14px; padding: 18px; text-align: center; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; gap: 8px; min-height: 140px; position: relative; overflow: hidden; }
.photo-drop img { max-height: 260px; border-radius: 10px; }
.photo-drop:hover { border-color: var(--green); color: var(--green); }
.photo-full { max-height: 420px; width: auto; border-radius: 14px; border: 1px solid var(--line); }

/* ---------- Toast / modal ---------- */
.toast-wrap { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (max-width: 899px) { .toast-wrap { bottom: calc(var(--bottombar) + 16px); } }
.toast { background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: .92rem; font-weight: 500; animation: tin .25s ease-out; pointer-events: auto; max-width: 90vw; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }
dialog.modal { border: 0; border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(20, 14, 8, .5); }
dialog.modal .mb { padding: 22px 22px 8px; }
dialog.modal .mf { padding: 12px 22px 20px; display: flex; flex-direction: row-reverse; justify-content: flex-start; gap: 8px; flex-wrap: wrap; }

.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--surface); }
.empty .icon { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--line-2); }
.empty h3 { color: var(--ink-2); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { padding: 10px 14px; border: 0; background: none; cursor: pointer; text-decoration: none; color: var(--ink-3); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a[aria-current="page"], .tabs button[aria-selected="true"] { color: var(--green); border-bottom-color: var(--green); }

.search-results h2 { font-size: 1.1rem; margin-top: 26px; }
.hit { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.hit:hover { background: var(--surface-2); }
.hit .icon { color: var(--ink-3); }
mark { background: var(--saffron-soft); color: inherit; border-radius: 3px; padding: 0 1px; }

.source-list { list-style: none; padding: 0; margin: 0; }
.source-list li { padding: 10px 0; border-bottom: 1px solid var(--line); margin: 0; }

.cert { border: 2px solid var(--ink); border-radius: 6px; padding: 30px; text-align: center; background: var(--surface); position: relative; }
.cert::before { content: ""; position: absolute; inset: 8px; border: 1px solid var(--line-2); border-radius: 3px; pointer-events: none; }

/* ---------- Print ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #fff; --ink: #000; --line: #ccc; }
  body { background: #fff; font-size: 11pt; }
  .sidebar, .topbar, .bottombar, .timer-dock, .no-print, .toast-wrap, .footer .no-print { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .recipe-grid { grid-template-columns: 260px 1fr; }
  .recipe-grid > .ing-col { position: static; }
  .card, .panel, .step, .rhead { box-shadow: none !important; break-inside: avoid; }
  a { color: #000; text-decoration: none; }
  .more { border: 0; background: none; }
  details > * { display: block !important; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
