/* Takkie Bak: moods (colour) + a calm, Notion-like layout. */

/* ---------- moods ---------- */
:root, [data-mood="sunday"] {
  --bg: #FFFDF7; --card: #FFFFFF; --soft: #F5F2E7; --line: #E5E0D0; --line-2: #D3CDBA;
  --ink: #07563C; --ink-strong: #063F2C; --ink-2: #557566; --ink-3: #82998D;
  --band: #07563C; --on-band: #FFFDF7; --accent: #F25524; --on-accent: #FFFDF7;
  --hi: #FCE51F; --on-hi: #063F2C; --tint: #F6EFE0;
  --c-red: #F25524; --c-pink: #F8A6BC; --c-yellow: #FCE51F; --c-green: #07563C; --c-leaf: #A7D49B;
  --c-lav: #D8D9F1; --c-sky: #B5DDF7; --c-cream: #FFFDF7; --c-brown: #B8743C;
  --tile-1: #F8A6BC; --tile-2: #D8D9F1; --tile-3: #B5DDF7; --tile-4: #FBEFA0; --tile-5: #F9D2C0;
  --pat-bg: #D8D9F1; --pat-1: #F8A6BC; --pat-2: #F25524;
}
[data-mood="picnic"] {
  --bg: #FFF9F0; --card: #FFFFFF; --soft: #F3F1FA; --line: #E6E2EE; --line-2: #D2CDE0;
  --ink: #2D2B55; --ink-strong: #1F1D42; --ink-2: #605E8A; --ink-3: #8E8CB0;
  --band: #2D2B55; --on-band: #FFF9F0; --accent: #EB5A1E; --on-accent: #FFF9F0;
  --hi: #D6D8F0; --on-hi: #1F1D42; --tint: #F1EFFA;
  --c-red: #EB5A1E; --c-pink: #F7B9C4; --c-yellow: #F9D65C; --c-green: #3F7D4E; --c-leaf: #B6D7A8;
  --c-lav: #D6D8F0; --c-sky: #BFD5F2; --c-cream: #FFF9F0; --c-brown: #B0703F;
  --tile-1: #D6D8F0; --tile-2: #FBD3C0; --tile-3: #F7B9C4; --tile-4: #FBE7A8; --tile-5: #C9DDF4;
  --pat-bg: #D6D8F0; --pat-1: #FFF9F0; --pat-2: #EB5A1E;
}
[data-mood="cottage"] {
  --bg: #FAF1E1; --card: #FFFAF0; --soft: #F2E6CF; --line: #E5D6BA; --line-2: #D4C19F;
  --ink: #3A4640; --ink-strong: #28322D; --ink-2: #5A6760; --ink-3: #7F8B84;
  --band: #B8473B; --on-band: #FFFAF0; --accent: #B8473B; --on-accent: #FFFAF0;
  --hi: #A9B5AE; --on-hi: #28322D; --tint: #F4E7CF;
  --c-red: #C24A3D; --c-pink: #EDB9AA; --c-yellow: #EBC66C; --c-green: #5E7366; --c-leaf: #A9B5AE;
  --c-lav: #DAD5E6; --c-sky: #BFD4D9; --c-cream: #FFFAF0; --c-brown: #9C6A43;
  --tile-1: #F3D9C9; --tile-2: #DCE3DE; --tile-3: #F4E2B5; --tile-4: #E9CFC8; --tile-5: #D9E3E6;
  --pat-bg: #F6E7CB; --pat-1: #A9B5AE; --pat-2: #B8473B;
}
[data-mood="seaside"] {
  --bg: #FFFBF2; --card: #FFFFFF; --soft: #EEF5FC; --line: #DCE5F0; --line-2: #C5D3E4;
  --ink: #1E2B4F; --ink-strong: #131D3A; --ink-2: #546287; --ink-3: #8592B0;
  --band: #A3122F; --on-band: #FFFBF2; --accent: #A3122F; --on-accent: #FFFBF2;
  --hi: #FCE51F; --on-hi: #131D3A; --tint: #EAF4FC;
  --c-red: #A3122F; --c-pink: #F6B8C3; --c-yellow: #FCE51F; --c-green: #2F6B4F; --c-leaf: #A8D5A2;
  --c-lav: #D8D9F1; --c-sky: #B5DDF7; --c-cream: #FFFBF2; --c-brown: #B57A45;
  --tile-1: #B5DDF7; --tile-2: #FCF0A0; --tile-3: #F6CBD3; --tile-4: #D8D9F1; --tile-5: #CFE8CB;
  --pat-bg: #B5DDF7; --pat-1: #FFFBF2; --pat-2: #A3122F;
}


[data-mood="takkie"] {
  --bg: #FFFBF0; --card: #FFFFFF; --soft: #F4EEDC; --line: #E7DFC8; --line-2: #D3C9AC;
  --ink: #0E4FA1; --ink-strong: #0B3A78; --ink-2: #4E6C98; --ink-3: #7A8BAA;
  --band: #0E4FA1; --on-band: #FFF7E1; --accent: #0E4FA1; --on-accent: #FFF7E1;
  --hi: #FBE3A1; --on-hi: #0B3A78; --tint: #F6EFD9;
  --c-red: #D9573F; --c-pink: #F2BDB2; --c-yellow: #F2C24A; --c-green: #2E6B4F; --c-leaf: #A9CFA0;
  --c-lav: #D6DDF3; --c-sky: #C3D8F2; --c-cream: #FFFBF0; --c-brown: #B07A45;
  --tile-1: #DCE7F6; --tile-2: #FBEFC9; --tile-3: #F5E0D6; --tile-4: #E3EEDB; --tile-5: #E6E1F3;
  --pat-bg: #FBF3DC; --pat-1: #C9DAF0; --pat-2: #0E4FA1;
}

/* ==========================================================================
   Layout system (24 Nov 2026): calm, Notion-like pages. Off-white paper, fine rules,
   small radii, serif page titles, soft highlighted tags, line-drawn illustrations.
   Colour comes from the chosen mood; patterns only on covers and small accents.
   Spacing: 4 / 8 / 12 / 16 / 24 / 32 / 48.
   ========================================================================== */
:root {
  --r-xs: 4px; --r-sm: 6px; --r: 8px; --r-lg: 12px; --pill: 999px;
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'DM Sans', -apple-system, system-ui, sans-serif;
  --mono: 'Space Mono', ui-monospace, Menlo, monospace;
  --max: 1080px; --read: 760px; --side: 248px;
  --pattern: none; --pattern-size: 48px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --rule: color-mix(in srgb, var(--ink-strong) 78%, transparent);   /* the strong hairline from the references */
  --hair: color-mix(in srgb, var(--ink-strong) 12%, transparent);   /* quiet dividers */
  --hover: color-mix(in srgb, var(--ink-strong) 5%, transparent);
  --press: color-mix(in srgb, var(--ink-strong) 9%, transparent);
  --side-bg: color-mix(in srgb, var(--ink-strong) 3%, var(--bg));
  color-scheme: light;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink-strong); font: 400 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: clip; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.015em; margin: 0; color: var(--ink-strong); font-variation-settings: 'opsz' 72; }
h1 { font-size: clamp(32px, 6.4vw, 44px); line-height: 1.1; }
h2 { font-size: 22px; line-height: 1.25; }
h3 { font-size: 17px; line-height: 1.3; font-family: var(--sans); font-weight: 600; letter-spacing: 0; }
p { margin: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 16px; border-radius: var(--r); z-index: 99; }
.skip:focus { left: 8px; }
.eyebrow { font: 500 12px/1.4 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.mono { font: 400 12px/1.5 var(--sans); color: var(--ink-2); }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.tiny { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.stack-sm { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.section { margin-top: 32px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.grid-2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 520px) { .grid-3 { grid-template-columns: 1fr 1fr; } }

/* ---------- shell: top bar on phones, sidebar on computers ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--hair); padding-top: env(safe-area-inset-top, 0px); }
.topbar-in { display: flex; align-items: center; gap: 12px; padding: 6px 12px 6px 16px; min-height: 52px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; min-width: 0; }
.brand-mark { width: 28px; height: 28px; flex: none; display: block; border-radius: 7px; }
.brand-name { font: 500 17px/1.2 var(--serif); color: var(--ink-strong); letter-spacing: -0.01em; white-space: nowrap; }
.topnav { display: none; }
.icon-btn { width: 40px; height: 40px; border-radius: var(--r); border: 0; background: transparent; display: grid; place-items: center; color: var(--ink-2); flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--ink-strong); }
.icon-btn svg { width: 20px; height: 20px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 94%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-top: 1px solid var(--hair); display: grid; grid-template-columns: repeat(5, 1fr); padding: 4px 4px calc(4px + var(--safe-b)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 1px; text-decoration: none; font-size: 11px; font-weight: 500; color: var(--ink-2); min-height: 48px; justify-content: center; border-radius: var(--r); }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--ink-strong); }
.tabbar a.add span.plus { width: 40px; height: 32px; border-radius: var(--r); background: var(--ink-strong); color: var(--bg); display: grid; place-items: center; }
.tabbar a.add span.plus svg { width: 20px; height: 20px; color: var(--bg); }

.main { max-width: var(--max); margin: 0 auto; padding: 20px 20px calc(96px + var(--safe-b)); outline: none; }
.main.reading-width { max-width: var(--read); }

@media (min-width: 860px) {
  .topbar { position: fixed; inset: 0 auto 0 0; width: var(--side); border-bottom: 0; border-right: 1px solid var(--hair); background: var(--side-bg); -webkit-backdrop-filter: none; backdrop-filter: none; padding: 0; overflow-y: auto; }
  .topbar-in { flex-direction: column; align-items: stretch; gap: 2px; padding: 14px 10px; min-height: 100%; }
  .brand { margin: 0 0 14px; padding: 6px 8px; }
  .topbar-in > .icon-btn { position: absolute; top: 14px; right: 10px; width: 32px; height: 32px; }
  .topnav { display: flex; flex-direction: column; gap: 1px; }
  .topnav a { display: flex; align-items: center; gap: 10px; padding: 6px 10px; min-height: 34px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2); font-size: 14px; font-weight: 500; }
  .topnav a svg { width: 18px; height: 18px; flex: none; }
  .topnav a:hover { background: var(--hover); color: var(--ink-strong); }
  .topnav a[aria-current="page"] { background: var(--press); color: var(--ink-strong); }
  .topnav .nav-sep { height: 1px; background: var(--hair); margin: 10px 8px; }
  .tabbar { display: none; }
  .backdrop-frame { margin-left: var(--side); }
  .main { padding: 48px 56px 80px; }
}

/* ---------- backgrounds (mood settings) ---------- */
[data-backdrop="tinted"] body { background: var(--tint); }
[data-backdrop="tinted"] .topbar { background: color-mix(in srgb, var(--tint) 92%, transparent); }
[data-backdrop="pattern"] body { background-color: var(--pat-bg); background-image: var(--pattern); background-size: var(--pattern-size); }
[data-backdrop="pattern"] .backdrop-frame { padding: 12px 10px 0; }
[data-backdrop="pattern"] .main { background: var(--bg); border-radius: var(--r-lg); border: 1px solid var(--hair); }
[data-backdrop="band"] .page-head { background: var(--band); color: var(--on-band); border-radius: var(--r-lg); padding: 24px; }
[data-backdrop="band"] .page-head :is(h1, .eyebrow, .lede, .mono, .page-icon) { color: var(--on-band); }
[data-backdrop="band"] .page-head .page-icon { background: color-mix(in srgb, var(--on-band) 16%, transparent); border-color: transparent; }
[data-backdrop="band"] .page-head .icon-btn, [data-backdrop="band"] .page-head .btn.ghost { color: var(--on-band); border-color: color-mix(in srgb, var(--on-band) 45%, transparent); }
@media (min-width: 860px) {
  [data-backdrop="pattern"] .backdrop-frame { padding: 24px 24px 0; }
  [data-backdrop="band"] .topbar { background: var(--band); border-color: transparent; }
  [data-backdrop="band"] .topbar :is(.brand-name, .topnav a) { color: var(--on-band); }
  [data-backdrop="band"] .topbar .topnav a:hover, [data-backdrop="band"] .topbar .topnav a[aria-current="page"] { background: color-mix(in srgb, var(--on-band) 16%, transparent); }
  [data-backdrop="band"] .topbar .icon-btn { color: var(--on-band); }
}

/* ---------- page heads (Notion-style: icon, title, quiet subtitle) ---------- */
.page-head { display: grid; gap: 8px; margin-bottom: 24px; justify-items: start; }
.page-head .lede { color: var(--ink-2); max-width: 60ch; font-size: 15px; }
.page-icon { width: 56px; height: 56px; border-radius: var(--r-lg); display: grid; place-items: center; background: var(--soft); margin-bottom: 4px; }
.page-icon .illus { width: 40px; }
.page-icon svg:not(.illus) { width: 28px; height: 28px; }
.back { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-size: 14px; color: var(--ink-2); min-height: 36px; padding: 0 8px 0 4px; margin: -4px 0 12px -4px; border-radius: var(--r-sm); }
.back:hover { background: var(--hover); color: var(--ink-strong); }
.back svg { width: 16px; height: 16px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--ink-strong); background: var(--ink-strong); color: var(--bg); font-weight: 500; font-size: 14px; text-decoration: none; white-space: nowrap; transition: background .12s; }
.btn:hover { background: color-mix(in srgb, var(--ink-strong) 86%, var(--bg)); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.accent { background: var(--band); border-color: var(--band); color: var(--on-band); }
.btn.ghost, .btn.soft { background: transparent; color: var(--ink-strong); border-color: var(--hair); }
.btn.ghost:hover, .btn.soft:hover { background: var(--hover); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.danger { background: transparent; color: #B3261E; border-color: color-mix(in srgb, #B3261E 30%, transparent); }
.btn.danger:hover { background: color-mix(in srgb, #B3261E 8%, transparent); }
.btn:disabled { opacity: .45; cursor: default; }
@media (pointer: coarse) { .btn { min-height: 44px; } .btn.sm { min-height: 40px; } }
.linkish { background: none; border: 0; padding: 6px 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
.linkish:hover { color: var(--ink-strong); }

/* Tags: soft highlighter blocks, like a database property. */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: var(--r-xs); background: var(--soft); font-size: 13px; line-height: 22px; font-weight: 500; color: var(--ink-strong); white-space: nowrap; }
.tag svg { width: 14px; height: 14px; }
.tag.t1 { background: color-mix(in srgb, var(--tile-1) 70%, var(--bg)); } .tag.t2 { background: color-mix(in srgb, var(--tile-2) 70%, var(--bg)); }
.tag.t3 { background: color-mix(in srgb, var(--tile-3) 70%, var(--bg)); } .tag.t4 { background: color-mix(in srgb, var(--tile-4) 70%, var(--bg)); }
.tag.t5 { background: color-mix(in srgb, var(--tile-5) 70%, var(--bg)); }

/* Filter chips: quiet pills; the chosen one is filled. */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px; scrollbar-width: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: var(--pill); border: 1px solid var(--hair); background: transparent; font-size: 13px; font-weight: 500; color: var(--ink-2); text-decoration: none; }
.chip:hover { background: var(--hover); color: var(--ink-strong); }
.chip[aria-pressed="true"] { background: var(--ink-strong); border-color: var(--ink-strong); color: var(--bg); }
.chip svg { width: 15px; height: 15px; }
.chip.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
@media (pointer: coarse) { .chip { min-height: 40px; } .chip.sm { min-height: 36px; } }

.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.input, textarea.input, select.input { width: 100%; min-height: 42px; padding: 9px 12px; border-radius: var(--r); border: 1px solid var(--hair); background: var(--card); font-size: 16px; color: var(--ink-strong); }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.55; }
.input:hover { border-color: color-mix(in srgb, var(--ink-strong) 22%, transparent); }
.input:focus { outline: none; border-color: var(--ink-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink-strong) 10%, transparent); }
.input::placeholder { color: var(--ink-3); }
.search { position: relative; flex: 1; min-width: 160px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-3); pointer-events: none; }
.search .input { padding-left: 38px; background: var(--hover); border-color: transparent; min-height: 40px; }
.search .input:focus { background: var(--card); }
.seg { display: inline-flex; background: var(--hover); border-radius: var(--r); padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; min-height: 34px; padding: 0 12px; border-radius: var(--r-sm); font-weight: 500; font-size: 13px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.seg button svg { width: 16px; height: 16px; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink-strong); box-shadow: 0 0 0 1px var(--hair), 0 1px 2px color-mix(in srgb, var(--ink-strong) 8%, transparent); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--hair); border-radius: var(--r); background: var(--card); }
.stepper button { width: 34px; height: 30px; border: 0; background: transparent; border-radius: var(--r-sm); font-size: 17px; font-weight: 500; color: var(--ink-2); }
.stepper button:hover { background: var(--hover); color: var(--ink-strong); }
.stepper output { min-width: 22px; text-align: center; font-weight: 600; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; min-height: 48px; }
.switch input { appearance: none; width: 40px; height: 24px; border-radius: 99px; background: var(--line-2); position: relative; flex: none; cursor: pointer; transition: background .15s; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--ink-strong); }
.switch input:checked::after { transform: translateX(16px); }

/* ---------- panels & callouts ---------- */
.panel { background: transparent; border: 1px solid var(--hair); border-radius: var(--r-lg); padding: 20px; }
.panel.soft { background: var(--hover); border-color: transparent; }
.panel > h2:first-child { padding-bottom: 10px; border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.callout { display: block; background: var(--hover); border-radius: var(--r); padding: 12px 14px; font-size: 14px; }
.note-box { background: var(--hover); border-radius: var(--r); padding: 14px 16px; white-space: pre-wrap; font-size: 15px; }

/* ---------- library: database toolbar, gallery and list ---------- */
.ribbon { display: none; }
.hero { display: grid; gap: 12px; margin-bottom: 16px; }
.db-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.db-bar .seg { flex: none; }
.hero-tools { display: flex; gap: 8px; align-items: center; }
.hero-tools .btn { flex: none; }
.db-count { font-size: 13px; color: var(--ink-2); margin: 12px 0; }

/* Gallery: equal cards, cover on top, properties underneath. */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
.rcard { display: flex; flex-direction: column; text-decoration: none; position: relative; border: 1px solid var(--hair); border-radius: var(--r-lg); overflow: hidden; background: var(--card); transition: border-color .12s, box-shadow .12s; }
.rcard:hover { border-color: color-mix(in srgb, var(--ink-strong) 30%, transparent); box-shadow: 0 2px 10px color-mix(in srgb, var(--ink-strong) 6%, transparent); }
.rcard .pic { position: relative; background: var(--tile, var(--tile-1)); aspect-ratio: 4 / 3; display: grid; place-items: center; border-bottom: 1px solid var(--hair); }
.rcard .pic.patterned { background-color: var(--pat-bg); background-image: var(--pattern); background-size: calc(var(--pattern-size) * .75); }
.rcard .pic.patterned .illus { background: var(--bg); border-radius: var(--r-lg); padding: 10%; width: 62%; }
.rcard .pic img { width: 100%; height: 100%; object-fit: cover; }
.rcard .illus { width: 52%; }
.rcard .body { padding: 10px 12px 12px; display: grid; gap: 6px; }
.rcard h3 { font: 600 14px/1.35 var(--sans); color: var(--ink-strong); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rcard .props { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.rcard .props .tag { font-size: 12px; line-height: 20px; padding: 0 6px; }
.rcard .props .mono { font-size: 12px; }
.fav-btn { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: var(--r); border: 0; background: color-mix(in srgb, var(--bg) 88%, transparent); display: grid; place-items: center; color: var(--ink-3); }
.fav-btn svg { width: 17px; height: 17px; }
.fav-btn[aria-pressed="true"] { color: var(--accent); }

/* List: stacked rows, like a database table. */
.rlist { border-top: 1px solid var(--hair); }
.rrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--hair); text-decoration: none; min-height: 60px; border-radius: 0; }
.rrow:hover { background: var(--hover); }
.rrow .mini { width: 44px; height: 44px; border-radius: var(--r); background: var(--tile); display: grid; place-items: center; overflow: hidden; }
.rrow .mini img { width: 100%; height: 100%; object-fit: cover; }
.rrow .mini .illus { width: 30px; }
.rrow .ttl { font-weight: 600; font-size: 15px; color: var(--ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.rrow .ttl svg { width: 14px; height: 14px; color: var(--accent); flex: none; }
.rrow .sub { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.rrow .sub .tag { font-size: 12px; line-height: 20px; padding: 0 6px; }
.rrow .cols { display: none; }
.rrow .chev { color: var(--ink-3); width: 18px; height: 18px; }
@media (min-width: 720px) {
  .rrow { grid-template-columns: 44px minmax(0, 1fr) 130px 90px 150px 20px; }
  .rrow .sub { display: none; }
  .rrow .cols { display: contents; font-size: 13px; color: var(--ink-2); }
  .rrow .cols > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rlist-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) 130px 90px 150px 20px; gap: 12px; padding: 6px 4px; font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--hair); }
}
.rlist-head { display: none; }
@media (min-width: 720px) { .rlist-head { display: grid; } .rlist { border-top: 0; } }

.empty { text-align: center; padding: 48px 16px; display: grid; gap: 12px; justify-items: center; }
.empty .art { width: 132px; height: 132px; border-radius: var(--r-lg); background: var(--soft); display: grid; place-items: center; }
.empty .art .illus { width: 88px; }
.empty p { max-width: 42ch; color: var(--ink-2); }

/* Collections: a ruled grid of cells, like the "Our services" reference. */
.ctiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
@media (min-width: 640px) { .ctiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .ctiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ctile { display: grid; grid-template-rows: 1fr auto; justify-items: center; gap: 8px; padding: 20px 12px 14px; min-height: 148px; text-decoration: none; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: transparent; text-align: center; }
.ctile:hover { background: var(--hover); }
.ctile.hl { background: var(--band); color: var(--on-band); }
.ctile.hl :is(b, .mono) { color: var(--on-band); }
.ctile .illus, .ctile > svg { width: 56px; height: 56px; align-self: center; }
.ctile b { font: 500 15px/1.25 var(--sans); color: var(--ink-strong); display: flex; align-items: center; gap: 6px; }
.ctile b svg { width: 16px; height: 16px; }
.ctile .mono { font-size: 12px; }
.ctile .label-card { display: grid; justify-items: center; gap: 2px; }
.ctile.pat { background: transparent; }

/* ---------- recipe page (a Notion-style page) ---------- */
.detail { max-width: var(--read); margin: 0 auto; }
.cover { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--tile, var(--tile-1)); height: clamp(140px, 30vw, 220px); display: grid; place-items: center; }
.cover.patterned { background-color: var(--pat-bg); background-image: var(--pattern); background-size: var(--pattern-size); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .spark { display: none; }
.cover > .illus { width: 120px; opacity: .9; }
.cover.patterned > .illus { display: none; }
.cover.has-photo + .r-icon { display: none; }
.r-icon { width: 76px; height: 76px; border-radius: var(--r-lg); background: var(--bg); border: 1px solid var(--hair); display: grid; place-items: center; margin: -38px 0 0 16px; position: relative; }
.r-icon .illus { width: 54px; }
.r-head { display: grid; gap: 10px; margin-top: 16px; }
.r-head h1 { font-size: clamp(32px, 6.6vw, 46px); }
.r-head .desc { color: var(--ink-2); font-size: 16px; max-width: 62ch; }
.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
@media (min-width: 560px) { .actions { grid-template-columns: repeat(4, max-content); } }
.actions .btn { justify-content: flex-start; }
.actions .btn[aria-pressed="true"] svg { color: var(--accent); }
.props-table { display: grid; grid-template-columns: minmax(96px, 150px) minmax(0, 1fr); margin-top: 20px; border-top: 1px solid var(--hair); }
.props-table > div { display: contents; }
.props-table dt, .props-table dd { margin: 0; padding: 8px 4px; border-bottom: 1px solid var(--hair); min-height: 40px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.props-table dt { color: var(--ink-2); font-size: 14px; gap: 8px; }
.props-table dt svg { width: 16px; height: 16px; color: var(--ink-3); }
.props-table dd { font-size: 14px; }
.props-table dd a { color: var(--ink-strong); }
.r-section { margin-top: 36px; }
.r-section > .section-title h2 { font-size: 24px; }
.meta-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.ing-list { list-style: none; padding: 0; margin: 0; }
.ing-list li.group { padding: 18px 0 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 7px 4px; cursor: pointer; min-height: 40px; border-radius: var(--r-sm); font-size: 15px; }
.check:hover { background: var(--hover); }
.check input { appearance: none; width: 18px; height: 18px; border: 1.5px solid var(--ink-2); border-radius: var(--r-xs); flex: none; margin: 3px 0 0; display: grid; place-items: center; cursor: pointer; background: var(--card); }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { content: ''; width: 9px; height: 5px; border: 2px solid var(--on-accent); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.check input:checked + span { text-decoration: line-through; color: var(--ink-3); }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 32px 1fr; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--hair); font-size: 16px; line-height: 1.65; color: var(--ink-strong); }
.steps li:last-child { border-bottom: 0; }
.steps li::before { counter-increment: s; content: counter(s) "."; font: 500 15px/1.65 var(--serif); color: var(--ink-2); }
.steps li.group { display: block; padding: 18px 0 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); border-bottom: 0; }
.steps li.group::before { display: none; }
.sources { display: flex; gap: 8px; flex-wrap: wrap; }
.sources button { border: 1px solid var(--hair); border-radius: var(--r); padding: 0; width: 64px; height: 100px; overflow: hidden; background: var(--soft); }
.sources img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.sticky-cook { position: sticky; bottom: calc(68px + var(--safe-b)); z-index: 5; margin-top: 28px; padding: 8px 0; }
@media (min-width: 860px) { .sticky-cook { bottom: 16px; } }
.sticky-cook .btn { width: 100%; min-height: 52px; font-size: 16px; border-radius: var(--r-lg); }

/* ---------- editor ---------- */
.editor { display: grid; gap: 20px; max-width: var(--read); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { width: 72px; height: 112px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--hair); position: relative; background: var(--soft); }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: var(--r-sm); border: 0; background: var(--bg); font-weight: 600; box-shadow: 0 0 0 1px var(--hair); }
.illus-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; }
.illus-pick button { aspect-ratio: 1; border-radius: var(--r); border: 1px solid var(--hair); background: var(--soft); padding: 8px; }
.illus-pick button[aria-pressed="true"] { border: 2px solid var(--ink-strong); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 36px; height: 36px; border-radius: var(--r); border: 1px solid var(--hair); }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink-strong); }
.add-options { display: grid; border-top: 1px solid var(--rule); }
@media (min-width: 720px) { .add-options { grid-template-columns: repeat(3, 1fr); border-left: 1px solid var(--rule); } }
.add-opt { text-align: left; border: 0; border-bottom: 1px solid var(--rule); background: transparent; border-radius: 0; padding: 20px 4px; display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: center; text-decoration: none; }
@media (min-width: 720px) { .add-opt { border-right: 1px solid var(--rule); grid-template-columns: 1fr; padding: 24px; align-content: start; } }
.add-opt:hover { background: var(--hover); }
.add-opt .top { width: 64px; height: 64px; display: grid; place-items: center; background: var(--tile); border-radius: var(--r-lg); }
.add-opt .top svg.illus { width: 44px; }
.add-opt .txt { display: grid; gap: 4px; }
.add-opt b { font: 400 21px/1.2 var(--serif); color: var(--ink-strong); }
.drop { border: 1px dashed var(--line-2); border-radius: var(--r-lg); padding: 24px 16px; text-align: center; display: none; gap: 12px; justify-items: center; }
@media (pointer: fine) { .drop { display: grid; } }
.drop.over { border-color: var(--ink-strong); background: var(--hover); }
.reading { display: grid; justify-items: center; gap: 12px; padding: 64px 16px; text-align: center; }
.reading .art { width: 96px; height: 96px; border-radius: var(--r-lg); background: var(--soft); display: grid; place-items: center; animation: wobble 1.6s ease-in-out infinite; }
.reading .art .illus { width: 64px; }
@keyframes wobble { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@media (prefers-reduced-motion: reduce) { .reading .art { animation: none; } }

/* ---------- plan ---------- */
.week-head { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; width: 100%; }
.week-head h1 { font-size: clamp(30px, 6vw, 40px); }
.season-card { border: 1px solid var(--hair); border-radius: var(--r-lg); display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; align-items: start; padding: 14px; }
.season-card .badge { width: 48px; height: 48px; border-radius: var(--r); background-color: var(--pat-bg); background-image: var(--pattern); background-size: calc(var(--pattern-size) * .5); display: grid; place-items: center; }
.season-card .badge span { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--bg); display: grid; place-items: center; }
.season-card .badge svg { width: 18px; height: 18px; color: var(--ink-strong); }
.season-card h3 { margin-bottom: 2px; }
.days { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--rule); }
@media (min-width: 860px) { .days { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; } }
.day { padding: 14px 0 10px; border-bottom: 1px solid var(--hair); }
.day.today .day-h b::after { content: 'Today'; margin-left: 8px; font: 500 11px/20px var(--sans); text-transform: uppercase; letter-spacing: .06em; background: var(--hi); color: var(--on-hi); padding: 1px 6px; border-radius: var(--r-xs); vertical-align: middle; }
.day-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.day-h b { font: 400 20px/1.3 var(--serif); color: var(--ink-strong); }
.slot { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; align-items: start; padding: 4px 0; }
.slot .label { padding-top: 10px; font-size: 11px; }
.slot-items { display: grid; gap: 2px; grid-template-columns: minmax(0, 1fr); }
.pentry { display: flex; align-items: center; gap: 10px; border-radius: var(--r-sm); padding: 4px; min-height: 40px; }
.pentry:hover { background: var(--hover); }
.pentry .mini { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--tile); flex: none; display: grid; place-items: center; overflow: hidden; }
.pentry .mini img { width: 100%; height: 100%; object-fit: cover; }
.pentry .mini .illus { width: 22px; }
.pentry a, .pentry .t { flex: 1; min-width: 0; font-weight: 500; font-size: 14px; text-decoration: none; color: var(--ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pentry .t { font-style: italic; font-weight: 400; color: var(--ink-2); }
.pentry button { width: 32px; height: 32px; border: 0; background: transparent; border-radius: var(--r-sm); color: var(--ink-3); flex: none; opacity: .7; }
.pentry button:hover { background: var(--press); opacity: 1; }
.slot-add { border: 0; background: transparent; border-radius: var(--r-sm); min-height: 36px; color: var(--ink-3); font-size: 13px; text-align: left; padding: 0 6px; }
.slot-add:hover { background: var(--hover); color: var(--ink-strong); }
.ideas { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }

/* ---------- shopping ---------- */
.aisle { margin-top: 24px; }
.aisle h3 { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); padding-bottom: 6px; border-bottom: 1px solid var(--rule); margin-bottom: 2px; }
.shop-item { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--hair); }
.shop-item .check { flex: 1; }
.shop-item .from { font-size: 12px; color: var(--ink-3); display: block; }
.shop-item button.x { width: 36px; height: 36px; border: 0; background: transparent; color: var(--ink-3); border-radius: var(--r-sm); }
.shop-item button.x:hover { background: var(--hover); }

/* ---------- sheets ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--ink-strong) 32%, transparent); }
.sheet { position: relative; background: var(--bg); width: 100%; max-width: 600px; max-height: 88vh; overflow: auto; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 6px 20px calc(24px + var(--safe-b)); animation: up .18s ease-out; overscroll-behavior: contain; }
.sheet::before { content: ''; display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 4px auto 12px; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; position: sticky; top: -6px; background: var(--bg); padding: 8px 0 10px; z-index: 2; border-bottom: 1px solid var(--rule); }
.sheet-h h2 { font-size: 22px; }
@media (min-width: 720px) { .sheet-wrap { align-items: center; } .sheet { border-radius: var(--r-lg); max-height: 84vh; box-shadow: 0 16px 48px color-mix(in srgb, var(--ink-strong) 18%, transparent); } .sheet::before { display: none; } }
@keyframes up { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
.pick-list { display: grid; gap: 1px; }
.pick { display: flex; align-items: center; gap: 12px; padding: 6px; border-radius: var(--r); border: 0; background: transparent; text-align: left; width: 100%; min-height: 52px; }
.pick:hover { background: var(--hover); }
.pick .mini { width: 40px; height: 40px; border-radius: var(--r); background: var(--tile); flex: none; display: grid; place-items: center; overflow: hidden; }
.pick .mini img { width: 100%; height: 100%; object-fit: cover; }
.pick .mini .illus { width: 28px; }
.pick b { display: block; font-weight: 600; font-size: 14px; color: var(--ink-strong); }

/* look & feel */
.moods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mood { border: 1px solid var(--hair); border-radius: var(--r-lg); padding: 0; overflow: hidden; background: var(--card); text-align: left; }
.mood[aria-pressed="true"] { border-color: var(--ink-strong); box-shadow: 0 0 0 1px var(--ink-strong); }
.mood .sw { width: 100%; height: 44px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; }
.mood .sw i { display: block; }
.mood .nm { display: block; padding: 8px 10px 10px; }
.mood .nm b { display: block; font: 500 15px/1.3 var(--sans); color: var(--ink-strong); }
.mood .nm span { font-size: 12px; color: var(--ink-2); }
.pats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pat { border: 1px solid var(--hair); border-radius: var(--r); aspect-ratio: 1; padding: 0; background-color: var(--pat-bg); background-size: 28px; position: relative; overflow: hidden; }
.pat[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink-strong); }
.pat span { position: absolute; left: 4px; right: 4px; bottom: 4px; background: var(--bg); border-radius: var(--r-xs); font-size: 11px; font-weight: 600; padding: 2px 0; color: var(--ink-strong); }
.backs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.backs button { border: 1px solid var(--hair); border-radius: var(--r); background: var(--card); padding: 8px; text-align: left; display: grid; gap: 6px; }
.backs button[aria-pressed="true"] { border-color: var(--ink-strong); box-shadow: 0 0 0 1px var(--ink-strong); }
.backs .pv { height: 44px; border-radius: var(--r-sm); position: relative; overflow: hidden; border: 1px solid var(--hair); }
.backs b { font-size: 13px; font-weight: 600; color: var(--ink-strong); }

/* ---------- cooking (focus mode) ---------- */
.cook { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); padding: env(safe-area-inset-top, 0px) 0 var(--safe-b); }
.cook-top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--hair); }
.cook-top .ttl { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cook-progress { display: flex; gap: 3px; padding: 10px 16px 0; max-width: 820px; width: 100%; margin: 0 auto; }
.cook-progress i { flex: 1; height: 3px; border-radius: 2px; background: var(--hair); }
.cook-progress i.on { background: var(--ink-strong); }
.cook-body { overflow: auto; padding: 16px 24px 24px; max-width: 820px; width: 100%; margin: 0 auto; }
.cook-step-n { font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--ink-2); text-transform: uppercase; margin: 16px 0 12px; }
.cook-text { overflow-wrap: anywhere; font: 400 clamp(24px, 5.4vw, 36px)/1.4 var(--serif); color: var(--ink-strong); }
.cook-text .tmr { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; font: 600 16px/1 var(--sans); min-height: 40px; padding: 0 12px; border-radius: var(--r); border: 0; background: var(--hi); color: var(--on-hi); margin: 0 2px; }
.cook-text .tmr svg { width: 17px; height: 17px; }
.cook-ings { margin-top: 20px; background: var(--hover); border-radius: var(--r); padding: 12px 16px; font-size: 15px; line-height: 1.7; }
.cook-ings b { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.cook-nav { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--hair); max-width: 820px; width: 100%; margin: 0 auto; }
.cook-nav .btn { min-height: 56px; font-size: 16px; border-radius: var(--r-lg); }
.timers { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + var(--safe-b)); z-index: 70; display: grid; gap: 6px; width: min(420px, calc(100% - 32px)); }
.timer { display: flex; align-items: center; gap: 10px; background: var(--ink-strong); color: var(--bg); border-radius: var(--r-lg); padding: 6px 6px 6px 14px; }
.timer b { font: 600 18px/1 var(--sans); font-variant-numeric: tabular-nums; }
.timer .grow { font-size: 13px; opacity: .8; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.timer button { min-height: 36px; border-radius: var(--r); border: 0; background: color-mix(in srgb, var(--bg) 16%, transparent); color: var(--bg); padding: 0 10px; font-weight: 600; font-size: 13px; }
.timer.done { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.02); } }

/* ---------- misc ---------- */
.toast { position: fixed; left: 50%; bottom: calc(150px + var(--safe-b)); transform: translateX(-50%); z-index: 80; background: var(--ink-strong); color: var(--bg); padding: 10px 16px; border-radius: var(--r-lg); font-weight: 500; font-size: 14px; max-width: calc(100% - 32px); box-shadow: 0 6px 24px color-mix(in srgb, var(--ink-strong) 20%, transparent); }
@media (min-width: 860px) { .toast { bottom: 32px; left: calc(50% + var(--side) / 2); } .timers { bottom: 24px; left: calc(50% + var(--side) / 2); } }
.dev-banner, .offline-banner { background: var(--hi); color: var(--on-hi); text-align: center; font-size: 12px; font-weight: 600; padding: 4px 12px; position: relative; z-index: 25; }
@media (min-width: 860px) { .dev-banner, .offline-banner { margin-left: var(--side); } }
.gate { max-width: 400px; margin: 10vh auto 0; text-align: center; display: grid; gap: 14px; justify-items: center; }
.gate .art { width: 112px; height: 112px; border-radius: var(--r-lg); background: var(--soft); display: grid; place-items: center; }
.gate .art .illus { width: 76px; }
.list-rows .r { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hair); }
.cat-row { display: flex; gap: 6px; align-items: center; }
.cat-row .input { min-height: 40px; }
.cat-row button { width: 40px; height: 40px; border-radius: var(--r); border: 1px solid var(--hair); background: transparent; flex: none; color: var(--ink-2); }
.cat-row button:hover { background: var(--hover); }
.illus { display: block; height: auto; }
.lightbox img { width: 100%; border-radius: var(--r); }

/* ---------- illustrations: cut-paper colour, or (default) line drawing like the references ---------- */
.f-red { fill: var(--c-red); } .f-pink { fill: var(--c-pink); } .f-yellow { fill: var(--c-yellow); } .f-green { fill: var(--c-green); }
.f-leaf { fill: var(--c-leaf); } .f-lav { fill: var(--c-lav); } .f-sky { fill: var(--c-sky); } .f-cream { fill: var(--c-cream); }
.f-brown { fill: var(--c-brown); } .f-ink { fill: var(--ink-strong); }
.s-red { stroke: var(--c-red); } .s-green { stroke: var(--c-green); } .s-leaf { stroke: var(--c-leaf); } .s-cream { stroke: var(--c-cream); }
.s-lav { stroke: var(--c-lav); } .s-brown { stroke: var(--c-brown); }
/* Line drawing, in the app icon's hand: bold rounded ink strokes, with small solid details like the hen's eye. */
[data-art="line"] .illus:not(.stamp) :is(circle, ellipse, path, rect, polygon) { fill: none; stroke: var(--ink); stroke-width: 3px; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
[data-art="line"] .illus:not(.stamp) .f-ink { fill: var(--ink); stroke: none; }
[data-art="line"] .illus:not(.stamp) .f-red:is(circle, ellipse) { fill: var(--ink); stroke: var(--ink); }
[data-art="line"] :is(.page-icon, .r-icon, .mini) .illus:not(.stamp) :is(circle, ellipse, path, rect, polygon) { stroke-width: 2.4px; }
/* Cut-paper colour, given the icon's drawn edge: a fine ink outline around each paper shape. */
[data-art="colour"] .illus:not(.stamp) :is(circle, ellipse, path, rect, polygon):not([class^="s-"]) { stroke: var(--ink); stroke-width: 1.4px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
[data-art="colour"] .illus:not(.stamp) .f-ink { fill: var(--ink); }
/* Stamp: the app icon's own style. */
.illus.stamp { --stamp-ink: var(--ink); --stamp-paper: var(--c-cream); }
.illus.stamp .sb { fill: var(--stamp-ink); }
.illus.stamp .sbl { fill: none; stroke: var(--stamp-ink); stroke-linecap: round; stroke-linejoin: round; }
.illus.stamp .sd { fill: none; stroke: var(--stamp-paper); stroke-linecap: round; stroke-linejoin: round; }
.illus.stamp .sdf { fill: var(--stamp-paper); }
.illus.stamp .sdo { fill: var(--stamp-paper); stroke: var(--stamp-ink); stroke-width: 3; stroke-linejoin: round; }
.stamp-tile { width: 84px; height: 84px; flex: none; display: grid; place-items: center; background: var(--c-cream); border: 3.5px solid var(--ink);
  border-radius: 31% 27% 30% 28% / 28% 31% 27% 31%; }   /* a little uneven, like the hand-drawn icon frame */
.stamp-tile .illus { width: 74%; }
.ctile .stamp-tile { width: 72px; height: 72px; }
.ctile.hl .stamp-tile { border-color: var(--on-band); }
.page-icon .stamp-tile { width: 100%; height: 100%; border-width: 2.5px; }
.family-card .stamp-tile { width: 68px; height: 68px; background: var(--c-cream); border-color: var(--on-hi); }
.family-card .stamp-tile .illus { --stamp-ink: var(--on-hi); }

/* screenshot review, drafts inbox */
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--ink-strong); display: inline-block; animation: spin .8s linear infinite; flex: none; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }
.drafts-banner { display: flex; align-items: center; gap: 12px; text-decoration: none; background: var(--hi); color: var(--on-hi); border-radius: var(--r-lg); padding: 10px 14px; margin-bottom: 20px; min-height: 52px; }
.drafts-banner b { color: var(--on-hi); font-weight: 600; }
.drafts-banner .tiny { color: var(--on-hi); opacity: .8; }
.drafts-banner svg { width: 18px; height: 18px; flex: none; }
.drafts-banner .spin { border-color: color-mix(in srgb, var(--on-hi) 25%, transparent); border-top-color: var(--on-hi); }
.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.shot { position: relative; aspect-ratio: 9 / 16; border-radius: var(--r); overflow: hidden; border: 1px solid var(--hair); background: var(--soft); }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.shot-n { position: absolute; left: 6px; top: 6px; min-width: 22px; height: 22px; border-radius: var(--r-xs); background: var(--ink-strong); color: var(--bg); font: 600 12px/22px var(--sans); text-align: center; }
.shot-x { position: absolute; right: 4px; top: 4px; width: 36px; height: 36px; border-radius: var(--r); border: 0; background: var(--bg); color: var(--ink-strong); display: grid; place-items: center; box-shadow: 0 0 0 1px var(--hair); }
.shot-st { position: absolute; inset: auto 0 0 0; display: grid; place-items: center; padding: 8px; background: color-mix(in srgb, var(--bg) 85%, transparent); font-size: 12px; font-weight: 600; }
.shot-st.err { background: #B3261E; color: #fff; }
.shot.add, .add-thumb { display: grid; place-items: center; align-content: center; gap: 4px; border: 1px dashed var(--line-2); background: transparent; color: var(--ink-2); font-weight: 500; font-size: 13px; cursor: pointer; }
.shot.add:hover, .add-thumb:hover { background: var(--hover); }
.add-thumb { width: 72px; height: 112px; border-radius: var(--r); }
.draft-row { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--hair); padding: 10px 4px; }
.draft-row:first-child { border-top: 1px solid var(--rule); }
.draft-row > .btn, .draft-row > .icon-btn { flex: none; }
.draft-thumb { width: 44px; height: 64px; border-radius: var(--r-sm); overflow: hidden; background: var(--soft); flex: none; position: relative; border: 1px solid var(--hair); }
.draft-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.draft-thumb b { position: absolute; right: 2px; bottom: 2px; background: var(--ink-strong); color: var(--bg); font: 600 11px/16px var(--sans); min-width: 16px; border-radius: var(--r-xs); text-align: center; }
.draft-title { display: block; color: var(--ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.draft-sub { display: flex; align-items: center; gap: 6px; }
.editor .row[style*="sticky"] { background: color-mix(in srgb, var(--bg) 94%, transparent) !important; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
@media (min-width: 860px) { .editor .row[style*="sticky"] { bottom: 0 !important; } }
@media (max-width: 600px) {
  .page-head { gap: 6px; margin-bottom: 16px; }
  .page-icon { width: 44px; height: 44px; border-radius: var(--r); }
  .page-icon .illus { width: 32px; }
  .page-icon svg:not(.illus) { width: 22px; height: 22px; }
  h1 { font-size: 32px; }
  .main { padding-top: 16px; }
}
.actions .cook-btn { grid-column: 1 / -1; justify-content: center; }
@media (min-width: 560px) { .actions { grid-template-columns: repeat(5, max-content); } .actions .cook-btn { grid-column: auto; } }
.end-cook { margin-top: 28px; }
.end-cook .btn { min-height: 48px; }

/* Takkie Bak identity: the oval logo heads the sidebar on computers; phones show the chicken icon and name. */
.brand-logo { display: none; }
@media (min-width: 860px) {
  .brand { justify-content: center; margin: 4px 0 18px; padding: 4px; }
  .brand-logo { display: block; width: 104px; height: auto; }
  .brand .brand-mark, .brand .brand-name { display: none; }
}
.gate .logo, .empty .logo, .about-logo { width: 150px; height: auto; }
.about-logo { width: 96px; }

/* clickable properties: meal type, author, cuisine, season, tag */
.tag-link { text-decoration: none; cursor: pointer; }
.tag-link:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink-strong) 28%, transparent); }
.author-link { color: var(--ink-strong); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink-strong) 30%, transparent); text-underline-offset: 3px; cursor: pointer; }
.author-link:hover { text-decoration-color: var(--ink-strong); }
.rcard .by { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcard .by .author-link { color: var(--ink-2); }
.initial { display: grid; place-items: center; width: 100%; height: 100%; font: 400 26px/1 var(--serif); color: var(--ink-strong); }
.author-list { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .author-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; } }
.author-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--hair); text-decoration: none; min-height: 52px; }
.author-row:hover { background: var(--hover); }
.author-row .initial { width: 34px; height: 34px; border-radius: 50%; background: var(--soft); font-size: 17px; flex: none; }
.author-row .grow { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-head .meta-chips { margin-top: 4px; }

/* cover photos: fill (drag + zoom) or whole (a printed photo on the banner) */
.cover img.fill, .rcard .pic img.fill { width: 100%; height: 100%; object-fit: cover; }
.cover { overflow: hidden; }
.cover.whole { height: clamp(220px, 62vw, 340px); padding: 16px; }
.print { display: inline-block; background: #fff; padding: 6px 6px 22px; border-radius: 2px; box-shadow: 0 2px 10px color-mix(in srgb, var(--ink-strong) 16%, transparent), 0 0 0 1px color-mix(in srgb, var(--ink-strong) 6%, transparent); transform: rotate(-2deg); max-height: 100%; }
.print img { display: block; max-height: calc(clamp(220px, 62vw, 340px) - 60px); width: auto; max-width: 100%; object-fit: contain; }
.rcard .pic.whole { padding: 8px; }
.rcard .pic.whole .print { padding: 3px 3px 10px; transform: rotate(-2deg); }
.rcard .pic.whole .print img { max-height: calc(var(--card-pic-h, 120px) - 24px); height: auto; }
.rcard .pic { --card-pic-h: 132px; }
@media (min-width: 640px) { .rcard .pic { --card-pic-h: 160px; } }
.cover-btn { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; min-height: 32px; border-radius: var(--r); background: color-mix(in srgb, var(--bg) 90%, transparent); color: var(--ink-strong); font-size: 13px; font-weight: 500; text-decoration: none; box-shadow: 0 0 0 1px var(--hair); }
.cover-btn svg { width: 15px; height: 15px; }
.cover-btn:hover { background: var(--bg); }
@media (hover: hover) { .cover .cover-btn { opacity: 0; transition: opacity .15s; } .cover:hover .cover-btn, .cover .cover-btn:focus-visible { opacity: 1; } }
.cover-edit { margin: 0; }
.cover-edit.draggable { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.cover-edit.draggable.dragging { cursor: grabbing; }
.cover-edit .drag-hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r); background: color-mix(in srgb, var(--ink-strong) 70%, transparent); color: #fff; font-size: 12px; font-weight: 500; pointer-events: none; }
.cover-edit .drag-hint svg { width: 14px; height: 14px; }
.cover-edit.dragging .drag-hint { opacity: 0; }
.zoom { display: flex; align-items: center; gap: 10px; color: var(--ink-2); }
.zoom svg { width: 18px; height: 18px; flex: none; }
.zoom input { flex: 1; accent-color: var(--ink-strong); }
.illus-box summary { cursor: pointer; font-size: 14px; color: var(--ink-2); padding: 6px 0; }
/* Photos are pinned to their frame, so the chosen position and zoom are what you see (a grid row can't size them). */
.cover, .rcard .pic, .pentry .mini, .pick .mini, .rrow .mini, .mini { position: relative; }
.cover img.fill, .rcard .pic img.fill { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
#coverField { scroll-margin-top: 72px; }

/* ---------- one-page recipe export (A4) ---------- */
#printArea { display: none; }
.pprobe { position: absolute; left: -10000px; top: 0; width: 703px; visibility: hidden; pointer-events: none; }
.psheet { --pb: #0B3A78; --pa: #0E4FA1; --pt: #1F2633; --pm: #556178; --pl: #E4E8F0;
  width: 703px; min-height: 1032px; display: flex; flex-direction: column; background: #fff; color: var(--pt);
  font: 400 calc(10.5pt * var(--s)) / 1.45 var(--sans); -webkit-print-color-adjust: exact; print-color-adjust: exact; text-align: left; }
.psheet .ph { text-align: center; margin-bottom: calc(8px * var(--s)); }
.psheet .plogo { height: calc(92px * var(--s)); width: auto; margin: 0 auto; display: block; }
.psheet .pfam { text-align: center; font: 600 calc(7.5pt * var(--s)) / 1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--pa); margin: 0 0 calc(4px * var(--s)); }
.psheet .pt { font: 400 calc(26pt * var(--s)) / 1.12 var(--serif); text-align: center; color: var(--pb); margin: 0 auto calc(6px * var(--s)); max-width: 88%; letter-spacing: -0.01em; }
.psheet .pd { text-align: center; color: var(--pm); max-width: 82%; margin: 0 auto calc(4px * var(--s)); font-size: calc(10pt * var(--s)); }
.psheet .pm { text-align: center; font-size: calc(8.5pt * var(--s)); color: var(--pm); letter-spacing: .06em; text-transform: uppercase; padding: 0; margin: calc(10px * var(--s)) 0 calc(26px * var(--s)); }
.psheet .pm i { font-style: normal; margin: 0 calc(10px * var(--s)); color: #A3ADBF; }
.psheet .pcols { display: grid; grid-template-columns: 35% 1fr; gap: calc(26px * var(--s)); align-items: start; }
.psheet h2 { font: 600 calc(8pt * var(--s)) / 1.3 var(--sans); text-transform: uppercase; letter-spacing: .14em; color: var(--pa); margin: 0 0 calc(10px * var(--s)); }
.psheet ul, .psheet ol { list-style: none; padding: 0; margin: 0; }
.psheet .pi li { padding: calc(3px * var(--s)) 0; break-inside: avoid; }
.psheet .ps li { display: grid; grid-template-columns: calc(20px * var(--s)) 1fr; gap: calc(6px * var(--s)); padding: calc(4px * var(--s)) 0 calc(6px * var(--s)); break-inside: avoid; }
.psheet .ps li b { font: 500 calc(11pt * var(--s)) / 1.3 var(--serif); color: var(--pa); }
.psheet li.pg { display: block; font-weight: 600; font-size: calc(7.5pt * var(--s)); text-transform: uppercase; letter-spacing: .12em; color: var(--pa); padding: calc(12px * var(--s)) 0 calc(3px * var(--s)); }
.psheet li.pg:first-child { padding-top: 0; }
.psheet .pf { margin-top: auto; padding-top: calc(18px * var(--s)); font-size: calc(8.5pt * var(--s)); color: var(--pm); }
.psheet .pcols { margin-bottom: calc(28px * var(--s)); column-gap: calc(34px * var(--s)); }
.psheet .pn { margin-bottom: calc(10px * var(--s)); }
.psheet .pn h3, .psheet dt { font: 600 calc(7pt * var(--s)) / 1.4 var(--sans); text-transform: uppercase; letter-spacing: .12em; color: #8792A8; margin: 0; }
.psheet .pn p { white-space: pre-wrap; margin: calc(2px * var(--s)) 0 0; color: var(--pt); }
.psheet .pinfo { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: calc(6px * var(--s)) calc(18px * var(--s)); margin: 0 0 calc(10px * var(--s)); }
.psheet .pinfo dd { margin: 0; color: var(--pt); overflow-wrap: anywhere; }
.psheet .pdis { font-size: calc(7pt * var(--s)); line-height: 1.4; color: #8792A8; font-style: italic; text-align: center; margin: calc(6px * var(--s)) auto 0; max-width: 90%; }

.export-view { position: fixed; inset: 0; z-index: 65; background: color-mix(in srgb, var(--ink-strong) 8%, var(--bg)); display: grid; grid-template-rows: auto 1fr auto; overflow: auto; padding-top: env(safe-area-inset-top, 0px); }
.ex-top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--hair); position: sticky; top: 0; z-index: 2; }
.ex-ttl { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-stage { position: relative; margin: 12px; }
.ex-paper { position: absolute; left: 50%; top: 0; width: 793px; padding: 45px; background: #fff; box-shadow: 0 4px 24px color-mix(in srgb, var(--ink-strong) 14%, transparent); transform-origin: top center; }
.ex-tip { text-align: center; font-size: 13px; color: var(--ink-2); padding: 4px 16px calc(16px + var(--safe-b)); }

@page { size: A4; margin: 12mm; }
@media print {
  body.printing > *:not(#printArea) { display: none !important; }
  body.printing { background: #fff !important; }
  body.printing #printArea { display: block !important; }
  body.printing #printArea .psheet { width: 100%; min-height: 270mm; }
}

/* ---------- Family recipes ---------- */
.fam-badge { display: inline-flex; align-items: center; gap: 6px; align-self: start; text-decoration: none; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--on-hi); background: var(--hi); padding: 3px 10px 3px 8px; border-radius: var(--pill); }
.fam-badge svg { width: 15px; height: 15px; }
.fam-dot { position: absolute; left: 6px; top: 6px; width: 28px; height: 28px; border-radius: var(--r); background: var(--hi); color: var(--on-hi); display: grid; place-items: center; }
.fam-dot svg { width: 16px; height: 16px; }
.family-card { display: grid; grid-template-columns: 76px minmax(0, 1fr) 20px; gap: 16px; align-items: center; text-decoration: none; padding: 16px; margin-bottom: 20px; border-radius: var(--r-lg); background: var(--hi); color: var(--on-hi); }
.family-card:hover { filter: brightness(0.98); }
.family-card .fc-pic { width: 76px; height: 76px; display: grid; place-items: center; }
.family-card .fc-pic > svg { width: 40px; height: 40px; }
.family-card .print { padding: 3px 3px 10px; transform: rotate(-4deg); }
.family-card .print img { max-height: 64px; max-width: 60px; object-fit: cover; }
.family-card .fc-txt { display: grid; gap: 2px; }
.family-card .fc-txt b { font: 400 24px/1.2 var(--serif); color: var(--on-hi); }
.family-card .eyebrow, .family-card .tiny { color: var(--on-hi); opacity: .8; }
.family-card > svg { width: 20px; height: 20px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions .btn { flex: 1 1 calc(50% - 4px); }
.actions .cook-btn { flex-basis: 100%; }
@media (min-width: 560px) { .actions .btn { flex: 0 0 auto; } .actions .cook-btn { flex-basis: auto; } }
.psheet .pabout.with-photo { display: grid; grid-template-columns: calc(86px * var(--s)) 1fr; gap: calc(16px * var(--s)); align-items: start; }
.psheet .pphoto { display: block; background: #fff; padding: calc(3px * var(--s)) calc(3px * var(--s)) calc(10px * var(--s)); box-shadow: 0 1px 4px rgba(11, 58, 120, .18), 0 0 0 1px rgba(11, 58, 120, .08); transform: rotate(-3deg); }
.psheet .pphoto img { display: block; width: 100%; height: calc(96px * var(--s)); object-fit: cover; object-position: 50% 30%; }
.page-icon-space { display: block; width: 56px; height: 56px; margin-bottom: 4px; }
@media (max-width: 600px) { .page-icon-space { width: 44px; height: 44px; } }
[data-backdrop="tinted"] .tabbar { background: color-mix(in srgb, var(--tint) 94%, transparent); }
[data-backdrop="pattern"] .tabbar, [data-backdrop="band"] .tabbar { background: color-mix(in srgb, var(--bg) 96%, transparent); }
