:root {
  --ink: #171511;
  --muted: #686158;
  --paper: #fbfaf6;
  --panel: #ffffff;
  --line: #ded8cd;
  --gold: #b88835;
  --gold-dark: #7c541f;
  --leaf: #285d4d;
  --oxblood: #7c2531;
  --blue: #355c7d;
  --charcoal: #25211b;
  --shadow: 0 18px 50px rgba(23, 21, 17, 0.12);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

#home,
#guide,
#guideFilters,
#wheel,
#suggest,
#submit {
  scroll-margin-top: 130px;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(40, 93, 77, 0.12), transparent 32rem),
    linear-gradient(90deg, rgba(184, 136, 53, 0.07) 1px, transparent 1px),
    linear-gradient(180deg, rgba(184, 136, 53, 0.07) 1px, transparent 1px),
    var(--paper);
  background-size: 44px 44px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid rgba(222, 216, 205, 0.86);
  background: rgba(251, 250, 246, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(184, 136, 53, 0.32), transparent),
    var(--ink);
  border: 2px solid var(--gold);
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.staff-only {
  display: none !important;
}

body.staff-mode .staff-only {
  display: flex !important;
}

body.staff-mode .form-section.staff-only {
  display: block !important;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vw, 30px);
  color: var(--muted);
  font-size: 0.92rem;
}

.nav-links a {
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--ink);
}

.staff-controls,
.data-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.staff-controls span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

#importDataInput {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 54px) 54px;
}

.guide-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  gap: clamp(28px, 5vw, 80px);
  min-height: 560px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  max-width: 860px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--gold-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4rem, 10vw, 9rem);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
}

h3 {
  margin-bottom: 12px;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-text {
  max-width: 650px;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.7;
}

.hero-panel {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
  box-shadow: var(--shadow);
}

.hero-panel div {
  padding: 28px;
  background: rgba(255, 255, 255, 0.92);
}

.hero-panel .guide-seal {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 260px;
  padding: 30px;
  color: #fff;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(184, 136, 53, 0.25), transparent 44%),
    var(--charcoal);
}

.guide-seal span {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  border: 2px solid var(--gold);
  color: var(--gold);
  font-size: 1.65rem;
  font-weight: 800;
}

.guide-seal strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.3rem;
  line-height: 1;
}

.guide-seal small {
  max-width: 220px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.45;
}

.stat {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1;
}

.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toolbar {
  position: sticky;
  top: 81px;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(260px, 1.8fr) repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin: 28px 0;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(251, 250, 246, 0.95);
  backdrop-filter: blur(18px);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 136, 53, 0.16);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 22px;
  align-items: start;
}

.restaurant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

.restaurant-card,
.detail-panel,
.wheel-section,
.form-section {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
}

.restaurant-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 16px;
  min-height: 360px;
  overflow: hidden;
  padding: 20px;
  text-align: left;
  box-shadow: 0 10px 26px rgba(23, 21, 17, 0.06);
}

.restaurant-card.active {
  border-color: var(--gold);
  box-shadow: 0 18px 36px rgba(184, 136, 53, 0.18);
}

.card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 66px;
  align-items: start;
  gap: 12px;
  min-width: 0;
}

.card-top > div:first-child {
  min-width: 0;
}

.score-ring {
  display: grid;
  flex: 0 0 auto;
  width: 66px;
  height: 66px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background:
    radial-gradient(circle at center, #fff 0 54%, transparent 55%),
    conic-gradient(var(--gold) calc(var(--score) * 10%), #ebe5da 0);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.22rem;
  font-weight: 700;
}

.score-ring.pending {
  color: var(--muted);
  background:
    radial-gradient(circle at center, #fff 0 54%, transparent 55%),
    conic-gradient(#d8d0c3 100%, #ebe5da 0);
  font-size: 1rem;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

.card-title {
  display: -webkit-box;
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.24rem, 1.7vw, 1.52rem);
  line-height: 1.12;
  overflow: hidden;
  overflow-wrap: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.meta {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.wheel-pool-count {
  margin: 10px 0 0;
}

.badge-row,
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge,
.chip {
  max-width: 100%;
  border: 1px solid var(--line);
  padding: 7px 10px;
  color: var(--muted);
  background: #fff;
  font-size: 0.8rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.badge.gold {
  border-color: rgba(184, 136, 53, 0.55);
  color: var(--gold-dark);
  background: rgba(184, 136, 53, 0.1);
}

.card-note {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  flex-wrap: wrap;
}

.text-button {
  border: 0;
  padding: 0;
  color: var(--gold-dark);
  background: transparent;
  font-weight: 800;
}

.detail-panel {
  position: sticky;
  top: 170px;
  max-height: calc(100vh - 190px);
  min-height: 420px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
  box-shadow: var(--shadow);
}

.mobile-detail-panel {
  display: none;
}

.detail-list {
  display: grid;
  gap: 16px;
  margin: 22px 0;
}

.review-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.review-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  padding: 12px;
  background: #fff;
}

.review-card strong {
  font-size: 0.95rem;
}

.review-card .review-score {
  color: var(--gold-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.6rem;
  line-height: 1;
}

.review-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.review-photo,
.review-photo-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #f5f0e6;
}

.review-photo-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.review-photo-button {
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.review-photo-button span {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
  overflow-wrap: anywhere;
}

.review-photo-button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.detail-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 24px;
}

.wheel-section,
.suggest-section,
.form-section {
  margin-top: 54px;
  padding: clamp(22px, 4vw, 42px);
}

.wheel-layout {
  display: grid;
  grid-template-columns: minmax(280px, 560px) minmax(240px, 340px) minmax(280px, 1fr);
  gap: clamp(22px, 5vw, 64px);
  align-items: start;
}

.wheel-wrap {
  position: relative;
  aspect-ratio: 1;
  width: min(100%, 560px);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.spin-button {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 116px;
  height: 116px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  box-shadow: 0 14px 28px rgba(23, 21, 17, 0.22);
}

.wheel-controls {
  display: grid;
  gap: 24px;
}

.wheel-options-panel {
  display: grid;
  align-self: stretch;
  gap: 12px;
  min-height: 0;
}

.wheel-options-panel h3 {
  margin: 0;
  font-size: 1rem;
}

.wheel-options-list {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}

.wheel-option {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid var(--line);
  padding: 10px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.wheel-option strong,
.wheel-option span {
  overflow-wrap: anywhere;
}

.wheel-option span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.control-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.wheel-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chip[aria-pressed="true"] {
  border-color: var(--oxblood);
  color: #fff;
  background: var(--oxblood);
}

.chip button {
  width: 24px;
  height: 24px;
  border: 0;
  color: #fff;
  background: var(--ink);
  line-height: 1;
}

.scroll-chip-list {
  max-height: 190px;
  overflow: auto;
  padding-right: 4px;
}

.winner-box {
  display: grid;
  gap: 7px;
  padding: 18px;
  color: #fff;
  background: var(--ink);
}

.winner-box span,
.winner-box small {
  color: rgba(255, 255, 255, 0.7);
}

.winner-box strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.6rem;
}

.restaurant-form {
  display: grid;
  gap: 22px;
}

.admin-quick-review {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  padding: 16px;
  background: #fff;
}

.business-info-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(53, 92, 125, 0.08), transparent 42%),
    #fff;
}

.business-info-panel h3,
.business-info-panel p {
  margin: 0;
}

.business-info-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.form-mode-banner {
  display: grid;
  gap: 4px;
  margin-bottom: -4px;
  border: 1px solid rgba(40, 93, 77, 0.32);
  padding: 14px 16px;
  background: rgba(40, 93, 77, 0.08);
}

.form-mode-banner.editing {
  border-color: rgba(184, 136, 53, 0.55);
  background: rgba(184, 136, 53, 0.12);
}

.form-mode-banner span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-mode-banner strong {
  font-size: 1.05rem;
}

.form-mode-banner small {
  color: var(--muted);
  line-height: 1.4;
}

.suggest-section {
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(40, 93, 77, 0.08), transparent 42%),
    rgba(255, 255, 255, 0.94);
}

.suggestion-form {
  display: grid;
  gap: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.wide {
  grid-column: span 2;
}

.reviewer-section {
  display: grid;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.reviewer-heading {
  display: grid;
  gap: 4px;
}

.reviewer-heading h3,
.reviewer-heading p {
  margin: 0;
}

.reviewer-heading p {
  color: var(--muted);
  line-height: 1.5;
}

.reviewer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.reviewer-input-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  padding: 16px;
  background: #fff;
}

.reviewer-input-card h4 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.review-photo-preview {
  min-height: 0;
}

.review-photo-inputs {
  display: grid;
  gap: 10px;
}

.field-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.review-photo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.85fr) 86px;
  gap: 10px;
  align-items: end;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.review-photo-row .review-photo-preview img {
  aspect-ratio: 1;
}

.review-modal[hidden] {
  display: none;
}

.review-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
}

.review-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 21, 17, 0.58);
}

.review-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  width: min(980px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  border: 1px solid var(--line);
  padding: clamp(22px, 4vw, 36px);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.login-dialog {
  width: min(460px, 100%);
}

.photo-lightbox[hidden] {
  display: none;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: clamp(14px, 4vw, 42px);
}

.photo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(23, 21, 17, 0.78);
  cursor: zoom-out;
}

.photo-lightbox-frame {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(960px, 100%);
  max-height: 92vh;
  margin: 0;
  padding: clamp(12px, 2vw, 18px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #171511;
  box-shadow: var(--shadow);
}

.photo-lightbox-frame img {
  display: block;
  max-width: 100%;
  max-height: min(76vh, 760px);
  margin: 0 auto;
  object-fit: contain;
}

.photo-lightbox-frame figcaption {
  color: #fbfaf6;
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: center;
}

.review-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 800;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  min-height: 44px;
  border: 1px solid var(--ink);
  padding: 10px 16px;
  font-weight: 800;
}

.primary-button {
  color: #fff;
  background: var(--ink);
}

.secondary-button,
.ghost-button {
  color: var(--ink);
  background: #fff;
}

.danger-button {
  color: #fff;
  border-color: var(--oxblood);
  background: var(--oxblood);
}

.ghost-button {
  border-color: var(--line);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 48px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
  text-align: center;
}

@media (max-width: 1080px) {
  .guide-hero,
  .layout,
  .wheel-layout {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }

  .toolbar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-quick-review {
    grid-template-columns: 1fr;
  }


  .reviewer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand {
    min-width: 0;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
  }

  .staff-controls {
    width: 100%;
    justify-content: space-between;
  }

  .data-actions {
    width: 100%;
  }

  .data-actions button {
    flex: 1;
  }

  .guide-hero {
    min-height: auto;
    padding: 58px 0 36px;
  }

  .toolbar,
  .form-grid,
  .wheel-filter-grid {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }

  .review-summary {
    grid-template-columns: 1fr;
  }

  .review-photo-row {
    grid-template-columns: 1fr;
  }

  .restaurant-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    display: none;
  }

  .mobile-detail-panel {
    display: block;
    border: 1px solid var(--gold);
    padding: 20px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 14px 28px rgba(184, 136, 53, 0.14);
  }

  h1 {
    font-size: 3rem;
  }
}
