:root {
  color-scheme: dark;
  --bg: #080b14;
  --panel: rgba(17, 24, 39, 0.82);
  --panel2: #111827;
  --line: #26324a;
  --text: #e8edf8;
  --muted: #8b9ab6;
  --primary: #8b5cf6;
  --cyan: #22d3ee;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: rgba(255, 255, 255, 0.9);
  --panel2: #fff;
  --line: #dbe3ef;
  --text: #132033;
  --muted: #62708a;
  --shadow: 0 16px 42px rgba(28, 43, 68, 0.1);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(
      circle at 80% -10%,
      rgba(139, 92, 246, 0.15),
      transparent 34%
    ),
    var(--bg);
  color: var(--text);
  font:
    14px Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  min-height: 100vh;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
.button {
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  padding: 0.68rem 0.9rem;
  border-radius: 0.65rem;
  cursor: pointer;
  transition: 0.16s;
}
button:hover,
.button:hover {
  border-color: #586985;
  transform: translateY(-1px);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.primary {
  background: linear-gradient(135deg, var(--primary), #6d4ce8);
  border-color: transparent;
  color: #fff;
}
.danger {
  color: #fecdd3;
  border-color: #7f1d35;
}
.shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: rgba(8, 11, 20, 0.84);
  backdrop-filter: blur(18px);
  padding: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  margin: 4px 6px 26px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.2);
}
nav {
  display: grid;
  gap: 5px;
}
.nav-link {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--muted);
  text-decoration: none;
}
.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: rgba(139, 92, 246, 0.13);
}
.main {
  min-width: 0;
}
.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 0 28px;
  background: rgba(8, 11, 20, 0.55);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.content {
  padding: 28px;
  max-width: 1540px;
  margin: auto;
}
.content > *, .card, .grid, .toolbar { min-width: 0; }
.eyebrow, .muted, .timeline-item, .card { overflow-wrap: anywhere; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
}
h1 {
  font-size: clamp(24px, 3vw, 36px);
  margin: 0.3rem 0 1.4rem;
}
h2 {
  font-size: 18px;
  margin: 0.2rem 0 1rem;
}
h3 {
  font-size: 15px;
}
.grid {
  display: grid;
  gap: 16px;
}
.grid.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.stat-value {
  font-size: 30px;
  font-weight: 750;
  margin-top: 10px;
}
.muted {
  color: var(--muted);
}
.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
}
.badge.good {
  color: var(--good);
}
.badge.bad {
  color: var(--bad);
}
.badge.warn {
  color: var(--warn);
}
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
input,
textarea,
select {
  width: 100%;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 9px;
  padding: 0.75rem;
}
textarea {
  min-height: 160px;
  resize: vertical;
}
.composer {
  max-width: 960px;
}
.dropzone {
  border: 1px dashed #586985;
  border-radius: 12px;
  padding: 22px;
  text-align: center;
  margin: 12px 0;
}
.dropzone.drag {
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.06);
}
.file {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  color: var(--muted);
  font-size: 12px;
}
.link {
  color: #a5b4fc;
  text-decoration: none;
}
.link:hover {
  text-decoration: underline;
}
.timeline {
  position: relative;
  margin-left: 7px;
}
.timeline-item {
  border-left: 2px solid var(--line);
  padding: 0 0 18px 20px;
  position: relative;
}
.timeline-item:before {
  content: "";
  position: absolute;
  left: -6px;
  top: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}
pre {
  white-space: pre-wrap;
  overflow: auto;
  max-height: 420px;
  font:
    12px ui-monospace,
    SFMono-Regular,
    monospace;
}
.brief-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px 16px;
}
.artifact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.artifact-preview {
  height: 150px;
  border-radius: 9px;
  background: #05070c;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.artifact-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.error-banner {
  border-color: #7f1d35;
  background: rgba(127, 29, 53, 0.2);
  margin-bottom: 16px;
}
.mobile-nav {
  display: none;
}
.login {
  max-width: 410px;
  margin: 11vh auto;
}
.login .brand {
  justify-content: center;
}
.loading {
  opacity: 0.7;
  pointer-events: none;
}
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--panel2);
  border: 1px solid var(--line);
  padding: 13px 16px;
  border-radius: 10px;
  z-index: 20;
  box-shadow: var(--shadow);
}
details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 12px;
}
.progress {
  height: 7px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
}
@media (max-width: 1050px) {
  .grid.stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .sidebar {
    display: none;
  }
  .topbar {
    height: 58px;
    padding: 0 16px;
  }
  .content {
    padding: 16px 14px 86px;
  }
  .grid.stats,
  .grid.two {
    grid-template-columns: 1fr;
  }
  .mobile-nav {
    position: fixed;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: rgba(8, 11, 20, 0.96);
    border-top: 1px solid var(--line);
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  }
  .mobile-nav a {
    font-size: 10px;
    text-align: center;
    color: var(--muted);
    text-decoration: none;
  }
  .brief-grid {
    grid-template-columns: 1fr;
  }
  table.responsive thead {
    display: none;
  }
  table.responsive,
  table.responsive tbody,
  table.responsive tr,
  table.responsive td {
    display: block;
  }
  table.responsive tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }
  table.responsive td {
    border: 0;
    padding: 4px;
  }
  table.responsive td:before {
    content: attr(data-label) ": ";
    font-weight: 700;
    color: var(--muted);
  }
  button {
    min-height: 44px;
  }
  .toolbar button {
    flex: 1;
  }
}
