:root {
  --bg: #0f1115;
  --surface: #181b22;
  --surface-2: #20242d;
  --surface-3: #262b36;
  --border: #2a2f3a;
  --border-strong: #3a4050;
  --text: #e6e8ee;
  --muted: #8a90a0;
  --accent: #7c5cff;
  --accent-2: #5cc4ff;
  --warn: #ffb86b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(124, 92, 255, 0.18), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(92, 196, 255, 0.12), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.app__header {
  text-align: center;
  margin-bottom: 28px;
}

.app__header h1 {
  font-size: 32px;
  letter-spacing: 0.16em;
  margin: 0 0 8px;
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.app__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.card--primary {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.18), rgba(92, 196, 255, 0.08));
  border-color: rgba(124, 92, 255, 0.4);
}

.card__label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.card__value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.card__hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* Blocks */
.block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 16px;
}

.block__title {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Breakdown */
.breakdown__row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.breakdown__row:last-child { border-bottom: 0; }

.breakdown__label { color: var(--muted); font-size: 14px; }

.breakdown__value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* Models */
.by-model__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.by-model__item:last-child { border-bottom: 0; }

.by-model__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.by-model__name {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  color: var(--text);
}

.by-model__count {
  font-size: 12px;
  color: var(--muted);
}

.by-model__cost {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.by-model__bar {
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
}

.by-model__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.by-model__empty,
.sessions__empty,
.by-project__empty {
  color: var(--muted);
  font-size: 13px;
  padding: 6px 0;
}

/* Sessions */
.sessions__item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.sessions__item:last-child { margin-bottom: 0; }

.sessions__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.sessions__project {
  font-weight: 600;
  font-size: 14px;
}

.sessions__id {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
}

.sessions__meta {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

.sessions__meta strong {
  color: var(--text);
  font-weight: 600;
}

.sessions__ctx {
  height: 6px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
}

.sessions__ctx-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.sessions__ctx-fill[data-warn="1"] {
  background: linear-gradient(90deg, var(--warn), #ff7a8a);
}

/* Projects */
.by-project__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.by-project__item:last-child { border-bottom: 0; }

.by-project__name {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.by-project__cost {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Footer */
.app__footer {
  margin-top: 32px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
