:root {
  color-scheme: light;
  --bg: #f6f8fe;
  --bg-alt: #eef4ff;
  --card: rgba(255, 255, 255, 0.86);
  --card-solid: #ffffff;
  --card-border: rgba(110, 140, 210, 0.14);
  --text: #13233f;
  --muted: #5e6f92;
  --accent: #4d79ff;
  --accent-2: #15b8a6;
  --accent-3: #f28c54;
  --warning: #e0a100;
  --danger: #d94e6a;
  --shadow: 0 18px 55px rgba(50, 76, 145, 0.12);
  --shadow-soft: 0 8px 28px rgba(50, 76, 145, 0.08);
  --radius: 24px;
  font-family: "Avenir Next", "Segoe UI", "Inter", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(77, 121, 255, 0.14), transparent 35%),
    radial-gradient(circle at right 15%, rgba(21, 184, 166, 0.12), transparent 28%),
    linear-gradient(180deg, #f9fbff 0%, #f2f6ff 100%);
}

body {
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.34)),
    linear-gradient(130deg, transparent 0%, rgba(255, 255, 255, 0.5) 18%, transparent 36%);
  pointer-events: none;
  opacity: 0.32;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(10px);
  opacity: 0.8;
  pointer-events: none;
}

.bg-orb-a {
  top: 2rem;
  left: -6rem;
  width: 16rem;
  height: 16rem;
  background: rgba(77, 121, 255, 0.14);
}

.bg-orb-b {
  right: -4rem;
  top: 10rem;
  width: 20rem;
  height: 20rem;
  background: rgba(21, 184, 166, 0.12);
}

.shell {
  position: relative;
  width: min(1320px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1.4rem 0 4rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.95fr);
  gap: 1.1rem;
  align-items: stretch;
  margin-bottom: 1rem;
}

.eyebrow,
.card-kicker {
  margin: 0 0 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.4rem, 4vw, 4.3rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

h2 {
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.lede {
  margin-top: 0.95rem;
  max-width: 66ch;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.68;
}

.hero-playbook {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.playbook-step {
  border-radius: 18px;
  padding: 0.95rem 1rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(77, 121, 255, 0.1);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 0.35rem;
}

.playbook-step strong {
  color: var(--accent);
  font-size: 0.92rem;
}

.playbook-step span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.hero-meta,
.card,
.stats-card {
  background: var(--card);
  backdrop-filter: blur(24px);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
}

.hero-meta {
  border-radius: calc(var(--radius) + 4px);
  padding: 1.15rem;
  display: grid;
  gap: 1rem;
}

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 0.42rem 0.74rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  background: rgba(77, 121, 255, 0.12);
  color: var(--accent);
}

.meta-stack {
  display: grid;
  gap: 0.85rem;
}

.meta-stack span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.meta-stack strong {
  font-size: 1.03rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.fallback-note {
  border-radius: 18px;
  padding: 0.9rem 1rem;
  background: rgba(21, 184, 166, 0.08);
  border: 1px solid rgba(21, 184, 166, 0.18);
  color: var(--muted);
  line-height: 1.6;
}

.fallback-note strong {
  color: var(--accent-2);
}

.button,
.action,
.mini-button,
.row-button {
  border: 0;
  border-radius: 14px;
  padding: 0.88rem 1rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, opacity 160ms ease;
}

.button:hover,
.action:hover,
.mini-button:hover,
.row-button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), #7c98ff);
  color: white;
  box-shadow: 0 14px 28px rgba(77, 121, 255, 0.22);
}

.button-secondary,
.action,
.row-button,
.mini-button {
  background: rgba(77, 121, 255, 0.08);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.button-ghost {
  color: var(--accent);
  background: rgba(77, 121, 255, 0.04);
  border: 1px solid rgba(77, 121, 255, 0.12);
}

.stats-grid,
.panel-grid {
  display: grid;
  gap: 1rem;
}

.stats-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.panel-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
}

.panel-grid.wide {
  grid-template-columns: 1fr;
  align-items: start;
  margin-top: 1rem;
}

.panel-grid.wide > .card {
  width: 100%;
}

.stats-card,
.card {
  border-radius: var(--radius);
  padding: 1.15rem;
}

.stats-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(244, 248, 255, 0.92));
}

.stat-label {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 0.45rem;
  font-weight: 700;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.stat-note {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 255, 0.94));
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.stack {
  display: grid;
  gap: 0.45rem;
}

label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(107, 131, 185, 0.18);
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  border-radius: 16px;
  padding: 0.95rem 1rem;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

input::placeholder,
textarea::placeholder {
  color: #8a97b3;
}

.form-hint,
.panel-note,
.help-footnote {
  display: block;
  margin-top: 0.42rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.panel-note {
  margin-bottom: 0.95rem;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  background: rgba(21, 184, 166, 0.06);
  border: 1px solid rgba(21, 184, 166, 0.14);
}

.help-list {
  margin: 0.8rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.55;
}

.help-list li + li {
  margin-top: 0.45rem;
}

.example-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.example-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.65rem 0.9rem;
  background: rgba(21, 184, 166, 0.08);
  color: var(--muted);
  border: 1px solid rgba(21, 184, 166, 0.16);
  font-size: 0.86rem;
}

.example-chip strong {
  color: var(--text);
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(77, 121, 255, 0.22);
  border-color: rgba(77, 121, 255, 0.42);
}

.two-up {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.report-item {
  background: rgba(77, 121, 255, 0.06);
  border: 1px solid rgba(77, 121, 255, 0.1);
  border-radius: 18px;
  padding: 0.9rem 1rem;
}

.report-item span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.22rem;
  font-weight: 700;
}

.report-item strong {
  font-size: 1rem;
}

.empty-state {
  display: grid;
  gap: 0.25rem;
  padding: 0.95rem 0.8rem;
  color: var(--muted);
}

.empty-state strong,
.empty-event .event-title {
  color: var(--text);
}

.empty-event {
  border-left-color: rgba(77, 121, 255, 0.28);
  background: rgba(77, 121, 255, 0.03);
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  text-align: left;
  padding: 0.85rem 0.7rem;
  border-bottom: 1px solid rgba(107, 131, 185, 0.12);
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tbody tr:hover {
  background: rgba(77, 121, 255, 0.04);
}

.row-button {
  border: 1px solid rgba(77, 121, 255, 0.12);
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
}

.timeline {
  display: grid;
  gap: 0.75rem;
}

.event {
  border-left: 3px solid rgba(77, 121, 255, 0.6);
  background: rgba(77, 121, 255, 0.05);
  padding: 0.95rem 1rem;
  border-radius: 0 16px 16px 0;
}

.event .event-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}

.event .event-title {
  font-weight: 800;
}

.event .event-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.code {
  margin: 0;
  padding: 1rem;
  border-radius: 18px;
  background: #f8fbff;
  color: #17304f;
  overflow: auto;
  min-height: 280px;
  white-space: pre-wrap;
  border: 1px solid rgba(107, 131, 185, 0.12);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.settings-grid label {
  display: grid;
  gap: 0.45rem;
}

.settings-grid textarea {
  min-height: 8rem;
  resize: vertical;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
  gap: 1rem;
  margin-top: 1rem;
}

.settings-help {
  display: grid;
  gap: 0.9rem;
}

.help-block {
  border-radius: 18px;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 249, 255, 0.96));
  border: 1px solid rgba(107, 131, 185, 0.12);
  box-shadow: var(--shadow-soft);
}

.help-block h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.help-block p {
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.93rem;
}

.example-block {
  margin: 0;
  padding: 1rem;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfcff, #eef4ff);
  color: #17304f;
  white-space: pre-wrap;
  line-height: 1.55;
  border: 1px solid rgba(77, 121, 255, 0.1);
  font-size: 0.9rem;
}

.settings-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}

.toolbar-pill {
  border-radius: 16px;
  padding: 0.8rem 0.9rem;
  background: rgba(77, 121, 255, 0.06);
  border: 1px solid rgba(77, 121, 255, 0.1);
  color: var(--muted);
}

.toolbar-pill strong {
  display: block;
  color: var(--text);
  margin-top: 0.2rem;
}

.toolbar-actions {
  grid-column: 3 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.version-list {
  display: grid;
  gap: 0.75rem;
}

.version-card {
  border-radius: 18px;
  padding: 0.95rem 1rem;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(107, 131, 185, 0.12);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 0.6rem;
}

.version-card.active {
  border-color: rgba(21, 184, 166, 0.34);
  background: linear-gradient(180deg, rgba(21, 184, 166, 0.09), rgba(255, 255, 255, 0.96));
}

.version-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.version-title {
  display: grid;
  gap: 0.2rem;
}

.version-title strong {
  font-size: 1.02rem;
}

.version-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.version-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.mini-button {
  border: 1px solid rgba(77, 121, 255, 0.14);
  background: rgba(77, 121, 255, 0.07);
  color: var(--text);
  padding: 0.62rem 0.82rem;
}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .panel-grid,
  .panel-grid.wide {
    grid-template-columns: 1fr;
  }

  .hero-playbook {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .shell {
    width: min(100% - 1rem, 1320px);
    padding-top: 1rem;
  }

  .stats-grid,
  .two-up,
  .action-grid,
  .report-grid,
  .settings-grid,
  .settings-toolbar {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .button,
  .action,
  .mini-button,
  .row-button {
    width: 100%;
    justify-content: center;
  }

  .card-head {
    flex-direction: column;
  }

  .toolbar-actions {
    grid-column: auto;
    justify-content: stretch;
  }

  .toolbar-actions .button {
    width: 100%;
  }

  .example-strip {
    flex-direction: column;
  }
}
