:root {
  --ink: #17211c;
  --muted: #65706a;
  --paper: #f6f4ed;
  --surface: #fffef9;
  --surface-soft: #eeece4;
  --line: #d9dcd3;
  --accent: #ef5b36;
  --accent-dark: #be3f22;
  --green: #176746;
  --green-soft: #e3efe8;
  --gold: #976413;
  --red: #a23d28;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow: 0 18px 50px rgba(28, 38, 32, 0.08);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; scroll-behavior: smooth; }
body { margin: 0; min-width: 0; min-height: 100vh; min-height: 100dvh; padding-bottom: env(safe-area-inset-bottom); overflow-x: hidden; color: var(--ink); background: var(--paper); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: 280px; z-index: -1; pointer-events: none; background: radial-gradient(circle at 75% 0%, rgba(239, 91, 54, 0.09), transparent 46%); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid rgba(239, 91, 54, 0.3); outline-offset: 2px; }
button svg, a svg { fill: none; stroke: currentColor; stroke-width: 1.8; }
[hidden] { display: none !important; }

.site-header { position: relative; z-index: 20; height: calc(68px + env(safe-area-inset-top)); display: flex; align-items: center; justify-content: space-between; max-width: 1120px; margin: 0 auto; padding: env(safe-area-inset-top) max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left)); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -0.025em; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; color: white; background: var(--accent); border-radius: 10px 10px 10px 3px; transform: rotate(-3deg); }
.brand-mark svg { width: 19px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.quiet-button, .saved-button, .info-button, .location-button { min-height: 42px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; }
.quiet-button { padding: 8px 12px; font-weight: 700; }
.saved-button { display: inline-flex; align-items: center; gap: 7px; padding: 7px 9px 7px 11px; font-weight: 700; }
.saved-button svg { width: 17px; }
.saved-button strong { min-width: 23px; padding: 3px 6px; color: var(--green); background: var(--green-soft); border-radius: 999px; font-size: 0.75rem; }

main { width: min(100% - 32px, 1040px); margin: 0 auto; }
.search-panel { max-width: 820px; margin: 0 auto; padding: 68px 0 44px; transition: padding 180ms ease; }
.eyebrow { margin: 0 0 10px; color: var(--accent-dark); font-size: 0.73rem; font-weight: 850; letter-spacing: 0.12em; text-transform: uppercase; }
h1 { max-width: 740px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.7rem, 7vw, 5.35rem); font-weight: 500; letter-spacing: -0.057em; line-height: 0.98; }
.intro { max-width: 620px; margin: 24px 0 22px; color: var(--muted); font-size: clamp(1rem, 2vw, 1.16rem); line-height: 1.6; }
.quick-searches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.quick-searches::before { content: "Try"; align-self: center; margin-right: 3px; color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.quick-searches button { padding: 7px 10px; color: #4f5a54; background: transparent; border: 1px solid var(--line); border-radius: 999px; font-size: 0.8rem; }
.quick-searches button:hover { color: var(--accent-dark); border-color: #d9a391; background: #fff9f5; }

.search-form { display: grid; gap: 16px; }
.search-box { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; background: var(--surface); border: 1px solid #cdd1c8; border-radius: var(--radius-md); box-shadow: var(--shadow); }
.search-box:focus-within { border-color: var(--accent); }
.search-box > svg { width: 22px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.search-box input { min-width: 0; height: 48px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 1.05rem; }
.search-box input::placeholder { color: #8d958f; }
.search-button { min-width: 108px; height: 48px; padding: 0 18px; border: 0; border-radius: 9px; color: white; background: var(--accent); font-weight: 780; }
.search-button:hover { background: var(--accent-dark); }
.search-button:disabled { opacity: 0.65; cursor: wait; }
.search-options { display: flex; align-items: center; gap: 12px; }
.location-button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; }
.location-button[data-active="true"] { color: var(--green); border-color: #9abdaa; background: var(--green-soft); }
.location-button svg { width: 18px; }
.area-control { min-width: 220px; min-height: 42px; display: flex; flex: 1; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); }
.area-control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(239, 91, 54, 0.14); }
.area-control svg { width: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }
.area-control input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 0.9rem; }
.area-control input::placeholder { color: #858c87; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.radius-control { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.88rem; }
.radius-control select, .filter-panel select { min-height: 42px; padding: 8px 30px 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); }
.priority-picker { min-width: 0; margin: 0; padding: 0; border: 0; }
.priority-picker legend { margin-bottom: 9px; color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.priority-options { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
.priority-options::-webkit-scrollbar { display: none; }
.priority-options label { flex: 0 0 auto; }
.priority-options input { position: absolute; opacity: 0; pointer-events: none; }
.priority-options span { display: block; min-height: 38px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 0.84rem; font-weight: 700; }
.priority-options input:checked + span { color: white; border-color: var(--ink); background: var(--ink); }
.priority-options input:focus-visible + span { outline: 3px solid rgba(239, 91, 54, 0.3); }

body.has-results .search-panel { position: sticky; top: 0; z-index: 10; max-width: none; padding: 14px 0 16px; background: rgba(246, 244, 237, 0.94); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(217, 220, 211, 0.8); }
body.has-results .search-panel > .eyebrow, body.has-results .search-panel > h1, body.has-results .search-panel > .intro, body.has-results .quick-searches { display: none; }
body.has-results .search-box { box-shadow: 0 8px 24px rgba(28, 38, 32, 0.06); }
body.has-results .search-form { grid-template-columns: minmax(320px, 1fr) auto; gap: 10px 16px; }
body.has-results .search-box { grid-row: span 2; }
body.has-results .search-options { justify-content: flex-end; }
body.has-results .priority-picker { align-self: end; }

.results-section { max-width: 900px; margin: 0 auto; padding: 38px 0 72px; }
.results-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.8rem, 4vw, 2.55rem); font-weight: 500; letter-spacing: -0.04em; }
.results-actions { display: flex; align-items: center; gap: 8px; }
.info-button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px; color: var(--muted); font-size: 0.82rem; }
.info-button svg { width: 16px; }
.info-button strong { min-width: 20px; padding: 2px 5px; color: white; background: var(--accent); border-radius: 999px; font-size: 0.68rem; }
.ranking-note { margin-top: 12px; padding: 15px 17px; border-left: 3px solid var(--accent); background: var(--surface-soft); color: #4f5953; font-size: 0.88rem; line-height: 1.55; }
.ranking-note strong { color: var(--ink); }
.filter-panel { display: grid; grid-template-columns: 1fr 1fr auto auto; align-items: end; gap: 12px; margin-top: 12px; padding: 14px; background: var(--surface-soft); border-radius: var(--radius-md); }
.filter-panel > label:not(.filter-checkbox) { display: grid; gap: 5px; color: var(--muted); font-size: 0.76rem; font-weight: 700; }
.filter-checkbox { min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 10px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; font-size: 0.84rem; font-weight: 700; }
.filter-checkbox input { accent-color: var(--green); }
.text-button { min-height: 42px; padding: 8px 10px; border: 0; color: var(--accent-dark); background: transparent; font-size: 0.82rem; font-weight: 750; }
.status { min-height: 38px; padding: 16px 0 6px; color: var(--muted); font-size: 0.84rem; }
.status.error { color: var(--red); }
.results-list { list-style: none; margin: 0; padding: 0; counter-reset: result; }

.result-card { counter-increment: result; margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease; }
.result-card:hover { transform: translateY(-1px); border-color: #bfc6bc; box-shadow: 0 12px 30px rgba(29, 39, 33, 0.06); }
.result-card:first-child { border-color: #9bb9a7; box-shadow: 0 12px 32px rgba(23, 103, 70, 0.08); }
.result-main { display: grid; grid-template-columns: 86px 1fr; gap: 18px; padding: 20px 20px 16px; }
.trust-score { position: relative; width: 82px; height: 82px; display: grid; place-items: center; align-content: center; color: var(--green); }
.trust-score svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.trust-score circle { fill: none; stroke-width: 2.7; }
.ring-track { stroke: #e0e7e2; }
.ring-value { stroke: var(--green); stroke-linecap: round; }
.trust-score strong { font-family: Georgia, serif; font-size: 1.55rem; font-weight: 500; line-height: 1; }
.trust-score span { margin-top: 3px; color: var(--muted); font-size: 0.57rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.result-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-height: 20px; }
.result-rank::before { content: counter(result, decimal-leading-zero); color: #929a94; font-family: Georgia, serif; font-size: 0.82rem; }
.place-type, .open-state, .closed-state { padding: 3px 7px; border-radius: 5px; font-size: 0.68rem; font-weight: 750; }
.place-type { color: var(--green); background: var(--green-soft); }
.open-state { color: var(--green); border: 1px solid #c7ddd0; }
.closed-state { color: var(--red); border: 1px solid #e2c4bd; }
.result-title { margin: 6px 0 0; font-size: 1.15rem; letter-spacing: -0.02em; }
.result-title a { color: var(--ink); text-decoration: none; }
.result-title a:hover { color: var(--accent-dark); text-decoration: underline; }
.result-address { margin: 6px 0 10px; color: var(--muted); font-size: 0.82rem; line-height: 1.42; }
.result-facts { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 13px; font-size: 0.82rem; }
.rating { color: var(--gold); font-weight: 800; }
.reviews { color: var(--ink); font-weight: 700; }
.distance { color: var(--muted); }
.trust-reason { margin: 10px 0 0; color: #46534c; font-size: 0.77rem; font-weight: 650; }
.result-toolbar { min-height: 48px; display: flex; align-items: center; gap: 4px; padding: 7px 12px; border-top: 1px solid #e8e9e3; background: #fbfaf5; }
.result-toolbar a, .result-toolbar button, .score-details summary { min-height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 7px 9px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 0.76rem; font-weight: 700; text-decoration: none; }
.result-toolbar a:hover, .result-toolbar button:hover, .score-details summary:hover { color: var(--ink); background: var(--surface-soft); }
.result-toolbar button svg { width: 16px; }
.save-place.is-saved { color: var(--green); }
.save-place.is-saved svg { fill: var(--green); }
.score-details { margin-left: auto; }
.score-details summary { list-style: none; cursor: pointer; }
.score-details summary::-webkit-details-marker { display: none; }
.score-details[open] { width: 100%; margin: 0; }
.score-details[open] summary { margin-left: auto; width: max-content; }
.score-bars { display: grid; grid-template-columns: repeat(4, minmax(70px, 1fr)); gap: 10px; width: 100%; padding: 8px 5px 5px; }
.score-bar { display: grid; grid-template-columns: 1fr auto; color: var(--muted); font-size: 0.68rem; text-transform: capitalize; }
.score-bar strong { color: var(--ink); }
.score-bar progress { grid-column: 1 / -1; width: 100%; height: 4px; margin-top: 4px; border: 0; border-radius: 9px; overflow: hidden; background: #dfe2db; appearance: none; }
.score-bar progress::-webkit-progress-bar { background: #dfe2db; }
.score-bar progress::-webkit-progress-value { background: var(--green); }
.score-bar progress::-moz-progress-bar { background: var(--green); }
.show-more { display: block; min-height: 46px; margin: 18px auto 0; padding: 9px 18px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-weight: 750; }

.skeleton { height: 170px; margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: linear-gradient(90deg, #efeee8, #fffefa, #efeee8); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty-state { max-width: 620px; margin: 50px auto 80px; padding: 36px; text-align: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.empty-state h2 { margin-top: 22px; font-size: clamp(1.5rem, 4vw, 2.1rem); }
.empty-state p { color: var(--muted); line-height: 1.55; }
.empty-visual { display: inline-flex; align-items: baseline; gap: 8px; padding: 10px 14px; color: var(--gold); background: #f1e8d4; border-radius: 7px; transform: rotate(-2deg); }
.empty-visual span:first-child { font-family: Georgia, serif; font-size: 1.5rem; }
.empty-visual span:last-child { color: #765e38; font-size: 0.78rem; font-weight: 700; }

.saved-dialog { width: min(94vw, 620px); max-height: min(82vh, 760px); padding: 0; color: var(--ink); background: var(--paper); border: 0; border-radius: var(--radius-lg); box-shadow: 0 30px 90px rgba(15, 24, 19, 0.3); }
.saved-dialog::backdrop { background: rgba(19, 28, 23, 0.56); backdrop-filter: blur(3px); }
.dialog-header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; padding: 22px; background: rgba(246, 244, 237, 0.96); border-bottom: 1px solid var(--line); }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--surface); font-size: 1.5rem; line-height: 1; }
.saved-empty { padding: 42px 24px; color: var(--muted); text-align: center; }
.saved-list { list-style: none; margin: 0; padding: 8px 22px 22px; }
.saved-list li { display: flex; justify-content: space-between; gap: 15px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.saved-list li > div { display: grid; gap: 5px; }
.saved-list li span { color: var(--muted); font-size: 0.78rem; }
.saved-list li > div:last-child { display: flex; align-items: center; }
.saved-list a, .saved-list button { padding: 7px 9px; color: var(--green); background: transparent; border: 0; font-size: 0.76rem; font-weight: 750; text-decoration: none; }
.saved-list button { color: var(--red); }
footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 24px; color: #7b847e; border-top: 1px solid var(--line); font-size: 0.76rem; text-align: center; }

@media (max-width: 760px) {
  .site-header { height: 60px; padding: 0 16px; }
  main { width: min(100% - 24px, 1040px); }
  .search-panel { padding: 44px 0 30px; }
  .intro { margin: 18px 0; }
  .quick-searches { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
  .search-box { grid-template-columns: auto 1fr; padding: 8px 10px 8px 14px; }
  .search-button { grid-column: 1 / -1; width: 100%; }
  .search-options { align-items: stretch; flex-wrap: wrap; }
  .area-control { order: -1; flex-basis: 100%; }
  .location-button { flex: 1; justify-content: center; }
  .radius-control { flex-direction: column; align-items: flex-start; gap: 3px; }
  .radius-control select { height: 42px; }
  body.has-results .search-panel { top: 0; padding: 8px 0 10px; }
  body.has-results .search-form { display: grid; grid-template-columns: 1fr; }
  body.has-results .search-box { grid-row: auto; }
  body.has-results .search-options { display: flex; }
  body.has-results .priority-picker { display: none; }
  .results-section { padding-top: 24px; }
  .results-heading { align-items: flex-start; flex-direction: column; }
  .results-actions { width: 100%; }
  .results-actions .info-button { flex: 1; justify-content: center; }
  .filter-panel { grid-template-columns: 1fr 1fr; }
  .filter-checkbox, .text-button { justify-content: center; }
  .result-main { grid-template-columns: 64px 1fr; gap: 12px; padding: 16px 14px 13px; }
  .trust-score { width: 62px; height: 62px; }
  .trust-score strong { font-size: 1.28rem; }
  .result-title { font-size: 1.04rem; }
  .result-address { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .trust-reason { line-height: 1.4; }
  .result-toolbar { flex-wrap: wrap; }
  .score-details { margin-left: 0; }
  .score-details[open] { flex-basis: 100%; }
  .score-bars { grid-template-columns: repeat(2, 1fr); }
  .saved-button > span { display: none; }
  .empty-state { margin-top: 34px; padding: 30px 12px; }
}

@media (max-width: 380px) {
  .filter-panel { grid-template-columns: 1fr; }
  .result-main { grid-template-columns: 1fr; }
  .trust-score { width: 58px; height: 58px; }
  .result-toolbar a, .result-toolbar button, .score-details summary { padding-inline: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
