:root {
  --bg: #0b1118;
  --bg-2: #121a24;
  --card: rgba(22, 30, 42, 0.78);
  --card-solid: #161e2a;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(228, 181, 106, 0.28);
  --text: #f3efe6;
  --muted: #9aa8b8;
  --gold: #e4b56a;
  --gold-2: #c78b3a;
  --copper: #d9a06a;
  --ok: #63d7a5;
  --err: #ff7b7b;
  --info: #7eb6ff;
  --warn: #f0c674;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 22px;
  --font: "Manrope", "Segoe UI", system-ui, sans-serif;
  --serif: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 16px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, summary { font: inherit; }
a { color: inherit; }

.bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(1200px 500px at 0% -10%, rgba(199, 139, 58, 0.18), transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(70, 120, 180, 0.16), transparent 50%),
    linear-gradient(180deg, #0b1118 0%, #0e1520 55%, #0b1118 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
}
.orb-a {
  width: 420px;
  height: 420px;
  left: -120px;
  top: -80px;
  background: radial-gradient(circle, rgba(228, 181, 106, 0.35), transparent 70%);
}
.orb-b {
  width: 380px;
  height: 380px;
  right: -80px;
  top: 120px;
  background: radial-gradient(circle, rgba(90, 140, 200, 0.28), transparent 70%);
}
.grid-fade {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 20%, black, transparent 72%);
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}
.mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #1a1208;
  background: linear-gradient(145deg, #f0d19a, var(--gold-2));
  box-shadow: 0 10px 30px rgba(199, 139, 58, 0.28);
}
.mark svg { width: 22px; height: 22px; }
.brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand span { color: var(--muted); font-size: 0.86rem; }
.top-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(228, 181, 106, 0.1);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.pill.soft {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.eyebrow.tiny { margin-bottom: 4px; opacity: 0.9; }
.hero h1 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 700;
  max-width: 16ch;
}
.lede {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 52ch;
}
.hero-aside {
  display: grid;
  gap: 10px;
}
.stat-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  color: var(--text);
  font-weight: 600;
}
.stat-chip span {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(228,181,106,0.25), rgba(199,139,58,0.12));
  color: var(--gold);
  font-size: 0.85rem;
}

.layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 20px;
  align-items: start;
}
.stack { display: grid; gap: 20px; }

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), transparent 40%),
    var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  padding: 24px;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(228,181,106,0.45), transparent);
  opacity: 0.7;
}
.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.card-head h2,
.empty-card h2,
.job-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.card-head p { margin: 6px 0 0; color: var(--muted); font-size: 0.9rem; }

form { display: grid; gap: 14px; }
.field { display: grid; gap: 8px; }
.field > span,
.range-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.range-label b { color: var(--gold); font-weight: 700; }

.domain-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 12, 18, 0.65);
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.domain-wrap:focus-within {
  border-color: rgba(228, 181, 106, 0.55);
  box-shadow: 0 0 0 4px rgba(228, 181, 106, 0.12);
}
.prefix {
  padding: 0 0 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
}
.domain-wrap input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
}

input[type="text"],
input[type="month"],
input:not([type]),
input[name="domain"] {
  width: 100%;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(8, 12, 18, 0.65);
  color: var(--text);
  padding: 0 14px;
  font-size: 0.98rem;
  transition: border-color .2s, box-shadow .2s;
}
input[type="month"] { color-scheme: dark; }
input:focus {
  outline: none;
  border-color: rgba(228, 181, 106, 0.55);
  box-shadow: 0 0 0 4px rgba(228, 181, 106, 0.12);
}

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { margin: -2px 0 0; color: var(--muted); font-size: 0.86rem; }

.range input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
  height: 28px;
}
.range-ends {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.75rem;
}

.toggles { display: grid; gap: 10px; }
.toggle {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
}
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui {
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: #243041;
  position: relative;
  transition: background .2s;
}
.toggle-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #d7dee8;
  transition: transform .2s, background .2s;
}
.toggle input:checked + .toggle-ui {
  background: linear-gradient(90deg, var(--gold-2), var(--gold));
}
.toggle input:checked + .toggle-ui::after {
  transform: translateX(18px);
  background: #1a1208;
}
.toggle-text { display: grid; gap: 2px; }
.toggle-text strong { font-size: 0.94rem; font-weight: 650; }
.toggle-text small { color: var(--muted); font-size: 0.8rem; }

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.btn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  min-height: 48px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .15s, box-shadow .15s, background .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.primary {
  background: linear-gradient(180deg, #f0d19a, var(--gold-2));
  color: #1a1208;
  box-shadow: 0 12px 28px rgba(199, 139, 58, 0.28);
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1px solid var(--line);
}

.empty-card {
  text-align: center;
  padding: 36px 28px;
  min-height: 320px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
}
.empty-card p {
  margin: 0;
  color: var(--muted);
  max-width: 36ch;
}
.empty-art {
  width: 120px;
  height: 88px;
  margin-bottom: 8px;
  display: grid;
  place-items: center;
}
.reel {
  width: 100%;
  height: 72px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(90deg, rgba(228,181,106,0.15), rgba(228,181,106,0.04)),
    #121820;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}
.reel i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(228, 181, 106, 0.55);
  box-shadow: inset 0 0 0 3px #121820;
  background: rgba(228, 181, 106, 0.2);
}

.job-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  white-space: nowrap;
}
.badge.info { color: var(--info); border-color: rgba(126,182,255,0.3); background: rgba(126,182,255,0.08); }
.badge.queued, .badge.queued { color: var(--warn); }
.badge.indexing,
.badge.downloading,
.badge.rewriting,
.badge.packing { color: var(--info); border-color: rgba(126,182,255,0.28); background: rgba(126,182,255,0.08); }
.badge.done { color: var(--ok); border-color: rgba(99,215,165,0.3); background: rgba(99,215,165,0.1); }
.badge.error, .badge.cancelled { color: var(--err); border-color: rgba(255,123,123,0.28); background: rgba(255,123,123,0.08); }

.msg { margin: 0 0 14px; color: var(--muted); }
.progress {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(8, 12, 18, 0.8);
  overflow: hidden;
  border: 1px solid var(--line);
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-2), var(--gold), #f3d7a1);
  box-shadow: 0 0 16px rgba(228, 181, 106, 0.45);
  transition: width .35s ease;
}
.progress-value {
  color: var(--gold);
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 3ch;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0;
  margin: 0 0 16px;
  list-style: none;
}
.stats li {
  background: rgba(8, 12, 18, 0.55);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.82rem;
  color: var(--muted);
}
.stats b {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 1.15rem;
  font-family: var(--serif);
}

.inspect-lead {
  margin: 0 0 14px;
  color: var(--muted);
}
.inspect-lead b { color: var(--text); }
.calendar-title {
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.calendar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.calendar span {
  background: rgba(8, 12, 18, 0.7);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.78rem;
  color: var(--muted);
}
.status-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  margin: 14px 0 0;
}
.status-line.ok {
  border-color: rgba(99,215,165,0.25);
  background: rgba(99,215,165,0.08);
  color: var(--ok);
}
.status-line.err {
  border-color: rgba(255,123,123,0.25);
  background: rgba(255,123,123,0.08);
  color: var(--err);
}
.urls-title {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.urls {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.urls li {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(8, 12, 18, 0.55);
  border: 1px solid var(--line);
  word-break: break-all;
}
.urls .mime {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.urls .url { color: var(--muted); font-size: 0.84rem; }

.log-wrap {
  margin-top: 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(8, 12, 18, 0.45);
  overflow: hidden;
}
.log-wrap summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.86rem;
}
.log {
  margin: 0;
  padding: 0 14px 14px;
  max-height: 220px;
  overflow: auto;
  font: 12px/1.5 ui-monospace, Consolas, "Courier New", monospace;
  color: #b8c4d4;
  white-space: pre-wrap;
}

footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}
footer p { margin: 0; max-width: 70ch; }

.ok { color: var(--ok); }
.err { color: var(--err); }

@media (max-width: 900px) {
  .hero, .layout, .row { grid-template-columns: 1fr; }
  .hero h1 { max-width: none; }
  .top { align-items: flex-start; flex-direction: column; }
  .empty-card { min-height: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .bar i, .toggle-ui, .toggle-ui::after { transition: none; }
}
