:root {
  --bg: #f8f8f8;
  --fg: #1f1f1f;
  --accent: #0066cc;
  --muted: #5a5a5a;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  flex-direction: column;
}

/* Site Header */
.site-header {
  background: white;
  border-bottom: 1px solid #ddd;
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem clamp(1rem, 4vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.site-header h1 a {
  color: inherit;
  text-decoration: none;
}

.site-header h1 a:hover {
  color: var(--accent);
}

.header-nav {
  display: flex;
  gap: 1.5rem;
}

.header-nav a {
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.header-nav a:hover {
  color: var(--accent);
}

.header-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
}

.hamburger {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--fg);
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 2px;
  background: var(--fg);
  left: 0;
}

.hamburger::before {
  top: -7px;
}

.hamburger::after {
  top: 7px;
}

/* Mobile header styles */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }

  .header-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    gap: 0;
    padding: 0;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 4px 8px rgb(0 0 0 / 0.1);
    display: none;
  }

  .header-nav.open {
    display: flex;
  }

  .header-nav a {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
  }

  .header-nav a:last-child {
    border-bottom: none;
  }

  .header-nav a.active {
    background: #f8f8f8;
    border-bottom: 1px solid #eee;
  }
}

/* Legacy header support (for pages not yet converted) */
header:not(.site-header) {
  background: white;
  border-bottom: 1px solid #ddd;
  padding: 1rem clamp(1rem, 4vw, 2rem);
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

header:not(.site-header) h1 {
  margin: 0;
  font-size: 1.5rem;
}

header:not(.site-header) h1 a {
  color: inherit;
  text-decoration: none;
}

header:not(.site-header) h1 a:hover {
  color: var(--accent);
}

header nav {
  margin-bottom: 0.75rem;
  display: flex;
  gap: 1.5rem;
}

header nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

header nav a:hover {
  text-decoration: underline;
}

#search-form {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

#search-form input,
#search-form select {
  flex: 1 1 240px;
  padding: 0.6rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

#search-form button {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 600;
}

main {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(240px, 280px) minmax(240px, 280px) 1fr;
  padding: 2rem clamp(1.5rem, 4vw, 3rem);
  flex: 1;
  position: relative;
  z-index: 1;
}

/* Status page uses single column layout */
body:has(.status-detail) main {
  grid-template-columns: 1fr;
}

.recordings header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.date-navigation {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.date-nav-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.date-nav-controls select {
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
  background: white;
}

.date-nav-controls select:disabled {
  background: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

.date-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.date-nav-btn {
  padding: 0.4rem 0.8rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
}

.date-nav-btn:hover {
  background: #f5f5f5;
}

.date-nav-btn.today-btn {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.date-nav-btn.today-btn:hover {
  background: #1565c0;
}

.date-nav-input {
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
  width: auto;
}

section h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
}

.status-detail {
  grid-column: 1 / -1;
}

.status-detail ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Apply status styles to status-detail as well */
.status-detail li {
  background: white;
  border-radius: 8px;
  border: 1px solid #e2e2e2;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.status-detail li.ok {
  border-color: #2e8b57;
  box-shadow: 0 0 0 2px rgb(46 139 87 / 15%);
}

.status-detail li.warn {
  border-color: #e6a700;
  box-shadow: 0 0 0 2px rgb(230 167 0 / 15%);
}

.status-detail li.error {
  border-color: #d13b3b;
  box-shadow: 0 0 0 2px rgb(209 59 59 / 15%);
}

.status-detail li header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.status-detail li header h3 {
  margin: 0;
  font-size: 1rem;
}

.status-detail li header span {
  font-size: 0.8rem;
  color: var(--muted);
}

.status-detail li dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.5rem;
  margin: 0;
  font-size: 0.9rem;
}

.status-detail li dt {
  color: var(--muted);
}

.status-detail li dd {
  margin: 0;
}

.status-detail li .status-message {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.status-detail li.warn .status-message {
  color: #8a6d3b;
}

.status-detail li.error .status-message {
  color: #b22222;
}

.status-detail li .health-indicator {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
}

.status-detail li.ok .health-indicator {
  color: #2e8b57;
}

.status-detail li.warn .health-indicator {
  color: #e6a700;
}

.status-detail li.error .health-indicator {
  color: #d13b3b;
}

.status-detail li .dashboard-stats {
  margin: 0.75rem 0;
  padding: 0.75rem 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.status-detail li .stat-group {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.status-detail li .stat-group:last-child {
  margin-bottom: 0;
}

.status-detail li .stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.status-detail li .stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-detail li .stat-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg);
}

.status-detail li .stat-value.backlog-low {
  color: #2e8b57;
}

.status-detail li .stat-value.backlog-medium {
  color: #e6a700;
}

.status-detail li .stat-value.backlog-high {
  color: #d13b3b;
}

.status-detail li .backlog-bar {
  width: 100%;
  height: 4px;
  background: #eee;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.status-detail li .backlog-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.status-detail li.ok .backlog-fill {
  background: #2e8b57;
}

.status-detail li.warn .backlog-fill {
  background: #e6a700;
}

.status-detail li.error .backlog-fill {
  background: #d13b3b;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stations ul {
  gap: 0.5rem;
}

.stations li {
  background: white;
  border-radius: 6px;
  border: 1px solid #e2e2e2;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
}

.stations li.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgb(0 102 204 / 0.15);
}

/* Health status styling for stations */
.stations li.ok {
  border-color: #2e8b57;
}

.stations li.warn {
  border-color: #e6a700;
}

.stations li.error {
  border-color: #d13b3b;
}

.stations li .health-indicator {
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 1rem;
  vertical-align: middle;
}

.stations li.status-link {
  cursor: default;
  border: none;
  background: transparent;
  padding: 0.5rem;
}

.stations li.status-link:hover {
  background: transparent;
}

.stations li span {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
}

.station-logo,
.station-flag {
  display: inline-block;
  margin-right: 0.25rem;
  font-size: 1em;
  vertical-align: middle;
}

.station-logo {
  margin-right: 0.5rem;
}

article {
  background: white;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  border: 1px solid #e2e2e2;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

article header h3 {
  margin: 0;
  font-size: 1rem;
}

article header time {
  font-size: 0.85rem;
  color: var(--muted);
}

article p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
  white-space: pre-wrap;
}

article footer {
  display: flex;
  gap: 1rem;
}

article footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.status ul {
  gap: 0.75rem;
}

.status li {
  background: white;
  border-radius: 8px;
  border: 1px solid #e2e2e2;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.status li.ok {
  border-color: #2e8b57;
  box-shadow: 0 0 0 2px rgb(46 139 87 / 15%);
}

.status li.warn {
  border-color: #e6a700;
  box-shadow: 0 0 0 2px rgb(230 167 0 / 15%);
}

.status li.error {
  border-color: #d13b3b;
  box-shadow: 0 0 0 2px rgb(209 59 59 / 15%);
}

.status li header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.status li header h3 {
  margin: 0;
  font-size: 1rem;
}

.status li header span {
  font-size: 0.8rem;
  color: var(--muted);
}

.status li dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.5rem;
  margin: 0;
  font-size: 0.9rem;
}

.status li dt {
  color: var(--muted);
}

.status li dd {
  margin: 0;
}

.status li .status-message {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.status li.warn .status-message {
  color: #8a6d3b;
}

.status li.error .status-message {
  color: #b22222;
}

/* Enhanced Dashboard Styles */
.status li header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.status li .health-indicator {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
}

.status li.ok .health-indicator {
  color: #2e8b57;
}

.status li.warn .health-indicator {
  color: #e6a700;
}

.status li.error .health-indicator {
  color: #d13b3b;
}

.status li .dashboard-stats {
  margin: 0.75rem 0;
  padding: 0.75rem 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.status li .stat-group {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.status li .stat-group:last-child {
  margin-bottom: 0;
}

.status li .stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.status li .stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status li .stat-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg);
}

.status li .stat-value.backlog-low {
  color: #2e8b57;
}

.status li .stat-value.backlog-medium {
  color: #e6a700;
}

.status li .stat-value.backlog-high {
  color: #d13b3b;
}

.status li .backlog-bar {
  width: 100%;
  height: 4px;
  background: #eee;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.status li .backlog-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.status li.ok .backlog-fill {
  background: #2e8b57;
}

.status li.warn .backlog-fill {
  background: #e6a700;
}

.status li.error .backlog-fill {
  background: #d13b3b;
}

.transcript-page {
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
}

.transcript-header {
  background: white;
  border-bottom: 1px solid #ddd;
  padding: 1.25rem clamp(1.5rem, 4vw, 3rem);
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
}

.transcript-header h1 {
  margin: 0;
  font-size: 1.75rem;
}

.transcript-header .back-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.transcript-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 4vw, 3rem) 4rem;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
  gap: 2rem;
}

/* Compact meta display */
.meta-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding: 0.75rem 0;
}

.meta-compact .meta-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.meta-compact .meta-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.meta-compact .meta-details a {
  color: var(--accent);
  text-decoration: none;
}

.meta-compact .meta-details a:hover {
  text-decoration: underline;
}

/* AI Analysis Section */
.ai-analysis {
  background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
  border: 1px solid #e0e6ff;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
  max-width: 100%;
}

.ai-analysis-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 1rem 0;
}

.ai-analysis h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-analysis h3::before {
  content: "📝";
}

/* Segment Navigation */
.segment-nav {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e8ecf4;
}

.segment-nav-btn {
  background: white;
  border: 1px solid #d0d7e8;
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg);
  cursor: pointer;
  transition: all 0.15s ease;
}

.segment-nav-btn:hover {
  background: #f0f4ff;
  border-color: var(--accent);
  color: var(--accent);
}

.segment-nav-btn:active {
  transform: scale(0.98);
}

.segment-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f5f5f5;
}

.segment-nav-btn:disabled:hover {
  background: #f5f5f5;
  border-color: #d0d7e8;
  color: var(--fg);
}

.ai-analysis-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Summary Meta (station, date, duration) */
.summary-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e8ecf4;
  margin-bottom: 0.5rem;
}

.summary-meta .summary-station {
  font-weight: 600;
  color: var(--fg);
}

/* Download Links */
.download-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.9rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}

.download-links a {
  color: var(--accent);
  text-decoration: none;
}

.download-links a:hover {
  text-decoration: underline;
}

/* Content Type Badge */
.ai-content-type {
  margin-bottom: 0.5rem;
}

.content-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.content-type-badge .badge-icon {
  font-size: 1rem;
}

.content-type-news {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #90caf9;
}

.content-type-talk {
  background: #f3e5f5;
  color: #7b1fa2;
  border: 1px solid #ce93d8;
}

.content-type-music {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.content-type-sports {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
}

.content-type-mixed {
  background: #f5f5f5;
  color: #616161;
  border: 1px solid #bdbdbd;
}

/* AI Summary */
.ai-summary {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid #e8ecf4;
}

.ai-summary p {
  margin: 0;
  line-height: 1.6;
  color: var(--fg);
}

/* AI Labels */
.ai-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-right: 0.5rem;
}

/* Speakers */
.ai-speakers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.speaker-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.speaker-tag {
  background: #e8eaf6;
  color: #3949ab;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Topics */
.ai-topics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.topic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.topic-tag {
  background: #fce4ec;
  color: #c2185b;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Detected Items (Music, Ads) */
.ai-detected-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e0e6ff;
}

.detected-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.detected-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: white;
  border-radius: 8px;
  border: 1px solid #e8ecf4;
}

.detected-item .item-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.detected-item .item-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  overflow: hidden;
}

.detected-item .item-title {
  font-weight: 500;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detected-item .item-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detected-item .confidence-indicator {
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}

/* Timestamp links */
.timestamp-link {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: monospace;
}

.timestamp-link:hover {
  background: #4a5bcc;
  transform: scale(1.05);
}

.timestamp-link:active {
  transform: scale(0.98);
}

/* Ad type badges */
.ad-type-badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.ad-type-commercial {
  background: #fee2e2;
  color: #dc2626;
}

.ad-type-promo {
  background: #fef3c7;
  color: #d97706;
}

.ad-type-sponsorship {
  background: #dbeafe;
  color: #2563eb;
}

.ad-type-psa {
  background: #dcfce7;
  color: #16a34a;
}

/* Music item styling */
.music-item {
  border-left: 3px solid #8b5cf6;
}

/* Ad item styling */
.ad-item {
  border-left: 3px solid #666;
  background: #fafafa;
}

.transcript-text {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.transcript-block {
  background: white;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  padding: 1.25rem;
  line-height: 1.6;
  color: var(--fg);
}

.transcript-block p {
  margin: 0;
  white-space: pre-wrap;
}

/* Transcript Sections */
.transcript-sections {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.transcript-section {
  border-radius: 8px;
  padding: 0.75rem 1rem;
  border-left: 4px solid transparent;
}

.transcript-section.section-type-talk {
  background: transparent;
  border-left-color: transparent;
  padding-left: 0;
}

.transcript-section.section-type-ad {
  background: #f5f5f5;
  border-left-color: #6b7280;
}

.transcript-section.section-type-music {
  background: #faf5ff;
  border-left-color: #8b5cf6;
}

.transcript-section.section-type-news {
  background: #eff6ff;
  border-left-color: #3b82f6;
}

/* Section headers (card-like) */
.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: white;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  border: 1px solid #e8ecf4;
}

.section-type-ad .section-header {
  background: #f9fafb;
  border-color: #d1d5db;
}

.section-type-music .section-header {
  background: #faf5ff;
  border-color: #e9d5ff;
}

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

.section-header-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.section-header-title {
  font-weight: 600;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.section-header-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
}

.section-timestamp {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  font-family: monospace;
  flex-shrink: 0;
}

.section-timestamp:hover {
  background: #4a5bcc;
}

/* Section type badges */
.section-type-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  text-transform: uppercase;
  font-weight: 600;
}

.section-badge-commercial {
  background: #fee2e2;
  color: #dc2626;
}

.section-badge-promo {
  background: #fef3c7;
  color: #d97706;
}

.section-badge-sponsorship {
  background: #dbeafe;
  color: #2563eb;
}

.section-badge-psa {
  background: #dcfce7;
  color: #16a34a;
}

/* Section text */
.section-text {
  display: block;
  font-size: 1rem;
  line-height: 1.7;
  padding: 0.5rem 0;
  color: var(--fg);
}

.section-type-ad .section-text {
  color: #6b7280;
  font-style: italic;
}

.section-type-music .section-text {
  color: #5b21b6;
}

.section-text .transcript-segment-text {
  display: inline;
  color: inherit;
}

/* Collapsible sections */
.section-header-clickable {
  cursor: pointer;
  user-select: none;
  flex-wrap: wrap;
}

.section-header-clickable:hover {
  background: #f3f4f6;
}

.section-toggle {
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: auto;
  padding-left: 0.5rem;
}

.section-collapsed .section-text {
  display: none !important;
}

.section-collapsed .section-toggle {
  color: var(--accent);
}

/* Mobile section styles */
@media (max-width: 768px) {
  .section-header {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.6rem;
  }
  
  .section-header-icon {
    font-size: 1.25rem;
  }
  
  .section-header-title {
    font-size: 0.9rem;
  }
  
  .section-header-subtitle {
    font-size: 0.8rem;
  }
  
  .section-timestamp {
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
  }
  
  .section-toggle {
    width: 100%;
    text-align: center;
    padding-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
    margin-top: 0.5rem;
    margin-left: 0;
  }
}

.transcript-text-clickable {
  position: relative;
}

.transcript-segment-text {
  transition: background-color 0.2s ease, color 0.2s ease;
  border-radius: 3px;
  padding: 1px 2px;
  margin: 0 1px;
}

.transcript-segment-text:hover {
  background-color: #f0f7ff;
  color: var(--accent);
}

.transcript-segment-text.playing-text {
  background-color: #e8f4fd;
  color: var(--accent);
  font-weight: 500;
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

.transcript-tooltip {
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
  z-index: 1000;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.rollon-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--accent);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  font-size: 0.9rem;
  font-weight: 500;
  animation: slideIn 0.3s ease-out;
}

.rollon-notification.error {
  background: #dc3545;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.rollon-toggle {
  margin: 1rem 0;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e2e2e2;
}

.rollon-toggle label {
  font-size: 0.9rem;
  color: var(--fg);
}

.rollon-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.music-events {
  border-top: 1px solid #eee;
  padding-top: 1rem;
}

.music-events h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.music-events ul {
  gap: 0.5rem;
}

.music-events li {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--muted);
}

.music-events li strong {
  color: var(--fg);
}

/* Collapsible segments section */
.segments-collapsible {
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  margin-top: 2rem;
}

.segments-collapsible summary {
  cursor: pointer;
  padding: 1rem 1.25rem;
  background: #f8f9fa;
  border-radius: 8px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.segments-collapsible summary::-webkit-details-marker {
  display: none;
}

.segments-collapsible summary::before {
  content: "▶";
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.segments-collapsible[open] summary::before {
  transform: rotate(90deg);
}

.segments-collapsible summary h2 {
  margin: 0;
  font-size: 1.1rem;
}

.segments-collapsible[open] summary {
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid #e2e2e2;
}

.segments-collapsible .segments-container {
  padding: 1rem 1.25rem;
}

.segments-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.segment {
  background: white;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.segment header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Music segments - warm amber/gold */
.segment.music,
.segment.possibly-music {
  border-color: #cfa972;
  background: #fff7ec;
}

.segment.music .segment-badge,
.segment.possibly-music .segment-badge.music-badge {
  background: #c37a1b;
  color: white;
}

/* Ad break segments - muted gray */
.segment.ad-break {
  border-color: #aaa;
  background: #f5f5f5;
  opacity: 0.8;
}

.segment.ad-break .segment-badge.ad-badge {
  background: #666;
  color: white;
}

.segment.ad-break p {
  color: var(--muted);
  font-style: italic;
}

/* Combined ad + music */
.segment.ad-break.possibly-music {
  border-color: #999;
  background: linear-gradient(135deg, #f5f5f5 50%, #fff7ec 50%);
}

.segment-badge {
  align-self: flex-start;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #4c6ef5;
  color: white;
  text-transform: uppercase;
}

.segment-badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* Song info display */
.segment-song-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #c37a1b;
  margin-top: 0.25rem;
}

.segment-song-info .song-icon {
  font-size: 1rem;
}

.segment-song-info .song-title {
  font-weight: 600;
}

.segment-song-info .song-artist {
  color: var(--muted);
}

/* Text block styling for ads and music */
.transcript-segment-text.ad-text {
  color: var(--muted);
  font-style: italic;
  background-color: #f0f0f0;
}

.transcript-segment-text.music-text {
  background-color: #fff7ec;
  color: #8b6914;
}

.transcript-segment-text.ad-text:hover {
  background-color: #e8e8e8;
  color: #666;
}

.transcript-segment-text.music-text:hover {
  background-color: #ffe8cc;
  color: #6b4c00;
}

/* Transcript Legend */
.transcript-legend {
  background: white;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

.legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Transcript summary stats */
.transcript-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #eee;
}

.transcript-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.transcript-stat .stat-icon {
  font-size: 1rem;
}

.transcript-stat .stat-label {
  color: var(--muted);
}

.transcript-stat .stat-value {
  font-weight: 600;
}

.segment p {
  margin: 0;
  font-size: 1rem;
  color: var(--fg);
  line-height: 1.5;
  white-space: pre-wrap;
}

.segment:hover {
  background-color: #f8f9fa;
  border-color: var(--accent);
  transform: translateX(2px);
}

.segment:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.segment.playing {
  background-color: #e8f4fd;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

.segment.playing.music {
  background-color: #fff3e0;
  border-color: #c37a1b;
}

.segment-range {
  user-select: none;
}

.segment-range:hover {
  color: var(--accent);
  text-decoration: underline;
}

.audio-player-section {
  background: white;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  padding: 1.25rem;
}

.audio-player-section h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
}

.audio-player-container {
  width: 100%;
}

.audio-player-container audio {
  width: 100%;
  max-width: 100%;
}

@media (max-width: 768px) {
  .segment:hover {
    transform: none;
  }

  .audio-player-container audio {
    width: 100%;
  }
}

/* Visual Timeline */
.timeline-container {
  margin-top: 1rem;
  padding: 0.5rem 0;
  position: relative;
}

.timeline-bar {
  position: relative;
  height: 24px;
  background: #e8ecf4;
  border-radius: 4px;
  cursor: pointer;
  overflow: hidden;
}

.timeline-segment {
  position: absolute;
  top: 0;
  height: 100%;
  transition: opacity 0.15s ease;
}

.timeline-segment:hover {
  opacity: 0.8;
}

/* Timeline segment colors */
.tl-talk {
  background: #e8ecf4;
}

.tl-ad {
  background: linear-gradient(180deg, #9ca3af 0%, #6b7280 100%);
}

.tl-music {
  background: linear-gradient(180deg, #a78bfa 0%, #8b5cf6 100%);
}

.tl-news {
  background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
}

/* Timeline playhead */
.timeline-playhead {
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 24px;
  background: #ef4444;
  border-radius: 1px;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.5);
}

/* Timeline tooltip */
.timeline-tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  white-space: pre-line;
  pointer-events: none;
  z-index: 20;
  margin-bottom: 8px;
  max-width: 180px;
  text-align: center;
  word-break: break-word;
}

.timeline-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.85);
}

/* Timeline labels */
.timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
  font-family: monospace;
}

/* Timeline legend */
.timeline-legend {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.tl-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.tl-legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.tl-color-talk {
  background: #e8ecf4;
  border: 1px solid #d0d7e8;
}

.tl-color-ad {
  background: linear-gradient(180deg, #9ca3af 0%, #6b7280 100%);
}

.tl-color-music {
  background: linear-gradient(180deg, #a78bfa 0%, #8b5cf6 100%);
}

.tl-color-news {
  background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
}

/* Timeline mobile styles */
@media (max-width: 768px) {
  .timeline-bar {
    height: 32px; /* Larger touch target */
  }
  
  .timeline-playhead {
    height: 32px;
    width: 4px;
  }
  
  .timeline-tooltip {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
  }
  
  .timeline-legend {
    gap: 0.75rem;
  }
  
  .tl-legend-item {
    font-size: 0.75rem;
  }
  
  /* Transcript sections mobile */
  .transcript-section {
    padding: 0.5rem 0.75rem;
  }
  
  .section-label {
    font-size: 0.75rem;
  }
  
  .segment-nav {
    justify-content: space-between;
  }

  .segment-nav-btn {
    flex: 1;
    text-align: center;
  }
  
  /* Summary section mobile */
  .ai-detected-section {
    padding-top: 0.75rem;
    margin-top: 0.75rem;
  }
  
  .detected-item {
    padding: 0.5rem;
  }
  
  .detected-item .item-icon {
    font-size: 1rem;
  }
  
  .timestamp-link {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
  }
}

.placeholder {
  color: var(--muted);
  font-style: italic;
}

.error {
  color: #d13b3b;
}

@media (max-width: 1100px) {
  main {
    grid-template-columns: 1fr;
  }
}

/* Compact view reordering - search results first */
@media (max-width: 768px) {
  header nav {
    flex-wrap: wrap;
  }
  
  main {
    display: flex;
    flex-direction: column;
  }
  
  .results {
    order: 1; /* First after search box */
  }
  
  .stations {
    order: 2;
  }
  
  .recordings {
    order: 3;
  }
}

/* Search highlighting */
mark,
.search-highlight {
  background: #fff59d;
  color: #000;
  padding: 0.1em 0.2em;
  border-radius: 3px;
  font-weight: 500;
}

.search-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-bottom: 1px solid #90caf9;
  color: #1565c0;
  font-size: 0.95rem;
}

.search-banner-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-banner-text strong {
  color: #0d47a1;
}

.search-banner-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #1565c0;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.15s;
}

.search-banner-clear:hover {
  background: #0d47a1;
}


/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 4px;
}

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

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5rem;
}

.skeleton-text.short {
  width: 40%;
}

.skeleton-text.medium {
  width: 70%;
}

.skeleton-text.long {
  width: 90%;
}

.skeleton-card {
  padding: 1rem;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  background: white;
}

.skeleton-card .skeleton-title {
  height: 1.2em;
  width: 60%;
  margin-bottom: 0.75rem;
}

.skeleton-card .skeleton-line {
  height: 0.9em;
  margin-bottom: 0.5rem;
}

.skeleton-card .skeleton-meta {
  height: 0.8em;
  width: 30%;
  margin-top: 0.75rem;
}

/* Skeleton for status list */
.skeleton-status-item {
  list-style: none;
  margin-bottom: 0.75rem;
}

/* Skeleton for transcript meta */
.skeleton-meta-loading {
  padding: 0.5rem 0;
}

.skeleton-line {
  display: block;
}

.skeleton-segment {
  border-radius: 8px;
}

/* Skeleton grid for cards */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

/* Shared Footer */
.site-footer {
  margin-top: 3rem;
  padding: 2rem 0;
  border-top: 1px solid #e2e2e2;
  text-align: center;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-nav a:hover {
  color: var(--accent);
}

.footer-text {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

.footer-version {
  color: var(--muted);
  font-size: 0.7rem;
  margin: 0.5rem 0 0 0;
  opacity: 0.6;
}
