/* ============================================
   GRBS — Shubham's AI Journey
   Original Color Theme | Mobile-First | 375px+
   ============================================ */

/* === Design Tokens === */
:root {
  --bg: #F7F4EF;
  --bg-card: #FFFFFF;
  --bg-sidebar: #1A1A2E;
  --accent: #E84545;
  --accent-2: #F5A623;
  --accent-hover: #c03636;
  --text: #1C1C1E;
  --text-muted: #6B6B76;
  --text-dim: #9CA3AF;
  --text-sidebar: #E8E8F0;
  --border: #E2DDD6;
  --success: #27AE60;
  --warning: #F59E0B;
  --danger: #EF4444;
  --green: #27AE60;
  --green-dim: rgba(39,174,96,0.15);
  --amber-dim: rgba(245,158,11,0.15);
  --red-dim: rgba(239,68,68,0.15);
  --radius: 8px;
  --shadow: 0 1px 4px rgba(0,0,0,0.04);
  --font-heading: 'Lora', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --transition: 0.2s ease;
  --nav-height: 56px;
  --header-height: 48px;
}

/* === Reset === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-height) + 16px);
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; color: inherit; }
input { font-family: inherit; border: none; outline: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-heading); }

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* === Header === */
.app-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: var(--header-height);
  background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.app-header .logo {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 14px; font-weight: 700;
  color: var(--accent);
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-actions button {
  width: 36px; height: 36px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: background var(--transition);
}
.header-actions button:hover { background: var(--bg); }
.phase-indicator {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-muted); padding: 4px 10px;
  background: var(--bg); border-radius: 20px;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: background var(--transition);
}
.icon-btn:hover { background: var(--bg); }
.sync-indicator {
  font-size: 10px; font-family: var(--font-mono);
  color: var(--success); padding: 2px 8px;
  background: var(--green-dim); border-radius: 10px;
}
.sync-indicator.saving { color: var(--warning); background: var(--amber-dim); }

/* === Tab Content === */
main {
  max-width: 600px; margin: 0 auto;
  padding: 12px 16px; min-height: calc(100vh - var(--header-height) - var(--nav-height));
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.hidden { display: none !important; }

/* === Bottom Nav === */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--bg-card); border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-around;
  z-index: 100; padding: 0 4px;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.05);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 12px; border-radius: var(--radius);
  font-size: 10px; font-family: var(--font-mono);
  color: var(--text-muted); transition: all var(--transition);
  min-width: 56px; min-height: 44px;
  justify-content: center;
}
.nav-item .nav-icon { font-size: 20px; line-height: 1; }
.nav-item.active { color: var(--accent); background: rgba(232,69,69,0.08); }
@media (max-width: 420px) {
  .nav-item .nav-label { display: none; }
  .nav-item { padding: 6px 4px; min-width: 36px; }
}

/* === Cards === */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  transition: all var(--transition);
}
.card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

/* === Progress Ring === */
.progress-ring-wrap {
  position: relative; width: 140px; height: 140px; margin: 0 auto 12px;
}
.progress-ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--border); stroke-width: 8; }
.ring-fill {
  fill: none; stroke: var(--accent); stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.ring-text {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  text-align: center;
}
.ring-text .pct {
  font-family: var(--font-mono); font-size: 28px; font-weight: 700;
  color: var(--accent); line-height: 1;
}
.ring-text .label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* === Readiness Meters === */
.meter-group { margin-bottom: 20px; }
.meter-item { margin-bottom: 14px; }
.meter-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.meter-label { font-size: 13px; font-weight: 500; }
.meter-pct { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.meter-bar {
  height: 8px; background: var(--border); border-radius: 4px; overflow: hidden;
}
.meter-fill {
  height: 100%; border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--accent);
}
.meter-fill.green { background: var(--green); }
.meter-fill.amber { background: var(--warning); }
.meter-fill.red { background: var(--danger); }

/* === Stats Chips === */
.stats-row {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 4px 0; margin-bottom: 20px;
  scrollbar-width: none;
}
.stats-row::-webkit-scrollbar { display: none; }
.stat-chip {
  flex-shrink: 0; padding: 8px 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); text-align: center;
  min-width: 90px;
}
.stat-chip .stat-val {
  font-family: var(--font-mono); font-size: 18px; font-weight: 700;
  color: var(--accent);
}
.stat-chip .stat-lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* === Today's Focus === */
.focus-panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 3px solid var(--accent-2);
  border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 20px; box-shadow: var(--shadow);
}
.focus-title {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--accent-2); text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 10px;
}
.focus-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.focus-item:last-child { border-bottom: none; }
.focus-item .fi-name { font-size: 13px; flex: 1; }
.focus-item .fi-btn {
  padding: 4px 10px; border-radius: 6px; font-size: 11px;
  font-family: var(--font-mono); font-weight: 600;
  background: var(--green-dim); color: var(--green);
  transition: all var(--transition);
}
.focus-item .fi-btn:hover { background: var(--green); color: #fff; }

/* === Phase Cards (Roadmap) === */
.phase-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 8px;
  overflow: hidden;
}
.phase-card.locked { opacity: 0.5; }
.phase-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; cursor: pointer;
  transition: background var(--transition);
  min-height: 48px;
}
.phase-header:hover { background: var(--bg); }
.phase-header .ph-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.phase-header .ph-emoji { font-size: 22px; flex-shrink: 0; }
.phase-header .ph-info { min-width: 0; }
.phase-header .ph-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phase-header .ph-meta { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.phase-header .ph-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.phase-header .ph-status {
  font-size: 10px; font-family: var(--font-mono); font-weight: 700;
  padding: 3px 8px; border-radius: 10px; text-transform: uppercase;
}
.status-active { background: var(--green-dim); color: var(--green); }
.status-progress { background: var(--amber-dim); color: var(--warning); }
.status-done { background: rgba(232,69,69,0.1); color: var(--accent); }
.status-locked { background: var(--red-dim); color: var(--danger); }
.phase-header .ph-arrow { font-size: 12px; color: var(--text-muted); transition: transform 0.3s; }
.phase-card.open .ph-arrow { transform: rotate(180deg); }
.phase-body {
  display: none; padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}
.phase-card.open .phase-body { display: block; }

/* Mini ring inside phase card */
.mini-ring { position: relative; width: 36px; height: 36px; flex-shrink: 0; }
.mini-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mini-ring .ring-bg { stroke-width: 4; }
.mini-ring .ring-fill { stroke-width: 4; transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1); }
.mini-ring .mini-pct {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-family: var(--font-mono); font-size: 8px; font-weight: 700; color: var(--text-muted);
}

/* === Topics List === */
.topic-group-title {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.05em; padding: 10px 0 6px;
  border-bottom: 1px solid var(--border); margin-bottom: 4px;
}
.topic-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0; min-height: 44px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.topic-row:last-child { border-bottom: none; }
.topic-check { flex-shrink: 0; margin-top: 2px; }
.topic-check input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer;
}
.topic-info { flex: 1; min-width: 0; }
.topic-name { font-size: 13px; font-weight: 500; }
.topic-row.done .topic-name { text-decoration: line-through; color: var(--text-muted); }

/* === Resources Section === */
.resources-section { margin-top: 12px; }
.resources-section h4 {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: var(--accent); text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 8px;
}
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.res-item {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; background: var(--bg);
  border-radius: var(--radius); font-size: 12px;
  border: 1px solid var(--border); transition: all var(--transition);
}
.res-item:hover { border-color: var(--accent); }
.res-item .res-icon { font-size: 14px; flex-shrink: 0; }
.res-item .res-text { font-size: 11px; line-height: 1.3; }

/* === Milestones === */
.milestones { margin-top: 12px; }
.milestones h4 {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: var(--accent-2); text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 8px;
}
.ms-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; font-size: 13px;
}
.ms-item input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--accent-2); cursor: pointer;
}
.ms-item.done .ms-text { text-decoration: line-through; color: var(--text-muted); }

/* === Projects Tab === */
.filter-bar {
  display: flex; gap: 6px; overflow-x: auto; padding: 4px 0;
  margin-bottom: 16px; scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-btn {
  flex-shrink: 0; padding: 8px 14px; border-radius: 20px;
  font-size: 12px; font-family: var(--font-mono); font-weight: 600;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-muted); transition: all var(--transition);
  min-height: 44px;
}
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.project-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
  margin-bottom: 8px;
  transition: all var(--transition);
}
.project-card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.pc-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.pc-title { font-size: 14px; font-weight: 600; flex: 1; }
.pc-phase { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }
.pc-stars { font-size: 12px; color: var(--accent-2); margin-bottom: 6px; }
.pc-status {
  display: inline-block; padding: 3px 10px; border-radius: 10px;
  font-size: 10px; font-family: var(--font-mono); font-weight: 700;
}
.pc-status.not-started { background: var(--border); color: var(--text-muted); }
.pc-status.in-progress { background: var(--amber-dim); color: var(--warning); }
.pc-status.done { background: var(--green-dim); color: var(--green); }
.pc-status.deployed { background: rgba(232,69,69,0.1); color: var(--accent); }
.pc-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.pc-actions button, .pc-actions select {
  padding: 4px 10px; border-radius: 6px; font-size: 11px;
  font-family: var(--font-mono); background: var(--bg);
  border: 1px solid var(--border); color: var(--text-muted);
  min-height: 32px;
}
.pc-actions select { cursor: pointer; }

/* === Progress Tab === */
.chart-container {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
}
.chart-title {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 12px;
}
.chart-canvas { width: 100% !important; max-height: 300px; }
.heatmap-cell {
  aspect-ratio: 1; border-radius: 2px;
  background: var(--border); min-width: 0;
  position: relative;
}
.heatmap-cell.l1 { background: rgba(39,174,96,0.2); }
.heatmap-cell.l2 { background: rgba(39,174,96,0.4); }
.heatmap-cell.l3 { background: rgba(39,174,96,0.6); }
.heatmap-cell.l4 { background: var(--green); }

/* === Goals Tab === */
.career-path {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
}
.cp-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cp-emoji { font-size: 24px; }
.cp-title { font-size: 16px; font-weight: 700; }
.cp-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.cp-timeline { padding-left: 20px; border-left: 2px solid var(--border); }
.cp-step {
  position: relative; padding: 8px 0 16px 16px;
}
.cp-step::before {
  content: ''; position: absolute; left: -7px; top: 12px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
}
.cp-step.done::before { background: var(--green); }
.cp-step .step-title { font-size: 13px; font-weight: 600; }
.cp-step .step-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* === Toast Notifications === */
#toast-container {
  position: fixed; bottom: calc(var(--nav-height) + 12px);
  left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column;
  align-items: center; gap: 8px; pointer-events: none;
}
.toast {
  padding: 10px 20px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  background: var(--bg-card); border: 1px solid var(--border);
  box-shadow: var(--shadow); pointer-events: auto;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  white-space: nowrap;
}
.toast.toast-success { border-color: var(--green); color: var(--green); }
.toast.toast-warning { border-color: var(--warning); color: var(--warning); }
.toast.toast-error { border-color: var(--danger); color: var(--danger); }
.toast.toast-info { border-color: var(--accent); color: var(--accent); }
.toast.toast-gold { border-color: var(--accent-2); color: var(--accent-2); background: rgba(245,166,35,0.1); }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }

/* === Search Container === */
.search-container {
  max-width: 600px; margin: 0 auto;
  padding: 0 16px; position: relative;
}
.search-input {
  width: 100%; padding: 8px 14px; font-size: 14px;
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 4px;
}
.search-input::placeholder { color: var(--text-muted); }
.search-results {
  position: absolute; left: 16px; right: 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); max-height: 300px;
  overflow-y: auto; z-index: 150; box-shadow: var(--shadow);
}
.search-result {
  padding: 10px 16px; border-top: 1px solid var(--border);
  font-size: 13px; cursor: pointer; transition: background var(--transition);
}
.search-result:hover { background: var(--bg); }
.search-result .sr-phase {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--accent); display: block; margin-bottom: 2px;
}

/* === Username Modal === */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-card {
  background: var(--bg-card); border-radius: 12px;
  padding: 32px; max-width: 400px; width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  text-align: center;
}
.modal-card h2 {
  font-family: var(--font-heading); font-size: 24px;
  margin-bottom: 8px; color: var(--text);
}
.modal-sub {
  font-size: 14px; color: var(--text-muted);
  margin-bottom: 20px;
}
.modal-card input[type="text"] {
  width: 100%; padding: 12px 16px; font-size: 16px;
  border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text);
  margin-bottom: 12px; transition: border-color var(--transition);
  text-align: center;
}
.modal-card input[type="text"]:focus {
  border-color: var(--accent); outline: none;
}
.modal-card input[type="text"]::placeholder { color: var(--text-muted); }
.modal-error {
  color: var(--danger); font-size: 12px; font-family: var(--font-mono);
  min-height: 18px; margin-bottom: 8px;
}
.modal-card .btn-primary {
  width: 100%; padding: 12px 24px; font-size: 16px; font-weight: 600;
  background: var(--accent); color: #fff; border-radius: var(--radius);
  border: none; cursor: pointer; transition: background var(--transition);
  font-family: var(--font-body);
}
.modal-card .btn-primary:hover { background: var(--accent-hover); }

/* === Section Titles === */
.section-title {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 10px;
}

/* === Toolbar (Export/Import) === */
.toolbar {
  display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap;
}
.toolbar button {
  padding: 6px 14px; border-radius: var(--radius);
  font-size: 12px; font-family: var(--font-mono); font-weight: 600;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-muted); transition: all var(--transition);
  min-height: 36px;
}
.toolbar button:hover { border-color: var(--accent); color: var(--accent); }

/* === Responsive (320px - 374px: Extra Small) === */
@media (max-width: 374px) {
  main { padding: 8px 10px; }
  .dash-hero { padding: 14px 12px; }
  .dash-greeting h2 { font-size: 16px; }
  .stat-chip-sm { padding: 6px 10px; min-width: 100px; }
  .stat-chip-sm .stat-val { font-size: 13px; }
  .phase-header .ph-title { font-size: 12px; }
  .phase-header .ph-meta { font-size: 10px; }
  .chart-container { padding: 10px; }
  .filter-btn { padding: 6px 10px; font-size: 11px; min-height: 40px; }
  .career-path { padding: 10px; }
  .company-card { padding: 10px; }
  .res-grid { grid-template-columns: 1fr; }
  .modal-card { padding: 20px; }
}

/* === Responsive (375px - 429px: Small) === */
@media (min-width: 375px) and (max-width: 429px) {
  main { padding: 10px 12px; }
  .res-grid { grid-template-columns: 1fr; }
}

/* === Responsive (430px - 479px: Medium) === */
@media (min-width: 430px) and (max-width: 479px) {
  main { padding: 14px 16px; }
  .res-grid { grid-template-columns: 1fr 1fr; }
}

/* === Responsive (480px - 599px: Large) === */
@media (min-width: 480px) and (max-width: 599px) {
  main { padding: 16px 20px; }
  .dash-greeting h2 { font-size: 22px; }
  .readiness-grid { grid-template-columns: 1fr 1fr; }
}

/* === Responsive (600px+: Tablet+) === */
@media (min-width: 600px) {
  main { padding: 20px 24px; max-width: 700px; }
  .dash-hero-row { gap: 32px; }
  .dash-stats-col { flex-direction: row; gap: 10px; }
  .res-grid { grid-template-columns: 1fr 1fr; }
  .readiness-grid { grid-template-columns: 1fr 1fr; }
  .stat-chip-sm { min-width: 140px; }
}

/* === Responsive (768px+: Tablet Landscape) === */
@media (min-width: 768px) {
  main { padding: 24px 32px; max-width: 800px; }
  .dash-greeting h2 { font-size: 24px; }
  .readiness-grid { grid-template-columns: 1fr 1fr 1fr; }
  .bottom-nav { padding: 0 16px; }
  .nav-item { min-width: 64px; }
}

/* === Responsive (1024px+: Desktop) === */
@media (min-width: 1024px) {
  main { padding: 32px 48px; max-width: 900px; }
  .chart-canvas { max-height: 350px; }
  .readiness-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* === Responsive (1280px+: Large Desktop) === */
@media (min-width: 1280px) {
  main { max-width: 1000px; padding: 32px 64px; }
}

/* === Landscape mode on phones === */
@media (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
  .bottom-nav { height: 44px; }
  .nav-item { padding: 4px 8px; min-height: 36px; }
  .nav-item .nav-label { display: none; }
  main { padding-bottom: calc(44px + 8px); }
  .dash-hero { padding: 12px 16px; margin-bottom: 8px; }
  .dash-hero-row { gap: 16px; }
  .dash-hero-row .progress-ring-wrap { width: 80px; height: 80px; }
  .chart-container { padding: 10px; margin-bottom: 8px; }
}

/* === Print styles === */
@media print {
  .bottom-nav, .app-header, .command-palette-overlay, .toast, .update-banner, .offline-banner { display: none !important; }
  main { padding: 0; max-width: 100%; }
  body { padding-bottom: 0; }
  .phase-body { display: block !important; }
  .phase-card { break-inside: avoid; }
}

/* === Update Banner === */
.update-banner {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 610; padding: 10px 16px;
  background: var(--accent); color: #fff;
  text-align: center; font-size: 13px;
  font-weight: 600; font-family: var(--font-mono);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  animation: slideDown 0.3s ease;
  box-shadow: 0 2px 12px rgba(232,69,69,0.3);
}
.update-banner span { font-family: var(--font-mono); font-size: 12px; }

/* === Offline Banner === */
.offline-banner {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 600; padding: 8px 16px;
  background: var(--warning); color: #fff;
  text-align: center; font-size: 13px;
  font-weight: 600; font-family: var(--font-mono);
  animation: slideDown 0.3s ease;
}
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }

/* === Study Timer === */
.timer-quick-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: #0A0A0A; color: #E0E0E0;
  border-radius: 12px; padding: 14px 16px;
  margin-bottom: 20px; cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid #1A1A1A;
}
.timer-quick-bar:hover { background: #111; border-color: #333; transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,0,0,0.4); }
.tqb-left { display: flex; align-items: center; gap: 12px; }
.tqb-icon { color: #E84545; display: flex; align-items: center; }
.tqb-title { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: #FFFFFF; }
.tqb-sub { font-size: 11px; color: #888; font-family: var(--font-mono); }
.tqb-right { display: flex; align-items: center; gap: 14px; }
.tqb-stat { text-align: center; }
.tqb-stat-val { font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: #E84545; display: block; }
.tqb-stat-lbl { font-size: 9px; color: #666; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; }
.tqb-arrow { color: #444; }

/* Timer Full-Screen Overlay (Horizontal) */
.timer-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: #000000; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.timer-overlay.open { opacity: 1; pointer-events: auto; }
.timer-h-bar {
  width: 100%; max-width: 700px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 32px; gap: 24px;
}
.timer-h-left { flex-shrink: 0; cursor: pointer; -webkit-user-select: none; user-select: none; }
.timer-h-digits {
  font-family: 'Space Mono', monospace;
  font-size: 48px; font-weight: 700;
  color: #FFFFFF; letter-spacing: 2px; line-height: 1;
}
.timer-h-hint {
  font-family: var(--font-mono); font-size: 9px;
  color: #333; text-transform: uppercase;
  letter-spacing: 0.08em; margin-top: 6px;
}
.timer-h-controls {
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.timer-h-right { flex-shrink: 0; text-align: right; }
.timer-h-stats {
  font-family: var(--font-mono); font-size: 11px;
  color: #555; margin-bottom: 2px;
}
.timer-h-total { font-size: 13px; font-weight: 700; color: #E84545; }
.timer-btn {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 2px solid #222;
  background: #111; color: #888;
  cursor: pointer; transition: all 0.2s ease;
}
.timer-btn:hover { border-color: #444; color: #FFF; background: #1A1A1A; }
.timer-btn-start {
  width: 64px; height: 64px;
  border-color: #E84545; color: #E84545;
}
.timer-btn-start:hover { background: #E84545; color: #FFF; }
.timer-btn-start.running { background: #E84545; color: #FFF; border-color: #E84545; }
.timer-btn-reset {
  width: 44px; height: 44px;
}
.timer-btn-close {
  width: 44px; height: 44px;
}
.timer-progress-ring { width: 36px; height: 36px; }
.timer-progress-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring-bg { fill: none; stroke: #1A1A1A; stroke-width: 3; }
.timer-ring-fill { fill: none; stroke: #E84545; stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }



/* Session History Panel */
.timer-history-panel {
  width: 100%; margin-top: 12px;
  background: #0A0A0A; border-radius: 8px;
  border: 1px solid #1A1A1A; overflow: hidden;
}
.history-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid #1A1A1A;
}
.history-title {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: #555; text-transform: uppercase; letter-spacing: 0.05em;
}
.history-count {
  font-family: var(--font-mono); font-size: 10px; color: #444;
}
.history-list {
  max-height: 240px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: #222 #0A0A0A;
}
.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-track { background: #0A0A0A; }
.history-list::-webkit-scrollbar-thumb { background: #222; border-radius: 2px; }
.history-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid #111;
  transition: background 0.15s;
}
.history-item:last-child { border-bottom: none; }
.history-item:hover { background: #111; }
.history-item-date {
  font-family: var(--font-mono); font-size: 12px;
  font-weight: 600; color: #CCC;
}
.history-item-time {
  font-family: var(--font-mono); font-size: 10px;
  color: #555; margin-top: 1px;
}
.history-item-duration {
  font-family: var(--font-mono); font-size: 13px;
  font-weight: 700; color: #E84545; text-align: right;
}
.history-item-topic {
  font-family: var(--font-mono); font-size: 9px;
  color: #555; text-align: right; margin-top: 1px;
}
.history-empty {
  padding: 24px 16px; text-align: center;
  font-family: var(--font-mono); font-size: 11px; color: #444;
}
.history-actions {
  display: flex; align-items: center; gap: 10px;
}
.history-clear-btn {
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  color: #666; background: none; border: 1px solid #222;
  border-radius: 4px; padding: 3px 8px; cursor: pointer;
  transition: all 0.15s; text-transform: uppercase; letter-spacing: 0.03em;
}
.history-clear-btn:hover { color: #E84545; border-color: #E84545; }
.history-item-delete {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 4px;
  background: none; border: none; color: #333;
  cursor: pointer; transition: all 0.15s; flex-shrink: 0;
  opacity: 0;
}
.history-item:hover .history-item-delete { opacity: 1; }
.history-item-delete:hover { color: #E84545; background: rgba(232,69,69,0.1); }
@media (hover: none) and (pointer: coarse) {
  .history-item-delete { opacity: 0.6; }
}

/* Timer responsive */
@media (max-width: 480px) {
  .timer-h-bar { padding: 20px 16px; gap: 16px; }
  .timer-h-digits { font-size: 32px; }
  .timer-btn-start { width: 52px; height: 52px; }
  .timer-btn-reset, .timer-btn-close { width: 40px; height: 40px; }
  .timer-quick-bar { padding: 12px 14px; }
}
@media (min-width: 768px) {
  .timer-h-digits { font-size: 56px; }
  .timer-h-bar { padding: 32px 48px; }
}

/* === Utility === */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mt-12 { margin-top: 12px; }

/* === Command Palette === */
.command-palette-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 1000;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 20vh; opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.command-palette-overlay.open { opacity: 1; pointer-events: auto; }
.command-palette {
  width: 90%; max-width: 500px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2); overflow: hidden;
  transform: translateY(-20px) scale(0.95);
  transition: transform 0.2s ease;
}
.command-palette-overlay.open .command-palette { transform: translateY(0) scale(1); }
.cp-header {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.cp-header input {
  flex: 1; padding: 8px 0; font-size: 16px; font-family: var(--font-body);
  background: transparent; color: var(--text); border: none; outline: none;
}
.cp-header .cp-icon-search { font-size: 18px; color: var(--text-muted); }
.cp-results { max-height: 320px; overflow-y: auto; }
.cp-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; cursor: pointer; transition: background 0.15s;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.cp-item:hover, .cp-item:focus { background: var(--bg); outline: none; }
.cp-icon { font-size: 18px; flex-shrink: 0; }
.cp-label { font-size: 13px; flex: 1; }
.cp-shortcut { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); background: var(--bg); padding: 2px 6px; border-radius: 4px; }
.cp-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }
.cp-hint { padding: 8px 16px; border-top: 1px solid var(--border); font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); text-align: center; }

/* === Phase Transitions === */
.phase-body {
  animation: phaseSlideDown 0.3s ease;
  overflow: hidden;
}
@keyframes phaseSlideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 2000px; }
}
.phase-card { transition: all 0.3s ease; }
.phase-card:hover:not(.locked) { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

/* === Achievement Badges === */
.achievement-badge { transition: transform 0.2s ease; }
.achievement-badge.earned:hover { transform: scale(1.05); }
.achievement-badge.locked:hover { opacity: 0.7; }

/* === Resource Rating Stars === */
.resource-rating .rating-star { transition: color 0.15s, transform 0.15s; }
.resource-rating .rating-star:hover { transform: scale(1.2); }
.resource-stars:hover { opacity: 0.8; }

/* === Dependency Graph === */
.dep-graph-container {
  position: relative; padding: 16px 0; overflow-x: auto;
}
.dep-graph-node {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px; border-radius: 20px; font-size: 11px;
  font-family: var(--font-mono); font-weight: 600;
  border: 1px solid var(--border); background: var(--bg-card);
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.dep-graph-node:hover { border-color: var(--accent); }
.dep-graph-node.completed { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.dep-graph-node.active { background: var(--amber-dim); border-color: var(--warning); color: var(--warning); }
.dep-graph-node.locked { opacity: 0.4; }

/* === Touch Gestures === */
@media (hover: none) and (pointer: coarse) {
  .nav-item { min-height: 48px; min-width: 60px; }
  .filter-btn { min-height: 44px; padding: 10px 16px; }
  .topic-row { min-height: 48px; padding: 10px 0; }
  .project-card { padding: 16px; }
  .phase-header { min-height: 60px; }
  .res-item { padding: 10px 12px; }
  .focus-item { padding: 10px 0; }
  .ms-item { padding: 8px 0; }
  .cp-item { padding: 14px 16px; }
  button, a { min-height: 44px; }
}

/* === Swipe Hint Animation === */
@keyframes swipeHint {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-10px); }
}

/* === Confetti Pulse on Milestone === */
@keyframes milestonePulse {
  0% { box-shadow: 0 0 0 0 rgba(39,174,96,0.4); }
  70% { box-shadow: 0 0 0 10px rgba(39,174,96,0); }
  100% { box-shadow: 0 0 0 0 rgba(39,174,96,0); }
}
.milestone-complete { animation: milestonePulse 1s ease; }

/* === Dashboard Grouped Sections === */
.dash-hero {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
  margin-bottom: 16px; box-shadow: var(--shadow);
}
.dash-greeting { text-align: center; margin-bottom: 16px; }
.dash-greeting h2 { font-size: 20px; margin-bottom: 2px; }
.dash-hero-row {
  display: flex; align-items: center; justify-content: center;
  gap: 24px; flex-wrap: wrap;
}
.dash-hero-row .progress-ring-wrap {
  margin: 0; width: 110px; height: 110px; flex-shrink: 0;
}
.dash-hero-row .progress-ring-wrap .pct { font-size: 22px; }
.dash-stats-col {
  display: flex; flex-direction: column; gap: 8px;
}
.stat-chip-sm {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius);
  min-width: 120px;
}
.stat-chip-sm .stat-val {
  font-family: var(--font-mono); font-size: 15px;
  font-weight: 700; color: var(--accent);
}
.stat-chip-sm .stat-lbl {
  font-size: 11px; color: var(--text-muted);
}

/* Section cards */
.dash-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 12px;
  overflow: hidden; transition: border-color var(--transition);
}
.dash-section:hover { border-color: rgba(232,69,69,0.3); }
.dash-section-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.dash-section-icon {
  font-size: 16px; color: var(--accent); flex-shrink: 0;
}
.dash-section-title {
  font-family: var(--font-mono); font-size: 12px;
  font-weight: 700; color: var(--text);
  text-transform: uppercase; letter-spacing: 0.05em;
  flex: 1;
}
.dash-section-badge {
  font-family: var(--font-mono); font-size: 9px;
  font-weight: 700; padding: 3px 8px;
  border-radius: 10px; text-transform: uppercase;
  background: var(--amber-dim); color: var(--warning);
}
.dash-section-body { padding: 12px 16px; }

/* Readiness grid (2-col on desktop) */
.readiness-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 10px;
}
.readiness-item { min-width: 0; }
.readiness-item .meter-item { margin-bottom: 0; }
.readiness-item .meter-header { margin-bottom: 4px; }
.readiness-item .meter-label { font-size: 12px; }
.readiness-item .meter-pct { font-size: 11px; }
.readiness-item .meter-bar { height: 6px; }

/* Insight blocks */
.dash-insight-block {
  padding: 4px 0;
}
.dash-insight-block + .dash-insight-block {
  border-top: 1px solid var(--border);
  margin-top: 8px; padding-top: 12px;
}

/* Data tools row */
.dash-data-tools {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.dash-data-btn {
  flex: 1; min-width: 120px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 14px; border-radius: var(--radius);
  font-size: 12px; font-family: var(--font-mono); font-weight: 600;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-muted); transition: all var(--transition);
  min-height: 44px;
}
.dash-data-btn:hover {
  border-color: var(--accent); color: var(--accent);
  background: rgba(232,69,69,0.04);
}

/* Responsive for dashboard sections */
@media (min-width: 480px) {
  .readiness-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 600px) {
  .dash-hero-row { gap: 32px; }
  .dash-stats-col { flex-direction: row; gap: 10px; }
}

/* === Recommendation Items === */
.rec-item:hover { border-color: var(--accent) !important; transform: translateX(4px); }

/* === DYNAMIC ANIMATION SYSTEM === */
/* Scroll-reveal entrance animations */
.anim-reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: none;
}
.anim-reveal.anim-visible {
  animation: animRevealIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes animRevealIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Slide from left */
.anim-slide-left.anim-visible {
  animation: animSlideLeft 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes animSlideLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Slide from right */
.anim-slide-right.anim-visible {
  animation: animSlideRight 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes animSlideRight {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Scale pop */
.anim-pop.anim-visible {
  animation: animPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes animPop {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* Fade in only */
.anim-fade.anim-visible {
  animation: animFade 0.5s ease forwards;
}
@keyframes animFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Ring pulse on reveal */
.ring-animate .ring-fill {
  animation: ringPulse 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes ringPulse {
  0% { filter: drop-shadow(0 0 0px var(--accent)); }
  50% { filter: drop-shadow(0 0 8px var(--accent)); }
  100% { filter: drop-shadow(0 0 0px var(--accent)); }
}

/* Stagger children helper: children get increasing delays */
.anim-stagger > *:nth-child(1) { animation-delay: 0ms; }
.anim-stagger > *:nth-child(2) { animation-delay: 60ms; }
.anim-stagger > *:nth-child(3) { animation-delay: 120ms; }
.anim-stagger > *:nth-child(4) { animation-delay: 180ms; }
.anim-stagger > *:nth-child(5) { animation-delay: 240ms; }
.anim-stagger > *:nth-child(6) { animation-delay: 300ms; }
.anim-stagger > *:nth-child(7) { animation-delay: 360ms; }
.anim-stagger > *:nth-child(8) { animation-delay: 420ms; }

/* Hover micro-interactions */
.hover-lift {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease;
}
.hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.hover-glow {
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.hover-glow:hover {
  box-shadow: 0 0 0 3px rgba(232,69,69,0.12);
  border-color: var(--accent);
}

.hover-scale {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hover-scale:hover {
  transform: scale(1.04);
}

.hover-scale:active {
  transform: scale(0.97);
}

/* Button press effect */
.btn-press {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-press:active {
  transform: scale(0.95);
  box-shadow: none;
}

/* Ripple effect on nav items */
.nav-item {
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-item:active {
  transform: scale(0.92);
}

/* Card entrance on tab switch */
.tab-content.active .dash-hero { animation: animRevealIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.05s forwards; opacity: 0; }
.tab-content.active .dash-section { animation: animRevealIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards; opacity: 0; }
.tab-content.active .dash-section:nth-child(2) { animation-delay: 0.1s; }
.tab-content.active .dash-section:nth-child(3) { animation-delay: 0.15s; }
.tab-content.active .dash-section:nth-child(4) { animation-delay: 0.2s; }
.tab-content.active .dash-section:nth-child(5) { animation-delay: 0.25s; }
.tab-content.active .dash-section:nth-child(6) { animation-delay: 0.3s; }
.tab-content.active .dash-section:nth-child(7) { animation-delay: 0.35s; }
.tab-content.active .dash-section:nth-child(8) { animation-delay: 0.4s; }
.tab-content.active #timer-button-container { animation: animRevealIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.08s forwards; opacity: 0; }

/* Phase card stagger on roadmap */
.tab-content.active .phase-card { animation: animRevealIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards; opacity: 0; }
.tab-content.active .phase-card:nth-child(1) { animation-delay: 0.05s; }
.tab-content.active .phase-card:nth-child(2) { animation-delay: 0.1s; }
.tab-content.active .phase-card:nth-child(3) { animation-delay: 0.15s; }
.tab-content.active .phase-card:nth-child(4) { animation-delay: 0.2s; }
.tab-content.active .phase-card:nth-child(5) { animation-delay: 0.25s; }
.tab-content.active .phase-card:nth-child(6) { animation-delay: 0.3s; }
.tab-content.active .phase-card:nth-child(7) { animation-delay: 0.35s; }
.tab-content.active .phase-card:nth-child(8) { animation-delay: 0.4s; }
.tab-content.active .phase-card:nth-child(9) { animation-delay: 0.45s; }
.tab-content.active .phase-card:nth-child(10) { animation-delay: 0.5s; }
.tab-content.active .phase-card:nth-child(n+11) { animation-delay: 0.55s; }
.tab-content.active .dep-graph-container { animation: animRevealIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.02s forwards; opacity: 0; }

/* Project card stagger */
.tab-content.active .project-card { animation: animRevealIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards; opacity: 0; }
.tab-content.active .project-card:nth-child(1) { animation-delay: 0.05s; }
.tab-content.active .project-card:nth-child(2) { animation-delay: 0.1s; }
.tab-content.active .project-card:nth-child(3) { animation-delay: 0.15s; }
.tab-content.active .project-card:nth-child(4) { animation-delay: 0.2s; }
.tab-content.active .project-card:nth-child(5) { animation-delay: 0.25s; }
.tab-content.active .project-card:nth-child(6) { animation-delay: 0.3s; }
.tab-content.active .project-card:nth-child(7) { animation-delay: 0.35s; }
.tab-content.active .project-card:nth-child(8) { animation-delay: 0.4s; }
.tab-content.active .project-card:nth-child(9) { animation-delay: 0.45s; }
.tab-content.active .project-card:nth-child(10) { animation-delay: 0.5s; }
.tab-content.active .project-card:nth-child(n+11) { animation-delay: 0.55s; }
.tab-content.active .filter-bar { animation: animRevealIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) 0.02s forwards; opacity: 0; }

/* Progress tab chart stagger */
.tab-content.active .chart-container { animation: animRevealIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards; opacity: 0; }
.tab-content.active .chart-container:nth-child(1) { animation-delay: 0.05s; }
.tab-content.active .chart-container:nth-child(2) { animation-delay: 0.1s; }
.tab-content.active .chart-container:nth-child(3) { animation-delay: 0.15s; }
.tab-content.active .chart-container:nth-child(4) { animation-delay: 0.2s; }
.tab-content.active .chart-container:nth-child(5) { animation-delay: 0.25s; }
.tab-content.active .chart-container:nth-child(6) { animation-delay: 0.3s; }
.tab-content.active .chart-container:nth-child(7) { animation-delay: 0.35s; }
.tab-content.active .chart-container:nth-child(8) { animation-delay: 0.4s; }
.tab-content.active .chart-container:nth-child(9) { animation-delay: 0.45s; }
.tab-content.active .chart-container:nth-child(10) { animation-delay: 0.5s; }

/* Goals tab career-path stagger */
.tab-content.active .career-path { animation: animRevealIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards; opacity: 0; }
.tab-content.active .career-path:nth-child(1) { animation-delay: 0.05s; }
.tab-content.active .career-path:nth-child(2) { animation-delay: 0.1s; }
.tab-content.active .career-path:nth-child(3) { animation-delay: 0.15s; }
.tab-content.active .career-path:nth-child(4) { animation-delay: 0.2s; }
.tab-content.active .career-path:nth-child(5) { animation-delay: 0.25s; }
.tab-content.active .career-path:nth-child(6) { animation-delay: 0.3s; }
.tab-content.active .career-path:nth-child(7) { animation-delay: 0.35s; }
.tab-content.active .career-path:nth-child(8) { animation-delay: 0.4s; }
.tab-content.active .career-path:nth-child(9) { animation-delay: 0.45s; }
.tab-content.active .career-path:nth-child(10) { animation-delay: 0.5s; }
.tab-content.active .career-path:nth-child(n+11) { animation-delay: 0.55s; }

/* Timeline step animations */
.cp-step {
  transition: transform 0.2s ease;
}
.cp-step:hover {
  transform: translateX(4px);
}
.cp-step::before {
  transition: transform 0.2s ease, background 0.2s ease;
}
.cp-step:hover::before {
  transform: scale(1.3);
}

/* Milestone checkbox animation */
.ms-item input[type="checkbox"] {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ms-item input[type="checkbox"]:checked {
  transform: scale(1.15);
}

/* Topic row hover */
.topic-row {
  transition: background 0.15s ease, transform 0.15s ease;
  border-radius: 4px;
}
.topic-row:hover:not(.done) {
  background: rgba(232,69,69,0.03);
  transform: translateX(2px);
}

/* Resource item hover glow */
.res-item {
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.res-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* Filter button press */
.filter-btn {
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.filter-btn:active {
  transform: scale(0.94);
}

/* Section title slide-in (only direct children) */
.tab-content.active > .section-title {
  animation: animSlideLeft 0.35s cubic-bezier(0.22, 1, 0.36, 1) 0.02s forwards;
  opacity: 0;
}

/* Stats row stagger */
.stats-row .stat-chip {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stats-row .stat-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.stat-chip-sm {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-chip-sm:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

/* Dep graph node hover */
.dep-graph-node {
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.dep-graph-node:hover:not(.locked) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Modal entrance animation */
.modal-card {
  animation: modalBounceIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalBounceIn {
  from { opacity: 0; transform: scale(0.9) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Search results entrance */
.search-result {
  animation: searchResultIn 0.2s ease forwards;
}
.search-result:nth-child(1) { animation-delay: 0s; }
.search-result:nth-child(2) { animation-delay: 0.03s; }
.search-result:nth-child(3) { animation-delay: 0.06s; }
.search-result:nth-child(4) { animation-delay: 0.09s; }
.search-result:nth-child(5) { animation-delay: 0.12s; }
@keyframes searchResultIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Logo pulse on load */
.app-header .logo {
  animation: logoPulse 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s;
}
@keyframes logoPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Nav item active indicator bounce */
.nav-item.active .nav-icon {
  animation: navBounce 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes navBounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Chart container hover */
.chart-container {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.chart-container:hover {
  border-color: rgba(232,69,69,0.3);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

/* Achievement badge pop on earn */
.achievement-badge.earned {
  animation: badgeEarned 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes badgeEarned {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* Heatmap cell hover */
.heatmap-cell {
  transition: transform 0.15s ease, background 0.2s ease;
}
.heatmap-cell:hover {
  transform: scale(1.4);
  z-index: 1;
}

/* Smooth tab content transition */
.tab-content {
  transition: opacity 0.15s ease;
}

/* === Companies Page === */
.company-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 8px;
  transition: all var(--transition);
}
.company-card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.cc-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.cc-name { font-size: 14px; font-weight: 700; color: var(--text); }
.cc-hq { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.cc-roles { font-size: 12px; color: var(--accent); margin-bottom: 6px; font-weight: 500; }
.cc-skills { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.skill-tag {
  font-size: 10px; font-family: var(--font-mono); font-weight: 600;
  padding: 3px 8px; border-radius: 10px;
  background: var(--green-dim); color: var(--green);
}
.cc-notes { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.4; }
.cc-resources { margin: 8px 0; padding: 8px; background: var(--bg-card); border-radius: 8px; border: 1px solid var(--border); }
.cc-resources-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); margin-bottom: 6px; }
.cc-resource-link { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-primary); text-decoration: none; padding: 4px 0; transition: color 0.2s; }
.cc-resource-link:hover { color: var(--accent); }
.cc-resource-type { background: var(--accent); color: #fff; font-size: 9px; font-weight: 600; padding: 1px 5px; border-radius: 3px; white-space: nowrap; }
.cc-resource-title { font-size: 11px; }
.cc-actions { display: flex; gap: 8px; }
.cc-link-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 6px; font-size: 12px;
  font-family: var(--font-mono); font-weight: 600;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--accent); transition: all var(--transition);
  text-decoration: none;
}
.cc-link-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.tab-content.active .company-card { animation: animRevealIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards; opacity: 0; }
.tab-content.active .company-card:nth-child(1) { animation-delay: 0.05s; }
.tab-content.active .company-card:nth-child(2) { animation-delay: 0.08s; }
.tab-content.active .company-card:nth-child(3) { animation-delay: 0.11s; }
.tab-content.active .company-card:nth-child(4) { animation-delay: 0.14s; }
.tab-content.active .company-card:nth-child(5) { animation-delay: 0.17s; }
.tab-content.active .company-card:nth-child(n+6) { animation-delay: 0.2s; }
.topic-link { transition: color 0.15s; }
.topic-link:hover { color: var(--accent-hover) !important; text-decoration: underline; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .anim-reveal, .anim-reveal.anim-visible,
  .tab-content.active .dash-hero,
  .tab-content.active .dash-section,
  .tab-content.active .phase-card,
  .tab-content.active .project-card,
  .tab-content.active .chart-container,
  .tab-content.active .career-path,
  .tab-content.active > .section-title,
  .tab-content.active #timer-button-container,
  .tab-content.active .filter-bar,
  .tab-content.active .dep-graph-container,
  .app-header .logo,
  .nav-item.active .nav-icon,
  .modal-card,
  .search-result,
  .achievement-badge.earned {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

