:root {
  --bg: #f6f5f3;
  --surface: #fff;
  --text: #1c1b19;
  --muted: #6b6862;
  --line: #e2dfd8;
  --teal: #0c4a4a;
  --teal-soft: #e6f0f0;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --amber-dark: #92400e;
  --green: #166534;
  --red: #b91c1c;
  --radius: 12px;
  --tap: 44px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}

header,
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

header {
  padding-bottom: 8px;
}

header h1 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.error {
  color: var(--red);
  font-size: 0.95rem;
}

.banner {
  margin: 12px 0;
  padding: 12px 14px;
  background: var(--amber-bg);
  color: var(--amber-dark);
  border: 1px solid #f5d78a;
  border-radius: var(--radius);
}

#filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

#filters button {
  min-height: var(--tap);
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

#filters button.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.sessions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sessions li {
  min-height: 56px;
}

.sessions a,
.sessions li > button {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.alias {
  display: block;
  font-weight: 700;
}

.meta {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--muted);
}

.status {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.st-purchased { color: var(--green); }
.st-started { color: var(--amber); }
.st-cart { color: var(--amber-dark); }
.st-none { color: var(--muted); }

.timeline {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.timeline li {
  padding: 10px 0 10px 12px;
  border-left: 2px solid var(--line);
}

.timeline time {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.timeline .inferred {
  color: var(--muted);
  font-style: italic;
  border-left-color: #c4c0b8;
}

button,
.btn {
  min-height: var(--tap);
  padding: 8px 16px;
  border: 1px solid var(--teal);
  border-radius: 10px;
  background: var(--teal);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

button.secondary,
.btn.secondary {
  background: var(--surface);
  color: var(--teal);
}

.detail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 24px;
}

.detail h2 {
  margin: 0;
  font-size: 1.2rem;
}

.detail section { margin: 0; }

[hidden] { display: none !important; }

/* v1.1 reading layer */
.live { color: #0C4A4A; font-weight: 600; margin: 8px 0; }
.pat-bot { background: #fde8e8; color: #8a1f1f; }
.pat-human { background: #e2efe2; color: #1f5c2e; }
.pat-early { background: #eee; color: #555; }
.st-stage { background: #e8f0f0; color: #0C4A4A; }
.reading { border: 1px solid #d8e2e2; border-left: 4px solid #0C4A4A; border-radius: 8px; padding: 10px 12px; margin: 10px 0; background: #fbf9f6; }
.reading p { margin: 6px 0; }
.sessions .status { margin-right: 6px; }
