/* Zeke Library: Zeke & Learn web theme + Style Lab sidebar. Built from the Phase 1 prototype (concept B v2 + concept C's table). */
:root {
  --bg: #121419; --bg2: #1A1D23; --surface: #1F2229; --surface-2: #262A32; --line: #2E323C; --line-2: #3A3F4B;
  --ink: #F6F3EE; --soft: #CFD1D7; --mute: #9CA2AE; --accent: #FF783E; --accent-ink: #1A0F08;
  --blue-text: #6FAEE8; --good-text: #3FC1A6; --warn-text: #F2C46D;
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pixel: "Silkscreen", "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r-card: 12px; --r-row: 10px; --r-chip: 8px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --side-w: 256px; --top: 56px; --bnav: 60px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); color-scheme: dark; }
body { position: relative; margin: 0; color: var(--ink); font: 400 15.5px/1.55 var(--font); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(90vmax 60vmax at 8% -8%, rgba(255,120,62,.11), transparent 62%), radial-gradient(80vmax 60vmax at 100% 108%, rgba(52,127,197,.10), transparent 62%), var(--bg); }
body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(circle at 1px 1px, rgba(246,243,238,.05) 1px, transparent 0) 0 0 / 24px 24px;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 40%, #000 30%, transparent 100%); mask-image: radial-gradient(120% 90% at 50% 40%, #000 30%, transparent 100%); }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ico { flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 700; transition: top .15s; }
.skip:focus { top: 12px; }
kbd { font: 600 11px var(--mono); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface); color: var(--mute); }
.mono { font-family: var(--mono); }

/* ---------- app frame ---------- */
.app { min-height: 100vh; }
.main { min-width: 0; padding: 0 16px calc(var(--bnav) + 28px + env(safe-area-inset-bottom)); }
.page { max-width: 1180px; margin: 0 auto; }


/* ---------- mobile top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; height: calc(var(--top) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0 16px; margin: 0 -16px; display: flex; align-items: center; gap: 8px;
  background: rgba(18,20,25,.82); box-shadow: 0 1px 0 var(--line); -webkit-backdrop-filter: saturate(140%) blur(14px); backdrop-filter: saturate(140%) blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; min-width: 0; }
.brand img.mark { height: 26px; width: auto; }
.brand img.word { height: 14px; width: auto; }
.brand .lab { font: 400 10.5px var(--pixel); letter-spacing: .08em; color: var(--accent); padding: 3px 7px; border-radius: 7px; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.topbar .sp { flex: 1; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--soft); transition: background .15s, color .15s; }
.icon-btn:hover { background: rgba(255,255,255,.06); color: var(--ink); }
.coffee { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font: 700 13.5px/1 var(--font); white-space: nowrap; }
@media (max-width: 380px) { .brand img.word { display: none; } .coffee span { display: none; } }

/* ---------- sidebar (desktop), from Style Lab ---------- */
.side { display: none; }
@media (min-width: 768px) {
  .app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); align-items: start; }
  .topbar, .bnav { display: none !important; }
  .main { padding: 0 28px 48px; }
  .side { display: flex; position: sticky; top: 0; height: 100vh; flex-direction: column; gap: 12px; padding: 18px 14px 14px; background: var(--bg2); border-right: 1px solid var(--line); overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
}
.side .brand { padding: 2px 6px 4px; }
.side-toggle { position: absolute; top: 18px; right: 10px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--mute); transition: background .15s, color .15s; }
.side-toggle:hover { background: rgba(255,255,255,.07); color: var(--ink); }
.side-toggle .chev { transform-origin: 14.75px 12px; transition: transform .2s var(--ease); }
.search-btn { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 42px; padding: 9px 11px; border-radius: var(--r-row); background: var(--bg); border: 1px solid var(--line-2); color: var(--mute); font-weight: 600; font-size: 14px; transition: border-color .15s, color .15s; }
.search-btn:hover { color: var(--ink); border-color: var(--accent); }
.search-btn kbd { margin-left: auto; }
.cats { display: flex; flex-direction: column; gap: 2px; }
.nav-h { font: 700 10.5px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--mute); padding: 14px 10px 6px; opacity: .85; }
.cat { position: relative; display: flex; align-items: center; gap: 11px; min-height: 38px; padding: 8px 10px; border-radius: var(--r-row); color: color-mix(in srgb, var(--ink) 82%, var(--mute)); font-weight: 600; font-size: 14px; transition: background .15s, color .15s; }
.cat span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat small { font: 500 11px var(--mono); color: var(--mute); opacity: .85; }
.cat:hover { background: rgba(246,243,238,.06); color: var(--ink); }
.cat.on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--ink); }
.cat.on .ico { stroke: var(--accent); }
.cat.on::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.cat.on small { color: var(--accent); opacity: 1; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.side-foot .coffee { justify-content: center; }
.side-stat { font: 500 11px/1.4 var(--mono); color: var(--mute); padding: 0 6px; }

/* icon rail: tablets by default, or collapsed on desktop */
@media (min-width: 768px) { :root.rail { --side-w: 68px; } }
@media (min-width: 768px) {
  :root.rail .side { align-items: center; padding: 14px 10px; }
  :root.rail .side-toggle { position: static; flex: none; }
  :root.rail .side-toggle .chev { transform: scaleX(-1); }
  :root.rail .side .brand { padding: 0; }
  :root.rail .side .brand img.word, :root.rail .side .brand .lab { display: none; }
  :root.rail .search-btn { width: 44px; height: 42px; padding: 0; justify-content: center; }
  :root.rail .search-btn span, :root.rail .search-btn kbd { display: none; }
  :root.rail .cats { align-items: center; }
  :root.rail .nav-h { font-size: 0; padding: 0; margin: 10px 8px; height: 1px; width: 32px; background: var(--line); opacity: 1; }
  :root.rail .cat { width: 44px; height: 40px; min-height: 40px; padding: 0; justify-content: center; }
  :root.rail .cat span, :root.rail .cat small { display: none; }
  :root.rail .cat.on::before { left: -10px; }
  :root.rail .side-foot { width: 44px; }
  :root.rail .side-foot .coffee { width: 44px; padding: 0; } :root.rail .side-foot .coffee span, :root.rail .side-stat { display: none; }
}
.tip { position: fixed; z-index: 90; pointer-events: none; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line-2); font: 600 12.5px var(--font); color: var(--ink); white-space: nowrap; opacity: 0; transform: translateX(-4px); transition: opacity .12s, transform .12s var(--ease); }
.tip.show { opacity: 1; transform: none; }
.tip small { font: 500 11px var(--mono); color: var(--mute); margin-left: 6px; }

/* ---------- mobile bottom nav ---------- */
.bnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); padding: 0 4px env(safe-area-inset-bottom);
  background: rgba(26,29,35,.94); border-top: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.bnav a, .bnav button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: var(--bnav); border: 0; background: none; color: var(--mute); font: 600 11px var(--font); }
.bnav .on { color: var(--accent); }
.bnav .badge { position: absolute; top: 7px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font: 700 10px/16px var(--mono); }

/* ---------- type + sections ---------- */
.kicker { display: flex; align-items: center; gap: 6px; font: 400 11.5px/1.3 var(--pixel); letter-spacing: .04em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.h1 { font-weight: 700; font-size: clamp(28px, 6.4vw, 50px); line-height: 1.04; letter-spacing: -.03em; text-wrap: balance; }
.h1 em { font-style: normal; color: var(--accent); }
.lede { color: var(--soft); max-width: 40em; margin-top: 10px; }
.sec { margin-top: 32px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sec-h h2 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.sec-h .more { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; color: var(--mute); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.sec-h .more:hover { color: var(--ink); }
.sub-line { color: var(--mute); font-size: 13.5px; margin-top: -6px; margin-bottom: 12px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 18px 0 10px; color: var(--mute); font: 500 12px var(--mono); }
.crumbs a:hover { color: var(--ink); }

/* ---------- logo tile ---------- */
.logo { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 11px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font: 700 18px var(--font); }
.logo svg { width: 55%; height: 55%; fill: currentColor; }
.logo.lg { width: 72px; height: 72px; border-radius: 18px; font-size: 28px; }
.logo.sm { width: 32px; height: 32px; border-radius: 9px; font-size: 13px; }
.logo-stack { display: flex; }
.logo-stack .logo { box-shadow: 0 0 0 3px var(--surface), inset 0 0 0 1px var(--line); }
.logo-stack .logo + .logo { margin-left: -8px; }

/* ---------- badges ---------- */
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bdg { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: var(--r-chip); font: 600 11.5px/1 var(--font); color: var(--soft); background: rgba(255,255,255,.06); white-space: nowrap; }
.bdg .ico { width: 13px; height: 13px; }
.bdg.good { color: var(--good-text); background: rgba(38,150,129,.16); }
.bdg.warn { color: var(--warn-text); background: rgba(242,196,109,.12); }
.bdg.pick { font: 400 10px var(--pixel); letter-spacing: .04em; color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent); }
.bdg.new { color: var(--blue-text); background: rgba(111,174,232,.12); }
.devs { display: inline-flex; align-items: center; gap: 6px; color: var(--mute); }
.devs .ico { width: 15px; height: 15px; }

/* ---------- tool card (grid) ---------- */
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, transform .15s var(--ease); }
.card:hover { border-color: var(--line-2); }
.card .top { display: flex; gap: 12px; align-items: flex-start; padding-right: 40px; }
.card h3 { font-size: 15.5px; font-weight: 700; line-height: 1.25; }
.card .one { color: var(--soft); font-size: 13.5px; line-height: 1.45; margin-top: 2px; }
.card .stretch::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.limit { display: grid; gap: 2px; padding: 9px 10px; border-radius: var(--r-row); background: rgba(0,0,0,.18); }
.limit .lbl { font: 600 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.limit .val { font-size: 13px; color: var(--ink); line-height: 1.4; }
.card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.heart { position: absolute; top: 6px; right: 6px; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--mute); transition: color .15s, background .15s, transform .15s var(--ease); }
.heart:hover { background: rgba(255,255,255,.06); color: var(--ink); }
.heart[aria-pressed="true"] { color: var(--accent); }
.heart[aria-pressed="true"] .ico { fill: var(--accent); }
.heart.pop { transform: scale(1.18); }

/* ---------- tool row (compact list) ---------- */
.rows { display: flex; flex-direction: column; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.row { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 68px; padding: 10px 6px 10px 12px; transition: background .15s; }
.row + .row { border-top: 1px solid var(--line); }
.row:hover { background: rgba(255,255,255,.03); }
.row .nm { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; line-height: 1.25; }
.row .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .ln { font-size: 12.5px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.row .ln b { font-weight: 500; color: var(--soft); }
.row .heart { position: relative; top: auto; right: auto; }
.row .stretch::after { content: ""; position: absolute; inset: 0; }

/* ---------- pills, chips, scroller ---------- */
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--soft); font-weight: 600; font-size: 14px; white-space: nowrap; transition: border-color .15s, color .15s, background .15s; }
.pill:hover { border-color: var(--accent); color: var(--ink); }
.pill[aria-pressed="true"], .pill.on { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--ink); }
.pill .ico { width: 16px; height: 16px; color: var(--mute); }
.pill:hover .ico, .pill.on .ico { color: var(--accent); }
.scroller { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; /* snap to the padded edge, not the screen edge */ scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 2px 16px 6px; overscroll-behavior-x: contain; }
.scroller::-webkit-scrollbar { display: none; }
.scroller > * { scroll-snap-align: start; flex: none; }
@media (min-width: 768px) { .scroller { margin: 0; padding: 2px 0 6px; scroll-padding-inline: 0; } }

/* ---------- search field ---------- */
.searchbox { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 0 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); color: var(--mute); text-align: left; font-size: 15.5px; transition: border-color .15s; }
.searchbox:hover { border-color: var(--accent); }
.searchbox .ph { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.searchbox kbd { display: none; }
@media (min-width: 768px) { .searchbox kbd { display: inline-block; } }

/* ---------- kit card ---------- */
.kit { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); min-height: 168px; transition: border-color .15s; }
.kit:hover { border-color: var(--line-2); }
.kit.featured { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.kit h3 { font-size: 16px; line-height: 1.25; }
.kit p { color: var(--soft); font-size: 13.5px; line-height: 1.45; }
.kit .meta { display: flex; align-items: center; justify-content: space-between; margin-top: auto; color: var(--mute); font: 500 12px var(--mono); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 18px; border: 0; border-radius: 12px; font: 700 15px/1.1 var(--font); white-space: nowrap; transition: transform .14s var(--ease), background .15s; }
.btn:active { transform: scale(.975); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: rgba(255,255,255,.06); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost[aria-pressed="true"] { color: var(--accent); }
.btn-ghost[aria-pressed="true"] .ico { fill: var(--accent); }

/* ---------- filter bar ---------- */
.fbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0; }
.fbar .count { margin-left: auto; color: var(--mute); font: 500 12.5px var(--mono); }
.sel { min-height: 44px; padding: 0 34px 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239CA2AE' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; -webkit-appearance: none; appearance: none; font-weight: 600; font-size: 14px; color: var(--soft); }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); }
.seg button { display: grid; place-items: center; width: 38px; height: 36px; border: 0; border-radius: 999px; background: none; color: var(--mute); }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); }
.fbar .desk { display: none; }
.fbar .mob { display: inline-flex; }
@media (min-width: 768px) { .fbar .desk { display: inline-flex; } .fbar .mob { display: none; } }
.active-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.active-chips button { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 6px 0 10px; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--ink); font-weight: 600; font-size: 12.5px; }

/* ---------- empty state ---------- */
.empty { display: grid; justify-items: center; gap: 10px; padding: 40px 16px; text-align: center; color: var(--soft); border-radius: var(--r-card); border: 1px dashed var(--line-2); }
.empty .ico { width: 28px; height: 28px; color: var(--mute); }

/* ---------- overlays: palette + sheet ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(8,9,12,.62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s var(--ease); }
.scrim.show { opacity: 1; }
.palette { position: fixed; z-index: 61; inset: 0; display: flex; flex-direction: column; background: var(--bg2); opacity: 0; transform: translateY(8px); transition: opacity .18s var(--ease), transform .2s var(--ease); }
.palette.show { opacity: 1; transform: none; }
@media (min-width: 768px) { .palette { inset: 12vh auto auto 50%; width: min(680px, calc(100vw - 48px)); max-height: 70vh; margin-left: calc(min(680px, calc(100vw - 48px)) / -2); border-radius: 16px; border: 1px solid var(--line-2); box-shadow: 0 30px 80px -20px rgba(0,0,0,.7); } }
.pal-top { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px 16px; border-bottom: 1px solid var(--line); }
@media (min-width: 768px) { .pal-top { padding-top: 10px; } }
.pal-top .ico { color: var(--mute); }
.pal-in { flex: 1; min-width: 0; height: 48px; border: 0; background: none; outline: none; font: 600 18px var(--font); color: var(--ink); }
.pal-in::placeholder { color: var(--mute); font-weight: 500; }
.pal-list { flex: 1; overflow-y: auto; padding: 8px; overscroll-behavior: contain; }
.pal-sec { padding: 12px 10px 6px; font: 700 10.5px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.pal-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 52px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.pal-item .pn { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-item .pt { font-size: 12.5px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-item .pk { font: 500 11px var(--mono); color: var(--mute); }
.pal-item.on { background: var(--surface); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.pal-item .pi { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); color: var(--soft); }
.pal-item.on .pi { color: var(--accent); }
.pal-item mark { background: color-mix(in srgb, var(--accent) 26%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.pal-foot { display: none; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--mute); font-size: 12px; }
@media (min-width: 768px) { .pal-foot { display: flex; } }
.pal-sugg { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 10px 8px; }

.sheet { position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; max-height: 82vh; display: flex; flex-direction: column; border-radius: 18px 18px 0 0; background: var(--bg2); border-top: 1px solid var(--line-2); padding: 0 16px calc(16px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .24s var(--ease); }
.sheet.show { transform: none; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 10px auto 6px; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 8px; }
.sheet-h h2 { font-size: 18px; }
.sheet-body { overflow-y: auto; padding-bottom: 8px; }
.sheet .fgroup { padding: 12px 0; border-top: 1px solid var(--line); }
.sheet .fgroup h3 { font-size: 12px; font-family: var(--mono); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); margin-bottom: 10px; }
.sheet .fgroup .wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding-top: 12px; }
@media (min-width: 768px) { .sheet { left: 50%; right: auto; width: 480px; margin-left: -240px; bottom: auto; top: 50%; transform: translateY(-46%) scale(.98); opacity: 0; border-radius: 16px; border: 1px solid var(--line-2); transition: opacity .18s var(--ease), transform .2s var(--ease); } .sheet.show { transform: translateY(-50%); opacity: 1; } }

.toast { position: fixed; z-index: 70; left: 50%; bottom: calc(var(--bnav) + 16px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: 0 16px 40px -14px rgba(0,0,0,.7); font-weight: 600; font-size: 14px; transform: translate(-50%, 12px); opacity: 0; transition: opacity .18s var(--ease), transform .2s var(--ease); white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 9px; background: rgba(255,255,255,.08); color: var(--accent); font-weight: 700; }
@media (min-width: 768px) { .toast { bottom: 24px; } }

/* ---------- detail page ---------- */
.dt-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 8px; }
@media (max-width: 767px) { .dt-head { grid-template-columns: 1fr; gap: 12px; } }
.dt-head h1 { font-size: clamp(26px, 5vw, 38px); letter-spacing: -.02em; line-height: 1.1; }
.dt-head p { color: var(--soft); margin-top: 4px; }
.dt-actions { display: flex; gap: 10px; margin-top: 16px; }
.dt-actions .btn-primary { flex: 1; }
@media (min-width: 768px) { .dt-actions .btn-primary { flex: none; } }
.dt-grid { display: grid; gap: 16px; margin-top: 24px; }
@media (min-width: 1024px) { .dt-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }
.panel { padding: 16px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); }
.panel h2 { font-size: 15px; margin-bottom: 10px; }
.facts { display: grid; }
.facts > div { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.facts > div:first-child { border-top: 0; padding-top: 0; }
.facts dt { color: var(--mute); font: 500 12px/1.6 var(--mono); text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: 0; color: var(--ink); }
.steps { counter-reset: s; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; color: var(--soft); font-size: 14.5px; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); color: var(--accent); font: 700 13px var(--mono); }
.watch { display: flex; gap: 10px; color: var(--soft); font-size: 14px; }
.watch .ico { color: var(--warn-text); margin-top: 2px; }
.sticky-act { position: fixed; z-index: 35; left: 0; right: 0; bottom: calc(var(--bnav) + env(safe-area-inset-bottom)); display: flex; gap: 10px; padding: 10px 16px; background: rgba(26,29,35,.94); border-top: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.sticky-act .btn-primary { flex: 1; }
@media (min-width: 768px) { .sticky-act { display: none; } }

/* ---------- compare table ---------- */
.cmp { display: grid; gap: 12px; }
@media (min-width: 900px) { .cmp { grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); } }
.cmp .col { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); }
.cmp .col.paid { background: transparent; border-style: dashed; }
.cmp .col h3 { font-size: 16px; }
.cmp dl { display: grid; gap: 8px; margin: 0; }
.cmp dl div { display: grid; gap: 2px; }
.cmp dt { font: 600 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.cmp dd { margin: 0; font-size: 13.5px; color: var(--ink); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; scroll-behavior: auto !important; } }
.mob-spacer{display:block}@media(min-width:768px){.mob-spacer{display:none}}

/* ---------- Discover (concept B v2) ---------- */
.b-hero { margin-top: 22px; max-width: 760px; }
@media (min-width: 1024px) { .b-hero { margin: 48px auto 0; text-align: center; } .b-hero .lede { margin-inline: auto; } .b-hero .kicker { justify-content: center; } }
.b-hero .searchbox { min-height: 60px; margin-top: 18px; border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2)); font-size: 16px; }
.tasks { display: flex; gap: 8px; margin-top: 12px; }
@media (min-width: 768px) { .tasks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-inline: 0; padding: 0; overflow: visible; } }
.task { display: flex; align-items: center; gap: 9px; min-height: 46px; padding: 8px 14px 8px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--soft); font-weight: 600; font-size: 14px; text-align: left; white-space: nowrap; transition: border-color .15s, color .15s; }
@media (min-width: 768px) { .task { min-height: 52px; border-radius: var(--r-row); } }
.task:hover { border-color: var(--accent); color: var(--ink); }
.task .ico { color: var(--mute); }
.task:hover .ico { color: var(--accent); }
.wayout { margin-top: 14px; color: var(--mute); font-size: 14px; line-height: 1.5; }
.wayout a { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; padding: 12px 0; } /* inline + padding: big tap area without breaking the line */
.wayout a:hover { text-decoration-color: var(--accent); }
/* popular shelf: real tools in the first screen for people who are just looking */
.pop-sec { margin-top: 22px; }
.pop-sec .sec-h { margin-bottom: 8px; }
.pops > a { width: 196px; }
@media (min-width: 1024px) { .pops { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; } .pops > a { width: auto; } }
@media (min-width: 1400px) { .pops { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.pop { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); transition: border-color .15s; }
.pop:hover { border-color: var(--line-2); }
.pop .hd { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pop b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop p { font-size: 12.5px; line-height: 1.4; color: var(--soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.pop .bdg { align-self: flex-start; }
.stat { margin-top: 14px; color: var(--mute); font: 500 12px var(--mono); }
.groups { display: grid; gap: 20px; }
@media (min-width: 1024px) { .groups { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; } }
@media (min-width: 1280px) { .two .groups { grid-template-columns: 1fr; } }
@media (max-width: 767px) { .b-hero .lede { font-size: 15px; } }
.group h3 { font: 700 10.5px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--mute); margin-bottom: 8px; }
.ctiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ctile { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; align-items: center; min-height: 64px; padding: 10px 12px; border-radius: var(--r-row); background: var(--surface); border: 1px solid var(--line); transition: border-color .15s; }
.ctile:hover { border-color: var(--line-2); }
.ctile .ico { grid-row: 1 / 3; color: var(--soft); }
.ctile b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctile small { font: 500 11.5px var(--mono); color: var(--mute); }
.two { display: grid; gap: 28px; }
@media (min-width: 1280px) { .two { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; } }
.alts { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- table view (from concept C), desktop All tools / Category ---------- */
.tbl { display: table; width: 100%; border-collapse: separate; border-spacing: 0; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.tbl th { position: sticky; top: 0; text-align: left; padding: 10px 12px; font: 600 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); background: var(--bg2); border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { position: relative; transition: background .15s; }
.tbl tbody tr:hover { background: rgba(255,255,255,.03); }
.tbl .tn { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.tbl .tn b { color: var(--ink); font-size: 14.5px; }
.tbl .tn a::after { content: ""; position: absolute; inset: 0; }
.tbl .lim { max-width: 300px; }
.tbl .chk { font: 500 12px var(--mono); color: var(--mute); white-space: nowrap; }
.tbl .heart { position: relative; top: auto; right: auto; }
.tbl .tc { font-size: 12px; color: var(--mute); }
.tbl .hv { width: 52px; }

/* ---------- tool page extras: sources, notes ---------- */
.note { display: block; margin-top: 6px; color: var(--mute); font-size: 12.5px; line-height: 1.45; }
.srcs { display: grid; gap: 10px; }
.srcs li { display: grid; gap: 2px; }
.srcs a { display: inline-flex; align-items: center; gap: 4px; width: fit-content; min-height: 32px; color: var(--blue-text); font: 600 13.5px var(--mono); word-break: break-all; }
.srcs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.srcs span { color: var(--mute); font-size: 12.5px; line-height: 1.4; }
.kit-note { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--good-text); font-size: 13.5px; }

/* ---------- footer: thanks card + fine print ---------- */
.foot { max-width: 1180px; margin: 56px auto 0; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }
@media (min-width: 768px) { .foot { padding: 0 28px 40px; } }
.thanks { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; overflow: hidden; padding: 20px 16px 0; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); }
.thanks > div { padding-bottom: 20px; }
.thanks h2 { font-size: 24px; margin: 4px 0 6px; }
.thanks p { color: var(--soft); font-size: 14.5px; line-height: 1.5; margin-bottom: 14px; max-width: 46ch; }
.thanks img { height: 150px; width: auto; margin-bottom: -4px; }
@media (max-width: 420px) { .thanks { grid-template-columns: 1fr; } .thanks img { justify-self: center; height: 120px; } .thanks .btn { width: 100%; } .thanks > div { padding-bottom: 0; } }
.foot-meta { margin-top: 28px; display: grid; gap: 10px; color: var(--mute); font-size: 12.5px; line-height: 1.55; }
.foot-meta img { width: 150px; height: auto; margin-bottom: 4px; }
.foot-meta a { color: var(--soft); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }

/* ---------- GCash sheet ---------- */
.qr-card { display: grid; justify-items: center; gap: 6px; padding: 16px; border-radius: var(--r-card); background: #fff; color: #121419; text-align: center; }
.qr-card img { width: min(240px, 70vw); height: auto; }
.qr-card strong { font: 700 15px var(--mono); }
.qr-card span { font-size: 12px; color: #4a4f5a; }
.qr-steps { display: grid; gap: 8px; margin-top: 14px; padding-left: 20px; list-style: decimal; color: var(--soft); font-size: 14px; line-height: 1.45; }
.qr-steps b { color: var(--ink); }
.sheet[data-kind="coffee"] .sheet-actions { grid-template-columns: 1fr; }
/* mid widths (sidebar open, ~1024px): drop the Checked column so the table never scrolls sideways; the date is on each tool page */
.tbl { table-layout: auto; }
@media (max-width: 1279px) { .tbl th:nth-child(5), .tbl td.chk { display: none; } .tbl .tn { min-width: 170px; } }
