:root {
  --bg: #f6f2ec;
  --surface: #ffffff;
  --ink: #2a2724;
  --muted: #776f66;
  --line: #e4ddd3;
  --accent: #2f6b63;
  --accent-ink: #ffffff;
  --accent-soft: #e3efec;
  --star: #d39a2c;
  --star-off: #ddd5ca;
  --danger: #b03a2e;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(40, 30, 20, 0.06), 0 4px 16px rgba(40, 30, 20, 0.05);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171615;
    --surface: #211f1d;
    --ink: #ece7e1;
    --muted: #a39b91;
    --line: #353230;
    --accent: #5fb3a6;
    --accent-ink: #10201d;
    --accent-soft: #1f3330;
    --star: #e2ae47;
    --star-off: #46413b;
    --danger: #e0786c;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }
h1, h2 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 1.9rem; margin: 0 0 0.4rem; }
h2 { font-size: 1.25rem; margin: 2rem 0 0.8rem; }
.muted { color: var(--muted); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 48px; min-height: 70vh; }

/* Top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-mark { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 0.95rem; }
.nav a { text-decoration: none; }
.nav-user { color: var(--muted); }
.lang-switch { display: inline-flex; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.lang-switch a { padding: 2px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.lang-switch a.active { background: var(--accent); color: var(--accent-ink); }

/* Buttons and forms */
.btn {
  display: inline-block; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600;
  padding: 10px 22px; text-decoration: none;
}
.btn:hover { filter: brightness(1.07); }
.btn-small { padding: 6px 14px; font-size: 0.9rem; }
.btn-secondary { background: var(--accent-soft); color: var(--accent); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.linklike.danger, .danger { color: var(--danger); }
form.inline { display: inline; }
.inline-form { margin-bottom: 16px; }

.form { display: grid; gap: 16px; }
.form label, .search label { display: grid; gap: 4px; }
.form label > span, .search label > span, legend { font-weight: 600; font-size: 0.92rem; }
.form label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { padding: 0; margin-bottom: 6px; }
fieldset .check { margin-right: 18px; display: inline-flex !important; }
small { font-size: 0.82rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.narrow { max-width: 480px; margin: 24px auto; }
.form-card { margin-top: 32px; }

/* Flash messages */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid var(--line); background: var(--surface); }
.flash ul { margin: 0; padding-left: 18px; }
.flash-success { border-color: var(--accent); background: var(--accent-soft); }
.flash-error { border-color: var(--danger); color: var(--danger); }
.flash-info { border-color: var(--star); }
.notice { padding: 12px 16px; border-radius: 10px; background: var(--accent-soft); margin: 8px 0 20px; }

/* Home */
.hero { text-align: center; padding: 24px 0 8px; }
.hero h1 { font-size: 2.2rem; }
.lead { color: var(--muted); font-size: 1.1rem; margin: 0 auto 24px; max-width: 620px; }
.search { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 12px; align-items: end; text-align: left; }
.search-actions { display: flex; align-items: center; gap: 12px; }
@media (max-width: 760px) {
  .search { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.7rem; }
}

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 28px 0 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; display: grid; }
.stat strong { font-size: 1.6rem; }
.stat span { color: var(--muted); font-size: 0.9rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.chip:hover { border-color: var(--accent); }
.chip-count { color: var(--muted); font-size: 0.85rem; }
.cta { margin-top: 32px; text-align: center; }
.cta h2 { margin-top: 0; }
.cta p { max-width: 620px; margin: 0 auto 16px; color: var(--muted); }

/* Results */
.count { color: var(--muted); font-weight: 400; font-size: 1rem; }
.result-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.result { padding: 16px; display: grid; gap: 4px; }
.result-title { font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.result-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 0.9rem; }

/* Stars */
.stars { position: relative; display: inline-block; font-size: 1.05rem; line-height: 1; letter-spacing: 2px; color: var(--star-off); vertical-align: -1px; }
.stars::before { content: "★★★★★"; }
.stars-fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; white-space: nowrap; color: var(--star); }
.stars-fill::before { content: "★★★★★"; }
.score-num { font-weight: 700; font-size: 0.95rem; }

.stars-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.stars-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars-input label { font-size: 1.8rem; line-height: 1; color: var(--star-off); cursor: pointer; padding: 0 1px; }
.stars-input label:hover, .stars-input label:hover ~ label,
.stars-input input:checked ~ label { color: var(--star); }
.stars-input input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 4px; }
.rating-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
@media (max-width: 600px) { .two-col { grid-template-columns: 1fr; } }

/* Profile pages */
.profile-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; color: var(--accent); font-weight: 700; margin: 0 0 4px; }
.big-score { text-align: right; }
.big-score .stars { font-size: 1.5rem; }
.big-score .score-num { font-size: 1.4rem; }
.description { white-space: pre-line; max-width: 720px; }
.admin-bar { display: flex; gap: 16px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 8px; margin: 8px 0 16px; font-size: 0.9rem; }
.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-top: 16px; }
.score-grid > div { display: grid; gap: 4px; }
.score-grid span:first-child { color: var(--muted); font-size: 0.88rem; }

.review { margin-bottom: 12px; }
.review-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.review-scores { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 0 8px; font-size: 0.9rem; }
.review-scores dt { color: var(--muted); font-size: 0.8rem; }
.review-scores dd { margin: 0; }
.review-text { white-space: pre-line; margin: 8px 0 0; }
.extras { margin: 8px 0 0; font-size: 0.95rem; }
.is-hidden { opacity: 0.55; }
.badge { display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }

/* Photos */
.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.photo-grid img { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.photo-grid a:hover img { border-color: var(--accent); }
.photo-grid.editable { margin: 0 0 10px; }
.photo-remove { display: grid !important; gap: 4px; font-size: 0.85rem; justify-items: center; }
.photo-remove img { width: 96px; height: 96px; }
.photo-fields input[type=file] { font: inherit; max-width: 100%; }

/* Translation notice */
.translation-note { margin-top: 6px; font-size: 0.85rem; color: var(--muted); }
.translation-note summary { cursor: pointer; list-style: none; }
.translation-note summary::-webkit-details-marker { display: none; }
.translation-note[open] .linklike { display: none; }
.translation-note .original { color: var(--ink); border-left: 3px solid var(--line); padding-left: 10px; font-size: 0.95rem; }

/* Admin */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-review { max-width: 760px; margin: 0 auto; }
.tabs { display: inline-flex; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-bottom: 16px; }
.tabs a { padding: 6px 16px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; }
.tabs a.active { background: var(--accent); color: var(--accent-ink); }

/* Ranks */
.rank { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; vertical-align: 1px; white-space: nowrap; }
.rank-newbie { background: var(--line); color: var(--muted); }
.rank-user { background: var(--accent-soft); color: var(--accent); }
.rank-power { background: #e6e0f5; color: #5a3fa0; }
.rank-star { background: #fbecc8; color: #8a5a00; }
@media (prefers-color-scheme: dark) {
  .rank-power { background: #2e2745; color: #c4b2f2; }
  .rank-star { background: #3d3018; color: #f0c766; }
}
.rank-cell { white-space: nowrap; }
.rank-form { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.rank-form select { width: auto; padding: 3px 6px; font-size: 0.8rem; }

/* Comments on reviews */
.replies { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.reply { padding: 8px 0 8px 14px; border-left: 3px solid var(--accent-soft); margin-bottom: 8px; }
.reply-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 0.9rem; }
.reply .review-text { margin-top: 4px; }
.reply-form summary { cursor: pointer; color: var(--accent); font-size: 0.9rem; padding: 4px 0; }
.reply-form form { margin-top: 8px; gap: 8px; }
.linklike.small { font-size: 0.8rem; }

/* Photos locked by rank */
.photo-locked { font-size: 0.9rem; color: var(--muted); background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; padding: 8px 12px; margin: 12px 0 0; }
.photo-placeholder { width: 96px; height: 96px; display: grid; place-items: center; font-size: 2rem; background: var(--bg); border-radius: 8px; border: 1px solid var(--line); }

/* Venue links */
.venue-links { list-style: none; padding: 0; margin: 8px 0 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.venue-links a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; background: var(--surface); font-size: 0.9rem; }
.venue-links a:hover { border-color: var(--accent); }
.link-icon { font-weight: 700; width: 1.1em; text-align: center; }
.link-facebook { color: #1877f2; }
.link-instagram { color: #d6249f; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 600px) { .three-col { grid-template-columns: 1fr; } }
.link-fields { display: grid; gap: 12px; }

/* Admin navigation + Users page */
.admin-nav { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin: 8px 0 20px; }
.admin-nav a { padding: 8px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.admin-nav a:hover { color: var(--ink); }
.admin-nav a.active { color: var(--accent); border-bottom-color: var(--accent); }
.stat-link { text-decoration: none; color: inherit; }
.stat-link:hover { border-color: var(--accent); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.user-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; padding: 14px 16px; }
.user-filters label { display: grid; gap: 4px; font-size: 0.85rem; font-weight: 600; }
.user-filters label.grow { flex: 1 1 220px; }
.user-filters label.check { display: flex; align-items: center; gap: 6px; font-weight: 400; padding-bottom: 8px; }
.user-filters select { width: auto; }
.filter-actions { display: flex; gap: 10px; align-items: center; padding-bottom: 4px; }
.users-table td { font-size: 0.85rem; }
.pager { display: flex; justify-content: center; gap: 16px; align-items: center; margin: 16px 0; }

/* CSV import */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.csv-sample { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; font-size: 0.82rem; }
.small-list { font-size: 0.88rem; padding-left: 18px; }
.stats-row.compact { margin: 12px 0; }
.stats-row.compact .stat strong { font-size: 1.3rem; }
h2.flush { margin-top: 0; }
.import-confirm { margin-top: 12px; }
.import-table td { font-size: 0.85rem; }
.import-error td { background: color-mix(in srgb, var(--danger) 7%, transparent); }
.import-skip td, .import-exists td { color: var(--muted); }
.badge.status-new { background: var(--accent-soft); color: var(--accent); }
.badge.status-error { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.badge.status-exists, .badge.status-skip { background: var(--line); color: var(--muted); }
.nowrap { white-space: nowrap; }
.small { font-size: 0.8rem; }

/* Locked teaser */
.locked { text-align: center; }
.blur-preview { filter: blur(5px); user-select: none; color: var(--muted); margin: 16px 0; line-height: 2; }

/* Admin tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.8rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.clip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.actions { white-space: nowrap; display: flex; gap: 12px; }
td.ip-cell { font-family: ui-monospace, Consolas, monospace; font-size: 0.8rem; }
td.ip-cell .host { display: inline-block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

.footer { border-top: 1px solid var(--line); padding: 20px 0; color: var(--muted); font-size: 0.85rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer a { color: var(--muted); }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer a:hover { color: var(--accent); }
.small-note { font-size: 0.85rem; margin: 0; }

/* Privacy notice */
.legal { max-width: 820px; margin: 0 auto; padding: 28px 32px; line-height: 1.65; }
.legal h2 { font-size: 1.15rem; margin-top: 2rem; }
.legal-list dt { font-weight: 700; margin-top: 14px; }
.legal-list dd { margin: 4px 0 0; }
.legal table { font-size: 0.9rem; }
.legal code { font-size: 0.85rem; background: var(--bg); padding: 1px 6px; border-radius: 4px; }
@media (max-width: 600px) { .legal { padding: 20px 16px; } }
