@font-face { font-family: 'Young Serif'; src: url('/fonts/young-serif-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --ink: #273c30;
  --paper: #f6f3eb;
  --card: #fcfaf5;
  --muted: #5f665a;
  --line: #dedfd3;
  --soft: #e8ebdf;
  --accent: #c86639;
  --warm: #efe0cd;
  --heading: 'Young Serif', Georgia, serif;
  --body: system-ui, -apple-system, sans-serif;
  --gutter: max(16px, env(safe-area-inset-left));
  --header-h: 56px;
  --tabs-h: 60px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--body); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: #8c4e2f; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2 { font-family: var(--heading); font-weight: 500; line-height: 1.15; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
[hidden] { display: none !important; }

/* Header and tabs */
.site-header { position: sticky; top: 0; z-index: 20; height: var(--header-h); display: flex; align-items: center; justify-content: space-between; padding: 0 var(--gutter); background: var(--paper); border-bottom: 1px solid var(--line); }
.wordmark { font-family: var(--heading); font-size: 24px; color: var(--ink); text-decoration: none; letter-spacing: -0.5px; }
.wordmark em { color: var(--accent); font-style: italic; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: var(--paper); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tab { flex: 1; height: var(--tabs-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: 13px; }
.tab-icon { font-size: 20px; line-height: 1; }
.tab[aria-current="page"] { color: var(--accent); font-weight: 600; }
.count { display: none; }
body { padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); }
@media (min-width: 800px) {
  .tabs { position: static; border: 0; padding: 0; gap: 6px; background: none; }
  .tab { flex: none; height: auto; flex-direction: row; gap: 6px; padding: 8px 14px; border-radius: 999px; font-size: 15px; }
  .tab[aria-current="page"] { background: var(--soft); color: var(--ink); }
  .tab-icon { font-size: 16px; }
  body { padding-bottom: 0; }
}
.offline { margin: 0; padding: 8px var(--gutter); background: var(--warm); color: #7a4422; font-size: 14px; text-align: center; }

main { max-width: 1100px; margin: 0 auto; padding: 0 var(--gutter); }

/* List view */
.list-controls { position: sticky; top: var(--header-h); z-index: 10; background: var(--paper); margin: 0 calc(var(--gutter) * -1); padding: 12px var(--gutter) 8px; border-bottom: 1px solid var(--line); }
.list-title { font-size: 30px; margin: 4px 0 10px; }
.search { display: flex; min-width: 0; }
.search input { width: 100%; min-width: 0; background: #fffdf8; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 16px; outline: none; }
.search input:focus { border-color: var(--ink); }
.pill { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 10px 16px; font-size: 15px; white-space: nowrap; }
.pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips { display: flex; gap: 8px; margin: 10px calc(var(--gutter) * -1) 0; padding: 0 var(--gutter) 4px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 7px 13px; font-size: 14px; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--chip, var(--accent)); flex: none; }
.results-head { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 6px; color: var(--muted); font-size: 14px; }
.text-button { border: 0; background: none; padding: 6px 0; font-size: 14px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

.ideas { list-style: none; margin: 0; padding: 0; }
.idea { position: relative; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.idea-link { flex: 1; display: grid; gap: 2px; padding: 14px 0; color: var(--ink); text-decoration: none; min-width: 0; }
.idea-cat { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); margin: 0; }
.idea-name { font-family: var(--heading); font-size: 21px; line-height: 1.2; }
.idea-meta { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 13px; background: var(--warm); color: #7a4422; border-radius: 4px; padding: 0 6px; }
.save { border: 0; background: none; font-size: 24px; width: 48px; height: 48px; color: #6a7566; }
.save[aria-pressed="true"] { color: #ad5438; }
.empty, .status { text-align: center; padding: 40px 0; }

@media (min-width: 800px) {
  .chips { margin-left: 0; margin-right: 0; padding: 0; flex-wrap: wrap; }
  .ideas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 8px; }
  .idea { border: 1px solid var(--line); background: var(--card); border-radius: 10px; align-items: flex-start; padding: 0 0 0 18px; min-height: 150px; transition: border-color .2s; }
  .idea:hover { border-color: #a3ae98; }
  .idea-link { padding: 18px 0; gap: 8px; align-self: stretch; }
  .idea-name { font-size: 23px; }
  .idea-meta { margin-top: auto; }
}

/* Idea page */
.idea-page { max-width: 760px; padding-bottom: 40px; }
.back { display: inline-block; margin: 18px 0 10px; color: var(--muted); text-decoration: none; font-size: 15px; padding: 6px 0; }
.idea-page h1 { font-size: clamp(34px, 8vw, 52px); margin: 8px 0 14px; letter-spacing: -0.5px; }
.idea-page h1:focus { outline: none; }
.actions { display: flex; gap: 8px; margin-bottom: 18px; }
.review { display: inline-block; font-size: 14px; border-radius: 6px; padding: 6px 10px; margin: 4px 0 6px; background: var(--warm); color: #7a4422; }
.review.reviewed { background: var(--soft); color: var(--ink); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 14px 0; }
.metric { background: var(--soft); border-radius: 8px; padding: 12px 14px; }
.metric small { display: block; font-size: 13px; color: var(--muted); }
.metric strong { font-size: 18px; font-weight: 600; }
.done { border-left: 3px solid #78906b; padding: 0 14px 2px; margin-top: 18px; }
.done h2 { margin-top: 0; padding-top: 4px; }
.block h2, .general h2 { font-size: 24px; margin: 26px 0 8px; }
.block li, .general li { margin: 7px 0; }
ol, ul { padding-left: 22px; }
.safety { background: #f6dccf; border-radius: 8px; padding: 2px 18px 8px; }
.storage { background: var(--soft); border-radius: 8px; padding: 2px 18px 6px; margin-top: 18px; }
.notice { background: var(--warm); padding: 14px 16px; border-radius: 8px; margin: 14px 0; }
.notice p { margin: 8px 0 0; }
.general { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 6px; }
.eyebrow { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 18px 0 0; }

.guide-link { font-weight: 600; text-decoration: none; }
.guide-list { list-style: none; padding: 0; }
.guide-list li { border-bottom: 1px solid var(--line); }
.guide-list a { display: flex; align-items: center; gap: 10px; padding: 14px 0; color: var(--ink); text-decoration: none; font-family: var(--heading); font-size: 20px; }

@media print {
  .site-header, .tabs, #listView, .back, .actions { display: none !important; }
  body { background: #fff; }
}
