/* ========================================
   Claude Chat Resume — Styles v2
   Loosened up, more visual life
   ======================================== */

:root {
  /* Claude Dark Theme Colors */
  --bg-primary: #2b2a27;
  --bg-secondary: #353430;
  --bg-sidebar: #2b2a27;
  --bg-input: #3d3c37;
  --bg-hover: #403f39;
  --bg-message-user: #3d3c37;
  --bg-message-claude: transparent;

  --text-primary: #e8e4dc;
  --text-secondary: #a8a49b;
  --text-muted: #706d65;
  --text-placeholder: #706d65;

  --accent-orange: #c47f3c;
  --accent-orange-dim: #9e6a35;
  --accent-orange-glow: rgba(196, 127, 60, 0.15);
  --accent-green: #81c784;
  --accent-green-bg: rgba(76, 175, 80, 0.12);
  --accent-blue: #64b5f6;
  --accent-blue-bg: rgba(100, 181, 246, 0.10);

  --border-color: #3d3c37;
  --border-light: #4a4840;

  --send-bg: #c47f3c;
  --send-bg-hover: #d4904d;
  --send-bg-disabled: #4a4840;

  /* Sizing — loosened up */
  --sidebar-width: 260px;
  --chat-max-width: 760px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 28px;
}

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

html, body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ========================================
   App Layout
   ======================================== */
#app {
  display: flex;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
}

.claude-icon {
  color: var(--accent-orange);
  font-size: 22px;
  line-height: 1;
}

.logo-text {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.new-chat-btn {
  background: none;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.new-chat-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-nav {
  padding: 8px 10px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 12px 12px 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-section-label:first-child {
  padding-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--bg-input);
  color: var(--text-primary);
}

.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-plan {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 0;
}

.sidebar-mail {
  color: var(--text-muted);
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.sidebar-mail:hover {
  color: var(--accent-orange);
}

/* ========================================
   Mobile Header (hidden on desktop)
   ======================================== */
.mobile-header {
  display: none;
}

.sidebar-overlay {
  display: none;
}

@media (max-width: 768px) {
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
    z-index: 10;
  }

  .mobile-menu-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
  }

  .mobile-menu-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
  }

  .mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-logo .claude-icon {
    font-size: 18px;
  }

  .mobile-logo .logo-text {
    font-size: 15px;
  }

  /* Sidebar overlay mode on mobile */
  .sidebar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    width: 280px;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ========================================
   Main Chat Area
   ======================================== */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

/* ========================================
   Welcome Screen
   ======================================== */
.welcome-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  gap: 40px;
}

.welcome-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.welcome-icon {
  font-size: 40px;
  color: var(--accent-orange);
  line-height: 1;
  animation: welcomeIconSpin 20s linear infinite;
}

@keyframes welcomeIconSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.welcome-title {
  font-family: 'Source Serif 4', 'Georgia', serif;
  font-size: 34px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

/* ========================================
   Input Area (Welcome)
   ======================================== */
.input-area-welcome {
  width: 100%;
  max-width: 660px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.input-container,
.chat-input-container {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 18px 12px 18px;
  transition: border-color 0.25s, box-shadow 0.25s;
  cursor: text;
}

.input-container:hover,
.chat-input-container:hover {
  border-color: var(--text-muted);
  box-shadow: 0 0 0 1px rgba(196, 127, 60, 0.08);
}

.input-text {
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.55;
  min-height: 26px;
  padding-bottom: 12px;
}

.chat-input-text {
  color: var(--text-placeholder);
  font-size: 15px;
  line-height: 1.55;
  min-height: 26px;
  padding-bottom: 12px;
}

.input-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.attach-btn {
  background: none;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.attach-btn:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.input-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.model-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.model-selector:hover {
  color: var(--text-secondary);
}

.send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--send-bg);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.send-btn:hover {
  background: var(--send-bg-hover);
  transform: scale(1.08);
}

.send-btn.disabled {
  background: var(--send-bg-disabled);
  cursor: default;
  color: var(--text-muted);
}

.send-btn.disabled:hover {
  transform: none;
}

/* Pulse animation for the send button */
.send-btn.pulse {
  animation: sendPulse 2s ease-in-out infinite;
}

@keyframes sendPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196, 127, 60, 0.5); }
  50% { box-shadow: 0 0 0 14px rgba(196, 127, 60, 0); }
}

/* ========================================
   Quick Actions
   ======================================== */
.quick-actions {
  position: relative;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: none;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.quick-action:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* ========================================
   Handwritten Annotation
   ======================================== */
.quick-actions-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.handwritten-circle {
  position: absolute;
  top: -14px;
  left: -20px;
  width: calc(100% + 40px);
  height: calc(100% + 28px);
  pointer-events: none;
  color: var(--accent-orange);
  opacity: 0;
  animation: circleAppear 0.5s ease forwards;
  animation-delay: 1s;
}

.circle-path {
  stroke-dasharray: 1600;
  stroke-dashoffset: 1600;
  animation: drawCircle 1.2s ease forwards;
  animation-delay: 1s;
}

.handwritten-note {
  margin-top: 10px;
  font-family: 'Caveat', cursive;
  font-size: 22px;
  font-weight: 500;
  color: var(--accent-orange);
  transform: rotate(-1.5deg);
  user-select: none;
  overflow: hidden;
  white-space: nowrap;
}

.handwritten-note span {
  display: inline-block;
  padding-right: 4px;
  opacity: 0;
  animation: noteWrite 0.8s ease forwards;
  animation-delay: 2s;
}

@keyframes circleAppear {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes drawCircle {
  0% { stroke-dashoffset: 1600; }
  100% { stroke-dashoffset: 0; }
}

@keyframes noteWrite {
  0% {
    opacity: 0;
    max-width: 0;
  }
  1% {
    opacity: 1;
    max-width: 0;
  }
  100% {
    opacity: 1;
    max-width: 400px;
  }
}

/* ========================================
   Chat Screen
   ======================================== */
.chat-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 32px 28px;
  scroll-behavior: smooth;
}

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

.chat-input-area {
  padding: 14px 28px 24px;
  display: flex;
  justify-content: center;
}

.chat-input-container {
  max-width: var(--chat-max-width);
}

/* ========================================
   Messages — More breathing room
   ======================================== */
.message-wrapper {
  max-width: var(--chat-max-width);
  margin: 0 auto 28px;
  animation: messageIn 0.4s ease-out;
}

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

.message-user {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 32px;
}

.message-user .message-bubble {
  background: var(--bg-message-user);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  max-width: 80%;
  font-size: 15px;
  line-height: 1.6;
}

.message-claude {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
}

.claude-avatar {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-orange);
  font-size: 22px;
  margin-top: 2px;
}

.message-claude .message-content {
  flex: 1;
  font-size: 15px;
  line-height: 1.75;
  min-width: 0;
}

.message-claude .message-content p {
  margin-bottom: 16px;
}

.message-claude .message-content p:last-child {
  margin-bottom: 0;
}

/* ========================================
   Thinking Animation
   ======================================== */
.thinking-block {
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent-orange-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.thinking-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.thinking-header svg {
  transition: transform 0.2s;
}

.thinking-header.collapsed svg {
  transform: rotate(-90deg);
}

.thinking-content {
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.thinking-line {
  opacity: 0;
  animation: thinkFadeIn 0.4s ease forwards;
  padding: 1px 0;
}

@keyframes thinkFadeIn {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ========================================
   Typing Indicator
   ======================================== */
.typing-indicator {
  display: flex;
  gap: 5px;
  padding: 10px 0;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite both;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ========================================
   Branch Options (Interactive Buttons)
   ======================================== */
.branch-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  padding-top: 8px;
}

.branch-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.branch-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(196, 127, 60, 0.08), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}

.branch-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-orange-dim);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.branch-btn:hover::before {
  opacity: 1;
}

.branch-btn:active {
  transform: translateY(0) scale(0.98);
}

.branch-btn .branch-icon {
  font-size: 17px;
}

.branch-btn.selected {
  border-color: var(--accent-orange);
  background: var(--accent-orange-glow);
}

.branch-btn:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.branch-btn:disabled::before {
  display: none;
}

/* ========================================
   Stats Card — Richer, more spacious
   ======================================== */
.stats-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 28px;
  margin: 24px 0;
  position: relative;
  overflow: hidden;
}

/* Subtle gradient shimmer across the top */
.stats-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-orange), var(--accent-orange-dim), var(--accent-orange));
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
}

.stats-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.stats-avatar {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-orange-dim));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  color: white;
  box-shadow: 0 4px 14px rgba(196, 127, 60, 0.3);
  overflow: hidden;
}

.stats-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stats-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.stats-title {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.stat-item {
  text-align: center;
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  transition: background 0.2s;
}

.stat-item:hover {
  background: rgba(255,255,255,0.04);
}

.stat-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--accent-orange);
  line-height: 1.2;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 4px;
}

/* ========================================
   Cover Letter Card
   ======================================== */
.cover-letter-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 28px;
  margin: 24px 0;
  position: relative;
  overflow: hidden;
}

.cover-letter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-orange), var(--accent-orange-dim), var(--accent-orange));
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
}

.cover-letter-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.cover-letter-icon {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-orange-dim));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 14px rgba(196, 127, 60, 0.3);
}

.cover-letter-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.cover-letter-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.cover-letter-body {
  color: var(--text-secondary);
  line-height: 1.75;
  font-size: 14px;
}

.cover-letter-body p {
  margin-bottom: 12px;
}

.cover-letter-body p:last-child {
  margin-bottom: 0;
}

/* ========================================
   Match Badge
   ======================================== */
.match-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-green-bg);
  color: var(--accent-green);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
}

.match-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: matchPulse 2s infinite;
}

@keyframes matchPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ========================================
   Highlights / Tags — More spacious
   ======================================== */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.tag {
  display: inline-block;
  padding: 5px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.tag:hover {
  border-color: var(--accent-orange-dim);
  color: var(--text-primary);
  background: var(--accent-orange-glow);
}

/* ========================================
   Content sections inside responses
   ======================================== */
.response-section {
  margin-bottom: 24px;
}

.response-section:last-child {
  margin-bottom: 8px;
}

.response-section h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.response-section p {
  margin-bottom: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.response-section ul {
  list-style: none;
  padding: 0;
}

.response-section li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.response-section li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-orange-dim);
}

.bold {
  font-weight: 600;
  color: var(--text-primary);
}

.inline-link {
  color: var(--accent-orange);
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.inline-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ========================================
   Timeline Card (new)
   ======================================== */
.timeline-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 16px 0;
  position: relative;
  transition: border-color 0.2s;
}

.timeline-card:hover {
  border-color: var(--accent-orange-dim);
}

.timeline-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.timeline-logo {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.timeline-logo.no-img {
  background: var(--bg-input);
}

.timeline-card-header > div:not(.timeline-logo) {
  flex: 1;
  min-width: 0;
}

.timeline-role {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-company {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.timeline-date {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.timeline-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ========================================
   Quote Block (new — for testimonials)
   ======================================== */
.quote-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin: 20px 0;
  position: relative;
}

.quote-mark {
  font-size: 48px;
  color: var(--accent-orange-dim);
  line-height: 0.8;
  opacity: 0.5;
  position: absolute;
  top: 16px;
  left: 20px;
  font-family: Georgia, serif;
}

.quote-text {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 16px;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.7;
  padding-left: 24px;
  margin-bottom: 12px;
}

.quote-author {
  font-size: 13px;
  color: var(--text-muted);
  padding-left: 24px;
}

/* ========================================
   Progress Bar (new — for skill proficiency)
   ======================================== */
.skill-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.skill-bar-label {
  font-size: 13px;
  color: var(--text-secondary);
  width: 140px;
  flex-shrink: 0;
}

.skill-bar-track {
  flex: 1;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-orange-dim), var(--accent-orange));
  border-radius: 3px;
  width: 0;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-bar-value {
  font-size: 12px;
  color: var(--text-muted);
  width: 32px;
  text-align: right;
}

/* ========================================
   Metric Row (new — horizontal stats)
   ======================================== */
.metric-row {
  display: flex;
  gap: 12px;
  margin: 16px 0;
}

.metric-card {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  transition: all 0.25s;
}

.metric-card:hover {
  border-color: var(--accent-orange-dim);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.metric-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--accent-orange);
  line-height: 1.2;
}

.metric-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* ========================================
   Divider
   ======================================== */
.section-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 24px 0;
}

/* ========================================
   Streaming text effect
   ======================================== */
.streaming-cursor::after {
  content: '▊';
  animation: cursorBlink 0.8s infinite;
  color: var(--accent-orange);
  margin-left: 2px;
  font-size: 14px;
}

@keyframes cursorBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* ========================================
   Utility
   ======================================== */
.hidden {
  display: none !important;
}

/* Fade transition */
.fade-out {
  animation: fadeOut 0.4s ease forwards;
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-12px); }
}

/* Stagger animation for child elements */
.stagger-in > * {
  opacity: 0;
  animation: staggerChild 0.4s ease forwards;
}

.stagger-in > *:nth-child(1) { animation-delay: 0s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.08s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.16s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.24s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.32s; }
.stagger-in > *:nth-child(6) { animation-delay: 0.40s; }

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

/* Confetti / celebration effect */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-20px) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg) scale(0.5);
    opacity: 0;
  }
}

/* ========================================
   Tic-Tac-Toe Game
   ======================================== */
.ttt-game-container {
  margin: 20px 0;
}

.ttt-status {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-weight: 500;
}

.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  max-width: 280px;
  aspect-ratio: 1;
  background: var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 8px;
}

.ttt-cell {
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  font-family: 'Inter', monospace;
  color: var(--text-muted);
  aspect-ratio: 1;
  transition: all 0.15s ease;
  user-select: none;
}

.ttt-cell.ttt-clickable {
  cursor: pointer;
}

.ttt-cell.ttt-clickable:hover {
  background: var(--bg-hover);
  color: var(--accent-orange-dim);
}

.ttt-cell.ttt-x {
  color: var(--text-primary);
  animation: tttPop 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ttt-cell.ttt-o {
  color: var(--accent-orange);
  animation: tttPop 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ttt-cell.ttt-win {
  background: var(--accent-orange-glow);
  color: var(--accent-orange);
}

.ttt-cell.ttt-win.ttt-x {
  color: var(--accent-orange);
}

@keyframes tttPop {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* ========================================
   Responsive — Tablet (≤1024px)
   ======================================== */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 220px;
  }
}

/* ========================================
   Responsive — Small Tablet / Large Phone (≤768px)
   ======================================== */
@media (max-width: 768px) {
  .welcome-title {
    font-size: 24px;
  }

  .welcome-screen {
    padding: 40px 16px;
    gap: 28px;
  }

  .welcome-content {
    gap: 12px;
  }

  .welcome-icon {
    font-size: 32px;
  }

  .input-area-welcome {
    max-width: 100%;
    padding: 0 4px;
  }

  .chat-messages {
    padding: 20px 16px;
  }

  .chat-input-area {
    padding: 10px 16px 20px;
  }

  .stats-card {
    padding: 20px;
  }

  .cover-letter-card {
    padding: 20px;
  }

  .cover-letter-title {
    font-size: 15px;
  }

  .stats-card-header {
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
  }

  .stats-avatar {
    width: 46px;
    height: 46px;
    min-width: 46px;
    min-height: 46px;
    font-size: 18px;
  }

  .stats-name {
    font-size: 17px;
  }

  .stats-title {
    font-size: 13px;
  }

  .stats-grid {
    gap: 12px;
  }

  .stat-value {
    font-size: 24px;
  }

  .metric-row {
    flex-wrap: wrap;
  }

  .metric-card {
    min-width: calc(50% - 6px);
  }

  .metric-value {
    font-size: 20px;
  }

  .branch-options {
    flex-direction: column;
  }

  .branch-btn {
    width: 100%;
    justify-content: center;
  }

  .quote-block {
    padding: 20px 22px;
  }

  .quote-text {
    font-size: 15px;
    padding-left: 20px;
  }

  .quote-mark {
    font-size: 40px;
    left: 16px;
  }

  .quote-author {
    padding-left: 20px;
  }

  .timeline-card {
    padding: 16px 18px;
  }

  .timeline-card-header {
    flex-direction: column;
    gap: 8px;
  }

  .timeline-date {
    align-self: flex-start;
  }

  .message-user .message-bubble {
    max-width: 90%;
    padding: 12px 16px;
  }

  .message-claude {
    gap: 12px;
  }

  .claude-avatar {
    width: 26px;
    height: 26px;
    font-size: 18px;
  }
}

/* ========================================
   Responsive — Phone (≤480px)
   ======================================== */
@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .welcome-screen {
    padding: 32px 12px;
    gap: 24px;
  }

  .welcome-title {
    font-size: 20px;
  }

  .welcome-icon {
    font-size: 28px;
  }

  .input-container,
  .chat-input-container {
    border-radius: var(--radius-md);
    padding: 12px 14px 10px;
  }

  .input-text,
  .chat-input-text {
    font-size: 14px;
    padding-bottom: 10px;
  }

  .quick-actions {
    gap: 6px;
  }

  .quick-action {
    padding: 6px 12px;
    font-size: 12px;
  }

  .handwritten-note {
    font-size: 16px;
    margin-top: 8px;
  }

  .handwritten-circle {
    top: -10px;
    left: -14px;
    width: calc(100% + 28px);
    height: calc(100% + 20px);
  }

  .chat-messages {
    padding: 16px 12px;
  }

  .chat-input-area {
    padding: 8px 12px 16px;
  }

  .message-wrapper {
    margin-bottom: 20px;
  }

  .message-user {
    margin-bottom: 24px;
  }

  .message-user .message-bubble {
    font-size: 14px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
  }

  .message-claude {
    gap: 10px;
    margin-bottom: 24px;
  }

  .message-claude .message-content {
    font-size: 14px;
    line-height: 1.7;
  }

  .claude-avatar {
    width: 24px;
    height: 24px;
    font-size: 16px;
  }

  .stats-card {
    padding: 16px;
    margin: 16px 0;
    border-radius: var(--radius-sm);
  }

  .stats-card-header {
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 14px;
  }

  .stats-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    font-size: 16px;
  }

  .stats-name {
    font-size: 15px;
    gap: 2px;
  }

  .match-badge {
    font-size: 10px;
    padding: 3px 10px;
    margin-left: 4px;
  }

  .stats-title {
    font-size: 12px;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .stat-item {
    padding: 8px 4px;
  }

  .stat-value {
    font-size: 20px;
  }

  .stat-label {
    font-size: 9px;
    letter-spacing: 0.04em;
  }

  .tag {
    padding: 4px 10px;
    font-size: 11.5px;
  }

  .tag-row {
    gap: 6px;
  }

  .response-section h3 {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .response-section li {
    font-size: 13px;
    padding-left: 16px;
    margin-bottom: 8px;
  }

  .response-section li::before {
    width: 5px;
    height: 5px;
    top: 8px;
  }

  .response-section p {
    font-size: 13.5px;
  }

  .timeline-card {
    padding: 14px 14px;
    margin: 12px 0;
    border-radius: var(--radius-sm);
  }

  .timeline-role {
    font-size: 14px;
  }

  .timeline-company {
    font-size: 12.5px;
  }

  .timeline-date {
    font-size: 11px;
    padding: 2px 8px;
  }

  .timeline-desc {
    font-size: 13px;
    line-height: 1.6;
  }

  .metric-row {
    gap: 8px;
    margin: 12px 0;
  }

  .metric-card {
    padding: 12px 8px;
    border-radius: 6px;
    min-width: calc(50% - 4px);
  }

  .metric-value {
    font-size: 18px;
  }

  .metric-label {
    font-size: 9px;
    letter-spacing: 0.04em;
  }

  .quote-block {
    padding: 16px 16px;
    margin: 14px 0;
    border-radius: var(--radius-sm);
  }

  .quote-mark {
    font-size: 32px;
    top: 10px;
    left: 12px;
  }

  .quote-text {
    font-size: 14px;
    padding-left: 16px;
    margin-bottom: 8px;
  }

  .quote-author {
    font-size: 12px;
    padding-left: 16px;
  }

  .branch-options {
    gap: 8px;
    margin-top: 20px;
  }

  .branch-btn {
    padding: 10px 16px;
    font-size: 13px;
    border-radius: var(--radius-sm);
  }

  .branch-btn .branch-icon {
    font-size: 15px;
  }

  .thinking-block {
    padding: 10px 14px;
    font-size: 12.5px;
    margin-bottom: 18px;
  }

  .thinking-header {
    font-size: 11px;
  }

  .ttt-board {
    max-width: 240px;
  }

  .ttt-cell {
    font-size: 26px;
  }
}

/* ========================================
   Responsive — Small Phone (≤360px)
   ======================================== */
@media (max-width: 360px) {
  .welcome-title {
    font-size: 18px;
  }

  .welcome-icon {
    font-size: 24px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
  }

  .stat-value {
    font-size: 18px;
  }

  .stat-label {
    font-size: 8px;
  }

  .stats-name {
    font-size: 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .match-badge {
    margin-left: 0;
  }

  .metric-card {
    min-width: 100%;
  }

  .quick-actions-wrapper {
    display: none;
  }
}

/* ========================================
   Safe area insets (notched phones)
   ======================================== */
@supports (padding: env(safe-area-inset-bottom)) {
  .chat-input-area {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .input-area-welcome {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .sidebar-footer {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

/* ========================================
   Landscape Phone
   ======================================== */
@media (max-height: 500px) and (orientation: landscape) {
  .welcome-screen {
    padding: 20px 16px;
    gap: 16px;
  }

  .welcome-icon {
    font-size: 24px;
  }

  .welcome-title {
    font-size: 22px;
  }
}
