:root {
  color-scheme: dark;
  --bg: #111210;
  --panel: #1b1d1a;
  --panel-2: #242722;
  --text: #f2f2e9;
  --muted: #a7aaa0;
  --dim: #71756c;
  --line: #343830;
  --accent: #d9f98b;
  --accent-ink: #1b2110;
  --danger: #ff9e91;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, sans-serif; }
a { color: var(--accent); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.shell { width: min(680px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 48px; }
.topbar { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.brand { font-weight: 800; letter-spacing: -0.05em; font-size: 20px; }
.brand span { color: var(--accent); }
.eyebrow { color: var(--dim); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; margin: 0; }
.intro { padding: 64px 0 30px; }
h1 { font-size: clamp(34px, 8vw, 58px); line-height: .98; letter-spacing: -.06em; max-width: 600px; margin: 12px 0 18px; }
.muted, .hint { color: var(--muted); }
.muted { max-width: 520px; margin: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: 0 18px 60px #0003; }
.field-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 9px; }
textarea, input, select { color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; outline: none; }
textarea { display: block; width: 100%; resize: vertical; min-height: 120px; padding: 14px; line-height: 1.5; }
input, select { height: 42px; padding: 0 11px; }
textarea:focus, input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #d9f98b22; }
.hint { font-size: 12px; margin: 8px 0 0; }
code { color: var(--accent); font-size: .92em; }
.section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: start; margin: 30px 0 12px; }
.section-heading .hint { margin-top: -3px; }
.variables { display: grid; gap: 10px; }
.variable-row { border: 1px solid var(--line); background: #161815; border-radius: 12px; padding: 12px; }
.variable-topline { display: flex; align-items: center; gap: 5px; }
.variable-name { min-width: 0; width: 150px; height: 34px; padding: 0 7px; }
.brace { color: var(--dim); font-family: ui-monospace, monospace; }
.remove-variable { margin-left: auto; border: 0; color: var(--dim); background: transparent; font-size: 22px; line-height: 1; }
.remove-variable:hover { color: var(--danger); }
.variable-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 10px; }
.variable-controls select, .variable-value { width: 100%; min-width: 0; }
.variable-value { display: flex; gap: 8px; }
.variable-value input, .variable-value select { min-width: 0; width: 100%; }
.variable-help { color: var(--dim); font-size: 11px; margin: 8px 0 0; }
.lifetime-heading { align-items: center; }
.inline-inputs { display: flex; gap: 8px; }
.inline-inputs input { width: 80px; }
.inline-inputs select { width: 115px; }
.button { border: 0; border-radius: 10px; padding: 12px 16px; transition: transform .15s, opacity .15s; }
.button:hover { transform: translateY(-1px); }
.button-primary { display: block; width: 100%; color: var(--accent-ink); background: var(--accent); font-weight: 800; margin-top: 28px; }
.button-small { padding: 8px 11px; font-size: 12px; white-space: nowrap; }
.button-ghost { color: var(--text); background: transparent; border: 1px solid var(--line); }
.error { color: var(--danger); font-size: 13px; margin: 12px 0 0; }
.result { background: #273019; border: 1px solid #627532; border-radius: 12px; padding: 14px; margin-top: 18px; }
.result-row { display: flex; align-items: center; gap: 12px; margin-top: 5px; }
.result-row a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.footer { color: var(--dim); font-size: 12px; text-align: center; padding: 30px 0 0; }

.view-body { background: radial-gradient(circle at 50% 0%, #293020 0, var(--bg) 48%); }
.view-shell { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding-top: 48px; padding-bottom: 48px; }
.message { white-space: pre-wrap; overflow-wrap: anywhere; font-size: clamp(32px, 7vw, 72px); line-height: 1.02; letter-spacing: -.055em; font-weight: 800; }
.event-timers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 34px; }
.event-chip { display: inline-flex; align-items: baseline; gap: 8px; background: #ffffff0b; border: 1px solid #ffffff15; border-radius: 999px; padding: 8px 12px; }
.event-value { color: var(--accent); font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
.event-direction { color: var(--dim); font-size: 11px; }
.view-footer { margin-top: auto; padding-top: 60px; font-size: 12px; }
.empty-state { padding-top: 18vh; }
.empty-state h1 { margin-top: 10px; }
.empty-state .button { display: inline-block; text-decoration: none; margin-top: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 560px) {
  .shell { width: min(100% - 24px, 680px); padding-top: 18px; }
  .card { padding: 16px; border-radius: 14px; }
  .intro { padding-top: 48px; }
  .section-heading { align-items: center; }
  .variable-controls { grid-template-columns: 1fr; }
  .lifetime-heading { display: block; }
  .inline-inputs { margin-top: 12px; }
  .message { font-size: clamp(30px, 10vw, 52px); }
}
