@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --primary: #90A4AE;
  --primary-light: #B0BEC5;
  --primary-soft: #CFD8DC;
  --secondary: #ECEFF1;
  --accent: #546E7A;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --success: #059669;
  --success-bg: #ECFDF5;
  --warning: #D97706;
  --warning-bg: #FFFBEB;
  --danger: #DC2626;
  --danger-bg: #FEF2F2;
  --bg: #F1F5F9;
  --surface: #FFFFFF;
  --surface-hover: #F8FAFC;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --text: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

::selection {
  background: var(--accent);
  color: white;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ========== Loading Screen ========== */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 1rem;
  color: var(--text-secondary);
}

.loading-pulse {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}

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

/* ========== App Shell ========== */
.app-shell {
  max-width: 900px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========== Header ========== */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.92);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.header-icon {
  font-size: 1.5rem;
  animation: spin 3s linear infinite;
}

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

.header-title h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.user-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px rgba(5, 150, 105, 0.4);
}

/* ========== Tab Bar ========== */
.tab-bar {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1rem;
  gap: 0.25rem;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 0.5rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-secondary);
  background: var(--surface-hover);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-icon {
  font-size: 1.1rem;
}

/* ========== Main Content ========== */
.app-main {
  flex: 1;
  padding: 1.5rem;
}

/* ========== Skeletons ========== */
.form-skeleton,
.digest-skeleton,
.history-skeleton {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skeleton-block {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-title { height: 2rem; width: 60%; }
.skeleton-field { height: 5rem; }
.skeleton-field-short { height: 3rem; width: 80%; }
.skeleton-header { height: 4rem; }
.skeleton-card { height: 6rem; }
.skeleton-row { height: 3rem; }

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

/* ========== Standup Form ========== */
.standup-form-container {
  animation: fadeInUp 0.4s ease both;
}

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

.success-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--success-bg);
  border: 1px solid rgba(5, 150, 105, 0.2);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.3s ease both;
}

.success-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.success-banner strong {
  color: var(--success);
  font-size: 0.9rem;
}

.success-banner p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.view-digest-btn {
  margin-left: auto;
  background: var(--success);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.view-digest-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.standup-form {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.form-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 0.4rem 0.9rem;
  border-radius: 2rem;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.label-icon {
  font-size: 1rem;
}

.form-textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  resize: vertical;
  transition: all 0.2s ease;
  line-height: 1.5;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-textarea::placeholder {
  color: var(--text-muted);
}

.blockers-field {
  border-color: var(--warning-bg);
}

.blockers-field:focus {
  border-color: var(--warning);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

.mood-picker {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mood-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--surface);
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mood-btn:hover {
  border-color: var(--accent);
  transform: scale(1.1);
}

.mood-btn.selected {
  border-color: var(--accent);
  background: var(--accent-glow);
  transform: scale(1.1);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.submit-btn {
  width: 100%;
  padding: 0.9rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.submit-btn:hover:not(:disabled) {
  background: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========== Digest View ========== */
.digest-container {
  animation: fadeInUp 0.4s ease both;
}

.digest-header {
  margin-bottom: 1.5rem;
}

.digest-date h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.entry-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 0.5rem;
}

.digest-stats {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
}

.stat-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-moods {
  display: flex;
  gap: 0.35rem;
}

.mood-count {
  font-size: 0.85rem;
}

.blocker-pill {
  background: var(--warning-bg);
  border-color: rgba(217, 119, 6, 0.2);
}

.blocker-pill .stat-label {
  color: var(--warning);
}

.nudge-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--primary-soft);
  border: 1px solid rgba(45, 58, 140, 0.15);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.2rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 500;
}

.nudge-icon {
  font-size: 1.2rem;
}

/* ========== Empty State ========== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.empty-state h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ========== Standup Cards ========== */
.digest-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.standup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  animation: cardFadeIn 0.4s ease both;
}

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

.standup-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.standup-card.expanded {
  border-color: var(--accent);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.standup-card.is-me {
  border-left: 3px solid var(--accent);
}

.standup-card.has-blocker {
  border-left: 3px solid var(--warning);
}

.standup-card.is-me.has-blocker {
  border-left: 3px solid var(--warning);
}

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

.card-author {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.author-avatar.small {
  width: 30px;
  height: 30px;
  font-size: 0.75rem;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.me-badge {
  font-size: 0.65rem;
  background: var(--accent-glow);
  color: var(--accent);
  padding: 0.1rem 0.45rem;
  border-radius: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.card-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-mood {
  font-size: 1.5rem;
}

.card-preview {
  margin-bottom: 0.4rem;
}

.preview-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.expanded .preview-text {
  display: none;
}

.card-details {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
  animation: fadeInUp 0.3s ease both;
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-text {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
}

.blocker-section {
  background: var(--warning-bg);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--warning);
}

.blocker-section .detail-label {
  color: var(--warning);
}

.card-expand-hint {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  opacity: 0.6;
}

/* ========== History View ========== */
.history-container {
  animation: fadeInUp 0.4s ease both;
}

.history-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.history-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.date-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  box-shadow: var(--shadow-sm);
  max-height: 70vh;
  overflow-y: auto;
}

.date-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.8rem;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s ease;
  text-align: left;
  animation: cardFadeIn 0.3s ease both;
}

.date-item:hover {
  background: var(--surface-hover);
}

.date-item.selected {
  background: var(--primary-soft);
  color: var(--primary);
}

.date-item-main {
  display: flex;
  flex-direction: column;
}

.date-item-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.date-item.selected .date-item-label {
  color: var(--primary);
}

.date-item-count {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.date-blocker-badge {
  font-size: 0.72rem;
  background: var(--warning-bg);
  padding: 0.15rem 0.4rem;
  border-radius: 1rem;
  flex-shrink: 0;
}

.history-detail {
  min-height: 300px;
}

.select-date-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: var(--text-muted);
  gap: 0.5rem;
}

.prompt-icon {
  font-size: 2rem;
}

.history-date-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
}

.history-entries {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  animation: cardFadeIn 0.4s ease both;
}

.history-card.has-blocker {
  border-left: 3px solid var(--warning);
}

.history-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-light);
}

.history-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.history-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.history-mood {
  font-size: 1.2rem;
}

.history-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.history-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ========== Responsive ========== */
@media (max-width: 640px) {
  .app-main {
    padding: 1rem;
  }

  .standup-form {
    padding: 1.25rem;
  }

  .tab-label {
    display: none;
  }

  .tab-icon {
    font-size: 1.3rem;
  }

  .tab-btn {
    padding: 0.85rem 0.5rem;
  }

  .history-layout {
    grid-template-columns: 1fr;
  }

  .date-list {
    flex-direction: row;
    overflow-x: auto;
    max-height: none;
    padding: 0.5rem;
    gap: 0.25rem;
  }

  .date-item {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
  }

  .select-date-prompt .prompt-icon {
    transform: rotate(-90deg);
  }

  .success-banner {
    flex-wrap: wrap;
  }

  .view-digest-btn {
    margin-left: 0;
    margin-top: 0.5rem;
    width: 100%;
    text-align: center;
  }

  .header-title h1 {
    font-size: 1.1rem;
  }

  .digest-date h2 {
    font-size: 1.1rem;
  }
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ========== Focus Styles ========== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
```

<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to Async Standup — your team's daily check-in tool. Everyone fills in their update whenever it suits them.", "view": "user", "highlight_selector": ".app-header", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "The Today's Digest tab shows all standups submitted today. You can see who's checked in, their mood, and any blockers at a glance.", "view": "user", "highlight_selector": ".tab-btn:first-child", "wait_for": "tap_to_continue"},
  {"step": 3, "narration": "Click any team member's card to expand it and see their full yesterday, today, and blockers details.", "view": "user", "highlight_selector": ".digest-cards", "wait_for": "user_interaction"},
  {"step": 4, "narration": "Tap 'My Standup' to fill in your daily update. Share what you did yesterday, what you're working on today, and flag any blockers.", "view": "user", "highlight_selector": ".tab-btn:nth-child(2)", "wait_for": "user_interaction"},
  {"step": 5, "narration": "Pick a mood emoji to let the team know how you're feeling today.", "view": "user", "highlight_selector": ".mood-picker", "wait_for": "tap_to_continue"},
  {"step": 6, "narration": "You can update your standup anytime before end of day — just come back to the form and your previous answers will be pre-filled.", "view": "user", "highlight_selector": ".submit-btn", "wait_for": "tap_to_continue"},
  {"step": 7, "narration": "The History tab lets you browse past days' standups. Select a date on the left to see what the team reported.", "view": "user", "highlight_selector": ".tab-btn:nth-child(3)", "wait_for": "user_interaction"},
  {"step": 8, "narration": "Share the app link with your team. Everyone gets a name prompt and access code gate automatically. Start your async standups today!", "view": "user", "highlight_selector": ".app-header", "wait_for": "tap_to_continue"}
]
-->

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  text-align: center;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.auth-brand h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  color: var(--primary);
}

.auth-copy {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.google-signin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.google-signin-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.auth-footnote {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.logout-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface-hover);
}

@media (max-width: 640px) {
  .auth-card {
    padding: 1.5rem;
  }

  .header-user {
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

.history-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.insight-card,
.ai-summary-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.insight-card {
  padding: 0.9rem 1rem;
}

.insight-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.mini-chart {
  display: flex;
  align-items: end;
  gap: 0.4rem;
  min-height: 74px;
}

.mini-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  gap: 0.35rem;
  min-width: 0;
}

.mini-bar {
  width: 100%;
  border-radius: 999px 999px 6px 6px;
  background: var(--border);
  min-height: 10px;
  transition: all 0.2s ease;
}

.mini-bar.filled {
  background: linear-gradient(180deg, var(--accent), var(--primary-light));
  box-shadow: 0 6px 14px rgba(76, 95, 213, 0.2);
}

.mini-bar-caption {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.streak-card .streak-metrics {
  display: flex;
  gap: 1rem;
}

.streak-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.streak-caption {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.ai-summary-panel {
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
}

.ai-summary-header,
.ai-summary-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ai-summary-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.ai-summary-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.summary-refresh-btn,
.summary-link-btn {
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.summary-refresh-btn:disabled,
.summary-link-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.summary-error {
  margin-top: 0.75rem;
  color: var(--danger);
  font-size: 0.85rem;
}

.ai-summary-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.ai-summary-item {
  border-top: 1px solid var(--border-light);
  padding-top: 0.75rem;
}

.ai-summary-text {
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

@media (max-width: 640px) {
  .history-insights {
    grid-template-columns: 1fr;
  }

  .ai-summary-header,
  .ai-summary-item-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .streak-card .streak-metrics {
    justify-content: space-between;
  }
}
