:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-deep: #030814;
  --panel: rgba(14, 22, 38, 0.68);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f5f7fb;
  --muted: #9eb0ca;
  --accent: #77f2bc;
  --accent-2: #5dc8ff;
  --danger: #ff7a92;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius: 24px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(93, 200, 255, 0.12), transparent 30%),
    radial-gradient(circle at bottom right, rgba(119, 242, 188, 0.16), transparent 26%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  color: var(--text);
  font-family: "IBM Plex Sans", sans-serif;
}
body { position: relative; overflow-x: hidden; }
#app { position: relative; z-index: 1; width: min(1180px, calc(100% - 1.4rem)); margin: 0 auto; padding: 1rem 0 4rem; }
.aurora { position: fixed; width: 22rem; height: 22rem; border-radius: 999px; filter: blur(50px); opacity: 0.18; pointer-events: none; }
.aurora-one { top: -6rem; right: -5rem; background: #35d8ff; }
.aurora-two { bottom: -8rem; left: -4rem; background: #6effb7; }
.shell, .auth-shell, .grid, .section-stack, .stats-row, .chip-row, .form-grid, .field-grid, .session-list, .history-list, .bar-list, .reading-book-list, .heat-grid { display: grid; gap: 1rem; }
.topbar, .card, .nav, .auth-card { border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(22px); box-shadow: var(--shadow); }
.topbar, .auth-card { border-radius: 28px; padding: 1.1rem; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; position: sticky; top: 0.75rem; z-index: 5; }
.nav { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.5rem; border-radius: 24px; position: sticky; top: 6.6rem; z-index: 4; }
.card { border-radius: var(--radius); padding: 1rem; }
.brand h1, .auth-copy h1, .card h2, .card h3, .section-title, .metric-value { margin: 0; font-family: "Space Grotesk", sans-serif; }
.brand h1, .auth-copy h1 { font-size: clamp(1.5rem, 3vw, 2.8rem); line-height: 1; }
.metric-value { font-size: clamp(2rem, 4vw, 3rem); line-height: 1; }
.brand p, .auth-copy p, .muted, .subtle, .metric-label, .bar-caption { color: var(--muted); }
.stats-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chip-row { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.dashboard-grid { grid-template-columns: repeat(12, 1fr); }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
.task-tile, .idea-tile, .book-tile, .focus-tile, .workout-tile, .history-tile, .strength-tile, .heat-cell { border-radius: 20px; padding: 0.9rem; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.06); }
.task-tile, .metric, label, .bar-item { display: grid; gap: 0.6rem; }
.task-head, .idea-head, .book-head, .row-between, .bar-caption, .topbar-actions, .task-actions, .form-actions { display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start; flex-wrap: wrap; }
.topbar-actions { align-items: center; }
.pill, button, input, textarea, select { border-radius: 16px; }
.pill { padding: 0.55rem 0.85rem; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); color: var(--text); }
button { border: 0; cursor: pointer; transition: transform 180ms ease, opacity 180ms ease, background 180ms ease; }
button:hover { transform: translateY(-1px); }
button:disabled { opacity: 0.6; cursor: wait; }
.button-primary, .button-secondary, .button-ghost, .button-danger { padding: 0.8rem 1rem; font-weight: 600; }
.button-primary { color: #04131e; background: linear-gradient(135deg, var(--accent) 0%, #9ef9d5 100%); }
.button-secondary { color: var(--text); background: linear-gradient(135deg, rgba(93, 200, 255, 0.26), rgba(119, 242, 188, 0.2)); }
.button-ghost { color: var(--text); background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); }
.button-danger { color: white; background: rgba(255, 122, 146, 0.16); border: 1px solid rgba(255, 122, 146, 0.35); }
.tab-button { white-space: nowrap; padding: 0.8rem 1rem; background: transparent; color: var(--muted); }
.tab-button.active { color: var(--text); background: rgba(255, 255, 255, 0.08); }
input, textarea, select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(3, 8, 20, 0.45);
  color: var(--text);
  padding: 0.9rem;
  font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
.field-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.progress { height: 10px; width: 100%; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width 280ms ease; }
.heat-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.75rem; }
.heat-cell { min-height: 60px; display: grid; place-items: center; text-align: center; }
.heat-0 { background: rgba(255, 255, 255, 0.04); }
.heat-1 { background: rgba(93, 200, 255, 0.18); }
.heat-2 { background: rgba(93, 200, 255, 0.28); }
.heat-3 { background: rgba(119, 242, 188, 0.32); }
.heat-4 { background: rgba(119, 242, 188, 0.48); }
.auth-shell { min-height: 100vh; align-items: center; }
.auth-card { width: min(980px, 100%); margin: 0 auto; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 1rem; }
.auth-highlights { display: grid; gap: 0.75rem; margin-top: 1.25rem; }
.status-banner { padding: 0.85rem 1rem; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.08); background: rgba(255, 255, 255, 0.05); }
.status-banner.error { border-color: rgba(255, 122, 146, 0.35); background: rgba(255, 122, 146, 0.12); }
.small { font-size: 0.88rem; }
@media (max-width: 900px) {
  .auth-card, .stats-row, .dashboard-grid, .grid { grid-template-columns: 1fr; }
  .span-8, .span-6, .span-4, .span-12 { grid-column: auto; }
  .topbar { position: static; flex-direction: column; align-items: stretch; }
  .nav { top: 0; }
}
