/* Home page styles directly adapted from Electron src/index.css (HomeOverview). */
.home-overview {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding: 28px;
  min-width: 0;
}

.home-overview > * {
  animation: view-fade-up var(--dur-slow) var(--ease-out-expo) backwards;
}

.home-overview > *:nth-child(1) { animation-delay: 0.04s; }
.home-overview > *:nth-child(2) { animation-delay: 0.1s; }
.home-overview > *:nth-child(3) { animation-delay: 0.16s; }
.home-overview > *:nth-child(4) { animation-delay: 0.22s; }

.home-top-row {
  display: flex;
  gap: 16px;
  align-items: stretch;
}

.home-hero {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.home-hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  align-self: flex-end;
  margin-top: 12px;
}

.home-license-card {
  min-width: 0;
}

.home-top-row > .home-license-card {
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px;
}

.home-license-card.free {
  border: 1px solid rgba(249, 115, 22, 0.35);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.05) 0%, var(--bg-card) 100%);
}

.home-license-card.free .free-icon {
  background: rgba(249, 115, 22, 0.12);
  color: rgb(249, 115, 22);
}

.home-license-card.free.clickable:hover {
  border-color: rgba(249, 115, 22, 0.6);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.08) 0%, var(--bg-card-hover) 100%);
}

.home-trial-progress {
  width: 100%;
  margin-top: 2px;
}

.home-trial-progress > span {
  flex: 1;
  height: 5px;
  border-radius: 2.5px;
  background: var(--border);
}

.home-trial-progress > span.used {
  background: linear-gradient(135deg, var(--accent), #a78bfa);
}

.home-license-copy {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

.home-buy-now-btn {
  margin-top: 12px;
  align-self: flex-end;
  background: linear-gradient(135deg, #f97316, #fb923c);
  color: white;
  border: none;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 10px rgba(249, 115, 22, 0.25);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.home-buy-now-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 14px rgba(249, 115, 22, 0.35);
  background: linear-gradient(135deg, #ea580c, #f97316);
}

.home-buy-now-btn:active {
  transform: scale(0.98);
}

.home-license-card.licensed {
  border: 1px solid rgba(48, 209, 88, 0.25);
  background: linear-gradient(135deg, rgba(48, 209, 88, 0.04) 0%, var(--bg-card) 100%);
}

.home-license-card.licensed .licensed-icon {
  background: rgba(48, 209, 88, 0.12);
  color: var(--success);
}

.home-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.home-title {
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}

.home-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
  margin-top: 10px;
  max-width: 620px;
}

.home-primary-action {
  flex-shrink: 0;
}

.home-ai-card,
.home-stat-card,
.home-recent,
.home-knowledge {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.home-ai-card,
.home-stat-card {
  padding: 18px;
}

.home-ai-card.clickable,
.home-stat-card.clickable {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  outline: none;
}

.home-ai-card.clickable:hover,
.home-stat-card.clickable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.08);
  background-color: var(--bg-card-hover);
  border-color: var(--border-light);
}

.home-ai-card.clickable:active,
.home-stat-card.clickable:active {
  transform: translateY(0);
}

.home-ai-card.clickable:focus-visible,
.home-stat-card.clickable:focus-visible,
.home-recent-card:focus-visible,
.home-section-link:focus-visible {
  box-shadow: 0 0 0 2px var(--accent);
  outline: none;
}

.home-ai-card.needs-setup {
  border: 1.5px solid rgba(255, 69, 58, 0.55);
  background: linear-gradient(135deg, rgba(255, 69, 58, 0.08) 0%, rgba(255, 69, 58, 0.02) 100%);
  box-shadow: 0 0 12px rgba(255, 69, 58, 0.12), var(--shadow-card);
  animation: borderGlowPulse 2.5s infinite ease-in-out;
}

.home-ai-card.needs-setup .home-card-icon {
  background: rgba(255, 69, 58, 0.18);
  color: rgb(255, 69, 58);
}

.home-ai-card.needs-setup.clickable:hover {
  background: linear-gradient(135deg, rgba(255, 69, 58, 0.12) 0%, rgba(255, 69, 58, 0.04) 100%);
}

.home-ai-card.warning {
  border: 1.5px solid rgba(255, 214, 10, 0.55);
  background: linear-gradient(135deg, rgba(255, 214, 10, 0.08) 0%, rgba(255, 214, 10, 0.02) 100%);
  box-shadow: 0 0 12px rgba(255, 214, 10, 0.12), var(--shadow-card);
  animation: warningGlowPulse 2.5s infinite ease-in-out;
}

.home-ai-card.warning .home-card-icon {
  background: rgba(255, 214, 10, 0.18);
  color: rgb(255, 214, 10);
}

.home-ai-card.warning.clickable:hover {
  background: linear-gradient(135deg, rgba(255, 214, 10, 0.12) 0%, rgba(255, 214, 10, 0.04) 100%);
}

.home-ai-attention .home-ai-card {
  width: 100%;
}

@keyframes borderGlowPulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(255, 69, 58, 0.1), var(--shadow-card);
    border-color: rgba(255, 69, 58, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 69, 58, 0.22), var(--shadow-card);
    border-color: rgba(255, 69, 58, 0.85);
  }
}

@keyframes warningGlowPulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(255, 214, 10, 0.1), var(--shadow-card);
    border-color: rgba(255, 214, 10, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 214, 10, 0.22), var(--shadow-card);
    border-color: rgba(255, 214, 10, 0.85);
  }
}

.home-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.home-card-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  color: var(--accent);
  flex-shrink: 0;
}

.home-card-title {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
  margin: 0;
}

.home-card-subtitle {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 4px;
}

.home-ai-status-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.home-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1;
}

.home-status-pill.ready {
  color: var(--success);
}

.home-status-pill.blocked {
  color: var(--warning);
}

.home-card-action {
  margin-top: 14px;
}

.home-recent,
.home-knowledge {
  padding: 18px;
}

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

.home-section-header > div {
  min-width: 0;
}

.home-section-header h2 {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 650;
  margin: 0;
}

.home-section-header span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 3px;
}

.home-section-link {
  flex-shrink: 0;
  padding: 5px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.home-section-link:hover {
  background: var(--bg-hover);
}

.home-recent-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1px 1px 6px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  overscroll-behavior-inline: contain;
}

.home-recent-card {
  flex: 0 0 clamp(230px, 26vw, 280px);
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  scroll-snap-align: start;
  transition: transform var(--dur-fast) var(--ease-out-expo), border-color var(--dur-fast) ease, background var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.home-recent-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
  background: var(--bg-hover);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.home-recent-card:active {
  transform: translateY(0) scale(0.99);
}

.home-recent-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0d0d0f;
}

.home-recent-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform var(--dur-base) var(--ease-out-expo), opacity var(--dur-base) ease;
}

.home-recent-card:hover .home-recent-media img {
  transform: scale(1.025);
  opacity: 0.94;
}

.home-recent-media-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background:
    radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 52%),
    var(--bg-inset);
}

.home-recent-favorite {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.home-recent-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 11px 12px 12px;
}

.home-recent-title {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-recent-meta,
.home-empty-recent {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.home-recent-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-empty-recent {
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
}

.home-knowledge-grid,
.home-library-grid,
.home-system-grid {
  display: grid;
  gap: 12px;
}

.home-knowledge-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-knowledge-grid .home-stat-card {
  min-height: 104px;
}

.home-library-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-library-grid .home-stat-card {
  padding: 14px 16px;
}

.home-system-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.home-system-card {
  min-width: 0;
  min-height: 78px;
  padding: 14px 16px;
}

.home-version-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.home-version-icon {
  color: var(--accent);
}

.home-check-updates {
  flex-shrink: 0;
  font-size: 12px;
  padding: 6px 12px;
}

@media (max-width: 980px) {
  .home-top-row {
    flex-direction: column;
  }

  .home-top-row > .home-license-card {
    flex: none;
    width: 100%;
  }

  .home-knowledge-grid,
  .home-library-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }
}

@media (max-width: 620px) {
  .home-overview {
    padding: 18px;
  }

  .home-hero-actions {
    align-self: stretch;
  }

  .home-primary-action {
    flex: 1;
  }

  .home-recent-card {
    flex-basis: min(78vw, 280px);
  }

  .home-knowledge-grid,
  .home-library-grid,
  .home-system-grid {
    grid-template-columns: 1fr;
  }
}

/* Preview-specific responsive enhancements; retain app token colors. */
.demo-app-home { min-height:0; margin:0 0 0; background:var(--bg-primary); }
.demo-app-home .home-hero-actions a { white-space:nowrap; }
.demo-app-home .home-recent-card { min-width:210px; }
.demo-app-home .home-knowledge-grid .home-stat-card { width:100%; }
.demo-app-home .home-license-card { box-shadow:var(--shadow-card); }
@media(max-width:640px){
 .demo-app-home {padding:18px 12px;}
 .demo-app-home .home-recent-card {flex-basis:260px;}
}
.knowledge-demo-fidelity .knowledge-evidence-shot { display:block; margin:8px 0 2px; width:min(220px,100%); aspect-ratio:16/9; object-fit:cover; border-radius:9px; border:1px solid var(--border-light); }
.jumper-overlay .jumper-demo-actions { display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin:14px 0 0; }
.jumper-overlay .jumper-demo-actions button { font:inherit; min-height:38px; }
.jumper-overlay .jumper-demo-current { margin:8px 0; color:var(--text-secondary); font-size:12px; }
.jumper-overlay .jumper-demo-note { font-size:11px;color:var(--text-muted);line-height:1.5; }
.jumper-overlay .jumper-demo-active { color:var(--accent); font-weight:700; }

/* During Jumper playback the video stays visible, with a compact controller
   aligned to the same video panel. The expanded state returns when paused. */
.jumper-overlay.demo-jumper-playing { align-items:flex-end; justify-content:flex-end; background:transparent; backdrop-filter:none; padding:10px; pointer-events:none; }
.jumper-overlay.demo-jumper-playing .jumper-card { pointer-events:auto; width:min(300px,78%); padding:12px; opacity:.95; box-shadow:0 10px 36px rgba(0,0,0,.45); }
.jumper-overlay.demo-jumper-playing .highlight-list,
.jumper-overlay.demo-jumper-playing .jumper-demo-note { display:none; }
.jumper-overlay.demo-jumper-playing .jumper-card h3 { font-size:12px; margin:2px 30px 5px 0; }
.jumper-overlay.demo-jumper-playing .jumper-demo-actions { margin:6px 0 0; }
.jumper-overlay.demo-jumper-playing .jumper-demo-actions .btn { min-height:32px; padding:4px 8px; font-size:11px; }
@media(max-width:680px) {
 .jumper-overlay.demo-jumper-playing .jumper-card { width:min(260px,89%); }
 .jumper-overlay.demo-jumper-playing .jumper-kicker { font-size:9px; }
}
