/* Ember Ads - matches the app: very dark surfaces, the ember heat ramp. */
:root {
  --bg: #0a0a0b;
  --surface: #141416;
  --raised: #1e1e21;
  --border: #2a2a2e;
  --text: #fafafa;
  --muted: #a1a1a6;
  --faint: #6e6e73;
  --spark: #ffd166;
  --flame: #ff9e1a;
  --blaze: #ff6b1a;
  --inferno: #f23a2f;
  --success: #34c759;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--flame); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0; }
[hidden] { display: none !important; }

/* ---- frame ---------------------------------------------------------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
  background: rgba(10, 10, 11, 0.92);
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.brand b { color: var(--blaze); }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 24px 16px 48px; }
.foot {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  padding: 20px 16px 28px; color: var(--faint); font-size: 14px;
  border-top: 1px solid var(--border);
}
.loading { color: var(--muted); text-align: center; padding: 48px 0; }

/* ---- building blocks ------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }

button, .button {
  font: inherit; font-weight: 700; cursor: pointer;
  border: 0; border-radius: 999px;
  padding: 11px 20px;
  background: var(--blaze); color: #0a0a0b;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.45; cursor: default; filter: none; }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
button.danger { background: transparent; color: var(--inferno); border: 1px solid var(--inferno); }
button.small { padding: 6px 14px; font-size: 14px; }
button.link { background: none; color: var(--flame); padding: 0; font-weight: 600; }

label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
input, textarea, select {
  font: inherit; color: var(--text);
  background: var(--raised); border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 12px; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--blaze); outline-offset: 1px; border-color: transparent; }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; color: var(--text); }
label.check input { width: auto; margin-top: 3px; accent-color: var(--blaze); }
.error { color: var(--inferno); font-size: 14px; }

.badge {
  display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: 0.02em;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  background: var(--raised); color: var(--muted); border: 1px solid var(--border);
}
.badge.good { color: var(--success); border-color: rgba(52, 199, 89, 0.4); }
.badge.warn { color: var(--flame); border-color: rgba(255, 158, 26, 0.4); }
.badge.bad { color: var(--inferno); border-color: rgba(242, 58, 47, 0.4); }
.badge.hot { background: var(--inferno); color: #fff; border-color: transparent; }

.notice {
  border-radius: var(--radius); padding: 14px 16px;
  background: rgba(255, 158, 26, 0.08); border: 1px solid rgba(255, 158, 26, 0.35);
}
.notice.bad { background: rgba(242, 58, 47, 0.08); border-color: rgba(242, 58, 47, 0.4); }

/* ---- sign in -------------------------------------------------------- */
.hero { display: grid; gap: 32px; grid-template-columns: 1.1fr 1fr; align-items: start; padding-top: 24px; }
.hero h1 { font-size: 40px; letter-spacing: -0.02em; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--spark), var(--blaze), var(--inferno)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.points { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
.points li { display: flex; gap: 10px; color: var(--muted); }
.points li::before { content: "🔥"; }
.auth { max-width: 420px; width: 100%; justify-self: end; }
.tabs-mini { display: flex; gap: 6px; background: var(--raised); padding: 4px; border-radius: 999px; }
.tabs-mini button { flex: 1; background: transparent; color: var(--muted); padding: 8px; }
.tabs-mini button.on { background: var(--surface); color: var(--text); }

/* ---- dashboard tabs ------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 20px 0 24px; overflow-x: auto; }
.tabs button {
  background: none; color: var(--muted); border-radius: 0; padding: 12px 14px;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button.on { color: var(--text); border-bottom-color: var(--blaze); }

/* ---- categories ----------------------------------------------------- */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cat {
  position: relative; text-align: left; color: #fff; border-radius: 12px; padding: 12px;
  min-height: 92px; display: flex; flex-direction: column; justify-content: space-between;
  border: 2px solid transparent; font-weight: 600;
}
.cat.on { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 107, 26, 0.5); }
.cat .name { font-size: 16px; font-weight: 800; }
.cat .stat { font-size: 12px; opacity: 0.9; font-weight: 600; }
.cat .rank { position: absolute; top: 8px; right: 8px; font-size: 11px; background: rgba(0,0,0,0.35); padding: 2px 7px; border-radius: 999px; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.metric { background: var(--raised); border-radius: 12px; padding: 14px; }
.metric b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.metric span { color: var(--muted); font-size: 13px; }

/* ---- heatmap -------------------------------------------------------- */
.heat { display: grid; grid-template-columns: 38px repeat(24, 1fr); gap: 2px; font-size: 11px; color: var(--faint); }
.heat .h { text-align: center; }
.heat .d { display: flex; align-items: center; }
.heat .c { aspect-ratio: 1; border-radius: 3px; background: var(--raised); min-width: 0; }
.heat-wrap { overflow-x: auto; }
.heat-inner { min-width: 560px; }
.legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend i { width: 18px; height: 10px; border-radius: 2px; display: inline-block; }

/* ---- slots ---------------------------------------------------------- */
.days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.days button { background: var(--raised); color: var(--muted); padding: 8px 12px; border-radius: 12px; flex-direction: column; gap: 0; font-weight: 600; min-width: 62px; }
.days button b { color: var(--text); font-size: 18px; }
.days button.on { background: var(--blaze); color: #0a0a0b; }
.days button.on b { color: #0a0a0b; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.slot { background: var(--raised); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.slot.mine { border-color: var(--blaze); }
.slot .time { font-size: 18px; font-weight: 800; }

/* ---- lists and tables ----------------------------------------------- */
.ads { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ad { display: flex; gap: 12px; background: var(--raised); border-radius: 12px; padding: 12px; }
.ad img, .ad .ph { width: 64px; height: 114px; object-fit: cover; border-radius: 8px; background: var(--border); flex-shrink: 0; }
.ad .body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ad .body a { overflow-wrap: anywhere; font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
td.num, th.num { text-align: right; }

.progress { height: 8px; background: var(--raised); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--flame), var(--blaze)); transition: width 0.2s; }

/* ---- dialog --------------------------------------------------------- */
dialog {
  /* Some browsers drop the centring when margin is reset elsewhere. */
  margin: auto;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; width: min(460px, calc(100vw - 32px));
}
dialog::backdrop { background: rgba(0, 0, 0, 0.7); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--raised); border: 1px solid var(--border); border-radius: 999px;
  padding: 10px 18px; font-size: 14px; z-index: 20; max-width: calc(100vw - 32px);
}
.toast.bad { border-color: var(--inferno); color: #ffb3ad; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-top: 0; }
  .hero h1 { font-size: 32px; }
  .auth { justify-self: stretch; max-width: none; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .top { padding: 12px 16px; }
}
