:root {
  color-scheme: light;
  --bg: #fbf6f4;
  --surface: #ffffff;
  --surface-2: #f3e8ed;
  --line: #e8d9df;
  --text: #392b33;
  --muted: #786570;
  --accent: #9e496b;
  --accent-soft: #f3e8ed;
  --on-accent: #ffffff;
  --cyan: #925175;
  --warning: #916110;
  --danger: #b83b50;
  --sidebar: #402734;
  --sidebar-active: #5b394c;
  --sidebar-text: #fbf6f4;
  --sidebar-muted: #d9bdcd;
  --secondary-accent: #d99db9;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #211920;
  --surface: #2c222b;
  --surface-2: #392b36;
  --line: #513d4a;
  --text: #fbf6f4;
  --muted: #c2aebc;
  --accent: #d99db9;
  --accent-soft: #48303f;
  --on-accent: #211920;
  --cyan: #e4b4d0;
  --warning: #e8bf75;
  --danger: #ff9eae;
  --sidebar: #281c25;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 32rem),
    var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  padding-left: 244px;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 244px;
  padding: 30px 22px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  color: var(--sidebar-text);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 900;
  border-radius: 12px 12px 12px 3px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  letter-spacing: 0.02em;
}

.brand small {
  color: var(--sidebar-muted);
  margin-top: 2px;
}

.nav-list {
  display: grid;
  gap: 7px;
  margin-top: 70px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 12px;
  color: var(--sidebar-muted);
  border-radius: 10px;
  transition: 160ms ease;
}

.nav-item span {
  font-size: 0.72rem;
  color: var(--sidebar-muted);
}

.nav-item:hover,
.nav-item.active {
  color: var(--sidebar-text);
  background: var(--sidebar-active);
}

.nav-item.active span {
  color: var(--secondary-accent);
}

.sidebar-card {
  margin-top: auto;
  padding: 16px;
  background: var(--sidebar-active);
  border: 1px solid #715364;
  border-radius: 14px;
}

.sidebar-card p {
  margin: 10px 0 3px;
  font-weight: 700;
}

.sidebar-card small {
  color: var(--sidebar-muted);
}

.pulse,
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.docs-link {
  margin-top: 14px;
  color: var(--sidebar-muted);
  font-size: 0.9rem;
}

main {
  width: min(1500px, 100%);
  margin-inline: auto;
  padding: 38px 42px 24px;
}

.topbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  margin-bottom: 34px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

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

h1 {
  margin: 0 auto;
  max-width: 760px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 0.9rem;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  justify-content: center;
  flex-wrap: wrap;
}

.panel-tools {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  margin-bottom: -18px;
}

.theme-toggle {
  position: relative;
  flex: 0 0 88px;
  width: 88px;
  height: 44px;
  padding: 0;
  border: 1px solid #cfb7c3;
  border-radius: 999px;
  background: #e9dce3;
  color: #735469;
  cursor: pointer;
  box-shadow: inset 0 1px 3px #40273412;
  transition: background 180ms ease, border-color 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.theme-thumb {
  position: absolute;
  inset: 5px auto auto 5px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fffafc;
  color: #856078;
  box-shadow: 0 2px 6px #40273426;
  transition: transform 180ms ease, color 180ms ease;
}

.theme-thumb svg { width: 20px; height: 20px; }
.theme-state {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  transition: opacity 140ms ease;
}
.theme-state-off { right: 8px; }
.theme-state-on { left: 10px; opacity: 0; }
.theme-toggle[aria-checked="true"] { background: #68435d; border-color: #ac7f9b; color: #fff4fa; }
.theme-toggle[aria-checked="true"] .theme-thumb { transform: translateX(44px); color: #68435d; }
.theme-toggle[aria-checked="true"] .theme-state-off { opacity: 0; }
.theme-toggle[aria-checked="true"] .theme-state-on { opacity: 1; }
.theme-toggle:hover { border-color: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  .theme-toggle, .theme-thumb, .theme-state { transition: none; }
}

:focus-visible {
  outline: 3px solid var(--secondary-accent);
  outline-offset: 3px;
}

.command-panel {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 34px;
  padding: 26px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: 20px;
}

.command-panel > div > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 570px;
  line-height: 1.65;
}

form label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.input-row {
  display: flex;
  gap: 9px;
}

input {
  min-width: 0;
  flex: 1;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: var(--surface);
  color: var(--text);
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

button {
  border: 0;
  cursor: pointer;
}

.input-row button {
  padding: 0 20px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 10px;
  font-weight: 800;
}

.input-row button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.text-button {
  margin-top: 11px;
  padding: 0;
  color: var(--cyan);
  background: transparent;
  font-size: 0.82rem;
}

.message {
  min-height: 24px;
  padding: 10px 2px 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.message.error {
  color: var(--danger);
}

.metric-grid {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, 1fr);
  gap: 14px;
  margin: 20px 0 14px;
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 16px;
}

.metric-card {
  min-height: 142px;
  padding: 20px;
}

.metric-card p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.82rem;
}

.metric-card strong {
  display: block;
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.metric-card > span,
.metric-card div > span {
  color: var(--muted);
  font-size: 0.78rem;
}

.metric-card.feature {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background:
    linear-gradient(135deg, var(--accent-soft), transparent 75%),
    var(--surface);
}

.score-ring {
  --score: 0;
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--score) * 1%), var(--line) 0);
  position: relative;
}

.score-ring::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--surface);
}

.score-ring span {
  position: relative;
  z-index: 1;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 800;
}

.report-grid,
.split-section {
  display: grid;
  grid-template-columns: 1.55fr 0.85fr;
  gap: 14px;
  margin-bottom: 14px;
}

.split-section {
  grid-template-columns: 1fr 1fr;
}

.panel {
  padding: 23px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.panel-heading > a,
.panel-heading > span {
  color: var(--muted);
  font-size: 0.78rem;
}

.verdict {
  margin-bottom: 8px;
  color: var(--cyan);
  font-size: 1.05rem;
  font-weight: 750;
}

.summary {
  color: var(--muted);
  line-height: 1.65;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin: 22px 0 27px;
}

.mini-metric {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.mini-metric strong,
.mini-metric span {
  display: block;
}

.mini-metric strong {
  margin-bottom: 5px;
}

.mini-metric span {
  color: var(--muted);
  font-size: 0.7rem;
}

.subheading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 13px;
}

.subheading h3 {
  margin: 0;
}

.subheading span {
  color: var(--muted);
  font-size: 0.72rem;
}

.language-list {
  display: grid;
  gap: 11px;
}

.language-row {
  display: grid;
  grid-template-columns: 100px 1fr 44px;
  align-items: center;
  gap: 11px;
  font-size: 0.78rem;
}

.language-track {
  height: 7px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--line);
}

.language-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
}

.history-list,
.stack-list {
  display: grid;
  gap: 10px;
}

.history-item,
.stack-item {
  padding: 13px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 11px;
}

.history-item {
  cursor: pointer;
}

.history-item:hover {
  border-color: var(--accent);
}

.history-top,
.stack-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.history-top strong,
.stack-top strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-pill,
.severity-pill,
.priority-pill {
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.score-pill {
  color: var(--accent);
  background: var(--accent-soft);
}

.history-item small,
.stack-item p {
  color: var(--muted);
}

.history-item small {
  display: block;
  margin-top: 7px;
}

.stack-item p {
  margin: 8px 0 0;
  line-height: 1.45;
  font-size: 0.82rem;
}

.severity-pill.low,
.priority-pill.low {
  color: var(--cyan);
  background: var(--accent-soft);
}

.severity-pill.medium,
.priority-pill.medium {
  color: var(--warning);
  background: rgba(255, 180, 92, 0.12);
}

.severity-pill.high,
.severity-pill.critical,
.priority-pill.high,
.priority-pill.critical {
  color: var(--danger);
  background: rgba(255, 107, 107, 0.12);
}

.triage-list {
  display: grid;
  gap: 2px;
}

.triage-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 105px 90px;
  align-items: center;
  gap: 16px;
  padding: 15px 5px;
  border-top: 1px solid var(--line);
}

.triage-row:first-child {
  border-top: 0;
}

.issue-number,
.issue-meta {
  color: var(--muted);
  font-size: 0.75rem;
}

.issue-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
  text-align: center;
}

footer {
  display: flex;
  justify-content: space-between;
  padding-top: 14px;
  color: var(--muted);
  font-size: 0.72rem;
}

@media (max-width: 1100px) {
  .app-shell {
    padding-left: 0;
  }
  .sidebar {
    position: static;
    width: 100%;
    min-height: auto;
    padding: 18px 24px;
    flex-direction: row;
    align-items: center;
  }

  .nav-list,
  .sidebar-card {
    display: none;
  }

  .docs-link {
    margin: 0 0 0 auto;
  }

  main {
    width: 100%;
    padding: 30px 24px;
  }
}

@media (max-width: 820px) {
  .topbar,
  .command-panel {
    grid-template-columns: 1fr;
    display: grid;
  }

  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .report-grid,
  .split-section {
    grid-template-columns: 1fr;
  }

  .mini-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  main {
    padding: 24px 14px;
  }

  h1 {
    font-size: 2.45rem;
  }

  .input-row {
    display: grid;
  }

  .input-row button {
    min-height: 44px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .triage-row {
    grid-template-columns: 50px 1fr auto;
  }

  .issue-meta {
    display: none;
  }

  footer {
    gap: 10px;
    flex-direction: column;
  }
}


/* Keep the theme control visible at the right edge of the dashboard panel. */
.theme-toolbar {display:flex;align-items:center;justify-content:flex-end;gap:12px;margin:0 0 22px;width:100%}
.theme-label {font-size:13px;font-weight:600;color:var(--muted)}
.theme-toolbar .theme-toggle {height:48px;width:96px;flex-basis:96px;border:1px solid #c7abba}
.theme-toolbar .theme-thumb {width:36px;height:36px;inset:5px auto auto 5px}
.theme-toolbar .theme-thumb svg {width:24px;height:24px;fill:currentColor;stroke-width:1}
.theme-toolbar .theme-toggle[aria-checked="true"] .theme-thumb {transform:translateX(48px)}
