:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface2: #263348;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --red: #ef4444;
  --yellow: #f59e0b;
  --green: #22c55e;
  --font: system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 52px;
}

header h1 { font-size: 16px; font-weight: 700; letter-spacing: .05em; color: var(--accent); }

/* Brand / logo (top-left of every page) */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--accent);
  text-decoration: none;
}
.brand:hover { text-decoration: none; opacity: .85; }
.brand-mark { flex: none; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: .05em; }
.brand.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.brand.auth-logo .brand-mark { width: 22px; height: 22px; }
.brand.auth-logo .brand-name { font-size: 18px; }

nav { display: flex; gap: 20px; }
nav a { color: var(--muted); font-size: 13px; padding: 4px 0; border-bottom: 2px solid transparent; }
nav a:hover, nav a.active { color: var(--text); border-bottom-color: var(--accent); text-decoration: none; }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.header-right a { font-size: 13px; color: var(--muted); }
.header-right a:hover { color: var(--text); }

.banner {
  background: #78350f;
  color: #fcd34d;
  border: 1px solid #92400e;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 20px;
  font-size: 13px;
}
.banner.hidden { display: none; }
.banner a { color: #fde68a; text-decoration: underline; }
.banner-error { color: var(--red, #fca5a5); }

/* Auth pages (login / reset / verify) */
.auth-wrap {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
  width: 100%;
  max-width: 360px;
}
.auth-logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--accent);
  text-align: center;
  margin-bottom: 20px;
}
.auth-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.auth-tab {
  flex: 1;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
}
.auth-tab.active { background: var(--surface2); color: var(--text); border-color: var(--accent); }
.auth-heading { font-size: 15px; margin-bottom: 16px; }
.auth-field { margin-bottom: 14px; }
.auth-field input { width: 100%; }
.btn-block { width: 100%; justify-content: center; }
.auth-msg { min-height: 18px; margin-top: 4px; }
.ok { color: var(--green); font-size: 12px; }
.auth-link {
  display: block;
  width: 100%;
  margin-top: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  text-align: center;
}
.auth-link:hover { color: var(--text); text-decoration: underline; }

main { max-width: 1100px; margin: 0 auto; padding: 32px 24px; flex: 1 0 auto; width: 100%; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
  transition: background .15s;
}
.btn:hover { background: var(--border); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0f172a; font-weight: 600; }
.btn.primary:hover { opacity: .88; }
.btn.danger { background: transparent; border-color: var(--red); color: var(--red); }

form.add-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
form.add-form.hidden { display: none; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.field input, .field select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: 13px;
  padding: 6px 10px;
  font-family: var(--font);
  outline: none;
}
.field input:focus, .field select:focus { border-color: var(--accent); }

table {
  width: 100%;
  border-collapse: collapse;
}
thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:hover { background: var(--surface); }
tbody td { padding: 12px; vertical-align: middle; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}
.badge.open    { background: #7f1d1d; color: #fca5a5; }
.badge.acked   { background: #78350f; color: #fcd34d; }
.badge.snoozed { background: #1e3a5f; color: #93c5fd; }
.badge.resolved { background: #14532d; color: #86efac; }
.badge.intentional_manual { background: #1e293b; color: var(--muted); }

.mono { font-family: ui-monospace, monospace; font-size: 12px; }

.empty { color: var(--muted); text-align: center; padding: 48px; }

.notice { color: var(--muted); font-size: 12px; font-style: italic; }

.error { color: var(--red); font-size: 12px; }

.badge-error {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  background: #7f1d1d;
  color: #fca5a5;
  cursor: help;
  vertical-align: middle;
}

/* Marketing landing */
.header-right .btn { padding: 5px 14px; }

main.landing { max-width: 960px; margin: 0 auto; padding: 0 24px 64px; }

.hero { text-align: center; padding: 80px 0 64px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
}
.hero-title {
  font-size: 44px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 20px;
}
.hero-title .accent { color: var(--accent); }
.hero-sub {
  max-width: 620px;
  margin: 0 auto 28px;
  font-size: 17px;
  color: var(--muted);
}
.hero-sub em { color: var(--text); font-style: normal; }

.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta-row .btn { padding: 10px 22px; font-size: 14px; }

.section { padding: 48px 0; border-top: 1px solid var(--border); }
.section-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.01em;
  text-align: center;
  margin-bottom: 12px;
}
.section-lead {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}
.section-lead em { color: var(--text); font-style: normal; }

.how-grid, .feature-grid {
  display: grid;
  gap: 16px;
  margin-top: 32px;
}
.how-grid { grid-template-columns: repeat(3, 1fr); }
.feature-grid { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
}
.card-tag {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}
.card h4 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 14px; }
.card code {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text);
}

.final-cta {
  text-align: center;
  padding: 64px 0 24px;
  border-top: 1px solid var(--border);
}
.final-cta h3 { font-size: 26px; font-weight: 700; margin-bottom: 10px; }
.final-cta p { color: var(--muted); font-size: 15px; margin-bottom: 24px; }

/* Site footer (all pages) */
.site-footer {
  flex: none;
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 20px 24px;
  background: var(--surface);
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}
.footer-brand { font-weight: 700; letter-spacing: .05em; color: var(--accent); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }
.footer-copy { margin-left: auto; }

/* Cookie notice (dismiss-only — strictly-necessary cookie, no consent gate) */
.cookie-notice {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, .25);
  font-size: 13px;
  color: var(--muted);
}
.cookie-notice[hidden] { display: none; }
.cookie-notice span { flex: 1; min-width: 0; }
.cookie-notice a { color: var(--accent); }
.cookie-notice .btn { flex: none; }

/* Legal / document pages */
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  width: 100%;
}
.legal h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.legal .lede { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.legal h2 { font-size: 19px; font-weight: 700; margin: 32px 0 10px; }
.legal h3 { font-size: 15px; font-weight: 700; margin: 22px 0 8px; }
.legal p { margin-bottom: 14px; }
.legal ul { margin: 0 0 14px 22px; }
.legal li { margin-bottom: 6px; }
.legal a { text-decoration: underline; }
.legal table { margin: 8px 0 20px; }
.legal table th, .legal table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.legal table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.legal-disclaimer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--yellow);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 28px;
  font-size: 13px;
  color: var(--muted);
}
.legal-disclaimer code { color: var(--text); font-family: ui-monospace, monospace; font-size: 12px; }

@media (max-width: 720px) {
  .hero-title { font-size: 32px; }
  .how-grid, .feature-grid { grid-template-columns: 1fr; }
  .footer-copy { margin-left: 0; }
}
