/* LifeOS mockup — design tokens from .docs/specs/frontend/lifeos_design_language_v1.html */
:root {
  --los-bg-base: #0D0D14;
  --los-bg-surface: #15151F;
  --los-bg-elevated: #1C1C2A;
  --los-bg-hover: #24243A;
  --los-bg-deep: #0A0A10;

  --los-border: rgba(139, 92, 246, 0.12);
  --los-border-subtle: rgba(255, 255, 255, 0.06);
  --los-border-active: rgba(139, 92, 246, 0.4);

  --los-text-primary: #E8E6F0;
  --los-text-secondary: #9B97B0;
  --los-text-muted: #5E5A72;

  --los-accent: #8B5CF6;
  --los-accent-dim: #7C4DDB;
  --los-accent-soft: rgba(139, 92, 246, 0.15);
  --los-accent-glow: rgba(139, 92, 246, 0.08);

  --los-success: #34D399;
  --los-success-soft: rgba(52, 211, 153, 0.12);
  --los-warning: #FBBF24;
  --los-warning-soft: rgba(251, 191, 36, 0.12);
  --los-danger: #F87171;
  --los-danger-soft: rgba(248, 113, 113, 0.12);
  --los-info: #60A5FA;
  --los-info-soft: rgba(96, 165, 250, 0.12);
  --los-finance: #F59E0B;
  --los-finance-soft: rgba(245, 158, 11, 0.12);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.55);
  --shadow-accent: 0 8px 32px rgba(139,92,246,0.25);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.18s;
}

/* Alternate accent (teal) — toggled via command palette */
:root[data-accent="teal"] {
  --los-accent: #2DD4BF;
  --los-accent-dim: #14B8A6;
  --los-accent-soft: rgba(45, 212, 191, 0.15);
  --los-accent-glow: rgba(45, 212, 191, 0.08);
  --los-border: rgba(45, 212, 191, 0.12);
  --los-border-active: rgba(45, 212, 191, 0.4);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 15% 0%, rgba(139,92,246,0.08), transparent 40%),
    radial-gradient(circle at 85% 100%, rgba(139,92,246,0.05), transparent 45%),
    var(--los-bg-base);
  color: var(--los-text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
kbd { font-family: var(--font-mono); }
input, textarea { font-family: inherit; }

/* Subtle text selection */
::selection { background: var(--los-accent-soft); color: var(--los-text-primary); }

/* ── App shell ────────────────────────────────────────────────── */
.app {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
  width: 56px;
  background: rgba(21, 21, 31, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 0.5px solid var(--los-border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  gap: 4px;
  flex-shrink: 0;
  z-index: 10;
}
.sb-logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--los-accent), var(--los-accent-dim));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-accent);
  letter-spacing: -0.02em;
}
.sb-nav { display: flex; flex-direction: column; gap: 3px; width: 100%; align-items: center; }
.sb-i {
  width: 40px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-size: 16px;
  color: var(--los-text-muted);
  position: relative;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.sb-i:hover { color: var(--los-text-primary); background: var(--los-bg-hover); transform: translateX(1px); }
.sb-i.active { color: var(--los-accent); background: var(--los-accent-soft); }
.sb-i.active::before {
  content: ''; position: absolute;
  left: -10px; top: 8px; bottom: 8px;
  width: 2px; background: var(--los-accent); border-radius: 1px;
  box-shadow: 0 0 8px var(--los-accent);
}
/* Tooltip on hover */
.sb-i[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 14px);
  top: 50%; transform: translateY(-50%) translateX(-4px);
  background: var(--los-bg-elevated);
  border: 0.5px solid var(--los-border);
  color: var(--los-text-primary);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur), transform var(--dur);
  box-shadow: var(--shadow-md);
  z-index: 50;
}
.sb-i:hover[data-tip]::after { opacity: 1; transform: translateY(-50%) translateX(0); }

.sb-spacer { flex: 1; }
.sb-divider { width: 24px; height: 1px; background: var(--los-border-subtle); margin: 6px 0; }

/* Sidebar avatar with XP ring */
.sb-avatar {
  position: relative;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  margin-top: 4px;
  cursor: pointer;
}
.sb-avatar svg {
  position: absolute; inset: 0;
  transform: rotate(-90deg);
  filter: drop-shadow(0 0 6px var(--los-accent-soft));
}
.sb-avatar .initial {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid var(--los-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--los-text-primary);
  font-weight: 700; font-size: 12px;
  z-index: 1;
}
.sb-avatar .lvl {
  position: absolute;
  bottom: -2px; right: -2px;
  background: var(--los-accent);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 999px;
  box-shadow: 0 0 6px var(--los-accent);
  font-family: var(--font-mono);
  z-index: 2;
}

/* ── Main + topbar ────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 40px;
  background: rgba(28, 28, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 0.5px solid var(--los-border-subtle);
  display: flex; align-items: center;
  padding: 0 14px; gap: 10px;
  flex-shrink: 0;
  z-index: 5;
}
.presets { display: flex; gap: 2px; padding: 2px; background: var(--los-bg-base); border-radius: var(--radius-md); border: 0.5px solid var(--los-border-subtle); }
.preset {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 5px;
  color: var(--los-text-muted);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.preset:hover { color: var(--los-text-primary); background: var(--los-bg-hover); }
.preset.active { background: var(--los-accent-soft); color: var(--los-accent); box-shadow: inset 0 0 0 0.5px var(--los-border-active); }

.top-spacer { flex: 1; }
.top-clock {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--los-text-secondary);
  padding: 3px 9px;
  border-radius: 5px;
  background: var(--los-bg-base);
  border: 0.5px solid var(--los-border-subtle);
  letter-spacing: 0.04em;
}
.top-clock .sep { opacity: 0.5; }
.top-status {
  font-size: 10px;
  color: var(--los-text-muted);
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  padding: 3px 9px;
  border-radius: 5px;
  background: var(--los-bg-base);
  border: 0.5px solid var(--los-border-subtle);
}
.top-status .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--los-success);
  box-shadow: 0 0 8px var(--los-success);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.top-cmd {
  font-size: 10px;
  color: var(--los-text-secondary);
  padding: 3px 10px;
  border: 0.5px solid var(--los-border-subtle);
  border-radius: 5px;
  background: var(--los-bg-base);
  display: inline-flex; align-items: center; gap: 5px;
  transition: border-color var(--dur), color var(--dur);
}
.top-cmd:hover { border-color: var(--los-border-active); color: var(--los-text-primary); }
.top-cmd kbd { font-size: 10px; color: var(--los-text-muted); }

/* ── Workspace / tile grid ────────────────────────────────────── */
.workspace {
  flex: 1;
  display: grid;
  gap: 1px;
  background: var(--los-border-subtle);
  padding: 1px;
  min-height: 0;
  overflow: hidden;
  animation: fadeIn 0.28s var(--ease);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.workspace.ws-focus      { grid-template-columns: 1fr 380px; grid-template-rows: 1fr auto; }
.workspace.ws-focus .tile:nth-child(3) { grid-column: 1 / -1; }
.workspace.ws-dashboard  { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.workspace.ws-dashboard .tile:nth-child(1) { grid-row: span 2; }
.workspace.ws-review     { grid-template-columns: 1.4fr 1fr; grid-template-rows: 1fr 260px; }
.workspace.ws-review .tile.span-cols { grid-column: 1 / -1; }
.workspace.ws-morning    { grid-template-columns: 1fr; grid-template-rows: 1fr; overflow-y: auto; background: transparent; padding: 0; }
.workspace.ws-journal    { grid-template-columns: 1fr; grid-template-rows: 1fr; overflow-y: auto; background: transparent; padding: 0; }

/* ── Tile ─────────────────────────────────────────────────────── */
.tile {
  background: var(--los-bg-surface);
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
  overflow: hidden;
  position: relative;
  transition: background var(--dur) var(--ease);
}
.tile:hover .tile-dots { opacity: 1; }
.tile-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 13px;
  background: linear-gradient(180deg, var(--los-bg-elevated), rgba(28,28,42,0.6));
  border-bottom: 0.5px solid var(--los-border-subtle);
  flex-shrink: 0;
  gap: 8px;
}
.tile-title {
  font-size: 10.5px;
  color: var(--los-text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.tile-title::before {
  content: '';
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--los-accent);
  box-shadow: 0 0 6px var(--los-accent);
}
.tile-dots {
  font-size: 10px; color: var(--los-text-muted);
  font-family: var(--font-mono);
  opacity: 0.5;
  transition: opacity var(--dur);
}
.tile-body {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  font-size: 13px;
  color: var(--los-text-secondary);
  scrollbar-width: thin;
  scrollbar-color: var(--los-border-active) transparent;
}
.tile-body::-webkit-scrollbar { width: 6px; height: 6px; }
.tile-body::-webkit-scrollbar-thumb { background: var(--los-border-active); border-radius: 3px; }
.tile-body::-webkit-scrollbar-track { background: transparent; }
.tile-body.no-pad { padding: 0; }

/* ── Metric cards ─────────────────────────────────────────────── */
.metrics-panel { display: flex; flex-direction: column; height: 100%; gap: 14px; }
.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.metric-card {
  background: var(--los-bg-base);
  border: 0.5px solid var(--los-border-subtle);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--dur), transform var(--dur);
}
.metric-card:hover { border-color: var(--los-border-active); transform: translateY(-1px); }
.metric-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--los-accent), transparent);
  opacity: 0; transition: opacity var(--dur);
}
.metric-card:hover::before { opacity: 0.5; }
.metric-label {
  font-size: 9px;
  color: var(--los-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
  font-weight: 600;
}
.metric-value {
  font-size: 22px; font-weight: 600; color: var(--los-text-primary);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.metric-value.good { color: var(--los-success); }
.metric-value.accent {
  background: linear-gradient(135deg, var(--los-accent), #C084FC);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.metric-delta { font-size: 10px; margin-top: 3px; font-family: var(--font-mono); }
.metric-delta.good { color: var(--los-success); }
.metric-delta.muted { color: var(--los-text-muted); }

/* ── Sparkline (bar) ──────────────────────────────────────────── */
.sparkline-wrap { margin-top: auto; }
.sparkline-label {
  font-size: 10px;
  color: var(--los-text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 52px;
}
.spark-bar {
  flex: 1;
  background: var(--los-accent);
  border-radius: 2px 2px 0 0;
  min-width: 0;
  transition: opacity var(--dur), transform var(--dur);
}
.spark-bar:hover { transform: scaleY(1.05); transform-origin: bottom; }
.spark-bar.today { background: var(--los-accent); opacity: 1; box-shadow: 0 0 10px var(--los-accent-soft); }
.spark-axis {
  display: flex; justify-content: space-between;
  font-size: 9px; color: var(--los-text-muted);
  margin-top: 5px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* ── Line chart (SVG) ─────────────────────────────────────────── */
.linechart-wrap { display: flex; flex-direction: column; height: 100%; }
.linechart-title { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--los-text-muted); margin-bottom: 6px; font-weight: 600; }
.linechart { width: 100%; height: 100%; flex: 1; min-height: 110px; }
.linechart .grid { stroke: var(--los-border-subtle); stroke-width: 0.5; }
.linechart .target { stroke: var(--los-warning); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.5; }
.linechart .target-label { font-size: 9px; fill: var(--los-warning); font-family: var(--font-mono); }
.linechart .area { fill: url(#areaGrad); opacity: 0.4; }
.linechart .line { fill: none; stroke: var(--los-accent); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 6px var(--los-accent-soft)); }
.linechart .dot { fill: var(--los-accent); }
.linechart .dot-last { fill: var(--los-accent); stroke: var(--los-bg-surface); stroke-width: 2; filter: drop-shadow(0 0 4px var(--los-accent)); }
.linechart .axis-text { font-size: 9px; fill: var(--los-text-muted); font-family: var(--font-mono); }

/* ── Goals ────────────────────────────────────────────────────── */
.goal-list { display: flex; flex-direction: column; gap: 4px; }
.goal-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--los-bg-base);
  border: 0.5px solid transparent;
  transition: background var(--dur), border-color var(--dur), transform var(--dur);
  cursor: pointer;
}
.goal-row:hover { background: var(--los-bg-hover); border-color: var(--los-border); transform: translateX(2px); }
.goal-ring {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--los-border-active);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #fff;
  transition: all var(--dur);
}
.goal-ring.done { background: var(--los-accent); border-color: var(--los-accent); box-shadow: 0 0 8px var(--los-accent-soft); }
.goal-ring.pillar-stem    { border-color: var(--los-info); }
.goal-ring.pillar-sport   { border-color: var(--los-success); }
.goal-ring.pillar-spirit  { border-color: var(--los-warning); }
.goal-ring.pillar-finance { border-color: var(--los-finance); }
.goal-name {
  font-size: 12px; flex: 1;
  color: var(--los-text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 500;
}
.goal-name.done { color: var(--los-text-muted); text-decoration: line-through; font-weight: 400; }
.goal-pill {
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}
.goal-pill.stem    { background: var(--los-info-soft); color: var(--los-info); }
.goal-pill.sport   { background: var(--los-success-soft); color: var(--los-success); }
.goal-pill.spirit  { background: var(--los-warning-soft); color: var(--los-warning); }
.goal-pill.finance { background: var(--los-finance-soft); color: var(--los-finance); }
.goal-prio {
  font-size: 10px; color: var(--los-danger);
  flex-shrink: 0;
  padding: 0 2px;
}

/* ── Sessions ─────────────────────────────────────────────────── */
.session-list { display: flex; flex-direction: column; gap: 5px; }
.session-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  background: var(--los-bg-base);
  border: 0.5px solid transparent;
  transition: background var(--dur), border-color var(--dur);
}
.session-row:hover { background: var(--los-bg-hover); border-color: var(--los-border); }
.session-bar { width: 3px; height: 28px; border-radius: 2px; flex-shrink: 0; box-shadow: 0 0 6px currentColor; }
.session-info { flex: 1; min-width: 0; }
.session-title {
  font-size: 12px; font-weight: 500;
  color: var(--los-text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.session-meta { font-size: 10px; color: var(--los-text-muted); font-family: var(--font-mono); }
.session-dur {
  font-size: 11px; color: var(--los-text-secondary);
  font-family: var(--font-mono); flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.session-prod {
  font-size: 9px; color: var(--los-success);
  font-family: var(--font-mono); flex-shrink: 0;
  padding: 2px 6px;
  background: var(--los-success-soft);
  border-radius: 999px;
}

/* ── Chat ─────────────────────────────────────────────────────── */
.chat-body {
  display: flex; flex-direction: column;
  height: 100%;
}
.chat-msgs {
  flex: 1;
  display: flex; flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding-right: 4px;
}
.chat-msg { max-width: 100%; animation: slideUp 0.28s var(--ease); }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-from { font-size: 10px; margin-bottom: 4px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.chat-from.agent { color: var(--los-accent); }
.chat-from.user { color: var(--los-text-muted); }
.chat-from .bubble {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}
.chat-time { font-weight: 400; color: var(--los-text-muted); font-family: var(--font-mono); }
.chat-text {
  font-size: 13px; color: var(--los-text-primary); line-height: 1.55;
  padding: 9px 12px;
  background: var(--los-bg-base);
  border-radius: var(--radius-md);
  border-left: 2px solid transparent;
}
.chat-msg:has(.chat-from.agent) .chat-text { border-left-color: var(--los-accent); }
.chat-input-wrap {
  margin-top: 12px;
  display: flex; gap: 6px;
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  background: var(--los-bg-base);
  border: 0.5px solid var(--los-border);
  border-radius: var(--radius-md);
  padding: 9px 13px;
  font-size: 12px;
  color: var(--los-text-primary);
  outline: none;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.chat-input::placeholder { color: var(--los-text-muted); }
.chat-input:focus {
  border-color: var(--los-accent);
  box-shadow: 0 0 0 2px var(--los-accent-glow);
}
.chat-send {
  padding: 6px 16px;
  background: var(--los-accent);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 12px; font-weight: 600;
  transition: background var(--dur), transform var(--dur);
}
.chat-send:hover { background: var(--los-accent-dim); transform: translateY(-1px); }
.chat-send:active { transform: translateY(0); }

/* ── Morning workspace ────────────────────────────────────────── */
.morning {
  max-width: 820px;
  margin: 0 auto;
  padding: 44px 28px 80px;
  color: var(--los-text-primary);
  animation: fadeIn 0.4s var(--ease);
}
.morning-greet .time {
  font-size: 11px;
  color: var(--los-text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.morning-greet .time .weather { color: var(--los-text-secondary); }
.morning-greet h1 {
  font-size: 30px; font-weight: 500;
  margin: 8px 0 36px;
  letter-spacing: -0.015em;
}
.morning-greet h1 span {
  background: linear-gradient(135deg, var(--los-accent), #C084FC);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 600;
}
.bio-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 32px;
}
.bio-card {
  background: var(--los-bg-surface);
  border: 0.5px solid var(--los-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px 12px;
  position: relative;
  overflow: hidden;
  transition: transform var(--dur), border-color var(--dur);
}
.bio-card:hover { transform: translateY(-2px); border-color: var(--los-border-active); }
.bio-card::after {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--los-text-muted);
}
.bio-card.good::after { background: linear-gradient(90deg, var(--los-success), #6EE7B7); box-shadow: 0 0 12px var(--los-success); }
.bio-card.warn::after { background: linear-gradient(90deg, var(--los-warning), #FCD34D); box-shadow: 0 0 12px var(--los-warning); }
.bio-label {
  font-size: 10px; color: var(--los-text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 600;
}
.bio-val { font-size: 26px; font-weight: 600; margin: 4px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.bio-val .unit { font-size: 14px; color: var(--los-text-muted); font-weight: 400; margin-left: 2px; }
.bio-val.good { color: var(--los-success); }
.bio-val.accent {
  background: linear-gradient(135deg, var(--los-accent), #C084FC);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.bio-delta { font-size: 11px; font-family: var(--font-mono); }
.bio-delta.good { color: var(--los-success); }
.bio-delta.muted { color: var(--los-text-muted); }
.bio-sub { font-size: 10px; color: var(--los-text-muted); margin-top: 2px; }
.bio-trend { margin-top: 8px; height: 22px; display: flex; align-items: flex-end; gap: 2px; }
.bio-trend span { flex: 1; background: var(--los-accent); border-radius: 1px; opacity: 0.4; transition: opacity var(--dur); }
.bio-trend span:last-child { opacity: 1; }
.bio-card:hover .bio-trend span { opacity: 0.7; }
.bio-card:hover .bio-trend span:last-child { opacity: 1; }

.section-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--los-text-secondary);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 10px;
}
.section-label::after {
  content: ''; flex: 1; height: 1px;
  background: var(--los-border-subtle);
}
.brief-box {
  background: var(--los-bg-surface);
  border: 0.5px solid var(--los-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  position: relative;
  margin-bottom: 32px;
  overflow: hidden;
}
.brief-box::before {
  content: ''; position: absolute;
  top: 18px; bottom: 18px; left: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--los-accent), transparent);
  border-radius: 0 1px 1px 0;
}
.brief-box::after {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--los-accent-glow), transparent 60%);
  pointer-events: none;
}
.brief-from {
  font-size: 10px;
  color: var(--los-accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
  font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.brief-from::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--los-accent);
  box-shadow: 0 0 8px var(--los-accent);
}
.brief-text { font-size: 14.5px; line-height: 1.7; color: var(--los-text-primary); position: relative; }
.brief-text strong { font-weight: 600; color: var(--los-accent); }
.brief-tags { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.brief-tag {
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.streak-bar { display: flex; gap: 5px; margin-bottom: 32px; }
.streak-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.streak-dot { width: 100%; height: 7px; border-radius: 4px; background: var(--los-bg-hover); transition: transform var(--dur); }
.streak-day:hover .streak-dot { transform: scaleY(1.4); }
.streak-dot.good { background: linear-gradient(90deg, var(--los-success), #6EE7B7); box-shadow: 0 0 8px var(--los-success-soft); }
.streak-dot.warn { background: linear-gradient(90deg, var(--los-warning), #FCD34D); }
.streak-lbl { font-size: 9px; color: var(--los-text-muted); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; }

.morning-goals .section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.section-count {
  font-size: 11px; color: var(--los-text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.morning-goals .goal-row {
  background: var(--los-bg-surface);
  border: 0.5px solid var(--los-border);
  padding: 13px 18px;
  margin-bottom: 5px;
}
.morning-goals .goal-row:hover { background: var(--los-bg-elevated); }
.morning-goals .goal-info { flex: 1; min-width: 0; }
.morning-goals .goal-info .goal-name { font-size: 13.5px; white-space: normal; }
.morning-goals .goal-meta {
  font-size: 10px;
  color: var(--los-text-muted);
  margin-top: 3px;
  font-family: var(--font-mono);
}
.morning-actions { display: flex; gap: 10px; margin-top: 32px; }
.btn {
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--dur), border-color var(--dur), transform var(--dur), box-shadow var(--dur);
  letter-spacing: 0.01em;
}
.btn-primary {
  background: var(--los-accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover { background: var(--los-accent-dim); transform: translateY(-2px); box-shadow: 0 12px 40px rgba(139,92,246,0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: transparent;
  color: var(--los-text-secondary);
  border: 0.5px solid var(--los-border);
}
.btn-ghost:hover { border-color: var(--los-border-active); color: var(--los-text-primary); background: var(--los-accent-soft); }

/* ── Review workspace (flashcard) ─────────────────────────────── */
.review-card {
  padding: 14px;
  display: flex; flex-direction: column; gap: 14px;
  height: 100%;
}
.review-progress { display: flex; gap: 3px; }
.rp-dot {
  flex: 1; height: 5px;
  border-radius: 2px;
  background: var(--los-bg-hover);
}
.rp-dot.done { background: var(--los-accent); box-shadow: 0 0 6px var(--los-accent-soft); }
.rp-dot.current { background: var(--los-accent); opacity: 0.55; animation: pulse 1.4s infinite; }
.rp-dot.fail { background: var(--los-danger); }
.review-q {
  background: var(--los-bg-base);
  border: 0.5px solid var(--los-border-subtle);
  border-radius: var(--radius-md);
  padding: 28px 26px;
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  position: relative;
  overflow: hidden;
}
.review-q::before {
  content: '';
  position: absolute;
  top: -50%; left: -10%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, var(--los-accent-glow), transparent 60%);
  pointer-events: none;
}
.review-meta {
  font-size: 10px;
  color: var(--los-text-muted);
  display: flex; gap: 16px; flex-wrap: wrap;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  position: relative;
}
.review-meta span { display: inline-flex; align-items: center; gap: 5px; }
.review-meta b { color: var(--los-accent); font-weight: 600; }
.review-q-text {
  font-size: 18px;
  font-weight: 500;
  color: var(--los-text-primary);
  line-height: 1.5;
  position: relative;
}
.review-hint {
  font-size: 11px;
  color: var(--los-text-muted);
  margin-top: 14px;
  font-style: italic;
  position: relative;
}
.score-btns { display: flex; gap: 8px; }
.score-btn {
  flex: 1;
  padding: 13px 10px;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--los-border);
  background: var(--los-bg-base);
  text-align: center;
  color: var(--los-text-secondary);
  transition: background var(--dur), border-color var(--dur), transform var(--dur);
}
.score-btn:hover {
  border-color: var(--los-border-active);
  background: var(--los-bg-hover);
  transform: translateY(-1px);
}
.score-btn .num {
  display: block;
  font-size: 20px; font-weight: 600;
  margin-bottom: 2px;
  font-variant-numeric: tabular-nums;
}
.score-btn.again .num { color: var(--los-danger); }
.score-btn.hard  .num { color: var(--los-warning); }
.score-btn.good  .num { color: var(--los-success); }
.score-btn.easy  .num { color: var(--los-info); }
.score-btn .next { font-size: 9px; color: var(--los-text-muted); font-family: var(--font-mono); display: block; margin-top: 3px; }

/* ── Timer panel ──────────────────────────────────────────────── */
.timer-panel {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px;
  padding: 18px 0;
  position: relative;
}
.timer-ring { position: relative; }
.timer-ring svg { display: block; filter: drop-shadow(0 0 16px var(--los-accent-soft)); transition: filter 400ms ease; }
.timer-ring.breathing svg { animation: timerBreath 4s ease-in-out infinite; }
@keyframes timerBreath {
  0%, 100% { filter: drop-shadow(0 0 10px var(--los-accent-soft)); opacity: 0.92; }
  50%      { filter: drop-shadow(0 0 24px var(--los-accent)); opacity: 1; }
}
.timer-time {
  font-family: var(--font-mono);
  font-size: 30px;
  color: var(--los-text-primary);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.timer-label { font-size: 10px; color: var(--los-text-muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.timer-actions { display: flex; gap: 8px; margin-top: 10px; }
.timer-btn {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--los-border);
  color: var(--los-text-secondary);
  transition: all var(--dur);
}
.timer-btn:hover { background: var(--los-bg-hover); color: var(--los-text-primary); border-color: var(--los-border-active); }
.timer-btn.primary { background: var(--los-accent); color: #fff; border-color: var(--los-accent); }
.timer-btn.primary:hover { background: var(--los-accent-dim); }

/* ── Calendar ─────────────────────────────────────────────────── */
.cal-list { display: flex; flex-direction: column; gap: 5px; }
.cal-row {
  display: grid;
  grid-template-columns: 60px 4px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  background: var(--los-bg-base);
  border: 0.5px solid transparent;
  transition: all var(--dur);
}
.cal-row:hover { background: var(--los-bg-hover); border-color: var(--los-border); }
.cal-row.done { opacity: 0.55; }
.cal-time {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--los-text-secondary);
  letter-spacing: 0.02em;
}
.cal-time .end { color: var(--los-text-muted); font-size: 9px; display: block; }
.cal-bar {
  width: 3px; height: 32px; border-radius: 2px;
  box-shadow: 0 0 6px currentColor;
}
.cal-title {
  font-size: 12px;
  color: var(--los-text-primary);
  font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-kind {
  font-size: 9px; text-transform: uppercase;
  color: var(--los-text-muted);
  letter-spacing: 0.06em;
  font-weight: 600;
}
.cal-check { font-size: 14px; color: var(--los-success); }

/* ── Pillars wheel ────────────────────────────────────────────── */
.pillars-wrap { display: flex; flex-direction: column; gap: 14px; height: 100%; }
.pillars-radar { display: flex; justify-content: center; padding: 6px 0; }
.pillars-list { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.pillar-row {
  display: grid;
  grid-template-columns: 60px 1fr 40px;
  gap: 10px;
  align-items: center;
  font-size: 11px;
}
.pillar-lbl { color: var(--los-text-secondary); font-weight: 600; font-size: 10.5px; letter-spacing: 0.02em; }
.pillar-bar-wrap {
  height: 6px;
  background: var(--los-bg-base);
  border-radius: 999px;
  overflow: hidden;
}
.pillar-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--los-accent);
  transition: width 0.8s var(--ease);
}
.pillar-val {
  font-family: var(--font-mono);
  color: var(--los-text-primary);
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 600;
}

/* ── Activity feed ────────────────────────────────────────────── */
.activity-list { display: flex; flex-direction: column; gap: 2px; }
.activity-row {
  display: grid;
  grid-template-columns: 42px 18px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--dur);
}
.activity-row:hover { background: var(--los-bg-base); }
.activity-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--los-text-muted);
  letter-spacing: 0.02em;
}
.activity-icon {
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
}
.activity-icon.accent  { background: var(--los-accent-soft); color: var(--los-accent); }
.activity-icon.success { background: var(--los-success-soft); color: var(--los-success); }
.activity-icon.info    { background: var(--los-info-soft); color: var(--los-info); }
.activity-icon.warning { background: var(--los-warning-soft); color: var(--los-warning); }
.activity-icon.danger  { background: var(--los-danger-soft); color: var(--los-danger); }
.activity-icon.muted   { background: var(--los-bg-hover); color: var(--los-text-muted); }
.activity-text {
  font-size: 11.5px;
  color: var(--los-text-secondary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.activity-text strong { color: var(--los-text-primary); font-weight: 600; }

/* ── Habits grid ──────────────────────────────────────────────── */
.habit-grid { display: flex; flex-direction: column; gap: 6px; }
.habit-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  background: var(--los-bg-base);
  border: 0.5px solid transparent;
  transition: all var(--dur);
}
.habit-row:hover { background: var(--los-bg-hover); border-color: var(--los-border); }
.habit-name { font-size: 11px; color: var(--los-text-primary); font-weight: 500; }
.habit-dots { display: flex; gap: 3px; }
.habit-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--los-bg-hover); }
.habit-dot.on { background: var(--los-accent); box-shadow: 0 0 6px var(--los-accent-soft); }
.habit-best { font-size: 9px; color: var(--los-text-muted); font-family: var(--font-mono); }

/* ── Journal workspace ────────────────────────────────────────── */
.journal {
  max-width: 860px;
  margin: 0 auto;
  padding: 44px 28px 80px;
  animation: fadeIn 0.4s var(--ease);
}
.journal h1 {
  font-size: 28px; font-weight: 500;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.journal h1 span {
  background: linear-gradient(135deg, var(--los-accent), #C084FC);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 600;
}
.journal-sub {
  font-size: 12px;
  color: var(--los-text-muted);
  margin-bottom: 32px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.journal-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}
.journal-panel {
  background: var(--los-bg-surface);
  border: 0.5px solid var(--los-border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
}
.journal-panel .panel-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--los-text-secondary);
  margin-bottom: 14px;
}
.knowledge-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.knowledge-stat { text-align: left; }
.knowledge-stat .n { font-size: 22px; font-weight: 600; color: var(--los-text-primary); font-variant-numeric: tabular-nums; }
.knowledge-stat .n.accent {
  background: linear-gradient(135deg, var(--los-accent), #C084FC);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.knowledge-stat .lbl { font-size: 9px; text-transform: uppercase; color: var(--los-text-muted); letter-spacing: 0.06em; font-weight: 600; }
.domain-list { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; }
.domain-row {
  display: grid;
  grid-template-columns: 1fr 40px 60px;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  font-size: 11px;
  border-bottom: 0.5px solid var(--los-border-subtle);
}
.domain-row:last-child { border-bottom: none; }
.domain-name { color: var(--los-text-primary); font-weight: 500; text-transform: capitalize; }
.domain-count { color: var(--los-text-muted); font-family: var(--font-mono); text-align: right; font-size: 10px; }
.domain-ret {
  font-family: var(--font-mono); text-align: right; font-size: 10px;
  color: var(--los-success);
}
.journal-entries { display: flex; flex-direction: column; gap: 14px; }
.journal-entry {
  background: var(--los-bg-surface);
  border: 0.5px solid var(--los-border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  position: relative;
  transition: border-color var(--dur), transform var(--dur);
}
.journal-entry:hover { border-color: var(--los-border-active); transform: translateX(2px); }
.journal-entry::before {
  content: '';
  position: absolute;
  top: 18px; bottom: 18px; left: 0;
  width: 2px;
  background: var(--los-accent);
  border-radius: 0 1px 1px 0;
  opacity: 0.5;
}
.journal-entry .head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.journal-entry .date {
  font-size: 10px; color: var(--los-text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}
.journal-entry .mood {
  display: flex; gap: 8px;
  font-size: 11px;
}
.mood-chip {
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--los-bg-base);
  color: var(--los-text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mood-chip.good { color: var(--los-success); background: var(--los-success-soft); }
.mood-chip.warn { color: var(--los-warning); background: var(--los-warning-soft); }
.journal-entry .title { font-size: 15px; font-weight: 600; color: var(--los-text-primary); margin-bottom: 6px; letter-spacing: -0.005em; }
.journal-entry .body { font-size: 13px; color: var(--los-text-secondary); line-height: 1.65; }

/* ── Command palette ──────────────────────────────────────────── */
.palette-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 10, 16, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
}
.palette-backdrop.open { opacity: 1; pointer-events: auto; }
.palette {
  width: min(600px, 92vw);
  background: var(--los-bg-elevated);
  border: 0.5px solid var(--los-border-active);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--los-border-subtle);
  overflow: hidden;
  transform: translateY(-12px) scale(0.98);
  transition: transform 0.24s var(--ease);
}
.palette-backdrop.open .palette { transform: translateY(0) scale(1); }
.palette input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 15px;
  padding: 18px 22px;
  color: var(--los-text-primary);
  border-bottom: 0.5px solid var(--los-border-subtle);
}
.palette input::placeholder { color: var(--los-text-muted); }
.palette-list { max-height: 420px; overflow-y: auto; padding: 6px; }
.palette-group {
  font-size: 9px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--los-text-muted);
  padding: 10px 14px 6px;
  font-weight: 700;
}
.palette-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--dur);
  font-size: 13px;
}
.palette-item:hover, .palette-item.active {
  background: var(--los-accent-soft);
  color: var(--los-text-primary);
}
.palette-item .label { flex: 1; color: var(--los-text-primary); font-weight: 500; }
.palette-item .hint {
  font-size: 10px;
  color: var(--los-text-muted);
  font-family: var(--font-mono);
  padding: 2px 7px;
  border: 0.5px solid var(--los-border);
  border-radius: 4px;
}
.palette-foot {
  display: flex; align-items: center; gap: 18px;
  padding: 8px 14px;
  border-top: 0.5px solid var(--los-border-subtle);
  font-size: 10px;
  color: var(--los-text-muted);
  font-family: var(--font-mono);
}
.palette-foot kbd {
  background: var(--los-bg-base);
  padding: 2px 6px;
  border-radius: 3px;
  border: 0.5px solid var(--los-border-subtle);
  margin-right: 4px;
  color: var(--los-text-secondary);
}

/* ── Toast ────────────────────────────────────────────────────── */
.toasts {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 200;
  pointer-events: none;
}
.toast {
  background: var(--los-bg-elevated);
  border: 0.5px solid var(--los-border-active);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 12.5px;
  color: var(--los-text-primary);
  min-width: 240px;
  display: flex; align-items: center; gap: 10px;
  pointer-events: auto;
  animation: toastIn 0.28s var(--ease);
  border-left: 2px solid var(--los-accent);
  cursor: pointer;
  transition: transform 160ms var(--ease), border-color 160ms var(--ease);
}
.toast:hover { transform: translateY(-1px); border-color: var(--los-accent); }
.toast.leaving { animation: toastOut 0.24s var(--ease) forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px); }
}
.toast::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--los-accent);
  box-shadow: 0 0 8px var(--los-accent);
  flex-shrink: 0;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .workspace.ws-dashboard { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, minmax(180px, 1fr)); }
  .workspace.ws-dashboard .tile:nth-child(1) { grid-row: auto; }
}
@media (max-width: 900px) {
  .workspace.ws-focus,
  .workspace.ws-dashboard,
  .workspace.ws-review {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
    overflow-y: auto;
  }
  .workspace.ws-dashboard .tile:nth-child(1),
  .workspace.ws-focus .tile:nth-child(3),
  .workspace.ws-review .tile.span-cols { grid-column: auto; grid-row: auto; }
  .tile { min-height: 280px; }
  .bio-strip { grid-template-columns: repeat(2, 1fr); }
  .journal-grid { grid-template-columns: 1fr; }
}
