:root {
  --bg: #0a0a0a;
  --panel: rgba(255, 255, 255, 0.03);
  --line: rgba(255, 255, 255, 0.08);
  --fg: #e8e8e8;
  --dim: #8a8a8a;
  --faint: #5a5a5a;
  --brand: #f87f2e;
  --ok: #22c55e;
  --no: #ef4444;
  --radius: 12px;
}

* { box-sizing: border-box; }

/* `hidden` is how this app shows and hides everything, and a class with its own
   `display` silently outranks the attribute's UA rule. Losing that fight means
   the sign-in gate stays painted over a signed-in app. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

/* The house glow. Fixed and inert so it never intercepts a tap. */
.glow {
  position: fixed;
  inset: -30vh 0 auto 0;
  height: 60vh;
  pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, rgba(248, 127, 46, 0.13), transparent 70%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 18px 14px;
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand { font-weight: 600; letter-spacing: 0.01em; }
.brand-dot { color: var(--brand); }
.status { font-size: 12px; color: var(--dim); }

main { padding: 18px 18px calc(28px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }

.section-title {
  margin: 22px 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
main > section:first-child .section-title { margin-top: 6px; }

.cards { display: flex; flex-direction: column; gap: 12px; }

.card {
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.card.settled { opacity: 0.55; }
.card.expired { border-color: rgba(239, 68, 68, 0.25); }

.card-scope {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--brand);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}
.card-summary { margin: 6px 0 8px; font-size: 15px; }
.card-meta { font-size: 12px; color: var(--dim); line-height: 1.6; }
.card-args {
  margin-top: 8px;
  padding: 8px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--dim);
  white-space: pre-wrap;
  word-break: break-word;
}

/* A batch: several asks one action raised, answered on one card.
   The rows are labels wrapping their own checkbox, so the whole row is the tap
   target — a 16px box is not one on a phone. */
.group-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 10px 0 2px;
  border-top: 1px solid var(--line);
}
.group-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.group-row .pick {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  accent-color: var(--brand);
}
.group-row-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.group-row-scope {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--brand);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}
.group-row-summary { font-size: 14px; line-height: 1.45; }
/* An unticked row is about to be denied, not skipped. Saying so before the tap
   is cheaper than explaining it after. */
.group-row:has(.pick:not(:checked)) .group-row-summary,
.group-row:has(.pick:not(:checked)) .group-row-scope { opacity: 0.45; }
.group-row:has(.pick:not(:checked)) .group-row-summary { text-decoration: line-through; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge {
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--dim);
}
.badge.single { border-color: rgba(248, 127, 46, 0.35); color: var(--brand); }
.badge.soon { border-color: rgba(239, 68, 68, 0.35); color: #f08a6a; }

.actions { display: flex; gap: 10px; margin-top: 12px; }

.btn {
  appearance: none;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-block { display: block; width: 100%; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #140a03; font-weight: 600; }
.btn-approve { flex: 1; border-color: rgba(34, 197, 94, 0.45); color: #7ee2a8; }
.btn-deny { flex: 1; border-color: rgba(239, 68, 68, 0.45); color: #f08a8a; }
.btn-ghost { color: var(--dim); }
/* Row buttons sit next to text that can wrap; they must not. */
.row .btn { flex: 0 0 auto; white-space: nowrap; }

.panel {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.panel .section-title { margin: 0; padding: 12px 15px 4px; }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  border-top: 1px solid var(--line);
}
.row-title { font-size: 14px; }
.row-sub { font-size: 12px; color: var(--dim); margin-top: 2px; }

.empty { font-size: 13px; color: var(--dim); line-height: 1.6; }

.gate { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: var(--bg); z-index: 20; }
.gate-card { width: 100%; max-width: 340px; text-align: center; }
.gate-brand { font-size: 18px; font-weight: 600; margin-bottom: 14px; }
.gate-lede { font-size: 14px; color: var(--dim); line-height: 1.6; margin-bottom: 18px; }
.gate-note { font-size: 12px; color: var(--faint); line-height: 1.6; margin-top: 14px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 30;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #151515;
  font-size: 13px;
}

/* The card a notification deep-linked to. */
.card.focused { border-color: rgba(248, 127, 46, 0.55); box-shadow: 0 0 0 3px rgba(248, 127, 46, 0.09); }
