/* Dining (casual). Deliberately unlike Fine Dining: warm cream, tomato red, round type. */
:root {
  --bg: #fff6ea; --card: #ffffff; --ink: #2b1d14; --muted: #8a7462; --line: #f0dfc9;
  --accent: #e8492b; --accent-ink: #ffffff; --chip: #fde8d3; --chip-ink: #7a3a1c;
  --star: #f5a524; --star-off: #ecd9c2; --shadow: 0 2px 10px rgba(120, 60, 20, .08);
  --radius: 18px;
}
/* Dark: follows the device unless the ◐ button picked Light or Dark (html[data-theme]). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d1714; --card: #2a211c; --ink: #f7ebde; --muted: #b19c8a; --line: #3b2f27;
    --accent: #ff6a4a; --accent-ink: #1d1714; --chip: #3d2c22; --chip-ink: #ffc9a8;
    --star: #ffb938; --star-off: #4a3a2f; --shadow: 0 2px 10px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] {
    --bg: #1d1714; --card: #2a211c; --ink: #f7ebde; --muted: #b19c8a; --line: #3b2f27;
    --accent: #ff6a4a; --accent-ink: #1d1714; --chip: #3d2c22; --chip-ink: #ffc9a8;
    --star: #ffb938; --star-off: #4a3a2f; --shadow: 0 2px 10px rgba(0, 0, 0, .3);
}
:root[data-theme="dark"] { color-scheme: dark; } :root[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: Nunito, ui-rounded, system-ui, sans-serif; font-weight: 600; font-size: 16px;
       padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13px; }
body.anon .owner-only { display: none !important; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 10px;
       padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 8px; max-width: 900px; margin: 0 auto; }
.top h1 { margin: 0; font-size: 28px; font-weight: 900; color: var(--accent); letter-spacing: -.5px; }
@media (max-width: 480px) { .top .sub { display: none; } }
.top .sub { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.actions { display: flex; gap: 8px; align-items: center; }
.fine { font-size: 13px; color: var(--muted); text-decoration: none; border: 1.5px solid var(--line);
        padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.ghost { white-space: nowrap; background: none; border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 12px;
         font-size: 13px; cursor: pointer; }

main { max-width: 900px; margin: 0 auto; padding: 0 16px; }
.bar { display: flex; gap: 8px; margin: 6px 0 10px; }
.bar input { flex: 1; min-width: 0; padding: 11px 14px; border-radius: 999px; border: 1.5px solid var(--line);
             background: var(--card); }
.bar select { flex: none; padding: 0 10px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.chip { background: var(--chip); color: var(--chip-ink); border: 0; border-radius: 999px; padding: 4px 11px;
        font-size: 13px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.chip .n { opacity: .55; margin-left: 3px; font-weight: 700; }
.chips.active .chip { background: var(--accent); color: var(--accent-ink); }
.chips.active .chip::after { content: " ×"; }
#tagcloud { max-height: 62px; overflow: hidden; position: relative; }
#tagcloud.open { max-height: none; }
.more { background: none; border: 0; color: var(--accent); font-weight: 800; font-size: 13px; cursor: pointer; padding: 2px 0; }

.cards { display: grid; gap: 10px; margin: 8px 0 20px; }
@media (min-width: 700px) { .cards { grid-template-columns: 1fr 1fr; } }
.card { min-width: 0; overflow: hidden; display: flex; gap: 12px; background: var(--card); border-radius: var(--radius); padding: 12px;
        box-shadow: var(--shadow); cursor: pointer; border: 0; text-align: left; width: 100%; align-items: center; }
.card .ph { width: 64px; height: 64px; border-radius: 14px; background: var(--chip) center/cover; flex: none;
            display: grid; place-items: center; font-size: 26px; }
.card .body { min-width: 0; flex: 1; }
.card .name { font-weight: 900; font-size: 17px; line-height: 1.2; }
.card .where { color: var(--muted); font-size: 13px; margin: 2px 0 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .chips { margin: 0; flex-wrap: nowrap; overflow: hidden; }
.card .chip { font-size: 11.5px; padding: 2px 8px; cursor: inherit; }
.card .score { text-align: right; flex: none; }
.card .score b { display: block; font-size: 22px; font-weight: 900; line-height: 1; }
.unrated { font-size: 12px; color: var(--muted); }

.stars { display: inline-flex; gap: 1px; color: var(--star); font-size: 15px; letter-spacing: -1px; }
.star { position: relative; display: inline-block; color: var(--star-off); }
.star.full { color: var(--star); }
.star.half::before { content: "★"; position: absolute; left: 0; width: 50%; overflow: hidden; color: var(--star); }

.rank { background: var(--card); border-radius: var(--radius); padding: 12px 14px; margin: 10px 0; box-shadow: var(--shadow); }
.rank h3 { margin: 0 0 6px; font-weight: 900; display: flex; justify-content: space-between; align-items: baseline; }
.rank h3 button { background: none; border: 0; color: var(--accent); font-weight: 900; font-size: 18px; padding: 0; cursor: pointer; }
.rank ol { margin: 0; padding-left: 22px; }
.rank li { padding: 3px 0; cursor: pointer; }
.rank li .s { float: right; font-weight: 900; }

#map { height: calc(100vh - 230px); min-height: 320px; border-radius: var(--radius); box-shadow: var(--shadow); z-index: 0; }
.pin { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff;
       font-size: 11px; font-weight: 900; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }

.fab { position: fixed; right: 18px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); width: 56px; height: 56px;
       border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 32px; font-weight: 700;
       box-shadow: 0 6px 18px rgba(232, 73, 43, .4); cursor: pointer; z-index: 5; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 4px;
          background: var(--card); border-top: 1.5px solid var(--line); z-index: 6;
          padding: 6px 8px max(6px, calc(env(safe-area-inset-bottom, 0px) - 18px)); }
.tabbar button { flex: 1; max-width: 160px; background: none; border: 0; padding: 4px; font-size: 12px; font-weight: 800;
                 color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.tabbar button span { font-size: 19px; filter: grayscale(1); opacity: .7; }
.tabbar button.on { color: var(--accent); }
.tabbar button.on span { filter: none; opacity: 1; }

.sheet { position: fixed; inset: 0; background: rgba(40, 20, 10, .45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { background: var(--bg); width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; position: relative;
              border-radius: 24px 24px 0 0; padding: 20px 18px calc(24px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 700px) { .sheet { align-items: center; } .sheet-card { border-radius: 24px; } }
.close { position: absolute; right: 12px; top: 10px; background: var(--chip); color: var(--chip-ink); border: 0;
         width: 34px; height: 34px; border-radius: 50%; font-size: 22px; cursor: pointer; line-height: 1; }
.sheet h2 { margin: 0 40px 2px 0; font-size: 26px; font-weight: 900; line-height: 1.15; }
.big-score { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.big-score b { font-size: 34px; font-weight: 900; }
.big-score .stars { font-size: 24px; }
.big-score .lbl { color: var(--muted); font-weight: 800; }
.review { white-space: pre-wrap; line-height: 1.5; background: var(--card); padding: 12px 14px; border-radius: 14px; margin: 10px 0; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; margin: 10px 0; }
.photos .p { position: relative; aspect-ratio: 1; border-radius: 12px; background: var(--chip) center/cover; cursor: zoom-in; }
.photos .p .x { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.55); color: #fff; border: 0;
                border-radius: 50%; width: 24px; height: 24px; cursor: pointer; }
.visits { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.visits span { background: var(--card); border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.visits span button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 0 0 4px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }
.btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 10px 18px;
       font-weight: 900; cursor: pointer; }
.btn.alt { background: var(--chip); color: var(--chip-ink); }
.btn.danger { background: none; color: var(--accent); border: 1.5px solid var(--line); }
a.link { color: var(--accent); font-weight: 800; }
h4 { margin: 16px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

form label { display: block; margin: 12px 0 4px; font-size: 13px; font-weight: 800; color: var(--muted); }
form input[type=text], form input[type=url], form input[type=date], form textarea, form input[type=password] {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); }
form textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.picker { display: flex; align-items: center; gap: 12px; user-select: none; }
.picker .stars { font-size: 38px; letter-spacing: 0; cursor: pointer; touch-action: none; }
.picker .val { font-weight: 900; font-size: 20px; min-width: 3ch; }
.picker .lbl { color: var(--muted); font-weight: 800; white-space: nowrap; }
.picker { flex-wrap: wrap; row-gap: 2px; }
@media (max-width: 480px) { .picker .stars { font-size: 34px; } }
.picker .clear { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; text-decoration: underline; }
.tagbox { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border-radius: 12px; border: 1.5px solid var(--line);
          background: var(--card); }
.tagbox .chip::after { content: " ×"; }
.tagbox input { border: 0; flex: 1; min-width: 120px; background: none; padding: 4px; outline: none; }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sugg .chip { background: none; border: 1.5px dashed var(--line); color: var(--muted); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + env(safe-area-inset-bottom, 0px));
         background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; z-index: 30; font-weight: 800; }
.drop { display: block; border: 2px dashed var(--line); border-radius: 14px; padding: 14px; text-align: center;
        color: var(--muted); cursor: pointer; background: var(--card); margin: 0 !important; font-size: 14px !important; }
.drop.over { border-color: var(--accent); background: var(--chip); color: var(--chip-ink); }
.drop .photos:empty { display: none; }
.drop .photos { margin-bottom: 0; }

/* photo viewer — same behaviour as Fine Dining */
.lightbox{position:fixed;inset:0;z-index:80;background:rgba(10,9,8,.96);display:grid;
  grid-template-rows:1fr auto;padding:env(safe-area-inset-top,0px) 0 env(safe-area-inset-bottom,0px)}
/* dragging down dismisses: the stage follows the finger and the backdrop thins */
.lb-stage{will-change:transform,opacity}
.lb-stage.animate{transition:transform .28s cubic-bezier(.22,.61,.36,1),opacity .28s ease}
@media(prefers-reduced-motion:reduce){.lb-stage.animate{transition:none}}
.lightbox[hidden]{display:none}
/* The stage holds a three-slide track — previous, current, next — so a swipe
   can follow the finger and settle into place instead of the picture jumping. */
.lightbox .lb-stage{overflow:hidden;min-height:0;position:relative}
.lb-track{display:flex;height:100%;will-change:transform;transform:translate3d(-100%,0,0)}
.lb-track.animate{transition:transform .3s cubic-bezier(.22,.61,.36,1)}
.lb-slide{flex:0 0 100%;display:flex;align-items:center;justify-content:center;padding:10px;min-width:0}
.lightbox img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;display:block;
  touch-action:pan-y;-webkit-user-select:none;user-select:none;-webkit-user-drag:none;
  transform-origin:center center}
/* while zoomed the picture owns the gesture: no paging, no browser panning */
.lb-track.zoomed{touch-action:none}
.lb-track.zoomed img{touch-action:none;cursor:grab}

/* tap targets at the edges, as in Maps — chevrons appear on hover, and on a
   phone the zones are simply invisible */
.lb-edge{position:absolute;top:0;bottom:0;width:22%;max-width:160px;z-index:3;border:0;padding:0;
  background:none;display:flex;align-items:center;color:#fff;opacity:0;
  transition:opacity .18s ease;pointer-events:none}
.lb-edge.left{left:0;justify-content:flex-start}
.lb-edge.right{right:0;justify-content:flex-end}
.lb-edge span{font-size:34px;line-height:1;padding:0 14px;text-shadow:0 1px 6px rgba(0,0,0,.7)}
/* the chevrons are a hint only: the tap itself is resolved by geometry, so the
   dark surround can still close the viewer */
@media(hover:hover){.lightbox:not(.zoomed) .lb-stage:hover .lb-edge{opacity:.55}}
/* with a mouse the chevrons are visible, so clicking one must step, not close */
@media(hover:hover){.lb-edge{pointer-events:auto;cursor:pointer}}
.lightbox.zoomed .lb-edge{display:none}
@media(prefers-reduced-motion:reduce){.lb-track.animate{transition:none}}

.lightbox .lb-bar{display:flex;gap:10px;align-items:center;justify-content:center;padding:12px;color:#ddd;font-size:13px;flex-wrap:wrap}
.lightbox .lb-bar button{background:none;border:1px solid #555;color:#ddd;border-radius:999px;padding:7px 13px;cursor:pointer;font-weight:800}
.lightbox .lb-bar #lbcover.on{border-color:var(--star);color:var(--star);cursor:default}
.lightbox{z-index:40}
.photos .p.is-cover{box-shadow:0 0 0 3px var(--star)}

/* iPhone: Safari gives date inputs a fixed intrinsic width that ignores width:100%,
   which made the add sheet scroll sideways. Also never let the sheet pan sideways. */
form input[type=date] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%;
  min-height: 46px; text-align: left; }
form input[type=date]::-webkit-date-and-time-value { text-align: left; }
.sheet-card { overflow-x: hidden; overscroll-behavior: contain; touch-action: pan-y; }
.sheet-card form, .sheet-card form > *, .two > div { min-width: 0; max-width: 100%; }
.rank li.hit { color: var(--accent); font-weight: 900; }
.ghost.icon { padding: 5px 9px; font-size: 15px; line-height: 1; }
