:root {
  --ink: #17142b;
  --muted: #6b6880;
  --bg: #faf7f2;
  --card: #ffffff;
  --line: #e7e2d9;
  --accent: #ff5a36;
  --accent-ink: #ffffff;
  --good: #1f8a5b;
  --warn: #b7791f;
  --bad: #c0392b;
  --radius: 14px;
}

* { 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: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* header */
.top { background: var(--ink); color: #fff; }
.top .wrap { display: flex; align-items: center; gap: 16px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.25rem; text-decoration: none; letter-spacing: -.03em; }
.brand span { color: var(--accent); }
.top nav { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; font-size: .95rem; }
.top nav a { text-decoration: none; opacity: .85; }
.top nav a:hover { opacity: 1; }

/* hero */
.hero { background: var(--ink); color: #fff; padding: 36px 0 48px; }
.hero p { max-width: 620px; font-size: 1.1rem; opacity: .85; }
.onair {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); font-size: .85rem; font-weight: 600; margin-bottom: 18px;
}
.onair i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(255, 90, 54, .25); }
.codebar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; max-width: 420px; }
.codebar input { flex: 1; min-width: 160px; text-transform: uppercase; }

/* .wrap sets the side padding; a plain `main` rule would lose to it. */
main, main.wrap { padding-top: 28px; padding-bottom: 64px; }
section { margin-bottom: 40px; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.deal { display: flex; flex-direction: column; gap: 10px; }
.deal .head { display: flex; align-items: center; gap: 12px; }
.deal .head > div { min-width: 0; overflow-wrap: anywhere; }
.logo {
  width: 52px; height: 52px; border-radius: 12px; flex: none; object-fit: contain; background: #f1ede6;
  display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; color: var(--muted);
}
.deal .off { font-weight: 800; font-size: 1.5rem; line-height: 1; color: var(--accent); }
.deal p { flex: 1; margin: 0; color: var(--muted); font-size: .93rem; }
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .06em;
  background: #fff4ef; border: 1px dashed var(--accent); color: var(--ink); padding: 3px 8px; border-radius: 8px;
}

/* forms */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 14px; }
label span { display: block; font-weight: 400; color: var(--muted); font-size: .82rem; }
input, select, textarea {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px; border: 1px solid #cfc9bd; border-radius: 10px;
  font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 110px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid rgba(255, 90, 54, .35); outline-offset: 1px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; align-items: end; }
.hp { position: absolute; left: -9999px; }

.btn {
  display: inline-block; border: 0; border-radius: 10px; padding: 10px 18px; font: inherit; font-weight: 700;
  background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; text-align: center;
}
.btn:hover { filter: brightness(.95); }
.btn.ghost { background: transparent; color: inherit; border: 1px solid currentColor; }
.btn.sm { padding: 5px 10px; font-size: .82rem; }
.btn[disabled] { opacity: .5; cursor: default; }

.msg { padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: .93rem; }
.msg.err { background: #fdecea; color: var(--bad); }
.msg.ok { background: #e8f6ef; color: var(--good); }
.msg.note { background: #fff7e6; color: #7a5200; }
.msg:empty { display: none; }

/* dashboards */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat b { display: block; font-size: 1.6rem; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .85rem; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
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; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #eee9e0; }
.pill.active, .pill.paid { background: #e8f6ef; color: var(--good); }
.pill.pending, .pill.open, .pill.processing { background: #fff7e6; color: var(--warn); }
.pill.suspended, .pill.failed { background: #fdecea; color: var(--bad); }
.narrow { max-width: 460px; margin: 0 auto; }
.tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tabs button { flex: 1; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.steps b { color: var(--accent); }
footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: .88rem; }
[hidden] { display: none !important; }
