:root {
  color-scheme: dark;
  --bg: #0a0c0b;
  --surface: #111512;
  --surface-raised: #171c18;
  --line: #293129;
  --text: #f4f7f2;
  --muted: #9ca79d;
  --green: #b9f36a;
  --green-ink: #102000;
  --red: #ff7770;
  --amber: #f4bd62;
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 80% -20%, #24351d 0, transparent 35%), var(--bg); color: var(--text); }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
[hidden] { display: none !important; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 460px); padding: 46px; border: 1px solid var(--line); border-radius: 24px; background: rgba(17, 21, 18, .94); box-shadow: 0 28px 80px rgba(0, 0, 0, .42); }
.brand-mark { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: var(--green); color: var(--green-ink); font-weight: 900; font-size: 26px; box-shadow: inset 0 -4px 12px rgba(28, 55, 4, .18); }
.brand-mark.small { width: 38px; height: 38px; border-radius: 11px; font-size: 19px; }
.eyebrow { margin: 28px 0 8px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(32px, 5vw, 48px); letter-spacing: -.045em; line-height: 1; }
h2 { margin-bottom: 8px; font-size: 20px; letter-spacing: -.02em; }
.lede { color: var(--muted); line-height: 1.6; margin-bottom: 30px; }
.fine-print { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
code, .mono { font-family: "SFMono-Regular", Consolas, monospace; }

button { border: 0; border-radius: 10px; padding: 11px 16px; font-weight: 800; transition: transform .15s ease, filter .15s ease; }
button:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.primary { background: var(--green); color: var(--green-ink); }
.danger { background: var(--red); color: #2d0603; }
.secondary { border: 1px solid var(--line); background: var(--surface-raised); color: var(--text); }
.quiet { padding: 8px 12px; font-size: 13px; }
.wide { width: 100%; padding: 14px 18px; }
.text-button { padding: 6px; background: transparent; color: var(--green); }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; min-height: 70px; padding: 0 max(24px, calc((100vw - 1180px) / 2)); border-bottom: 1px solid var(--line); background: rgba(10, 12, 11, .9); backdrop-filter: blur(18px); }
.brand-lockup, .account { display: flex; align-items: center; gap: 12px; }
.brand-lockup span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.account { color: var(--muted); font-size: 13px; }
.page { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 56px 0 80px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; margin-bottom: 30px; }
.page-heading .eyebrow { margin-top: 0; }
.page-heading p:last-child { margin: 0; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
.stats article { min-height: 108px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(150deg, var(--surface-raised), var(--surface)); }
.stats span { display: block; margin-bottom: 14px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.stats strong { font-size: 24px; letter-spacing: -.03em; overflow-wrap: anywhere; }
.stats article:last-child strong { font-size: 15px; }

.panel { margin-top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel-heading { display: flex; justify-content: space-between; padding: 22px 24px 16px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { padding: 12px 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); background: #0e120f; font-size: 11px; text-align: left; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
td { padding: 15px 18px; border-bottom: 1px solid #202620; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(185, 243, 106, .025); }
.issue-cell strong, .issue-id { display: block; }
.issue-id { margin-top: 5px; color: var(--muted); font: 11px "SFMono-Regular", Consolas, monospace; }
.number { font-variant-numeric: tabular-nums; }
.actions { text-align: right; }
.reason { min-width: 260px; max-width: 440px; color: #d0d7d0; line-height: 1.45; }
.empty { padding: 40px; color: var(--muted); text-align: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.live { color: var(--green); background: rgba(185, 243, 106, .1); }
.pill.off { color: var(--red); background: rgba(255, 119, 112, .1); }

dialog { width: min(520px, calc(100% - 32px)); padding: 0; border: 1px solid #3b453b; border-radius: 20px; color: var(--text); background: var(--surface-raised); box-shadow: 0 28px 100px #000; }
dialog::backdrop { background: rgba(0, 0, 0, .72); backdrop-filter: blur(5px); }
dialog form { padding: 30px; }
dialog .eyebrow { margin-top: 0; }
dialog p:not(.eyebrow):not(.field-error) { color: var(--muted); line-height: 1.55; }
label { display: block; margin: 24px 0 8px; font-size: 13px; font-weight: 800; }
textarea { width: 100%; resize: vertical; padding: 13px; border: 1px solid var(--line); border-radius: 10px; outline: 0; color: var(--text); background: #0d100e; line-height: 1.5; }
textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(185, 243, 106, .11); }
.field-error { min-height: 18px; margin: 7px 0; color: var(--red); font-size: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.alert { padding: 12px 14px; border-radius: 9px; font-size: 13px; line-height: 1.45; }
.alert:empty { display: none; }
.alert.error { color: #ffc5c2; background: rgba(255, 119, 112, .1); }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 30; max-width: 470px; padding: 14px 18px; border: 1px solid rgba(185, 243, 106, .35); border-radius: 12px; color: var(--text); background: #182116; box-shadow: 0 18px 50px rgba(0, 0, 0, .4); }
.toast[data-type="error"] { border-color: rgba(255, 119, 112, .4); background: #291312; }
.busy::after { content: ""; position: fixed; top: 0; left: 0; z-index: 50; width: 100%; height: 2px; background: linear-gradient(90deg, transparent, var(--green), transparent); animation: loading 1.2s infinite; }
@keyframes loading { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .account #signed-in-as { display: none; }
}
@media (max-width: 580px) {
  .login-card { padding: 30px 24px; }
  .topbar { padding: 0 18px; }
  .page { width: min(100% - 24px, 1180px); padding-top: 36px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats article { min-height: 96px; padding: 16px; }
  .stats strong { font-size: 20px; }
}
