:root {
  --bg: #f7f4ee; --surface: #fff; --ink: #1d1b18; --muted: #6f6a62; --line: #e7e1d7; --soft: #f1ece3;
  --accent: #b4452c; --accent-soft: #f6e4de;
  --ok: #2b8a57; --s0: #c9c3b8; /* points take their colour from app.js scoreColor() as --sc */
  --radius: 14px; --shadow: 0 1px 2px rgba(40, 30, 20, .06), 0 4px 14px rgba(40, 30, 20, .06);
  --top: 60px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
/* a sheet locks the page's scroll (overflow: hidden): keep the scrollbar's room so nothing shifts sideways (Firefox) */
html { scrollbar-gutter: stable; }
body { margin: 0; min-height: 100vh; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
       stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

/* ---------- header */
.appbar { position: sticky; top: 0; z-index: 1000; background: var(--surface); border-bottom: 1px solid var(--line); }
.appbar-row { display: flex; align-items: center; gap: 12px; height: var(--top); padding: 0 14px; max-width: 1500px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; color: var(--accent); }
.brand svg { width: 28px; height: 28px; }
.appbar-link { color: var(--muted); font-weight: 600; font-size: 14px; }
.search { position: relative; flex: 1; display: flex; align-items: center; gap: 8px; background: var(--soft);
          border-radius: 999px; padding: 0 14px; height: 42px; max-width: 720px; margin: 0 auto; }  /* centred: logo left, account right */
.search input { flex: 1; border: 0; background: none; font: inherit; font-size: 16px; outline: none; min-width: 0; }
.search input::-webkit-search-cancel-button { display: none; }
.search .ico { color: var(--muted); }
.search .clear { border: 0; background: none; font-size: 22px; color: var(--muted); padding: 0 2px; }
.suggest { position: absolute; top: 48px; left: 0; right: 0; background: var(--surface); border-radius: var(--radius);
           box-shadow: 0 8px 30px rgba(0, 0, 0, .15); padding: 6px; max-height: 70vh; overflow: auto; }
.suggest h4 { margin: 8px 10px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.suggest button { display: flex; width: 100%; align-items: center; gap: 10px; text-align: left; border: 0; background: none;
                  padding: 9px 10px; border-radius: 10px; }
.suggest button:hover, .suggest button.on { background: var(--soft); }
.suggest .sub { color: var(--muted); font-size: 13px; margin-left: auto; white-space: nowrap; }
@media (max-width: 640px) {
  .brand span, .appbar-link { display: none; }
  .appbar-row { gap: 10px; padding: 0 10px; }
}

/* ---------- search view: filters */
.bar { position: sticky; top: var(--top); z-index: 900; background: var(--bg); border-bottom: 1px solid var(--line); }
.bar-row { display: flex; gap: 8px; overflow-x: auto; padding: 10px 14px; scrollbar-width: none; max-width: 1500px; margin: 0 auto; }
.bar-row::-webkit-scrollbar { display: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; flex: none; border: 1px solid var(--line); background: var(--surface);
        border-radius: 999px; padding: 7px 13px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.pill.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill.place { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.pill .ico { width: 15px; height: 15px; }
.pill .n { background: rgba(255, 255, 255, .25); border-radius: 999px; padding: 0 6px; font-size: 12px; }

/* ---------- search view: layout */
.results-wrap { max-width: 1500px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); }
.list { padding: 12px 14px 90px; }
.mapbox { display: none; }
.view-map .list { display: none; }
.view-map .mapbox { display: block; position: fixed; inset: calc(var(--top) + 55px) 0 0 0; }
@media (min-width: 980px) {
  .results-wrap { grid-template-columns: minmax(420px, 560px) 1fr; }
  /* inset before top (inset: auto resets it); align-self: a stretched grid cell has no room to stick */
  .mapbox, .view-map .mapbox { display: block; position: sticky; inset: auto; top: calc(var(--top) + 55px);
                               height: calc(100vh - var(--top) - 55px); align-self: start; }
  .view-map .list { display: block; }
  .toggle-view { display: none !important; }
}
#map { width: 100%; height: 100%; background: #e9e5dc; }
.map-btn { position: absolute; z-index: 800; top: 12px; left: 50%; transform: translateX(-50%); border: 0; border-radius: 999px;
           background: var(--surface); box-shadow: var(--shadow); padding: 9px 16px; font-weight: 700; font-size: 14px; }
.toggle-view { position: fixed; z-index: 950; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; align-items: center;
               gap: 8px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; padding: 12px 20px;
               font-weight: 700; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.map-card { position: absolute; z-index: 800; left: 12px; right: 12px; bottom: 84px; max-width: 520px; margin: 0 auto; }
@media (min-width: 980px) { .map-card { bottom: 18px; } }

.summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 2px 12px; }
.summary h2 { font-size: 17px; }
.summary .sub { color: var(--muted); font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 50px 20px; }
.more { display: block; margin: 18px auto; border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
        padding: 10px 22px; font-weight: 700; }

/* ---------- cards */
.card { display: flex; gap: 14px; background: var(--surface); border-radius: var(--radius); padding: 14px; margin-bottom: 10px;
        box-shadow: var(--shadow); border: 1px solid transparent; }
.card:hover { border-color: var(--line); }
.card-body { flex: 1; min-width: 0; }
.card h3 { font-size: 17px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .meta { color: var(--muted); font-size: 14px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .photo { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; flex: none; background: var(--soft); }
.score { flex: none; width: 58px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; }
.score b { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; color: #fff; font-size: 21px;
           font-weight: 800; letter-spacing: -.02em; background: var(--sc, var(--s0)); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 7px; padding: 3px 8px; font-size: 12.5px; font-weight: 700;
        color: var(--c); background: color-mix(in srgb, var(--c) 10%, white); border: 1px solid color-mix(in srgb, var(--c) 25%, white); }
.chip.past { opacity: .6; font-weight: 600; }
.chip .ico { width: 13px; height: 13px; }
.chip.badge { font-weight: 600; font-size: 12px; background: none; }
.flags { display: flex; gap: 10px; margin-top: 8px; font-size: 12.5px; font-weight: 600; }
.open { color: var(--ok); }
.closed { color: var(--muted); }
.new { color: var(--accent); }

/* ---------- map pins */
.pin { display: inline-block; color: #fff; font-weight: 800; font-size: 12px; padding: 3px 6px; border-radius: 8px;
       background: var(--sc, var(--s0)); box-shadow: 0 1px 4px rgba(0, 0, 0, .35); border: 2px solid #fff; white-space: nowrap;
       transform: translate(-50%, -50%); }
.pin.sel, .pin-dot.sel { outline: 3px solid var(--ink); }
.pin-dot { display: block; width: 13px; height: 13px; border-radius: 50%; background: var(--sc, var(--s0)); border: 2px solid #fff;
           box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transform: translate(-50%, -50%); }
.leaflet-div-icon { background: none; border: 0; }

/* ---------- sheet (filters, place picker) */
.sheet { position: fixed; inset: 0; z-index: 2000; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(20, 15, 10, .45); }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 85vh; overflow: auto; background: var(--surface);
               border-radius: 20px 20px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) {
  .sheet-panel { left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%); width: 520px; border-radius: 20px; }
}
.sheet h3 { font-size: 19px; margin-bottom: 14px; }
.sheet h4 { margin: 16px 0 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.opt { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.opt input { width: 20px; height: 20px; accent-color: var(--accent); }
.opt .n { margin-left: auto; color: var(--muted); font-size: 13px; }
.opt .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
.levels { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 4px 36px; }
.levels .pill { padding: 5px 10px; font-size: 13px; }
.prices { display: flex; gap: 8px; }
.prices { gap: 0; }
.prices .pill { flex: 1; justify-content: center; font-size: 16px; border-radius: 0; margin-left: -1px; }
.prices .pill[data-p="1"] { border-radius: 999px 0 0 999px; margin-left: 0; }
.prices .pill[data-p="4"] { border-radius: 0 999px 999px 0; }
.prices .pill[data-np] { flex: none; width: 56px; border-radius: 999px; margin-left: 12px; }
.prices .pill[data-np] .ico { width: 20px; height: 20px; }
.sheet-actions { position: sticky; bottom: -18px; display: flex; gap: 10px; margin: 18px -18px -18px; padding: 14px 18px;
                 background: var(--surface); border-top: 1px solid var(--line); }
.btn { flex: 1; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px; font-weight: 700; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.place-input { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); }

/* ---------- detail */
.detail { max-width: 860px; margin: 0 auto; padding: 0 0 60px; }
.hero { position: relative; height: 210px; background: var(--soft); overflow: hidden; }
.hero > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-logo { height: 140px; background: var(--surface); display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.hero-logo > img { width: auto; height: auto; max-width: 62%; max-height: 92px; object-fit: contain; }
.hero-logo.dark, .hero-badge.dark, .photo.logo.dark { background: #26231f; }
.hero-none { height: 60px; background: var(--surface); }
.hero-none .back { box-shadow: none; background: var(--soft); top: 10px; }
.hero-badge { position: absolute; left: 14px; bottom: 14px; width: 64px; height: 64px; border-radius: 14px; background: #fff;
              display: grid; place-items: center; padding: 7px; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.hero-badge img { max-width: 100%; max-height: 100%; object-fit: contain; }
.photo.logo { display: grid; place-items: center; padding: 8px; background: #fff; border: 1px solid var(--line); }
.photo.logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.back { position: absolute; top: 12px; left: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92);
        display: grid; place-items: center; box-shadow: var(--shadow); }
.head { background: var(--surface); padding: 18px 18px 16px; display: flex; gap: 16px; align-items: flex-start; border-bottom: 1px solid var(--line); }
.head h1 { font-size: 26px; letter-spacing: -.02em; }
.head .meta { color: var(--muted); margin-top: 6px; }
.big-score { flex: none; display: grid; place-items: center; color: #fff; border-radius: 16px; min-width: 72px; height: 72px; padding: 0 12px;
             background: var(--sc, var(--s0)); }
.big-score b { display: block; font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.actions { display: flex; justify-content: space-evenly; align-items: center; padding: 12px 18px; background: var(--surface);
           border-bottom: 1px solid var(--line); }
.action { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--soft); border: 0; padding: 0; }
.action .ico { width: 23px; height: 23px; color: var(--accent); }
.block { background: var(--surface); margin-top: 10px; padding: 18px; }
@media (min-width: 880px) { .block, .head, .actions { border-radius: var(--radius); } .block { margin: 12px 0 0; } .detail { padding-top: 14px; } .hero { border-radius: var(--radius); } }
.block h2 { font-size: 18px; margin-bottom: 12px; }
.block p { line-height: 1.5; margin: 6px 0; }
.src { padding: 12px 0; border-top: 1px solid var(--line); }
.src:first-of-type { border-top: 0; padding-top: 0; }
.src-head { display: flex; align-items: center; gap: 8px; font-weight: 750; }
.src-head .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--c); }
.src-head .kind { color: var(--muted); font-weight: 500; font-size: 13px; }
.years { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.year { border-radius: 8px; padding: 4px 9px; font-size: 13px; background: var(--soft); }
.year b { font-weight: 750; }
.year.best { background: color-mix(in srgb, var(--c) 14%, white); }
.dish { color: var(--muted); font-size: 13px; margin-top: 4px; }
.info-row { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.info-row:first-of-type { border-top: 0; }
.info-row .ico { color: var(--muted); margin-top: 2px; }
.info-row a { color: var(--accent); font-weight: 600; word-break: break-word; }
.hours { width: 100%; border-collapse: collapse; font-size: 14px; }
.hours td { padding: 3px 0; }
.hours td:last-child { text-align: right; color: var(--muted); }
.hours tr.today td { font-weight: 750; color: var(--ink); }
#mini-map { height: 220px; border-radius: 12px; margin-top: 12px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; font-weight: 600; }
.desc-src { color: var(--muted); font-size: 12.5px; }

/* ---------- pages */
.page { max-width: 860px; margin: 0 auto; padding: 18px 14px 60px; }
.page h1 { font-size: 26px; margin-bottom: 6px; }
.page .lead { color: var(--muted); margin: 0 0 18px; line-height: 1.5; }
.src-card { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border-radius: var(--radius); padding: 14px 16px;
            margin-bottom: 10px; box-shadow: var(--shadow); }
.src-card .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); margin-top: 4px; flex: none; }
.src-card h3 { font-size: 16px; }
.src-card .meta { color: var(--muted); font-size: 13.5px; margin-top: 4px; line-height: 1.45; }
.src-card .n { margin-left: auto; text-align: right; font-weight: 800; font-size: 18px; }
.why-note { color: var(--muted); font-size: 13px; margin-top: 12px; line-height: 1.45; }
.src-card .n small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }

/* Google look-ups ("Consultar"): set apart and credited, as Google's terms ask */
.gbox { border: 1px solid var(--line); border-radius: 12px; padding: 2px 12px; margin: 8px 0; background: #fcfbf9; }
.gbox .info-row:first-child { border-top: 0; }
.glabel { color: var(--muted); margin-right: 6px; }
.consult { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.busy { color: var(--muted); font-style: italic; }
.busy::before { content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 6px; vertical-align: -1px;
                border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.g-attr { font-family: Roboto, sans-serif; font-size: 12px; color: #5e5e5e; text-align: right; padding: 6px 0 8px; white-space: nowrap; }

/* ---------- accounts */
.appbar-user { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0;
               background: var(--soft); color: var(--accent); padding: 0; }
.appbar-user .ico { width: 20px; height: 20px; }
body.anon .search, body.anon .appbar-link, body.anon .appbar-user { visibility: hidden; }
.auth { max-width: 380px; margin: 40px auto; padding: 0 20px; }
.auth-brand { display: flex; align-items: center; gap: 12px; color: var(--accent); font-weight: 800; font-size: 30px; margin-bottom: 24px; }
.auth-brand svg { width: 44px; height: 44px; }
.auth-form { display: grid; gap: 14px; background: var(--surface); padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); }
.auth-form h2 { font-size: 20px; }
.auth-form p { margin: 0; }
.auth-form label, .admin-new label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.auth-form input, .admin-new input:not([type=checkbox]), .link-row input { font: inherit; font-size: 16px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); min-width: 0; }
.auth-form input:focus, .admin-new input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.auth-error { color: #b3261e; font-weight: 600; font-size: 14px; }
.btn.small { flex: 0 0 auto; padding: 6px 10px; font-size: 13px; }
.btn.danger { color: #b3261e; }
.menu { display: grid; gap: 2px; margin-top: 8px; }
.menu a, .menu button { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border: 0; background: none;
  font-size: 16px; text-align: left; border-bottom: 1px solid var(--line); }
.menu .ico { color: var(--accent); }
.menu .n { margin-left: auto; color: var(--muted); font-size: 14px; }
.action.save.on .ico { color: var(--accent); }
.score { position: relative; }
.saved-mark { position: absolute; top: -6px; right: -2px; color: var(--accent); }
.saved-mark .ico { width: 17px; height: 17px; stroke: #fff; stroke-width: 1.5; }
.admin h2 { font-size: 18px; margin-bottom: 10px; }
.admin-new, .link-box { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin: 14px 0; }
.admin-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.admin-row label { flex: 1 1 140px; }
.admin-row label.check { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding-bottom: 12px; }
.link-box p { margin: 0 0 8px; }
.link-row { display: flex; gap: 8px; }
.link-row input { flex: 1; font-size: 14px; }
.users { display: grid; gap: 8px; margin: 14px 0; }
.user { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: grid; gap: 10px; }
.user.off { opacity: .6; }
.user .sub { color: var(--muted); font-size: 13.5px; }
.user-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.forgot-note a, .auth-form .why-note a { color: var(--accent); font-weight: 600; }
