:root {
  --font-display: "Bodoni Moda", Georgia, serif;
  --bg: #faf6f0;
  --surface: #ffffff;
  --surface-2: #f3ece2;
  --text: #211a14;
  --muted: #6f6357;
  --border: #e4d9ca;
  --accent: #b8420f;
  --accent-text: #ffffff;
  --accent-soft: #fbe6d9;
  --star: #c98a06;
  --radius: 18px;
  --shadow: 0 1px 2px rgb(60 40 20 / .05), 0 10px 28px rgb(60 40 20 / .08);
  color-scheme: light dark;
}

:root[data-theme="light"] { color-scheme: light; }

/* Dark palette: when the OS is dark (unless light was forced), or when dark was forced. Kept in sync by hand. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17130f;
    --surface: #211b16;
    --surface-2: #2b241d;
    --text: #f2e9dd;
    --muted: #a99c8d;
    --border: #3a3128;
    --accent: #f08a4b;
    --accent-text: #1c1209;
    --accent-soft: #3a2517;
    --star: #f2b84b;
    --shadow: 0 1px 2px rgb(0 0 0 / .45), 0 12px 32px rgb(0 0 0 / .4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17130f;
  --surface: #211b16;
  --surface-2: #2b241d;
  --text: #f2e9dd;
  --muted: #a99c8d;
  --border: #3a3128;
  --accent: #f08a4b;
  --accent-text: #1c1209;
  --accent-soft: #3a2517;
  --star: #f2b84b;
  --shadow: 0 1px 2px rgb(0 0 0 / .45), 0 12px 32px rgb(0 0 0 / .4);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, .card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

main { padding-block: 24px 48px; outline: none; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-text); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* header / footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.brand { font-family: var(--font-display); font-style: italic; font-size: 1.4rem; font-weight: 600; color: var(--text); text-decoration: none; letter-spacing: 0; }
.site-footer { color: var(--muted); font-size: .875rem; padding-block: 16px 32px; }

/* controls */
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: 999px;
}
.btn:hover { border-color: var(--accent); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

.field, select {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; min-width: 0;
}

.search-box { position: relative; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-box input { width: 100%; padding: 14px 44px 14px 44px; font-size: 1.05rem; border-radius: 14px; }
.search-box .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; opacity: .7; }
.search-box .clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); font-size: 1.3rem; cursor: pointer; padding: 6px 10px; border-radius: 8px; }

.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.filters label { display: grid; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.filters select, .filters .field { width: 100%; font-weight: 400; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  font: inherit; font-size: .875rem; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 5px 12px; border-radius: 999px;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.chip .n { opacity: .65; margin-left: 4px; font-size: .8em; }
.chip.removable::after { content: " ×"; }

.tag { display: inline-block; font-size: .75rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); padding: 3px 11px; border-radius: 999px; }

.status { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 20px 0 12px; color: var(--muted); font-size: .9rem; min-height: 1.6em; }
.status .link { font: inherit; color: var(--accent); background: none; border: 0; cursor: pointer; text-decoration: underline; padding: 0; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  padding: 0; text-decoration: none; color: inherit; box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .12s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card h3 { margin: 0; font-size: 1.05rem; line-height: 1.25; }
.card .sub { color: var(--muted); font-size: .8rem; }
.card .desc { margin: 0; font-size: .9rem; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .ings { margin: 0; font-size: .85rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 22px; }
.rating { color: var(--star); font-weight: 700; font-size: .875rem; white-space: nowrap; }
.rating .votes { color: var(--muted); font-weight: 400; }

mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 1px; }

/* pagination */
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 28px; color: var(--muted); }

/* empty / error / loading */
.notice { text-align: center; padding: 48px 16px; color: var(--muted); }
.notice h2 { color: var(--text); margin: 0 0 8px; }
.skeleton { height: 150px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } .card { transition: none; } }

/* detail */
.back { display: inline-block; margin-bottom: 12px; text-decoration: none; font-weight: 600; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 20px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }
.panel h2 { margin: 0 0 14px; font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.hero { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.hero h1:focus { outline: none; } /* focused programmatically on navigation; not interactive */
.hero h1 { margin: 0; font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.1; letter-spacing: 0; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; color: var(--muted); font-size: .9rem; }
.lead { font-size: 1.1rem; margin: 0 0 16px; }
.ing-list { list-style: none; margin: 0; padding: 0; }
.ing-list li { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); }
.ing-list li:first-child { border-top: 0; }
.ing-list .qty { flex: none; min-width: 5.5em; font-family: var(--font-display); color: var(--accent); font-size: 1.05em; font-weight: 600; font-variant-numeric: tabular-nums; }
.ing-list .note { display: block; color: var(--muted); font-size: .85rem; }
.ing-list a { color: inherit; text-decoration-color: var(--border); text-underline-offset: 3px; }
.ing-list a:hover { color: var(--accent); }
.prep { white-space: pre-line; margin: 0; }
.bars { display: grid; gap: 6px; margin-top: 12px; }
.bar-row { display: grid; grid-template-columns: 28px 1fr 28px; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.bar-track { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, color-mix(in srgb, var(--star) 65%, transparent), var(--star)); border-radius: 999px; }
.big-rating { font-family: var(--font-display); font-size: 2.3rem; font-weight: 700; color: var(--star); line-height: 1; }
.comment { padding: 12px 0; border-top: 1px solid var(--border); }
.comment:first-of-type { border-top: 0; padding-top: 0; }
.comment .who { font-weight: 600; }
.comment .when { color: var(--muted); font-size: .8rem; margin-left: 6px; }
.comment p { margin: 4px 0 0; white-space: pre-line; }
.similar { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.similar a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--text); }
.similar a:hover { background: var(--surface-2); }

.ring { position: relative; flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.ring-hole { width: 32px; height: 32px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-family: var(--font-display); font-size: .62rem; font-weight: 500; color: var(--accent); }

.stars { position: relative; display: inline-block; font-size: 1.3rem; line-height: 1; letter-spacing: 3px; margin: 4px 0; }
.stars-track { color: var(--border); }
.stars-fill { position: absolute; inset: 0; width: 0; overflow: hidden; white-space: nowrap; color: var(--star); }
.stars.empty .stars-track { color: var(--border); }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 10px 0 2px; }
.empty-icon { font-size: 1.7rem; opacity: .5; }
.empty p { margin: 0; }
.muted { color: var(--muted); }

@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .filters { grid-template-columns: 1fr; }
  .bar .btn { padding: 8px 12px; }
  .hero { align-items: flex-start; }
}

/* nav */
[hidden] { display: none !important; }
.nav { display: flex; gap: 4px; margin-right: auto; margin-left: 16px; }
.nav a { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current] { color: var(--text); background: var(--surface-2); }
.count { display: inline-block; min-width: 1.4em; padding: 0 6px; margin-left: 2px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: .75rem; text-align: center; }

/* my bar */
.page-title { margin: 0 0 4px; font-size: clamp(1.6rem, 4vw, 2.1rem); letter-spacing: -.01em; }
.lead.muted { margin-bottom: 16px; }
.bar-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.bar-head h2 { margin: 0; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel > input.field { width: 100%; margin-top: 16px; }
.picker { margin-top: 12px; max-height: 340px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; padding: 4px 14px 14px; background: var(--bg); }
.picker-group h3 { margin: 14px 0 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.picker-group .chips { margin-top: 8px; }
.banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 16px; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 12px; }
.banner span { flex: 1 1 240px; }
a.tag { text-decoration: none; }
a.tag:hover { background: var(--accent); color: var(--accent-text); }
.tag.ok { color: #14682f; background: #dcf3e2; }
.tag.miss { color: var(--text); background: var(--surface-2); border: 1px solid var(--border); }
.card .miss { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: .8rem; }
.have { color: #14a04a; font-weight: 700; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.ok { color: #7ee2a0; background: #16321f; } :root:not([data-theme="light"]) .have { color: #5fd68a; } }
:root[data-theme="dark"] .tag.ok { color: #7ee2a0; background: #16321f; }
:root[data-theme="dark"] .have { color: #5fd68a; }
@media (max-width: 520px) {
  .nav { margin-left: 4px; }
  .nav a { padding: 6px 8px; }
  .lbl { display: none; }
  .brand { font-size: 1.05rem; }
}

/* pictures */
.card-media { aspect-ratio: 16 / 10; background: var(--surface-2); }
.card-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 16px; flex: 1; }
.hero { align-items: center; }
.hero-img { flex: none; width: min(300px, 42%); aspect-ratio: 16 / 10; object-fit: cover; border-radius: 22px; border: 1px solid var(--border); background: var(--surface-2); box-shadow: var(--shadow); }
.ing-list li { align-items: center; }
.ing-thumb { flex: none; width: 56px; height: 40px; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.chip.with-img { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px; }
.chip-img { flex: none; width: 28px; height: 28px; object-fit: cover; border-radius: 50%; background: var(--surface-2); }
.chip.with-img[aria-pressed="true"] .chip-img { box-shadow: 0 0 0 2px var(--accent-text); }
@media (max-width: 860px) {
  .hero { flex-direction: column; align-items: stretch; }
  .hero-img { width: 100%; }
}

/* language dropdown */
.menu { position: relative; }
.menu-trigger { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: .8rem; padding: 6px 10px 6px 8px; border-radius: 999px; cursor: pointer; }
.menu-trigger:hover, .menu-trigger[aria-expanded="true"] { border-color: var(--accent); }
.chev { font-size: .7em; opacity: .7; }
.flag { display: block; width: 20px; height: 14px; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgb(0 0 0 / .22); }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 160px; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.menu-list [role="option"] { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.menu-list [role="option"]:hover, .menu-list [role="option"]:focus { background: var(--surface-2); outline: none; }
.menu-list [role="option"]:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.menu-list [role="option"][aria-selected="true"]::after { content: "✓"; margin-left: auto; padding-left: 12px; color: var(--accent); }
.brand, .nav a { white-space: nowrap; }
@media (max-width: 520px) {
  .menu-trigger .code { display: none; }
  .menu-trigger { padding: 6px 8px; }
  .bar { gap: 6px; }
}
@media (max-width: 440px) { .brand-text { display: none; } .nav { margin-left: 2px; } }

/* menu contents shared by the language and theme dropdowns */
.menu-icon { display: inline-flex; align-items: center; }
.menu-trigger .code:empty { display: none; }
.emoji { font-size: 1rem; line-height: 1; width: 20px; text-align: center; }
