/* ─── LifeQuest RPG Theme ──────────────────────────────────────────────────── */

:root {
  --bg-deep:      #0d0d1a;
  --bg-card:      #1a1a2e;
  --bg-card-alt:  #16213e;
  --border:       #2a2a4a;
  --border-gold:  #d4a574;
  --text:         #e8e8f0;
  --text-muted:   #8888aa;
  --text-dim:     #555577;
  --gold:         #d4a574;
  --gold-light:   #f0c896;
  --hp-color:     #e05060;
  --hp-glow:      #ff2244;
  --mana-color:   #4488dd;
  --mana-glow:    #2266ff;
  --stamina-color:#44cc88;
  --stamina-glow: #22ff88;
  --xp-color:     #cc88ff;
  --attr-color:   #d4a574;
  --success:      #44cc88;
  --danger:       #e05060;
  --radius:       8px;
  --radius-sm:    4px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

/* ─── Navigation ───────────────────────────────────────────────────────────── */

.nav {
  background: var(--bg-card);
  border-bottom: 2px solid var(--border-gold);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-icon { font-size: 1.4rem; }

.nav-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: small-caps;
  color: var(--gold);
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--gold);
  background: rgba(212, 165, 116, 0.1);
}

/* ─── Main Content ─────────────────────────────────────────────────────────── */

.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* ─── Cards ─────────────────────────────────────────────────────────────────  */

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

.card:hover { border-color: var(--border-gold); }

/* ─── Section Blocks ───────────────────────────────────────────────────────── */

.section-block { margin-bottom: 1.5rem; }

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: small-caps;
  color: var(--gold);
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

/* ─── Character Header ─────────────────────────────────────────────────────── */

.char-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.char-name {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--gold-light);
  text-shadow: 0 0 20px rgba(212, 165, 116, 0.3);
}

.char-level {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.char-xp { min-width: 200px; }
.xp-label { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.xp-label-small { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.25rem; }

.xp-bar-track {
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
}

.xp-bar-track.wide { height: 12px; border-radius: 6px; }

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--xp-color), #aa66ff);
  border-radius: 4px;
  transition: width 0.6s ease;
  box-shadow: 0 0 8px rgba(204, 136, 255, 0.4);
}

/* ─── Attributes Grid ──────────────────────────────────────────────────────── */

.attr-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.attr-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
}

.attr-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.attr-abbr {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.attr-value {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--gold-light);
  line-height: 1;
  margin: 0.25rem 0;
  font-variant-numeric: tabular-nums;
}

.attr-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: small-caps;
}

.attr-trend {
  font-size: 0.7rem;
  margin-top: 0.3rem;
  font-weight: 700;
}

.trend-up    { color: var(--success); }
.trend-down  { color: var(--danger); }
.trend-stable{ color: var(--text-dim); }

.attr-xp-track {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.attr-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--attr-color), var(--gold-light));
  border-radius: 2px;
  transition: width 0.6s ease;
}

.attr-xp-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

/* ─── Resource Bars ─────────────────────────────────────────────────────────  */

.resources { display: flex; flex-direction: column; gap: 1rem; }

.resource-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.resource-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.resource-name { font-weight: 600; letter-spacing: 0.05em; }
.resource-value { color: var(--text-muted); font-variant-numeric: tabular-nums; }

.resource-track {
  height: 14px;
  background: rgba(255,255,255,0.06);
  border-radius: 7px;
  overflow: hidden;
}

.resource-fill {
  height: 100%;
  border-radius: 7px;
  transition: width 0.8s ease;
}

.hp-fill     { background: linear-gradient(90deg, #c03040, var(--hp-color)); box-shadow: 0 0 10px rgba(224, 80, 96, 0.5); }
.mana-fill   { background: linear-gradient(90deg, #2255aa, var(--mana-color)); box-shadow: 0 0 10px rgba(68, 136, 221, 0.5); }
.stamina-fill{ background: linear-gradient(90deg, #22aa66, var(--stamina-color)); box-shadow: 0 0 10px rgba(68, 204, 136, 0.5); }

/* ─── Exhaustion Pips ──────────────────────────────────────────────────────── */

.exhaustion-pips {
  display: flex;
  gap: 6px;
  margin: 0.75rem 0 0.5rem;
}

.pip {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-deep);
}

.pip-filled { background: var(--danger); border-color: var(--hp-color); box-shadow: 0 0 6px rgba(224,80,96,0.6); }
.exhaustion-pips.large .pip { width: 24px; height: 24px; }

.exhaustion-level { font-size: 1.1rem; font-weight: 700; color: var(--gold); margin-top: 0.25rem; }
.exhaustion-desc  { font-size: 0.85rem; color: var(--text-muted); }
.exhaustion-streak{ font-size: 0.8rem; color: var(--text-dim); margin-top: 0.25rem; }
.exhaustion-hint  { font-size: 0.75rem; color: var(--text-dim); font-style: italic; }

/* ─── Momentum ─────────────────────────────────────────────────────────────── */

.momentum-bar {
  display: flex;
  gap: 4px;
  margin: 0.75rem 0 0.5rem;
}

.momentum-pip {
  flex: 1;
  height: 12px;
  border-radius: 2px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
}

.momentum-active {
  background: linear-gradient(180deg, #ffdd44, #cc8800);
  border-color: #cc8800;
  box-shadow: 0 0 4px rgba(255, 221, 68, 0.5);
}

.momentum-value { font-size: 1.1rem; font-weight: 700; color: var(--gold); }
.momentum-multi { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }
.momentum-streak{ font-size: 0.8rem; color: var(--text-dim); }

.momentum-track-large {
  height: 16px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  overflow: hidden;
  margin: 0.75rem 0 0.5rem;
}

.momentum-fill-large {
  height: 100%;
  background: linear-gradient(90deg, #cc8800, #ffdd44);
  border-radius: 8px;
  transition: width 0.6s ease;
  box-shadow: 0 0 8px rgba(255, 221, 68, 0.4);
}

.momentum-value-large { font-size: 1.3rem; font-weight: 700; color: var(--gold); }

/* ─── Status Row ────────────────────────────────────────────────────────────  */

.status-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.status-card { padding: 1.25rem; }
.status-title { font-size: 0.9rem; font-weight: 700; text-transform: small-caps; color: var(--gold); letter-spacing: 0.05em; }

/* ─── Quests ─────────────────────────────────────────────────────────────── */

.quest-list { display: flex; flex-direction: column; gap: 0.75rem; }

.quest-item {
  padding: 1rem 1.25rem;
}

.quest-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.quest-name { font-weight: 600; color: var(--gold-light); }
.quest-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }

.quest-progress-track {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.quest-progress-track.wide { height: 10px; }

.quest-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #887700, var(--gold));
  border-radius: 4px;
  transition: width 0.6s ease;
}

.quest-pct { font-size: 0.75rem; color: var(--text-dim); text-align: right; margin-top: 0.2rem; }

/* Quest detail cards */
.quest-detail-card { margin-bottom: 0.75rem; padding: 1.25rem; }
.quest-detail-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.5rem; }
.quest-detail-name { font-weight: 700; font-size: 1.05rem; color: var(--gold-light); }
.quest-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.quest-detail-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.quest-progress-row { display: flex; align-items: center; gap: 0.75rem; }
.quest-reward { font-size: 0.8rem; color: var(--gold); margin-top: 0.5rem; }
.quest-completed-at { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.25rem; }
.quest-completed .quest-detail-name { color: var(--text-muted); }
.quest-failed .quest-detail-name { color: var(--danger); }

/* ─── Badges ───────────────────────────────────────────────────────────────── */

.badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  white-space: nowrap;
}

.badge-type    { background: rgba(212, 165, 116, 0.15); color: var(--gold); border: 1px solid var(--gold); }
.badge-active  { background: rgba(68, 204, 136, 0.15); color: var(--success); border: 1px solid var(--success); }
.badge-complete{ background: rgba(68, 204, 136, 0.2);  color: var(--success); }
.badge-failed  { background: rgba(224, 80, 96, 0.2);   color: var(--danger); }

/* ─── Event Log ─────────────────────────────────────────────────────────────  */

.event-list { display: flex; flex-direction: column; gap: 0.4rem; }

.event-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.event-time { color: var(--text-dim); margin-left: auto; font-size: 0.8rem; }

.event-type-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* Event type colors */
.event-sleep            { background: rgba(68, 100, 200, 0.3); color: #88aaff; }
.event-workout          { background: rgba(224, 80, 96, 0.3);  color: #ff8888; }
.event-run              { background: rgba(68, 204, 136, 0.3); color: #88ffcc; }
.event-nutrition        { background: rgba(100, 200, 68, 0.3); color: #aaffaa; }
.event-deep_work        { background: rgba(200, 150, 68, 0.3); color: #ffcc88; }
.event-plateau_session  { background: rgba(150, 68, 200, 0.3); color: #cc88ff; }
.event-meeting          { background: rgba(68, 150, 200, 0.3); color: #88ccff; }
.event-health_measurement{ background: rgba(200, 200, 68, 0.3); color: #ffffaa; }
.event-faith_practice   { background: rgba(200, 180, 255, 0.2); color: #ccccff; }
.event-qualitative      { background: rgba(180, 68, 180, 0.3); color: #ffaaff; }
.event-rest             { background: rgba(100, 100, 150, 0.3); color: #aaaadd; }

/* Event detail list */
.event-detail-list { display: flex; flex-direction: column; gap: 0.75rem; }

.event-detail-item { padding: 1rem 1.25rem; }

.event-detail-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.event-detail-time { color: var(--text-muted); font-size: 0.85rem; }

.event-detail-data {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.event-data-pair {
  font-size: 0.8rem;
  background: rgba(255,255,255,0.05);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  color: var(--text-muted);
}

.event-detail-id { font-size: 0.7rem; color: var(--text-dim); font-family: monospace; }

/* ─── Filter Bar ────────────────────────────────────────────────────────────  */

.filter-bar { margin-bottom: 1rem; }
.filter-form { display: flex; align-items: center; gap: 1rem; }

.filter-form select {
  background: var(--bg-deep);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.filter-form select:focus { outline: none; border-color: var(--gold); }

/* ─── Empty State ───────────────────────────────────────────────────────────  */

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-state a { color: var(--gold); text-decoration: none; }
.empty-state a:hover { text-decoration: underline; }

.empty-state.large { padding: 3rem; }
.empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-text { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.empty-hint { font-size: 0.85rem; margin-bottom: 1rem; }

.empty-example {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  text-align: left;
  white-space: pre-wrap;
  color: var(--text-muted);
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
}

/* ─── Page Titles ──────────────────────────────────────────────────────────── */

.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--gold-light);
  margin-bottom: 1.25rem;
  text-shadow: 0 0 20px rgba(212, 165, 116, 0.2);
}

/* ─── Character Page ────────────────────────────────────────────────────────  */

.char-level-block { margin-bottom: 1.5rem; }
.char-level-info { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 0.5rem; }
.big-level { font-size: 2rem; font-weight: 900; color: var(--gold-light); }
.total-xp  { font-size: 0.9rem; color: var(--text-muted); }
.xp-to-next{ font-size: 0.8rem; color: var(--text-dim); margin-bottom: 0.5rem; }

.attr-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.attr-detail-card { padding: 1.25rem; }

.attr-detail-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.attr-detail-abbr  { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.15em; color: var(--text-muted); text-transform: uppercase; }
.attr-detail-value { font-size: 2rem; font-weight: 900; color: var(--gold-light); }
.attr-detail-name  { font-size: 0.85rem; color: var(--text-muted); text-transform: small-caps; letter-spacing: 0.08em; }
.attr-detail-trend { font-size: 0.8rem; font-weight: 700; margin-bottom: 0.35rem; }
.attr-detail-xp-label { font-size: 0.75rem; color: var(--text-dim); margin-bottom: 0.3rem; }
.attr-last-activity { font-size: 0.72rem; color: var(--text-dim); margin-top: 0.25rem; }

/* Resources detail */
.resources-detail { gap: 0.75rem; }

.resource-detail-card { padding: 1.25rem; }

.resource-detail-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.resource-icon      { font-size: 1.2rem; }
.resource-detail-name  { font-weight: 600; font-size: 1rem; flex: 1; }
.resource-detail-value { font-size: 0.9rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.resource-detail-desc  { font-size: 0.78rem; color: var(--text-dim); margin-top: 0.5rem; }

/* ─── Toggle hint ───────────────────────────────────────────────────────────  */

.toggle-hint {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: none;
}

/* ─── Dashboard Layout ──────────────────────────────────────────────────────  */

/* ─── PWA Safe Areas (iPhone notch/island) ───────────────────────────────  */

body {
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}

.dashboard { max-width: 100%; }

/* ─── Grid Defaults (desktop) ───────────────────────────────────────────────  */

.attr-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.75rem; }
.resource-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.status-row { display: flex; flex-wrap: wrap; }

/* ─── Tablet ────────────────────────────────────────────────────────────────  */

@media (max-width: 768px) {
  .nav { padding: 0.6rem 0.75rem; gap: 0.75rem; }
  .nav-links { gap: 0.25rem; flex-wrap: wrap; }
  .nav-link { padding: 0.3rem 0.5rem; font-size: 0.8rem; }

  .main-content { padding: 1rem 0.75rem; }

  .attr-grid { grid-template-columns: repeat(3, 1fr); }
  .resource-grid { grid-template-columns: repeat(3, 1fr); }
  .attr-detail-grid { grid-template-columns: 1fr; }

  .status-row { flex-direction: column; }
  .status-row > * { width: 100%; }

  .char-header { flex-direction: column; align-items: flex-start; }

  .event-detail-data { gap: 0.35rem; }
}

/* ─── Mobile ────────────────────────────────────────────────────────────────  */

@media (max-width: 480px) {
  .attr-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .resource-grid { grid-template-columns: repeat(1, 1fr); gap: 0.5rem; }
  .attr-value { font-size: 2rem; }

  .nav-links { gap: 0.15rem; }
  .nav-link { padding: 0.25rem 0.4rem; font-size: 0.75rem; }
}

@media (max-width: 400px) {
  .attr-grid { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }
  .attr-value { font-size: 1.8rem; }
}

/* ─── Fidelity System ─────────────────────────────────────────────── */

.low-fidelity {
  opacity: 0.7;
  border-left: 3px solid var(--accent-warn, #f5a623);
}

.fidelity-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  white-space: nowrap;
}

.fidelity-badge.low {
  background: rgba(245, 166, 35, 0.2);
  color: #f5a623;
  border: 1px solid rgba(245, 166, 35, 0.4);
}

.fidelity-badge.backfill {
  background: rgba(100, 149, 237, 0.2);
  color: #6495ed;
  border: 1px solid rgba(100, 149, 237, 0.4);
}

.fidelity-badge.promoted {
  background: rgba(50, 205, 50, 0.2);
  color: #32cd32;
  border: 1px solid rgba(50, 205, 50, 0.4);
}

.low-fi-notice {
  font-size: 0.75rem;
  color: #f5a623;
  padding: 0.3rem 0;
  font-style: italic;
}

.event-detail-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 0.7rem;
  color: var(--text-dim, #666);
  margin-top: 0.3rem;
}

.event-recorded {
  color: #6495ed;
}

/* ─── Event Impact Chips ──────────────────────────────────────────── */

.event-impact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.4rem 0;
}

.impact-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.impact-chip.delta-positive {
  background: rgba(50, 205, 50, 0.15);
  color: #5dde5d;
  border-color: rgba(50, 205, 50, 0.3);
}

.impact-chip.delta-negative {
  background: rgba(255, 69, 58, 0.15);
  color: #ff6b6b;
  border-color: rgba(255, 69, 58, 0.3);
}

.impact-chip.xp-chip {
  background: rgba(255, 215, 0, 0.12);
  color: #ffd700;
  border-color: rgba(255, 215, 0, 0.3);
}

/* ─── Docs Page ───────────────────────────────────────────────────── */

.docs-page { max-width: 900px; margin: 0 auto; }

.docs-section {
  margin-bottom: 1.5rem;
  padding: 1.2rem;
}

.docs-section h2 {
  margin: 0 0 0.6rem 0;
  font-size: 1.2rem;
  color: var(--text-primary, #eee);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 0.4rem;
}

.docs-intro {
  font-size: 0.85rem;
  color: var(--text-dim, #999);
  margin-bottom: 0.8rem;
  line-height: 1.5;
}

.docs-table-wrap { overflow-x: auto; }

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.docs-table th {
  text-align: left;
  padding: 0.5rem 0.6rem;
  background: rgba(255,255,255,0.05);
  color: var(--text-primary, #eee);
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.docs-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: var(--text-dim, #bbb);
  vertical-align: top;
  line-height: 1.5;
}

.docs-table code {
  background: rgba(255,255,255,0.08);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.78rem;
  color: #7ec8e3;
}

.docs-event-type {
  margin-bottom: 1.2rem;
  padding: 0.8rem;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  border-left: 3px solid rgba(255,255,255,0.15);
}

.docs-event-type h3 {
  margin: 0 0 0.4rem 0;
  font-size: 1rem;
}

.docs-source {
  font-size: 0.75rem;
  color: var(--text-dim, #888);
  margin-bottom: 0.3rem;
}

.docs-fields {
  font-size: 0.82rem;
  margin-bottom: 0.3rem;
  color: var(--text-dim, #aaa);
}

.docs-fields code {
  background: rgba(255,255,255,0.08);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.78rem;
  color: #7ec8e3;
}

.docs-formula {
  font-size: 0.82rem;
}

.docs-formula ul {
  margin: 0.2rem 0 0.3rem 1.2rem;
  padding: 0;
}

.docs-formula li {
  margin-bottom: 0.15rem;
  line-height: 1.5;
}

.docs-formula code {
  background: rgba(255,255,255,0.08);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.78rem;
  color: #a8d8a8;
}

.docs-note {
  font-size: 0.78rem;
  color: var(--text-dim, #888);
  font-style: italic;
  margin-top: 0.3rem;
  line-height: 1.4;
}

.docs-list {
  margin: 0.3rem 0 0 1.2rem;
  padding: 0;
  font-size: 0.85rem;
}

.docs-list li {
  margin-bottom: 0.3rem;
  line-height: 1.5;
  color: var(--text-dim, #bbb);
}

/* ── Oaths ─────────────────────────────────────────────── */
.oath-list { display: flex; flex-direction: column; gap: 0.5rem; }
.oath-item, .oath-card {
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--accent, #6c5ce7);
  transition: border-color 0.2s;
}
.oath-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.3rem; }
.oath-name { font-weight: 600; font-size: 0.95rem; }
.oath-badges { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.oath-due { font-size: 0.8rem; color: var(--text-dim, #aaa); margin-top: 0.2rem; }
.oath-notes, .oath-notes-preview { font-size: 0.8rem; color: var(--text-dim, #999); margin-top: 0.3rem; line-height: 1.4; }
.oath-notes-preview { max-height: 2.8em; overflow: hidden; text-overflow: ellipsis; }
.oath-project { font-size: 0.8rem; color: var(--text-dim, #aaa); margin-top: 0.2rem; }
.oath-meta { font-size: 0.75rem; color: var(--text-dim, #777); margin-top: 0.4rem; }
.oath-resolved { opacity: 0.7; }
.oath-resolved-at { font-size: 0.78rem; color: var(--text-dim, #888); }

/* Drift indicators */
.oath-drift-warn { border-left-color: #f39c12; }
.oath-drift-high { border-left-color: #e74c3c; }

/* Domain badges */
.badge-domain { font-size: 0.7rem; padding: 0.1rem 0.4rem; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-domain-work { background: rgba(52, 152, 219, 0.2); color: #3498db; }
.badge-domain-health { background: rgba(46, 204, 113, 0.2); color: #2ecc71; }
.badge-domain-leadership { background: rgba(155, 89, 182, 0.2); color: #9b59b6; }
.badge-domain-home { background: rgba(230, 126, 34, 0.2); color: #e67e22; }
.badge-domain-personal { background: rgba(241, 196, 15, 0.2); color: #f1c40f; }
.badge-domain-growth { background: rgba(26, 188, 156, 0.2); color: #1abc9c; }
.badge-domain-finance { background: rgba(149, 165, 166, 0.2); color: #95a5a6; }
.badge-domain-daily { background: rgba(52, 73, 94, 0.3); color: #85929e; }
.badge-domain-quarterly { background: rgba(142, 68, 173, 0.2); color: #a569bd; }

.badge-drift-warn { background: rgba(243, 156, 18, 0.2); color: #f39c12; font-size: 0.7rem; }
.badge-drift-high { background: rgba(231, 76, 60, 0.2); color: #e74c3c; font-size: 0.7rem; }
.badge-delegated { background: rgba(52, 152, 219, 0.15); color: #74b9ff; font-size: 0.7rem; }
.badge-kept { background: rgba(46, 204, 113, 0.2); color: #2ecc71; font-size: 0.7rem; }
.badge-released { background: rgba(149, 165, 166, 0.2); color: #95a5a6; font-size: 0.7rem; }
.badge-broken { background: rgba(231, 76, 60, 0.2); color: #e74c3c; font-size: 0.7rem; }

/* ─── Buttons ──────────────────────────────────────────────────────────────  */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid #444;
  border-radius: 6px;
  background: #2a2a2a;
  color: #e0e0e0;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn:hover { background: #3a3a3a; border-color: #666; }
.btn:active { background: #222; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
}

.btn-primary {
  background: #1a5276;
  border-color: #2980b9;
  color: #e0f0ff;
}
.btn-primary:hover { background: #21618c; border-color: #3498db; }

.btn-success {
  background: #1a4a2a;
  border-color: #27ae60;
  color: #d5f5e3;
}
.btn-success:hover { background: #1e6634; border-color: #2ecc71; }

.btn-danger {
  background: #4a1a1a;
  border-color: #c0392b;
  color: #f5d5d5;
}
.btn-danger:hover { background: #661a1a; border-color: #e74c3c; }

.btn-warn {
  background: #3a3a1a;
  border-color: #d4a017;
  color: #ffeaa7;
}
.btn-warn:hover { background: #4a4a1a; border-color: #f1c40f; }

/* ─── Oath Cards ──────────────────────────────────────────────────────────  */

.oath-card {
  border-left: 3px solid #333;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s;
}
.oath-card:hover { border-left-color: #4dabf7; }
.oath-drift-warn { border-left-color: #f39c12 !important; }
.oath-drift-high { border-left-color: #e74c3c !important; }
.oath-drift-critical { border-left-color: #e74c3c !important; background: rgba(231, 76, 60, 0.05); }
.oath-resolved { opacity: 0.65; }
.oath-kept { border-left-color: #2ecc71; }
.oath-released { border-left-color: #95a5a6; }
.oath-broken { border-left-color: #e74c3c; }

.empty-state { padding: 1.5rem; text-align: center; color: #666; font-style: italic; }
.toggle-hint { font-size: 0.75rem; color: #666; font-weight: 400; }
