:root {
  --bg: #f6f4ec;
  --paper: #fffdf8;
  --ink: #1b2b24;
  --muted: #66746b;
  --line: #e3e4d8;
  --green: #2f7d4f;
  --deep: #17382b;
  --shadow: 0 18px 40px rgba(27, 43, 36, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: "Space Grotesk", "DM Sans", sans-serif; letter-spacing: -.03em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 244, 236, .9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: 68px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 9px; font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 17px; white-space: nowrap; }
.brand-mark { font-size: 20px; }
.brand-dot { color: var(--green); }
.site-header nav { display: flex; gap: 26px; margin-left: auto; }
.site-header nav a { font-size: 14px; font-weight: 600; color: var(--muted); transition: color .2s; }
.site-header nav a:hover, .site-header nav a.active { color: var(--green); }
.header-cta { background: var(--deep); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.header-cta:hover { background: var(--green); }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 64px; align-items: center; padding: 78px 0 54px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--green); }
.eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(47, 125, 79, .13); }
.hero h1 { font-size: clamp(2.8rem, 5.6vw, 4.6rem); line-height: 1.02; margin: 18px 0 22px; }
.hero h1 em { color: var(--green); font-style: normal; position: relative; }
.hero h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: 3px; height: 9px; background: rgba(47, 125, 79, .16); border-radius: 6px; z-index: -1; }
.lead { max-width: 610px; font-size: 18px; color: #46554c; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; gap: 9px; border-radius: 999px; padding: 13px 22px; font-size: 14px; font-weight: 700; border: 1px solid transparent; transition: transform .2s, background .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: #266a42; }
.btn-ghost { background: transparent; border-color: #cdd3c6; color: var(--ink); }
.btn-ghost:hover { background: #eceee3; }
.hero-note { margin-top: 22px; font-size: 12px; color: #8b968d; }

.hero-panel { background: var(--deep); color: #f4f6ee; border-radius: 24px; padding: 28px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero-panel::before { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.035); top: -130px; right: -90px; }
.panel-title { display: flex; align-items: center; gap: 9px; font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 15px; margin-bottom: 22px; }
.scale { display: grid; gap: 14px; }
.scale-row { display: grid; grid-template-columns: 104px 1fr 46px; align-items: center; gap: 10px; font-size: 12px; }
.scale-name { font-weight: 600; white-space: nowrap; }
.scale-track { height: 8px; border-radius: 99px; background: rgba(255,255,255,.13); overflow: hidden; }
.scale-track i { display: block; height: 100%; border-radius: 99px; }
.scale-row b { text-align: right; opacity: .7; font-weight: 600; font-size: 11px; }
.panel-divider { height: 1px; background: rgba(255,255,255,.14); margin: 24px 0 20px; }
.panel-subtitle { font-size: 11px; text-transform: uppercase; letter-spacing: .13em; opacity: .6; font-weight: 700; margin-bottom: 12px; }
.hero-top { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.hero-top li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.hero-top-rank { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.12); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.hero-top strong { display: block; font-weight: 600; }
.hero-top small { display: block; font-size: 11px; opacity: .55; }
.hero-top b { font-family: "Space Grotesk", sans-serif; font-size: 17px; color: #f6cf8b; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); overflow: hidden; }
.stat { padding: 22px 26px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat strong { display: block; font-family: "Space Grotesk", sans-serif; font-size: 30px; line-height: 1; color: var(--green); }
.stat span { display: block; margin-top: 7px; font-size: 12px; color: var(--muted); }

/* ---------- Section heads ---------- */
.explorer, .venues { padding: 76px 0 20px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.section-kicker { display: block; text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 700; color: var(--green); margin-bottom: 10px; }
.section-head h2 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); line-height: 1.1; }
.section-head p { color: var(--muted); margin-top: 10px; max-width: 650px; font-size: 15px; }
.view-toggle { display: flex; background: #e9eadf; padding: 4px; border-radius: 999px; flex-shrink: 0; }
.view-toggle button { border: 0; background: transparent; padding: 9px 18px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); }
.view-toggle button.active { background: var(--paper); color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.07); }

/* ---------- Controls ---------- */
.controls { display: grid; grid-template-columns: 1.7fr 1fr 1.2fr 1.1fr 1.1fr auto; gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: 0 4px 18px rgba(27,43,36,.03); }
.control { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.control > span { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #8b968d; }
.control input, .control select { width: 100%; border: 1px solid var(--line); background: #faf9f3; border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--ink); outline: none; }
.control input:focus, .control select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(47,125,79,.12); }
.control input::placeholder { color: #a4aea5; }
.reset-btn { align-self: end; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #faf9f3; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.reset-btn:hover { border-color: var(--green); color: var(--green); }

.results-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 24px 2px 14px; font-size: 13px; color: var(--muted); }
.results-head strong { color: var(--ink); }
.results-hint { font-size: 12px; }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; cursor: pointer; transition: transform .2s, box-shadow .2s, border-color .2s; outline: none; }
.card:hover, .card:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #c9d4c6; }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.rank { font-family: "Space Grotesk", sans-serif; font-size: 12px; font-weight: 700; color: #a0aaa1; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: color-mix(in srgb, var(--pill) 12%, white); color: var(--pill); border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pill); }
.card-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card h3 { font-size: 18px; line-height: 1.25; }
.venue { font-size: 12px; color: var(--muted); margin-top: 4px; }
.venue span { opacity: .65; }
.score { display: flex; align-items: baseline; gap: 2px; flex-shrink: 0; }
.score strong { font-family: "Space Grotesk", sans-serif; font-size: 32px; line-height: 1; color: var(--score-color); }
.score small { font-size: 11px; color: #a0aaa1; }
.meter { height: 7px; border-radius: 99px; background: #eceee4; overflow: hidden; margin: 16px 0 14px; }
.meter span { display: block; height: 100%; border-radius: 99px; }
.card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tag { font-size: 11px; font-weight: 600; color: #56655c; background: #eff1e8; border-radius: 6px; padding: 4px 8px; }
.tag-day { background: #e7eee2; color: #3d704a; }
.price { margin-left: auto; font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; min-height: 26px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; padding: 4px 7px; border-radius: 6px; border: 1px solid #e6e8dc; background: #fbfcf7; color: #57655b; }
.chip b { color: var(--green); font-size: 10px; }
.chip-more { color: #97a199; border-style: dashed; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 11px; font-weight: 700; color: var(--green); }

/* ---------- Ranking ---------- */
.rank-table { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.rank-head, .rank-row { display: grid; grid-template-columns: 56px minmax(190px, 2fr) minmax(120px, 1.3fr) 62px 106px 82px 24px; align-items: center; gap: 12px; padding: 12px 18px; }
.rank-head { background: #f0f2e9; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: #859087; }
.rank-row { border-top: 1px solid var(--line); cursor: pointer; outline: none; transition: background .15s; }
.rank-row:hover, .rank-row:focus-visible { background: #f8f9f2; }
.rank-num { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 14px; color: #8b968d; }
.rank-name strong { display: block; font-size: 14px; }
.rank-name span { display: block; font-size: 11px; color: var(--muted); }
.rank-bar .meter { margin: 0; height: 6px; }
.rank-score { font-family: "Space Grotesk", sans-serif; font-size: 20px; font-weight: 700; text-align: right; }
.rank-price { font-size: 12px; text-align: right; color: var(--muted); }
.rank-arrow { color: #a2aca3; text-align: right; }

.more-wrap { display: flex; justify-content: center; margin: 26px 0 10px; }
.more-wrap .btn { background: var(--paper); border-color: #cdd3c6; }
.more-wrap .btn span { font-weight: 500; opacity: .65; }

.empty { text-align: center; padding: 64px 20px; background: var(--paper); border: 1px dashed #cfd6c8; border-radius: var(--radius); }
.empty-icon { font-size: 34px; }
.empty h3 { margin: 12px 0 6px; font-size: 20px; }
.empty p { color: var(--muted); margin-bottom: 18px; font-size: 14px; }

/* ---------- Method ---------- */
.method { background: var(--deep); color: #f2f4ec; padding: 76px 0 64px; margin-top: 70px; }
.section-head-light h2 { color: #fff; }
.section-head-light .section-kicker { color: #a9d5a8; }
.section-head-light p { color: #b8c7bb; }
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 28px; }
.method-card { background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.11); border-radius: var(--radius); padding: 24px; }
.method-card h3 { font-size: 18px; margin-bottom: 18px; }
.legend { display: grid; gap: 14px; }
.legend-item { display: flex; gap: 12px; align-items: center; }
.legend-emoji { font-size: 22px; width: 34px; text-align: center; }
.legend-item strong { display: block; font-size: 14px; }
.legend-item small { display: block; color: #a9baae; font-size: 11px; }
.method-foot { font-size: 11px; color: #9fb1a4; margin-top: 18px; }
.example div { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.08); color: #d5e0d6; }
.example b { font-family: "Space Grotesk", sans-serif; }
.example .example-sum { border-bottom: 0; border-top: 2px solid rgba(255,255,255,.22); margin-top: 6px; padding-top: 10px; color: #fff; font-weight: 700; font-size: 15px; }
.example-sum b { color: #f6cf8b; font-size: 19px; }
.ing-details { margin-top: 20px; border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius); background: rgba(255,255,255,.035); }
.ing-details summary { cursor: pointer; padding: 16px 22px; font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; list-style: none; }
.ing-details summary::-webkit-details-marker { display: none; }
.ing-details[open] summary { border-bottom: 1px solid rgba(255,255,255,.14); }
.ing-groups { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 22px; padding: 22px; max-height: 420px; overflow: auto; }
.ing-group h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: #a9d5a8; margin-bottom: 10px; }
.ing-group ul { list-style: none; margin: 0; padding: 0; }
.ing-group li { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; padding: 4px 0; border-bottom: 1px dashed rgba(255,255,255,.08); color: #cfdbd1; }
.ing-group b { color: #f6cf8b; }
.disclaimer { margin-top: 18px; font-size: 11px; color: #94a99a; max-width: 900px; }

/* ---------- Venues ---------- */
.venue-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.venue-card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.venue-card.bevakas { background: #f2f2ea; }
.venue-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.venue-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 4px 8px; border-radius: 6px; }
.venue-badge.menu { background: #e2efe2; color: #2f7d4f; }
.venue-badge.bevakas { background: #e8e7dd; color: #8a8978; }
.venue-count { font-size: 11px; color: var(--muted); }
.venue-card h3 { font-size: 16px; }
.venue-cuisine { font-size: 12px; color: var(--green); margin-top: 3px; font-weight: 600; }
.venue-address { font-size: 12px; color: var(--muted); margin-top: 10px; }
.venue-price { font-size: 12px; font-weight: 600; margin-top: 3px; }
.venue-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 10px; color: #909a91; }
.venue-bottom a { font-size: 16px; color: var(--green); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 74px; padding: 30px 0; }
.footer-inner { display: flex; align-items: center; gap: 30px; }
.footer-brand { font-family: "Space Grotesk", sans-serif; font-weight: 700; }
.footer-inner p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.footer-links { display: flex; gap: 20px; margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.footer-links a:hover { color: var(--green); }
.footer-copy { font-size: 11px; color: #a4aea5; }

/* ---------- Dialog ---------- */
#detail { border: 0; padding: 0; border-radius: 22px; max-width: 560px; width: calc(100% - 32px); max-height: 88vh; background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.24); }
#detail::backdrop { background: rgba(18, 34, 26, .55); backdrop-filter: blur(3px); }
.dialog-inner { padding: 30px; overflow-y: auto; max-height: 88vh; position: relative; }
.dialog-close { position: absolute; top: 18px; right: 18px; border: 0; background: #eef0e7; width: 32px; height: 32px; border-radius: 50%; color: var(--muted); font-size: 14px; }
.dialog-close:hover { background: #e2e6da; color: var(--ink); }
.dialog-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--green); font-weight: 700; }
.dialog-head h2 { font-size: 28px; margin: 8px 40px 6px 0; }
.dialog-head p { font-size: 13px; color: var(--muted); }
.dialog-score { background: #f3f5ec; border-radius: 14px; padding: 16px 18px; margin: 22px 0; }
.dialog-score > div { display: flex; align-items: baseline; gap: 5px; }
.dialog-score strong { font-family: "Space Grotesk", sans-serif; font-size: 42px; line-height: 1; color: var(--score-color); }
.dialog-score span { font-size: 12px; color: var(--muted); }
.dialog-score .meter { margin-bottom: 0; margin-top: 12px; }
.dialog-inner h3 { font-size: 15px; margin-bottom: 10px; }
.breakdown { border-top: 1px solid var(--line); }
.break-row { display: grid; grid-template-columns: 1fr auto 44px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.break-row em { font-style: normal; color: var(--muted); font-size: 11px; }
.break-group { font-size: 10px; color: #99a399; text-transform: uppercase; letter-spacing: .06em; }
.break-row strong { text-align: right; font-family: "Space Grotesk", sans-serif; color: var(--green); font-size: 13px; }
.break-base { background: #fafbf5; }
.break-total { display: flex; justify-content: space-between; align-items: center; padding: 14px 0 4px; font-weight: 700; font-size: 14px; }
.break-total strong { font-family: "Space Grotesk", sans-serif; font-size: 26px; }
.detail-note { margin-top: 10px; font-size: 12px; color: var(--muted); font-style: italic; }
.dialog-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--line); font-size: 11px; color: var(--muted); }
.dialog-foot a { color: var(--green); font-weight: 700; white-space: nowrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .hero { gap: 32px; }
  .controls { grid-template-columns: repeat(3, 1fr); }
  .control-search { grid-column: span 3; }
  .grid, .venue-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .rank-head, .rank-row { grid-template-columns: 44px minmax(150px,2fr) 90px 48px 88px 60px 20px; gap: 8px; }
  .ing-groups { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .wrap { width: min(100% - 32px, 1180px); }
  .site-header nav { display: none; }
  .header-cta { margin-left: auto; }
  .hero { grid-template-columns: 1fr; padding: 48px 0 36px; }
  .hero h1 { font-size: 2.8rem; }
  .hero-panel { order: 2; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .section-head { flex-direction: column; align-items: flex-start; }
  .controls { grid-template-columns: repeat(2, 1fr); }
  .control-search { grid-column: span 2; }
  .reset-btn { grid-column: span 2; justify-content: center; }
  .grid, .venue-grid, .method-grid { grid-template-columns: 1fr; }
  .results-hint { display: none; }
  .rank-head { display: none; }
  .rank-row { grid-template-columns: 34px 1fr 46px 20px; gap: 8px; padding: 14px; }
  .rank-bar, .rank-level, .rank-price { display: none; }
  .rank-num { font-size: 12px; }
  .explorer, .venues { padding-top: 54px; }
  .footer-inner { flex-wrap: wrap; }
  .footer-links { margin-left: 0; width: 100%; }
  .dialog-inner { padding: 24px 20px; }
}
