:root {
  --bg: #09090b;
  --bg-elevated: #121214;
  --surface: #18181b;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #fafafa;
  --muted: #a1a1aa;
  --muted-dim: #71717a;
  --accent: #e4e4e7;
  --accent-hover: #ffffff;
  --danger: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-w: 200px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden { display: none !important; }

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  padding: 1.5rem 0.75rem 1.5rem 1.25rem;
  border-right: 1px solid var(--border);
  background: var(--bg);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sidebar-brand {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  padding: 0 0.5rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.65rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 450;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.main-column {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(1.5rem, 5vh, 3.5rem) 1.5rem 2rem;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

.view {
  width: 100%;
}

.view:not(.active) {
  display: none;
}

.view-home.active {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.25rem;
}

.drop-zone {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.drop-zone:hover,
.drop-zone:focus-visible {
  border-color: rgba(255, 255, 255, 0.22);
  background: var(--surface);
}

.drop-zone.dragover {
  border-color: rgba(250, 250, 250, 0.35);
  border-style: solid;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.drop-zone-inner {
  padding: clamp(2rem, 6vw, 3.25rem) 1.5rem;
  text-align: center;
}

.drop-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.drop-sub {
  margin: 0 auto 1.25rem;
  max-width: 28rem;
  font-size: 0.8125rem;
  line-height: 1.55;
}

.drop-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.picked-files {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.picked-files li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.picked-files .size {
  color: var(--muted-dim);
  flex-shrink: 0;
}

.upload-note {
  margin: 0;
  font-size: 0.75rem;
  text-align: center;
}

.home-secondary {
  margin-top: 0.5rem;
}

.home-msg {
  font-size: 0.8125rem;
  text-align: center;
  max-width: 32rem;
  margin: 0 auto;
}

.session-block {
  margin-top: 1.5rem;
}

.session-head {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

.view-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.view-lead {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
}

.muted { color: var(--muted); }
.error { color: var(--danger); margin-top: 0.5rem; }

.subhead {
  font-size: 0.8125rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--muted-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-height: 140px;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow-x: auto;
}

.chart-bar {
  flex: 1 0 12px;
  min-width: 10px;
  max-width: 24px;
  background: linear-gradient(180deg, #52525b, #3f3f46);
  border-radius: 4px 4px 0 0;
  position: relative;
}

.chart-bar[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--muted-dim);
  white-space: nowrap;
}

.cards {
  display: grid;
  gap: 0.65rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.card h4 { margin: 0 0 0.35rem; font-size: 0.9375rem; font-weight: 600; }
.card ul { margin: 0.35rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.8125rem; }

.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
  font-size: 0.875rem;
}

.kv dt { color: var(--muted); margin: 0; }
.kv dd { margin: 0; }

.pay-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }

.btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--accent);
}

.btn-ghost:hover {
  color: var(--accent-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn.primary {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.btn.primary:hover {
  background: #e4e4e7;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.about-body {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.8125rem;
  background: var(--surface);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text);
  margin: 0;
}

.support-links a {
  display: inline-block;
  margin-right: 1rem;
  color: var(--muted);
  font-size: 0.875rem;
  text-decoration: none;
}

.support-links a:hover {
  color: var(--text);
}

.footer {
  padding: 0.5rem 1.5rem 1rem;
  margin-left: 0;
  font-size: 11px;
  text-align: center;
  color: var(--muted-dim);
}

.summary-line { margin-top: 0.25rem; font-size: 0.8125rem; }

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 45;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(0, 0, 0, 0.5);
}

@media (max-width: 720px) {
  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar-backdrop:not(.hidden) {
    display: block;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.5);
  }

  .main-column {
    margin-left: 0;
    padding-top: 3.25rem;
  }

  .stage {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
