﻿/* ═══════════════════════════════════════════════════════
   VietWP — Work Session OS — style.css
   Dark theme design system
═══════════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0f1117;
  --surface:     #1a1d27;
  --surface2:    #222638;
  --border:      #2d3048;
  --border2:     #3a3f5c;
  --primary:     #6366f1;
  --primary-dim: #4f52c8;
  --success:     #22c55e;
  --warning:     #f59e0b;
  --danger:      #ef4444;
  --text:        #f1f5f9;
  --text-muted:  #94a3b8;
  --text-dim:    #64748b;
  --radius:      10px;
  --radius-sm:   6px;
  --radius-lg:   14px;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.3);
  --transition:  0.2s ease;

  /* Type badge colors */
  --type-insight:  #7c3aed;
  --type-decision: #059669;
  --type-change:   #2563eb;
  --type-evidence: #d97706;
  --type-output:   #0891b2;
  --type-learning: #db2777;
  --type-blocker:  #dc2626;
  --type-question: #4b5563;
}

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Screens ─────────────────────────────────────── */
.screen {
  min-height: 100vh;
  animation: fadeIn 0.25s ease;
}
.screen.hidden { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.screen-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}
.screen-inner-wide {
  max-width: 1200px;
}

.screen-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 12px;
}
.screen-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

/* ── HOME SCREEN ─────────────────────────────────── */
.home-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 20px;
  text-align: center;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.logo-icon { font-size: 36px; }
.logo-text {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-tagline {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 400;
}

/* Resume banner */
.resume-banner {
  max-width: 1200px;
  margin: 0 auto 28px;
  padding: 0 24px;
}
.resume-banner-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(99,102,241,0.05));
  border: 1px solid rgba(99,102,241,0.4);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
}
.resume-banner-icon { font-size: 22px; }
.resume-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.resume-banner-text strong { color: var(--text); font-size: 15px; }
.resume-banner-text span { color: var(--text-muted); font-size: 13px; }

/* Home sections */
.home-section {
  max-width: 1200px;
  margin: 0 auto 36px;
  padding: 0 24px;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.section-title { font-size: 18px; font-weight: 700; }
.section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: var(--surface2);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Projects grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.project-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.project-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.project-card-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}
.project-status-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.status-active   { background: rgba(34,197,94,0.15);  color: var(--success); }
.status-paused   { background: rgba(245,158,11,0.15); color: var(--warning); }
.status-archived { background: rgba(100,116,139,0.15); color: var(--text-dim); }
.status-open     { background: rgba(99,102,241,0.15); color: var(--primary); }
.status-closed   { background: rgba(100,116,139,0.15); color: var(--text-dim); }
.status-parked   { background: rgba(245,158,11,0.15); color: var(--warning); }

/* Sessions list */
.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.session-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
}
.session-card:hover {
  border-color: var(--border2);
  transform: translateX(3px);
}
.session-card-body { flex: 1; min-width: 0; }
.session-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.session-card-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}
.session-card-events {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Home CTA */
.home-cta {
  max-width: 1200px;
  margin: 0 auto 40px;
  padding: 0 24px;
  display: flex;
  justify-content: center;
}

/* ── EMPTY STATES ────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 36px 20px;
  color: var(--text-dim);
  font-size: 14px;
  grid-column: 1 / -1;
}
.empty-icon { font-size: 28px; opacity: 0.6; }
.empty-small { color: var(--text-dim); font-size: 13px; font-style: italic; }
.timeline-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 60px 20px;
  color: var(--text-dim);
  text-align: center;
}

/* ── CARDS ───────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}

/* ── BUTTONS ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dim); border-color: var(--primary-dim); }

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.btn-success:hover:not(:disabled) { background: #16a34a; }

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) { background: #dc2626; }

.btn-warning {
  background: var(--warning);
  color: #000;
  border-color: var(--warning);
}
.btn-warning:hover:not(:disabled) { background: #d97706; }

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border2);
}
.btn-outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--surface2); color: var(--text); }

.btn-back {
  padding: 8px 14px;
  font-size: 13px;
}
.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; }

/* ── FORMS ───────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-group:last-child { margin-bottom: 0; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text); }
.form-optional { font-weight: 400; color: var(--text-muted); }
.form-required { color: var(--danger); }

.form-textarea,
.form-select,
.form-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  padding: 10px 12px;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  resize: vertical;
}
.form-textarea:focus,
.form-select:focus,
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.form-textarea::placeholder,
.form-input::placeholder { color: var(--text-dim); }
.form-select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-select option { background: var(--surface); }

.form-actions { margin-top: 24px; }
.form-row { display: flex; gap: 12px; }
.form-group-half { flex: 1; }

/* ── NEW SESSION SCREEN ──────────────────────────── */
.contract-card { max-width: 680px; margin: 0 auto; }
.contract-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  padding: 12px 16px;
  background: rgba(99,102,241,0.08);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ── WORKSPACE SCREEN ────────────────────────────── */
#screen-workspace {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
#screen-workspace.hidden { display: none !important; }

.workspace-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
}
.workspace-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.workspace-session-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}
.workspace-elapsed {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  background: rgba(99,102,241,0.12);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.workspace-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Alert banners */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.alert-banner.hidden { display: none !important; }
.alert-warning { background: rgba(245,158,11,0.15); border-bottom: 1px solid rgba(245,158,11,0.3); color: #fbbf24; }
.alert-danger  { background: rgba(239,68,68,0.15);  border-bottom: 1px solid rgba(239,68,68,0.3);  color: #fca5a5; }
.alert-banner > span { flex: 1; }
.alert-banner-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Workspace columns */
.workspace-columns {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* COMPASS PANEL */
.compass-panel {
  width: 30%;
  min-width: 240px;
  max-width: 320px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 0 0 16px;
  flex-shrink: 0;
}
.compass-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.compass-section:last-child { border-bottom: none; }
.compass-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.compass-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
}
.compass-textarea {
  font-size: 12px;
  resize: none;
  min-height: 72px;
}
.autosave-hint {
  display: block;
  font-size: 11px;
  color: var(--success);
  margin-top: 4px;
  transition: opacity 0.5s;
}
.autosave-hint.hidden { display: none; }

.compass-questions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.compass-questions-list li {
  font-size: 12px;
  color: var(--text-muted);
  padding: 5px 8px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  line-height: 1.4;
}
.compass-empty-small {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
}
.compass-next-action {
  font-size: 13px;
  color: var(--text);
  padding: 8px 10px;
  background: rgba(99,102,241,0.08);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  line-height: 1.45;
}
.compass-park-btn {
  padding: 12px 16px;
  margin-top: auto;
}

/* WORK AREA */
.work-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
.events-timeline {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Event cards */
.event-card {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}
.event-card:hover { border-color: var(--border2); }
.event-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
}
.badge-insight  { background: rgba(124,58,237,0.2);  color: #a78bfa; }
.badge-decision { background: rgba(5,150,105,0.2);   color: #34d399; }
.badge-change   { background: rgba(37,99,235,0.2);   color: #93c5fd; }
.badge-evidence { background: rgba(217,119,6,0.2);   color: #fbbf24; }
.badge-output   { background: rgba(8,145,178,0.2);   color: #67e8f9; }
.badge-learning { background: rgba(219,39,119,0.2);  color: #f9a8d4; }
.badge-blocker  { background: rgba(220,38,38,0.2);   color: #fca5a5; }
.badge-question { background: rgba(75,85,99,0.3);    color: #d1d5db; }

.event-body { flex: 1; min-width: 0; }
.event-content { font-size: 13px; color: var(--text); line-height: 1.55; }
.event-time {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* Capture input area */
.capture-input-area {
  padding: 12px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.capture-input-area.hidden { display: none !important; }
.capture-input-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.capture-input-type-badge {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(99,102,241,0.2);
  color: var(--primary);
}
.capture-textarea { resize: none; }
.capture-input-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Capture bar */
.capture-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.capture-bar-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  white-space: nowrap;
}
.capture-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.capture-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.capture-btn:hover { border-color: currentColor; transform: translateY(-1px); }
.capture-insight:hover  { color: #a78bfa; border-color: #7c3aed; background: rgba(124,58,237,0.1); }
.capture-decision:hover { color: #34d399; border-color: #059669; background: rgba(5,150,105,0.1); }
.capture-change:hover   { color: #93c5fd; border-color: #2563eb; background: rgba(37,99,235,0.1); }
.capture-evidence:hover { color: #fbbf24; border-color: #d97706; background: rgba(217,119,6,0.1); }
.capture-output:hover   { color: #67e8f9; border-color: #0891b2; background: rgba(8,145,178,0.1); }
.capture-learning:hover { color: #f9a8d4; border-color: #db2777; background: rgba(219,39,119,0.1); }
.capture-blocker:hover  { color: #fca5a5; border-color: #dc2626; background: rgba(220,38,38,0.1); }
.capture-question:hover { color: #d1d5db; border-color: #6b7280; background: rgba(75,85,99,0.2); }

/* ── CLOSURE SCREEN ──────────────────────────────── */
#screen-closure .screen-inner-wide {
  padding-top: 24px;
  padding-bottom: 60px;
}
.closure-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.closure-summary { overflow-y: auto; max-height: 80vh; }
.closure-events-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.closure-event-group { margin-bottom: 12px; }
.closure-event-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.closure-event-item {
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 10px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  line-height: 1.45;
}

.closure-form { overflow-y: auto; max-height: 80vh; }
.subsection-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.closure-next-action-section { margin-top: 12px; }

/* ── RESUME SCREEN ───────────────────────────────── */
.handoff-card {
  margin-bottom: 24px;
}
.handoff-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px;
  color: var(--text-muted);
}
.handoff-section {
  margin-bottom: 20px;
}
.handoff-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.handoff-goal {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 4px;
}
.handoff-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.handoff-list li {
  font-size: 13px;
  color: var(--text-muted);
  padding: 7px 12px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  line-height: 1.45;
}
.handoff-next-action {
  padding: 14px 16px;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}

.resume-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── MODAL ───────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.hidden { display: none !important; }
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--surface2); color: var(--text); }
.modal-body { padding: 22px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
}

/* ── TOASTS ──────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  box-shadow: var(--shadow);
  pointer-events: auto;
  animation: toastIn 0.3s ease;
  line-height: 1.4;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast-fadeout { animation: toastOut 0.3s ease forwards; }
@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px); }
}
.toast-success { background: #166534; border: 1px solid #22c55e; }
.toast-error   { background: #7f1d1d; border: 1px solid #ef4444; }
.toast-info    { background: #1e3a5f; border: 1px solid #3b82f6; }
.toast-warning { background: #78350f; border: 1px solid #f59e0b; }

/* ── SPINNER ─────────────────────────────────────── */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SCROLLBAR ───────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 900px) {
  .closure-grid { grid-template-columns: 1fr; }
  .closure-summary { max-height: 40vh; }
}

@media (max-width: 768px) {
  .workspace-columns { flex-direction: column; overflow: visible; height: auto; }
  #screen-workspace { height: auto; overflow: auto; }
  .compass-panel {
    width: 100%;
    max-width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow: visible;
  }
  .work-area { min-height: 60vh; }
  .events-timeline { min-height: 300px; }
  .workspace-session-title { max-width: 160px; font-size: 13px; }
  .projects-grid { grid-template-columns: 1fr; }
  .home-header { padding: 24px 16px 16px; }
  .resume-banner, .home-section, .home-cta { padding-left: 16px; padding-right: 16px; }
  .capture-bar { padding: 10px 12px; }
  .screen-inner-wide { padding: 16px 12px 60px; }
  .form-row { flex-direction: column; }
  .resume-actions { flex-direction: column; }
  .resume-actions .btn { width: 100%; }
}

@media (max-width: 480px) {
  .capture-buttons { gap: 4px; }
  .capture-btn { padding: 5px 8px; font-size: 11px; }
  .workspace-elapsed { display: none; }
  .alert-banner { padding: 8px 12px; }
}
