.story-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  background: var(--story-header-bg, rgba(255, 255, 255, 0.90));
  border-bottom: 1px solid var(--story-header-border, #d8e5e1);
}

.story-header-row {
  min-width: 0;
  display: flex;
  align-items: center;
}

.story-header-row-title {
  justify-content: flex-start;
}

.story-header-row-meta {
  justify-content: space-between;
  gap: 10px;
}

.story-header-title {
  min-width: 0;
  color: var(--story-header-title-color, #0f172a);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.story-header-progress {
  min-width: 0;
  flex: 1 1 auto;
  color: var(--story-header-progress-color, #334155);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
}

.story-header-progress-track {
  width: 100%;
  height: var(--story-header-bar-height, 8px);
  background: var(--story-header-track-bg, #dbeafe);
  border: 1px solid var(--story-header-track-border, #bfdbfe);
  border-radius: 999px;
  overflow: hidden;
}

.story-header-progress-bar {
  width: 0%;
  height: 100%;
  background: var(--story-header-bar-bg, linear-gradient(90deg, #22c55e, #06b6d4));
  transition: width 180ms ease;
}

.story-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex: 0 0 auto;
}

.story-header-actions button {
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.story-header[data-variant="chat"] .story-header-title {
  white-space: normal;
  overflow-wrap: anywhere;
}

.story-header[data-variant="chat"] .story-header-progress {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-header[data-variant="voice"] {
  --story-header-bg: rgba(0, 0, 0, 0.40);
  --story-header-border: rgba(255, 255, 255, 0.12);
  --story-header-title-color: #f8fff9;
  --story-header-progress-color: #d8ffe3;
  --story-header-track-bg: rgba(255, 255, 255, 0.18);
  --story-header-track-border: transparent;
  --story-header-bar-height: 6px;
  --story-header-bar-bg: linear-gradient(90deg, #34d399 0%, #22c55e 100%);
}

.story-header[data-variant="voice"] .story-header-title {
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-header[data-variant="voice"] .story-header-progress {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.story-header[data-variant="voice"] .story-header-actions {
  gap: 6px;
}

@media (hover: none), (pointer: coarse), (max-width: 699px) {
  .story-header {
    padding: 9px 11px;
  }

  .story-header-actions button {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 9px;
    font-size: 16px;
  }
}
