:root {
  color-scheme: dark;
  --bg: #0f1115;
  --panel: rgba(255, 255, 255, 0.05);
  --panel-strong: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f5f7fb;
  --muted: #9ba3b2;
  --accent: #d9e2ff;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  --radius: 20px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at top, #1a2030, var(--bg) 55%);
  color: var(--text);
}
button, input { font: inherit; }
button {
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1.1rem;
  background: var(--accent);
  color: #161a22;
  font-weight: 600;
  cursor: pointer;
}
button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
input {
  width: 100%;
  margin-top: 0.45rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0.9rem 1rem;
}
label span, .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--muted);
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { color: var(--text); line-height: 1.45; }
ul { margin: 0; padding-left: 1.2rem; color: var(--muted); }

.shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.auth-card {
  width: min(420px, 100%);
  margin: min(12vh, 6rem) auto 0;
  padding: 1.5rem;
  display: grid;
  gap: 1.5rem;
}
.stack { display: grid; gap: 0.6rem; }
.gap-md { gap: 1rem; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: #ff8f8f; min-height: 1.2rem; }
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.25rem;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.stats-grid, .content-grid {
  display: grid;
  gap: 1rem;
}
.stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}
.content-grid {
  grid-template-columns: 1.05fr 1fr;
}
.stat, .panel { padding: 1.1rem; }
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 0.85rem;
}
.item {
  padding: 0.35rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  background: var(--panel-strong);
}
.item-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.45rem 0.55rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.item-heading {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.item-heading-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}
.item-subline {
  display: flex;
  gap: 0.45rem 0.7rem;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
}
.item-date {
  color: var(--accent);
}
.item-toggle h3 {
  flex: 1;
  min-width: 0;
  font-size: 0.96rem;
  line-height: 1.3;
}
.item-toggle:hover,
.item-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}
.item-toggle-icon {
  width: 0.7rem;
  height: 0.7rem;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  flex: 0 0 auto;
  margin-right: 0.2rem;
  transition: transform 160ms ease;
}
.collapsible-item.expanded .item-toggle-icon {
  transform: rotate(225deg);
  margin-top: 0.2rem;
}
.item-body {
  padding: 0 0.55rem 0.55rem;
  display: grid;
  gap: 0.65rem;
}
.item p { color: var(--muted); }
.item-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  flex-wrap: wrap;
}
.item-meta span {
  color: var(--muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}
.chips {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.chip {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.06);
}
.score-chip {
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
@media (max-width: 520px) {
  .item-heading {
    align-items: flex-start;
  }

  .score-chip {
    display: none;
  }
}
.score-high {
  color: #9ee6b3;
  background: rgba(68, 185, 112, 0.18);
  border-color: rgba(108, 214, 143, 0.26);
}
.score-medium {
  color: #f1cf8a;
  background: rgba(196, 146, 34, 0.18);
  border-color: rgba(241, 190, 86, 0.24);
}
.score-low {
  color: #d1adb2;
  background: rgba(141, 94, 101, 0.18);
  border-color: rgba(191, 146, 154, 0.18);
}

@media (max-width: 900px) {
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .shell { width: min(100% - 1rem, 1120px); padding-top: 1rem; }
  .topbar { align-items: start; flex-direction: column; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .auth-card, .stat, .panel { padding: 1rem; }
  .panel { padding: 0.9rem; }
  .item { padding: 0.3rem; }
  .item-toggle, .item-body { padding-left: 0.5rem; padding-right: 0.5rem; }
}
