/* The Deal Goat app. Palette matches work/dev-site/site.html (light + dark). */
:root {
  --bg: #fff5e4; --surface: #fffdf7; --ink: #2d241e; --muted: #665346; --line: #e0c8aa;
  --accent: #a43b0b; --accent-ink: #fff; --soft: #fae2c1; --highlight: #efb44e; --highlight-ink: #2d241e;
  --good: #2f6b3a; --bad: #a3281b; --shadow: 0 8px 25px #100a2014; --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1929; --surface: #18283b; --ink: #eff6fc; --muted: #bed0dd; --line: #344c60;
    --accent: #83e9d1; --accent-ink: #0e1929; --soft: #25374a; --highlight: #f9d463; --highlight-ink: #182435;
    --good: #8fe0a0; --bad: #ff9a8a; --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.01em; }
h2 { font-size: 1.25rem; margin-top: .5rem; }
h3 { font-size: 1.05rem; margin-top: 1.25rem; }
p { margin: 0 0 .75rem; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.warn { color: var(--bad); font-weight: 600; }
.ok-text { color: var(--good); font-weight: 600; }
.narrow { max-width: 460px; margin: 2rem auto; }
.narrow-wide { max-width: 900px; margin: 1.5rem auto; }

/* Header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-row { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.search { flex: 1; min-width: 180px; }
.search input { width: 100%; }
.nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; }
.nav a:hover { color: var(--accent); }
.pill { background: var(--soft); padding: 6px 12px; border-radius: 999px; }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 32px; padding-bottom: 40px; color: var(--muted); font-size: .9rem; }

/* Forms */
input, select, button, textarea { font: inherit; color: inherit; }
input, select, textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; min-height: 42px; }
input[type="checkbox"] { min-height: 0; width: 20px; height: 20px; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--highlight); outline-offset: 2px; }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 600; }
.form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 12px; }
.form legend { font-weight: 700; padding: 0 6px; }
.form > .btn, .form > .btn-small, .form > .inline { justify-self: start; }
.hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
.row-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 12px; }
.row-form label { display: grid; gap: 4px; font-weight: 600; }
.row-form input[type="search"], .row-form input[type="email"] { flex: 1; min-width: 200px; }
.inline { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; }
.btn, .btn-small { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; text-decoration: none; cursor: pointer; }
.btn { padding: 11px 20px; min-height: 44px; }
.btn-small { padding: 6px 14px; min-height: 34px; font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
button[disabled] { opacity: .5; cursor: not-allowed; }

/* Messages, badges */
.flash { background: var(--soft); border-left: 4px solid var(--highlight); padding: 10px 14px; border-radius: 8px; margin: 14px 0; }
.flash-error { border-left-color: var(--bad); }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--soft); color: var(--ink); vertical-align: middle; text-transform: capitalize; }
.badge-approved, .badge-active { background: color-mix(in srgb, var(--good) 22%, transparent); }
.badge-pending, .badge-paused { background: color-mix(in srgb, var(--highlight) 40%, transparent); }
.badge-suspended, .badge-rejected, .badge-ended { background: color-mix(in srgb, var(--bad) 22%, transparent); }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }

/* Home */
.hero { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin: 28px 0 18px; }
.city-pick { display: grid; gap: 4px; font-weight: 600; }
.slot { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: 0; background: var(--surface); border: 2px solid var(--highlight);
  border-radius: calc(var(--radius) + 4px); overflow: hidden; margin-bottom: 26px; box-shadow: var(--shadow); }
.slot-img { width: 100%; height: 100%; min-height: 220px; object-fit: cover; }
.slot-body { padding: 22px 26px; display: grid; align-content: center; gap: 4px; }
.slot-tag { display: inline-block; justify-self: start; background: var(--highlight); color: var(--highlight-ink); font-weight: 800; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .06em; padding: 3px 10px; border-radius: 999px; }
.slot-title { font-size: 1.15rem; font-weight: 600; }
.slot-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 680px) { .slot { grid-template-columns: 1fr; } .slot-img { min-height: 180px; max-height: 220px; } }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card-link { display: block; color: inherit; text-decoration: none; height: 100%; }
.card-link:hover h3 { color: var(--accent); }
.card-img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--soft); }
@media (max-width: 600px) { .card-img-text { aspect-ratio: 16 / 7; } }
.card-img-text { display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; color: var(--accent); }
.card-body { padding: 12px 14px 16px; }
.card-kicker { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.card-kicker a { color: inherit; }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.card-meta { margin: 0; color: var(--muted); font-size: .9rem; }
.card-meta strong { color: var(--ink); }
.save { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--surface); color: var(--muted);
  font-size: 1.1rem; cursor: pointer; box-shadow: var(--shadow); }
.save.is-saved { color: var(--bad); }
.save.save-text { position: static; width: auto; height: auto; border-radius: 999px; font-size: 1rem; box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent); padding: 11px 20px; }

/* Deal page */
.deal { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; margin: 28px 0; align-items: start; }
.deal-img { width: 100%; border-radius: var(--radius); object-fit: cover; max-height: 460px; }
.deal-title { font-size: 1.3rem; font-weight: 600; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 16px 0; }
.facts dt { font-weight: 700; color: var(--muted); }
.facts dd { margin: 0; }
@media (max-width: 760px) { .deal { grid-template-columns: 1fr; } }

/* Panels, tables */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 18px 0; }
.panel.two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 820px) { .panel.two { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td input[type="number"] { width: 120px; }
.actions { white-space: nowrap; }
.actions form { display: inline-flex; gap: 6px; }
.pos { color: var(--good); }
.neg { color: var(--bad); }
.list { list-style: none; padding: 0; margin: 0 0 12px; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.list li > div { flex-basis: 100%; }
.prices { margin: 0 0 8px; padding-left: 18px; }

/* Business */
.biz-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 24px; }
.balance { background: var(--surface); border: 2px solid var(--highlight); border-radius: var(--radius); padding: 16px 20px; min-width: 240px; }
.balance-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0; }
.balance-num { font-size: 2.2rem; font-weight: 800; margin: 0; font-variant-numeric: tabular-nums; }
.packages { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 20px; }
.package { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 4px; text-align: center; }
.package h2 { margin: 0; }
.package-price { font-size: 2rem; font-weight: 800; margin: 4px 0 0; }
.package-tokens { font-weight: 700; margin: 0; }
.package-bonus { color: var(--good); font-weight: 700; margin: 0; }
.package .btn { margin-top: auto; }
.package > p:last-of-type { margin-bottom: 14px; }
.package-silver { border: 2px solid var(--line); }
.package-gold { border: 2px solid var(--highlight); }

/* Admin */
.subnav, .tabs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 20px 0 16px; }
.subnav a, .tabs a { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; background: var(--surface); border: 1px solid var(--line); }
.subnav a[aria-current="page"], .tabs a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.subnav .badge { margin-left: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--muted); text-decoration: none; font-weight: 600; }
.stat span { display: block; font-size: 1.8rem; color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }
a.stat:hover { border-color: var(--accent); }
.claim { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.wide-form { max-width: none; }
.kit { display: grid; grid-template-columns: 260px 1fr; gap: 18px; }
.kit-files { display: grid; gap: 2px; align-content: start; }
.kit-files a { padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: .92rem; }
.kit-files a[aria-current="page"] { background: var(--soft); font-weight: 700; }
.kit-body { min-width: 0; }
.kit-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.kit pre { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; white-space: pre-wrap; word-break: break-word; font-size: .88rem; max-height: 75vh; overflow: auto; }
@media (max-width: 760px) { .kit { grid-template-columns: 1fr; } }
