:root {
  --paper: #f3ecdf;
  --paper-2: #fffaf3;
  --ink: #241c16;
  --ink-soft: #65584c;
  --line: #e4d7c6;
  --line-strong: #cbbba6;
  --tomato: #c24b32;
  --tomato-dark: #8d3220;
  --olive: #2f4a3c;
  --gold: #b5812f;
  --shadow: 0 12px 30px rgba(60, 36, 16, 0.08);
  color-scheme: light;
  font-family: Outfit, "Avenir Next", "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; padding-bottom: calc(5.2rem + env(safe-area-inset-bottom)); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--tomato-dark); }

.skip {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background: white;
  padding: 0.4rem 0.7rem;
  z-index: 10;
}
.skip:focus { top: 0.5rem; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(243, 236, 223, 0.92);
  backdrop-filter: blur(10px);
}
.topbar-inner {
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: calc(0.7rem + env(safe-area-inset-top)) 0 0.7rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  text-decoration: none;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.35rem;
  font-weight: 680;
}
.mark {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 99px;
  background: radial-gradient(circle at 40% 40%, #e07a4c, var(--tomato) 55%, var(--olive));
  box-shadow: 6px 2px 0 -2px var(--olive);
}
.desktop-nav { display: none; }
.desktop-nav a, .tabbar a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
}
.desktop-nav a.is-active, .tabbar a.is-active { color: var(--ink); }

main { width: min(980px, calc(100% - 2rem)); margin: 0 auto; padding-top: 1rem; }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 560; line-height: 1.15; }
h1 { font-size: clamp(2rem, 8vw, 3.3rem); margin: 0 0 0.4rem; }
h2 { font-size: 1.45rem; margin: 0; }
p { margin: 0.3rem 0; }

.intro, .empty { padding: 0.4rem 0 1rem; }
.empty { background: var(--paper-2); border: 1px solid var(--line); border-radius: 20px; padding: 1.2rem; box-shadow: var(--shadow); }
.muted, .meta { color: var(--ink-soft); }
.eyebrow { letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.78rem; font-weight: 600; color: var(--olive); margin-bottom: 0.2rem; }
.warning { color: var(--tomato-dark); background: #f8e4dc; border-radius: 12px; padding: 0.6rem 0.75rem; }
.notice { background: #e7f0e4; color: var(--olive); border-radius: 12px; padding: 0.7rem 0.8rem; }

.stack { display: grid; gap: 0.75rem; }
.inset { margin-top: 1.4rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.6rem 0; }
.row-actions .button { width: auto; flex: 1 1 8rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin: 1.3rem 0 0.6rem; }
.panel, .filters {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1rem;
  box-shadow: var(--shadow);
  margin: 0.8rem 0;
}
label { display: grid; gap: 0.3rem; font-size: 0.92rem; font-weight: 600; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: white;
  border-radius: 12px;
  padding: 0.75rem 0.8rem;
  min-height: 48px;
}
textarea { min-height: 6rem; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--tomato);
  outline-offset: 2px;
}

.button, .text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  border: 0;
  text-decoration: none;
  font-weight: 650;
}
.button { background: var(--tomato); color: white; width: 100%; }
.button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.text-button { background: transparent; color: var(--ink-soft); padding-inline: 0.2rem; min-height: 44px; }
.danger { color: var(--tomato-dark); }
.text-link { font-weight: 650; }

.filter-grid, .edit-item { display: grid; gap: 0.6rem; }
.filters { display: grid; gap: 0.75rem; }

.drop {
  position: relative;
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  text-align: center;
  padding: 1.1rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: 18px;
  background: #fff;
  font-weight: 650;
  overflow: hidden;
}
.drop input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.file-list { margin: 0; }
.drop small { font-weight: 450; color: var(--ink-soft); }
.drop input::file-selector-button,
.drop input::-webkit-file-upload-button {
  font: inherit;
  font-weight: 650;
  color: white;
  background: var(--olive);
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  margin-bottom: 0.45rem;
}

input[type="radio"], input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  min-height: 0;
  padding: 0;
  margin: 0;
  accent-color: var(--tomato);
  flex: none;
}
.rate, .choices { border: 0; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.rate {
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.rate legend, .choices legend { font-weight: 700; padding: 0; margin-bottom: 0.2rem; }
.rate legend { grid-column: 1 / -1; }
.rate label, .choice {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  border: 1px solid var(--line);
  background: white;
  border-radius: 14px;
  padding: 0.55rem 0.7rem;
  min-height: 48px;
}
.rate label {
  position: relative;
  justify-content: center;
  min-width: 0;
  border-radius: 999px;
  padding: 0.75rem 0.6rem;
}
.rate label span { white-space: nowrap; }
.rate input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  margin: 0;
  opacity: 0;
}
.rate label:focus-within { outline: 2px solid var(--tomato); outline-offset: 2px; }
.choice span { display: grid; }
.choice small { color: var(--ink-soft); font-weight: 450; }
.rate label:has(input:checked), .choice:has(input:checked) { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.choice:has(input:checked) small { color: #eadfce; }

.cards, .photo-grid { display: grid; gap: 0.75rem; }
.card, .photo-tile {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 0.8rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.card-body, .photo-tile span { display: grid; gap: 0.15rem; padding-right: 0.7rem; }
.card strong, .photo-tile strong { font-family: Fraunces, Georgia, serif; font-size: 1.15rem; }
.card-photo, .placeholder, .photo-tile img, .film img, .gallery .shot, .confirm-photo {
  background: #efe4d4;
  overflow: hidden;
}
.card-photo, .placeholder { width: 104px; height: 104px; display: grid; place-items: center; }
.placeholder { font-family: Fraunces, Georgia, serif; font-size: 2rem; color: var(--olive); }
.card-photo img, .gallery img, .film img, .confirm-photo img, .photo-tile img, .viewer img { width: 100%; height: 100%; object-fit: cover; display: block; }
.match { color: var(--olive); font-size: 0.92rem; }

.film-wrap { margin: 1rem 0; }
.film {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 46%;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.3rem;
}
.film a { scroll-snap-align: start; aspect-ratio: 1; border-radius: 16px; overflow: hidden; display: block; }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.gallery .shot { position: relative; display: block; aspect-ratio: 1; border-radius: 12px; margin: 0; overflow: hidden; }
.gallery .shot a { display: block; height: 100%; }
.gallery .shot form { position: absolute; top: 0.4rem; right: 0.4rem; margin: 0; }
.shot-delete {
  min-height: 44px;
  padding: 0.3rem 0.75rem;
  border: 0;
  border-radius: 999px;
  background: rgba(22, 17, 14, 0.78);
  color: white;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
}
.gallery .shot:first-child { grid-column: 1 / -1; aspect-ratio: 4 / 3; border-radius: 18px; }
.gallery .shot:nth-child(2):last-child { grid-column: 1 / -1; aspect-ratio: 4 / 3; }
.confirm-photo { display: block; aspect-ratio: 4 / 3; border-radius: 16px; }

.photo-grid { grid-template-columns: 1fr 1fr; }
.photo-tile { grid-template-columns: 1fr; align-items: stretch; }
.photo-tile a { display: contents; color: inherit; text-decoration: none; }
.photo-tile form { padding: 0 0.7rem 0.45rem; }
.photo-tile img { aspect-ratio: 1; height: auto; }
.photo-tile span { padding: 0.55rem 0.7rem 0.35rem; }

.place-head { margin: 1rem 0; }
.reviews { display: grid; gap: 0.7rem; margin-top: 0.8rem; }
.review { border-top: 1px solid var(--line); padding-top: 0.7rem; }
.review header { display: flex; justify-content: space-between; gap: 0.5rem; align-items: center; }

.menu-board, .menu-edit {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0.9rem 1rem 1rem;
  margin: 0.7rem 0;
}
.menu-board h2, .menu-edit h2 {
  font-size: 0.92rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tomato-dark);
}
.dish { padding: 0.75rem 0; border-top: 1px solid var(--line); }
.dish-row { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.dish h3 { margin: 0; font-size: 1.12rem; }
.price { font-variant-numeric: tabular-nums; white-space: nowrap; }
.dish p { color: var(--ink-soft); }
.edit-item { border-top: 1px solid var(--line); padding-top: 0.75rem; margin-top: 0.75rem; }
.edit-item .wide { grid-column: 1 / -1; }
.ignored { color: var(--ink-soft); }

.star-read { position: relative; display: inline-block; color: #ddd2c4; letter-spacing: 0.04em; }
.star-fill { position: absolute; left: 0; top: 0; width: var(--score); overflow: hidden; color: var(--gold); white-space: nowrap; }
.rating-num { font-variant-numeric: tabular-nums; font-weight: 650; }

.viewer { margin: 0; }
.viewer img { border-radius: 18px; background: black; max-height: 72vh; object-fit: contain; height: auto; }
.viewer-page { background: #16110e; color: #f6f0e6; }
.viewer-page .topbar, .viewer-page .colophon, .viewer-page .tabbar { background: #16110e; color: #f6f0e6; border-color: #3a3028; }
.viewer-page .brand, .viewer-page .tabbar a, .viewer-page .desktop-nav a, .viewer-page .colophon { color: #f6f0e6; }
.viewer-page a:not(.button) { color: #f3d2b5; }
.viewer-page .button.secondary { color: #f6f0e6; border-color: #6d5c4e; }

.lightbox { border: 0; padding: 0; background: transparent; width: min(960px, 100vw); }
.lightbox::backdrop { background: rgba(18, 12, 8, 0.88); }
.lightbox img { width: 100%; max-height: 82vh; object-fit: contain; background: black; }
.lightbox p { color: white; text-align: center; }
.lightbox-close { position: absolute; right: 0.5rem; top: 0.5rem; }

.auth-card {
  width: min(440px, 100%);
  margin: 1.2rem auto;
  display: grid;
  gap: 0.75rem;
}
.auth-card h1 { font-family: Fraunces, Georgia, serif; margin: 0; }
.auth-links { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0; }
.who { color: var(--ink-soft); font-size: 0.92rem; }
.auth-page { padding-bottom: 2rem; }

.card.discover { align-items: start; }
.card.discover form { margin: 0; }
.discover-list { margin-top: 1.4rem; }
.discover-list h2 { margin-bottom: 0.35rem; }

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 250, 243, 0.96);
  border-top: 1px solid var(--line);
  padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom));
  z-index: 5;
}
.tabbar a { text-align: center; padding: 0.55rem 0.15rem; border-radius: 12px; font-size: 0.82rem; }
.colophon { width: min(980px, calc(100% - 2rem)); margin: 1.5rem auto 0; color: var(--ink-soft); font-size: 0.82rem; }

@media (min-width: 720px) {
  .filter-grid, .edit-item { grid-template-columns: 1.4fr 0.7fr 0.8fr; }
  .edit-item .wide { grid-column: 1 / -1; }
  .button { width: auto; }
  .photo-grid { grid-template-columns: repeat(4, 1fr); }
  .film { grid-auto-columns: 18%; }
}
@media (min-width: 860px) {
  .tabbar { display: none; }
  body { padding-bottom: 2rem; }
  .desktop-nav { display: flex; gap: 1rem; }
  .cards { grid-template-columns: 1fr 1fr; }
  .detail { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 0 1.2rem; align-items: start; }
  .detail .gallery, .detail .place-head { grid-column: 1; }
  .detail #menu { grid-column: 2; grid-row: 1 / span 6; }
}

@media print {
  .topbar, .tabbar, .filters, .panel form, .colophon, .row-actions { display: none !important; }
  body { background: white; padding: 0; }
  .menu-board { break-inside: avoid; box-shadow: none; }
}
