/* =========================================================
   COMMUNITY RADIOS
   Retro Ops Console UI
   ========================================================= */


/* =====================================================
OPS CONSOLE HEADER
=====================================================*/

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

  background:#161b22;
  border:1px solid #30363d;
  border-radius:6px;

  padding:10px 14px;
  margin-bottom:20px;
}

.console-title{
  font-weight:700;
  letter-spacing:0.12em;
  color:#d29922;
}

.console-meta{
  font-size:0.75rem;
  color:#8b949e;
}

.console-meta a{
  color:#8b949e;
  text-decoration:none;
}

.console-meta a:hover{
  color:#58a6ff;
}


/* -------------------------
   RESET
--------------------------*/

* {
  box-sizing: border-box;
}

body {
  margin:0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background:#0d1117;
  color:#c9d1d9;
  line-height:1.4;
}


/* -------------------------
   LAYOUT
--------------------------*/

.container{
  max-width:1100px;
  margin:auto;
  padding:0 20px;
}

.main{
  padding:30px 0;
  min-height:70vh;
}

/* -------------------------
   TOP BAR
--------------------------*/

.topbar{
  border-bottom:1px solid #30363d;
  background:#0b0f14;
}

.topbar-inner{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  padding:10px 0;
}

/* TITLE */

.site-title a{
  text-decoration:none;
  color:#d29922;
  font-weight:700;
  letter-spacing:0.14em;
}

.site-title a:hover{
  color:#f0b44c;
}


/* -------------------------
   NAVIGATION
--------------------------*/

.nav{
  display:flex;
  flex-direction:column;
  gap:1px;
  font-size:0.82rem;
  text-transform:lowercase;
}

.nav-row{
  display:flex;
  align-items:center;
  gap:0;
  line-height:1.5;
}

.nav-row-admin{
  opacity:0.85;
}

/* nav groups */

.nav-group{
  display:inline-flex;
  align-items:center;
  gap:0;
}

.nav-label{
  font-size:0.72rem;
  letter-spacing:0.06em;
  color:#6e5a1e;
  margin-right:2px;
  user-select:none;
}

/* links */

.nav a{
  text-decoration:none;
  color:#8b949e;
  padding:2px 4px;
  white-space:nowrap;
}

.nav a:hover{
  color:#58a6ff;
}

/* separators: only within .nav-group, not on first link */

.nav-group a::before{
  content:"/";
  color:#484f58;
  margin-right:4px;
}

.nav-group a:first-of-type::before{
  content:none;
}

/* user + logout cluster (right side) */

.nav-end{
  display:inline-flex;
  align-items:center;
  gap:0;
  margin-left:auto;
}

.nav-end a{
  color:#6e7681;
}

.nav-end a:hover{
  color:#58a6ff;
}

/* username */

.nav-user{
  color:#6e7681;
  padding:2px 4px;
}

/* admin row links are amber */

.nav-row-admin a{
  color:#9e8c45;
}

.nav-row-admin a:hover{
  color:#f0b44c;
}

.site-title::after{
  content:"_";
  margin-left:4px;
  animation:blink 1s infinite;
}

@keyframes blink{
  0%,50%,100%{opacity:1;}
  25%,75%{opacity:0;}
}

.nav a.active{
  color:#58a6ff;
}

/* -------------------------
   FOOTER
--------------------------*/

.footer{
  border-top:1px solid #30363d;
  background:#161b22;
  margin-top:40px;
}

.footer-inner{
  display:flex;
  justify-content:space-between;
  padding:18px 0;
  font-size:0.75rem;
  color:#8b949e;
}

.footer-links a{
  margin-left:16px;
  color:#8b949e;
  text-decoration:none;
}

.footer-links a:hover{
  color:#58a6ff;
}


/* -------------------------
   PANEL SYSTEM
--------------------------*/

.panel{
  background:#161b22;
  border:1px solid #30363d;
  border-radius:6px;

  padding:16px 18px;
  margin-bottom:20px;

  box-shadow:0 0 0 1px rgba(0,0,0,0.2) inset;
}

.panel-title{
  font-size:0.7rem;
  letter-spacing:0.14em;
  text-transform:uppercase;

  color:#8b949e;

  margin-bottom:10px;
  padding-bottom:6px;

  border-bottom:1px solid #21262d;
}


/* -------------------------
   STATS BOX
--------------------------*/

.stat-box{
  background:#0d1117;
  border:1px solid #30363d;
  padding:10px 14px;
  border-radius:4px;

  min-width:140px;

  transition:border-color 0.15s;
}

.stat-box:hover{
  border-color:#58a6ff;
}

.stat-label{
  font-size:0.65rem;
  color:#8b949e;
  letter-spacing:0.08em;
  text-transform:uppercase;
}

.stat-value{
  font-size:1.4rem;
  font-weight:700;
  color:#e6edf3;
}


/* -------------------------
   LED INDICATORS
--------------------------*/

.led-green{ color:#3fb950; text-shadow:0 0 4px rgba(63,185,80,0.4); }
.led-red{ color:#f85149; text-shadow:0 0 4px rgba(248,81,73,0.4); }
.led-amber{ color:#d29922; text-shadow:0 0 4px rgba(210,153,34,0.4); }
.led-gray{ color:#484f58; }


/* -------------------------
   PROGRESS BAR
--------------------------*/

.progress-track {
  height: 5px;
  background: #21262d;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}
.progress-fill {
  height: 100%;
  background: #3fb950;
  border-radius: 3px;
  transition: width 0.3s ease;
}
.progress-fill.fill-warn { background: #d29922; }
.progress-fill.fill-fail { background: #f85149; }


/* -------------------------
   TABLES (terminal style)
--------------------------*/

.mono-table{
  width:100%;
  border-collapse:collapse;
  font-size:0.82rem;
}

.mono-table th{
  text-align:left;
  font-size:0.65rem;
  letter-spacing:0.1em;
  text-transform:uppercase;
  color:#8b949e;
  border-bottom:1px solid #30363d;
  padding:6px 8px;
}

.mono-table td{
  padding:6px 8px;
  border-bottom:1px solid #21262d;
}

.mono-table tr:last-child td{
  border-bottom:none;
}
.mono-table tr:hover td{
  background:#0d1117;
}

/* -------------------------
   NUMERIC COLORS
--------------------------*/

.num-run{ color:#d29922; }
.num-done{ color:#3fb950; }
.num-fail{ color:#f85149; font-weight:700; }
.num-mute{ color:#484f58; }


/* -------------------------
   LINKS
--------------------------*/

a{
  color:#58a6ff;
}

a:hover{
  color:#79c0ff;
}


/* -------------------------
   SUBTITLE
--------------------------*/

.sub-title{
  font-size:0.7rem;
  letter-spacing:0.08em;
  color:#8b949e;
  text-transform:uppercase;
  margin:12px 0 6px;
}


/* -------------------------
   ERROR TEXT
--------------------------*/

.error-excerpt{
  font-size:0.75rem;
  color:#8b949e;
  max-width:400px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}


/* -------------------------
   OPTIONAL TERMINAL EFFECT
--------------------------*/

body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;

  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 2px,
    rgba(255,255,255,0.02) 3px
  );
}


/* -------------------------
   DASHBOARD GRID
--------------------------*/

.dashboard-grid{
  display:grid;
  grid-template-columns: 2fr 1fr;
  gap:20px;
}

.dashboard-wide{
  grid-column:1 / -1;
}


/* =====================================================
   RADIO DETAIL PAGE
=====================================================*/


.radio-header{
  display:flex;
  align-items:center;
  gap:20px;
}

.radio-logo img{
  width:90px;
  height:90px;
  object-fit:cover;
  border-radius:6px;
}

.radio-title h1{
  margin:0;
  font-size:1.4rem;
}

.radio-meta{
  color:#8b949e;
  font-size:0.85rem;
}

.radio-actions{
  margin-left:auto;
}


/* =====================================================
   SOURCE CARD (reusable radio/feed info card)
=====================================================*/

.source-card-row{
  display:flex;
  align-items:center;
  gap:16px;
}

.source-card-logo{
  flex:0 0 64px;
  width:64px;
  height:64px;
  display:block;
}

.source-card-logo img{
  display:block;
  width:64px;
  height:64px;
  object-fit:cover;
  border-radius:6px;
  border:1px solid #30363d;
}

.source-card-info{
  flex:1;
  min-width:0;
}

.source-card-name{
  margin:0;
  font-size:1.15rem;
  line-height:1.3;
}

.source-card-name a{
  color:#e6edf3;
  text-decoration:none;
}

.source-card-name a:hover{
  color:#58a6ff;
}

.source-card-motto{
  color:#8b949e;
  font-size:0.78rem;
  font-style:italic;
  margin-top:2px;
}

.source-card-meta{
  display:flex;
  flex-wrap:wrap;
  gap:2px 0;
  margin-top:6px;
  font-size:0.78rem;
  color:#8b949e;
}

.source-card-meta span::before{
  content:" \00b7 ";
  color:#484f58;
}

.source-card-meta span:first-child::before{
  content:"";
}

.source-card-meta a{
  color:#58a6ff;
  text-decoration:none;
}

.source-card-meta a:hover{
  text-decoration:underline;
}

.source-card-nav{
  flex-shrink:0;
  margin-left:auto;
}

.source-card-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:-12px;
  margin-bottom:20px;
}

.broadcast-date-bar{
  display:flex;
  align-items:baseline;
  gap:12px;
  margin-bottom:20px;
}

.broadcast-date-bar h2{
  margin:0;
  font-size:1rem;
  color:#e6edf3;
}


/* GRID */

.radio-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px;
  margin-top:20px;
}


/* TAGS */

.tag-list{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.tag{
  padding:2px 8px;
  border:1px solid #30363d;
  background:#0d1117;
  font-size:0.75rem;
  color:#c9d1d9;
  text-decoration:none;
  display:inline-block;
}

a.tag:hover{
  border-color:#58a6ff;
  color:#58a6ff;
}

.tag-active{
  border-color:#58a6ff;
  color:#58a6ff;
}


/* TEXT BLOCK */

.text-block{
  white-space:pre-line;
  font-size:0.9rem;
}


/* STREAMS */

.stream-block{
  margin-top:14px;
  padding-top:10px;
  border-top:1px solid #30363d;
}

.stream-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:6px;
}

.stream-name{
  font-weight:600;
}

.stream-controls{
  display:flex;
  gap:10px;
  align-items:center;
}

.audio-player{
  width:100%;
}

/* -------------------------
   CHECKBOXES
--------------------------*/

input[type="checkbox"]{
  appearance:none;
  -webkit-appearance:none;

  width:16px;
  height:16px;

  border:1px solid #30363d;
  background:#0d1117;

  border-radius:3px;

  cursor:pointer;
  position:relative;
}

/* hover */

input[type="checkbox"]:hover{
  border-color:#58a6ff;
}

/* checked */

input[type="checkbox"]:checked{
  background:#238636;
  border-color:#238636;
}

/* checkmark */

input[type="checkbox"]:checked::after{
  content:"";
  position:absolute;

  left:4px;
  top:1px;

  width:4px;
  height:8px;

  border:solid #ffffff;
  border-width:0 2px 2px 0;

  transform:rotate(45deg);
}


/* BUTTONS */

.button{
  border:1px solid #30363d;
  padding:6px 12px;
  text-decoration:none;
  background:#0d1117;
  color:#c9d1d9;
  cursor:pointer;
  transition:background 0.15s;
}

.button:hover{
  background:#161b22;
}

.button-small{
  display:inline-block;
  font-size:0.75rem;
  border:1px solid #30363d;
  padding:3px 8px;
  text-decoration:none;
  background:#0d1117;
  color:#c9d1d9;
  cursor:pointer;
}

.button-small:hover{
  background:#161b22;
}


/* ADMIN FOOTER */

.admin-footer{
  margin-top:20px;
  text-align:right;
  font-size:0.85rem;
}


/* =====================================================
RECORDINGS PAGE
=====================================================*/

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

.filter-grid{
display:flex;
gap:20px;
flex-wrap:wrap;
align-items:end;
}

.filter-grid input{
border:1px solid #30363d;
background:#0d1117;
color:#c9d1d9;
padding:5px 8px;
}

.filter-actions{
display:flex;
gap:10px;
}

.recordings-list{
margin-top:20px;
}

.recording-block{
border:1px solid #30363d;
background:#161b22;
margin-bottom:12px;
}

.seg-highlight{
border-color:#d29922 !important;
box-shadow:0 0 0 2px rgba(210,153,34,0.35);
transition:border-color 2s ease, box-shadow 2s ease;
}

.recording-summary{
display:flex;
gap:20px;
align-items:center;
padding:10px 14px;
cursor:pointer;
}

.rec-stream{
font-weight:600;
}

.rec-time{
color:#8b949e;
font-size:0.85rem;
}

.tz-label{
color:#484f58;
font-size:0.72rem;
margin-left:0.25rem;
}

.rec-stages{
margin-left:auto;
display:flex;
gap:6px;
}

.recording-content{
border-top:1px solid #30363d;
padding:14px;
}

.section-label{
font-size:0.7rem;
letter-spacing:0.08em;
color:#8b949e;
text-transform:uppercase;
margin-bottom:6px;
}

.player-actions{
margin-top:6px;
display:flex;
gap:10px;
}

.pipeline-error{
border:1px solid #f85149;
background:#2d1111;
padding:10px;
margin-top:10px;
}

.segments{
margin-top:12px;
}

.segment-block{
border-top:1px solid #30363d;
padding:10px 0;
}

.segment-header{
display:flex;
gap:10px;
align-items:center;
font-size:0.8rem;
margin-bottom:6px;
}

.segment-type{
padding:1px 6px;
border:1px solid #30363d;
font-size:0.7rem;
}

.segment-type.type-speech{color:#58a6ff;}
.segment-type.type-music{color:#d29922;}
.segment-type.type-noise{color:#8b949e;}

.segment-time{
color:#8b949e;
}

.segment-text{
margin-top:6px;
font-size:0.85rem;
}

.segment-meta{
font-size:0.75rem;
color:#8b949e;
}

.segment-extra summary{
cursor:pointer;
font-size:0.75rem;
color:#8b949e;
}

.summary-block{
border-top:1px solid #30363d;
margin-top:10px;
padding-top:10px;
}

.summary-text{
font-size:0.9rem;
background-color:#1c2633;
padding:0.75rem 1rem;
border-radius:6px;
}

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

.song-unknown{
font-size:0.8rem;
color:#8b949e;
}

.empty-note{
color:#8b949e;
font-size:0.85rem;
}

.center{
text-align:center;
}

/* =====================================================
   BROADCAST DAY — SHOW BLOCKS
=====================================================*/

.show-block{
border:1px solid #30363d;
background:#161b22;
margin-bottom:12px;
}

.show-header{
padding:14px;
}

.show-header-top{
display:flex;
gap:16px;
align-items:center;
margin-bottom:8px;
}

.show-summary{
margin-bottom:8px;
line-height:1.5;
}

/* --- Song grid --- */

.show-songs{
border-top:1px solid #30363d;
padding:14px;
}

.song-grid{
display:grid;
grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));
gap:10px;
}

.song-card{
display:grid;
grid-template-columns:56px 1fr;
grid-template-rows:auto auto;
gap:0 10px;
background:#0d1117;
border:1px solid #21262d;
border-radius:4px;
padding:8px;
align-items:start;
}

.song-cover{
grid-row:1;
width:56px;
height:56px;
object-fit:cover;
border-radius:3px;
background:#21262d;
}

.song-cover-placeholder{
width:56px;
height:56px;
border-radius:3px;
background:#21262d;
}

.song-info{
grid-row:1;
min-width:0;
}

.song-info .song-title{
font-weight:600;
font-size:0.85rem;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}

.song-artist{
font-size:0.8rem;
color:#c9d1d9;
}

.song-info .song-album{
font-size:0.75rem;
color:#8b949e;
}

.song-genres{
display:flex;
flex-wrap:wrap;
gap:3px;
margin-top:3px;
}

.tag-sm{
font-size:0.6rem !important;
padding:0 4px !important;
}

.song-player{
grid-column:1 / -1;
width:100%;
height:28px;
margin-top:4px;
}

/* --- Speech transcription (collapsible) --- */

.show-detail-section{
border-top:1px solid #30363d;
}

.show-detail-toggle{
cursor:pointer;
padding:10px 14px;
font-size:0.8rem;
font-weight:600;
color:#8b949e;
letter-spacing:0.04em;
text-transform:uppercase;
}

.show-detail-toggle:hover{
color:#c9d1d9;
}

.speech-segments{
padding:0 14px 14px;
}

.speech-segment{
border-top:1px solid #21262d;
padding:8px 0;
}

.speech-segment:first-child{
border-top:none;
}

.speech-segment-header{
display:flex;
gap:8px;
align-items:center;
margin-bottom:4px;
font-size:0.75rem;
}

.segment-lang{
color:#8b949e;
font-style:italic;
}

.segment-text-en{
color:#8b949e;
font-style:italic;
margin-top:2px;
}

.speech-player{
width:100%;
height:28px;
margin-top:4px;
}

/* --- LLM debug panel (admin only) --- */

.llm-debug-panel{
margin-bottom:16px;
}

.llm-debug-toggle{
cursor:pointer;
border-bottom:none;
}

.llm-debug-panel[open] .llm-debug-toggle{
border-bottom:1px solid #30363d;
}

.llm-record{
padding:12px 14px;
border-top:1px solid #21262d;
}

.llm-record:first-of-type{
border-top:none;
}

.llm-record-section{
margin-top:6px;
}

.llm-section-toggle{
cursor:pointer;
font-size:0.75rem;
font-weight:600;
color:#8b949e;
text-transform:uppercase;
letter-spacing:0.04em;
padding:4px 0;
}

.llm-section-toggle:hover{
color:#c9d1d9;
}

.llm-text{
margin:6px 0 0;
padding:10px 12px;
background:#161b22;
border:1px solid #21262d;
border-radius:4px;
font-size:0.75rem;
color:#c9d1d9;
white-space:pre-wrap;
word-break:break-word;
}

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

.llm-copy-btn{
cursor:pointer;
background:none;
border:1px solid #30363d;
border-radius:4px;
color:#8b949e;
font-size:0.7rem;
padding:2px 8px;
transition:color .15s, border-color .15s;
}

.llm-copy-btn:hover{
color:#c9d1d9;
border-color:#8b949e;
}

.llm-copy-btn.copied{
color:#3fb950;
border-color:#3fb950;
}

/* --- Dual timezone display --- */

.tz-alt{
font-size:0.75rem;
color:#8b949e;
margin-left:4px;
}

/* --- Show header as flex row (matches recording-summary) --- */

.show-header-row{
cursor:default;
}

.show-body{
border-top:1px solid #30363d;
padding:10px 14px;
}

.show-body:empty{
display:none;
}

/* --- Segment player (generic audio player in segment blocks) --- */

.segment-player{
width:100%;
height:28px;
margin-top:6px;
}

/* --- Song cover placeholder (visible on dark background) --- */

.song-cover-placeholder{
display:flex;
align-items:center;
justify-content:center;
background:#21262d;
border:1px solid #30363d;
}

.song-cover-placeholder::after{
content:"♪";
color:#484f58;
font-size:1.2rem;
}

/* --- Timeline song entries (inline, compact) --- */

.timeline-song-entry{
display:flex;
gap:10px;
align-items:flex-start;
margin-top:6px;
}

.timeline-song-cover{
width:40px;
height:40px;
object-fit:cover;
border-radius:3px;
background:#21262d;
border:1px solid #30363d;
flex-shrink:0;
}

.timeline-song-cover.song-cover-placeholder{
width:40px;
height:40px;
}

.timeline-song-cover.song-cover-placeholder::after{
font-size:0.9rem;
}

.timeline-song-entry .song-title{
font-size:0.85rem;
}

.timeline-song-entry .song-artist{
font-size:0.8rem;
}

.timeline-song-entry .song-album{
font-size:0.75rem;
color:#8b949e;
}

/* =====================================================
   RADIO DIRECTORY
=====================================================*/

.radio-directory{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
  gap:14px;
}

.radio-card{
  display:block;
  border:1px solid #30363d;
  background:#161b22;
  border-radius:6px;
  overflow:hidden;
  text-decoration:none;
  color:inherit;
}

.radio-card:hover{
  border-color:#58a6ff;
  background:#0d1117;
}

/* LOGO */

.radio-card-logo{
  height:90px;
  background:#0d1117;
  border-bottom:1px solid #30363d;
}

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

/* BODY */

.radio-card-body{
  padding:10px 12px;
}

.radio-card-name{
  font-weight:700;
  margin-bottom:2px;
}

.radio-card-frequency{
  font-size:0.8rem;
  color:#8b949e;
}

.radio-card-location{
  font-size:0.8rem;
  color:#8b949e;
  margin-bottom:6px;
}

.radio-card-tags{
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  margin-bottom:6px;
}

.radio-card-live{
  font-size:0.75rem;
  color:#3fb950;
}


/* STREAM SETTINGS */

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

.stream-title{
  font-weight:700;
  color:#d29922;
  letter-spacing:0.1em;
}

.stream-meta{
  font-size:0.8rem;
  color:#8b949e;
}

.stream-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px;
  margin-bottom:20px;
}

.form-actions{
  margin-top:12px;
}


/* =====================================================
GLOBAL PIPELINE SETTINGS
=====================================================*/

.pipeline-header{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.pipeline-title{
  font-weight:700;
  color:#d29922;
  letter-spacing:0.12em;
}

.pipeline-chain{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px;
  font-size:0.85rem;
}

.pipeline-stage{
  padding:2px 8px;
  border:1px solid #30363d;
  background:#0d1117;
}

.pipeline-arrow{
  color:#8b949e;
}

.pipeline-field{
  display:flex;
  flex-direction:column;
  gap:2px;
}

.pipeline-help{
  font-size:0.75rem;
  color:#8b949e;
}

.form-actions{
  margin-top:14px;
}

.recording-info{
  margin-top:10px;
  font-size:0.85rem;
}

.recording-info div{
  margin-bottom:4px;
}

.label{
  display:inline-block;
  width:80px;
  color:#8b949e;
}

.panel-warning{
  border:1px solid #f85149;
}

.warning-text{
  color:#f85149;
  margin-bottom:8px;
}

.warning-list{
  margin-left:16px;
  margin-bottom:10px;
  color:#c9d1d9;
}

.playlist-filter{
  display:block;
  width:100%;
  max-width:300px;
  padding:5px 10px;
  margin-bottom:12px;
  background:#0d1117;
  border:1px solid #30363d;
  border-radius:4px;
  color:#c9d1d9;
  font-family:inherit;
  font-size:0.8rem;
  box-sizing:border-box;
}

.playlist-filter:focus{
  outline:none;
  border-color:#58a6ff;
}

.button-danger{
  border-color:#f85149;
  color:#f85149;
}

.button-danger:hover{
  background:#f85149;
  color:#0d1117;
}

.button-row{
  display:flex;
  gap:12px;
  margin-top:16px;
}

/***** STAGE BADGE *****/




/* Stage badges */

.stage-badge{
  font-size:0.7rem;
  font-weight:600;
  padding:2px 6px;
  border-radius:4px;
  border:1px solid #30363d;
  margin-left:4px;
}


/* DONE */

.stage-done {
    background: green;
}

/* RUNNING */

.stage-running{
  background:#3b2f0b;
  color:#d29922;
  border-color:#d29922;
}
.stage-running{
  color:#d29922;
  border-color:#d29922;
  animation: pulse 1.2s infinite;
}

@keyframes pulse{
  0%{opacity:1;}
  50%{opacity:0.5;}
  100%{opacity:1;}
}

/* FAILED */

.stage-failed{
  background:#3b0d0d;
  color:#f85149;
  border-color:#f85149;
}


/* PENDING */

.stage-pending{
  background:#161b22;
  color:#8b949e;
}


/* SKIPPED */

.stage-skipped{
  background:#161b22;
  color:#6e7681;
}


/* TOO SHORT */

.stage-too_short{
  background:#1a1a0e;
  color:#9e8c45;
  border-color:#9e8c45;
}


/* =====================================================
   PER-RADIO PIPELINE TABLE
=====================================================*/

.table-scroll{
  overflow-x:auto;
}

.pipeline-radio-table th{
  text-align:center;
  white-space:nowrap;
}

.pipeline-radio-table th:first-child{
  text-align:left;
}

.pipeline-col-actions{
  font-size:0.65rem;
  color:#8b949e;
  margin-top:3px;
  font-weight:400;
  letter-spacing:0;
  text-transform:none;
}

.pipeline-col-actions a{
  color:#58a6ff;
  text-decoration:none;
}

.pipeline-col-actions a:hover{
  text-decoration:underline;
}

.pipeline-cb-cell{
  text-align:center;
}

.radio-meta-small{
  font-size:0.72rem;
  color:#8b949e;
  margin-left:6px;
}


/* =====================================================
   REFACTOR: shared utility classes (replace inline styles)
===================================================== */

/* Muted text */
.muted    { color:#8b949e; }
.muted-sm { color:#8b949e; font-size:0.75rem; }
.dim      { color:#484f58; }
.dim-sm   { color:#484f58; font-size:0.75rem; }

/* Pagination row */
.pagination          { text-align:center; }
.pagination-summary  { margin:0 1rem; color:#8b949e; }

/* Compact filter inputs (used in songs_played) */
.filter-input {
  background:#0d1117;
  color:#c9d1d9;
  border:1px solid #30363d;
  padding:5px 8px;
}

/* Song / album thumbnails */
.song-thumb {
  width:48px;
  height:48px;
  object-fit:cover;
  border:1px solid #30363d;
  flex-shrink:0;
  display:block;
}
.song-thumb-lg {
  width:80px;
  height:80px;
}
.song-thumb-placeholder {
  background:#0d1117;
  border:1px solid #21262d;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:2rem;
  color:#484f58;
}

/* Song entry row (used inside segment_card music section + segment_detail) */
.song-entry {
  display:flex;
  gap:0.75rem;
  align-items:flex-start;
  padding:0.25rem 0;
}
.song-entry-lg {
  gap:1rem;
  padding:0.75rem 0;
  border-bottom:1px solid #21262d;
}
.song-entry-body { flex:1; }

/* Song meta-line (footer of large song entry) */
.song-meta-line {
  font-size:0.75rem;
  color:#484f58;
  margin-top:0.5rem;
}

/* Compact audio player (table cells) */
.segment-player-compact {
  width:200px;
  height:28px;
}

/* Add-to-playlist cell (songs_played table) */
.add-cell { text-align:center; padding:0; }

/* Footer meta strip on segment cards */
.segment-meta-foot {
  margin-top:0.5rem;
  font-size:0.75rem;
  color:#484f58;
}

/* Songs_played table cells: nowrap stamps */
.cell-nowrap { white-space:nowrap; }

/* Inline placeholder for "no audio file" in tables */
.no-file-note { color:#484f58; font-size:0.8rem; }

/* segment_detail: header subtitle, meta strip, error blocks */
.segment-detail-source  { margin-top:0.25rem; }
.meta-strip             { display:flex; flex-wrap:wrap; gap:1.5rem; align-items:flex-start; }
.badge-row              { display:flex; gap:0.4rem; flex-wrap:wrap; margin-top:0.25rem; }
.meta-offsets           { margin-top:0.75rem; }
.badge-protected        { font-size:0.7rem; padding:1px 6px; border:1px solid #d29922; color:#d29922; border-radius:3px; }
.badge-manual           { font-size:0.7rem; padding:1px 6px; border:1px solid #388bfd; color:#388bfd; border-radius:3px; }
.button-sm              { font-size:0.75rem; padding:3px 8px; }

/* Manual song assignment (segment_detail, staff only) */
.song-assign-search     { display:flex; gap:8px; margin-bottom:12px; }
.song-assign-results    { border-top:1px solid #21262d; padding-top:8px; }
.song-assign-result     { cursor:pointer; border-radius:4px; padding:6px 8px !important; }
.song-assign-result:hover { background:#161b22; }
.song-assign-freetext   { margin-top:12px; }
.segment-language-line  { margin-bottom:0.75rem; }
.transcript-large       { font-size:1rem; line-height:1.6; }
.error-summary          { color:#f85149; }
.error-pre              { white-space:pre-wrap; font-size:0.75rem; color:#f85149; }
.day-overview-meta      { margin-top:0.5rem; }

/* songs_played table */
.col-add { width:40px; text-align:center; }
.col-art { width:60px; }
.col-artist { font-size:0.9rem; }
.song-thumb-row { width:52px; height:52px; }
.song-album-line { font-size:0.8rem; color:#8b949e; }
.musicbrainz-link { display:inline-block; margin-top:0.15rem; }
.filter-input-narrow { width:90px; }

/* --- Audio player enhancements (speed + download, same row) --- */

.aum-player {
  display:flex;
  align-items:center;
  gap:6px;
  width:100%;
}

.aum-player audio {
  flex:1 1 0%;
  min-width:80px;
  margin:0 !important;
}

.aum-player-song {
  grid-column:1 / -1;
}

.aum-speed-btn {
  font-size:0.65rem;
  padding:2px 5px;
  background:none;
  border:1px solid #30363d;
  color:#8b949e;
  cursor:pointer;
  border-radius:3px;
  font-family:inherit;
  white-space:nowrap;
  flex-shrink:0;
  line-height:1.3;
}

.aum-speed-btn:hover {
  background:#21262d;
  color:#c9d1d9;
}

.aum-dl-btn {
  display:flex;
  align-items:center;
  color:#8b949e;
  text-decoration:none;
  flex-shrink:0;
}

.aum-dl-btn:hover {
  color:#c9d1d9;
}


/* -------------------------
   SEEN / UNSEEN TOGGLE
--------------------------*/

.panel-title-row {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
  padding-bottom:6px;
  border-bottom:1px solid #21262d;
}

.seen-btn {
  display:inline-block;
  font-size:0.7rem;
  letter-spacing:0.06em;
  padding:3px 10px;
  border:1px solid #30363d;
  border-radius:4px;
  color:#8b949e;
  background:#161b22;
  cursor:pointer;
  user-select:none;
  transition:all 0.15s;
}

.seen-btn:hover {
  border-color:#58a6ff;
  color:#58a6ff;
  background:#0d1117;
}

.seen-btn.is-seen {
  border-color:#238636;
  color:#3fb950;
  background:#0d1117;
}

.seen-btn.is-seen:hover {
  border-color:#f85149;
  color:#f85149;
}

.seen-toggle-icon {
  color:#484f58;
  font-size:0.9em;
  user-select:none;
}

.seen-toggle-icon:hover {
  color:#58a6ff;
}

.seen-toggle-icon.is-seen {
  color:#3fb950;
}

tr.seen-row > td {
  opacity:0.55;
}

tr.seen-row:hover > td {
  opacity:0.85;
}

/* =====================================================
   COLLAPSIBLE SETTINGS SECTIONS
===================================================== */

.collapsible-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.collapsible-header:hover .panel-title {
  color: #c9d1d9;
}

.collapse-icon {
  font-size: 0.75rem;
  color: #8b949e;
  width: 14px;
  display: inline-block;
  text-align: center;
}

/* Sub-navigation between control and settings pages */

.pipeline-subnav {
  padding: 8px 18px;
  font-size: 0.85rem;
}

.pipeline-subnav a {
  text-decoration: none;
  color: #8b949e;
  padding: 2px 4px;
}

.pipeline-subnav a:hover {
  color: #58a6ff;
}

.pipeline-subnav a.active {
  color: #d29922;
  font-weight: 700;
}

.pipeline-subnav .sep {
  color: #484f58;
  margin: 0 6px;
}

/* Form inputs inside settings tables */

.mono-table input[type="text"],
.mono-table input[type="url"],
.mono-table input[type="number"],
.mono-table textarea,
.mono-table select {
  width: 100%;
  border: 1px solid #30363d;
  background: #0d1117;
  color: #c9d1d9;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.85rem;
  border-radius: 3px;
  box-sizing: border-box;
}

.mono-table input[type="text"]:focus,
.mono-table input[type="url"]:focus,
.mono-table input[type="number"]:focus,
.mono-table textarea:focus,
.mono-table select:focus {
  outline: none;
  border-color: #58a6ff;
}

.mono-table textarea {
  resize: vertical;
}

[x-cloak] { display: none !important; }

/* --- Multi-select dropdown (filter panel) --- */

.multi-select {
  position: relative;
}

.multi-select-trigger {
  width: 100%;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #0d1117;
  color: #c9d1d9;
  border: 1px solid #30363d;
  padding: 5px 8px;
  font-family: inherit;
  font-size: inherit;
}

.multi-select-trigger:hover {
  border-color: #58a6ff;
}

.multi-select-trigger-exclude {
  border-color: #f85149;
  color: #f85149;
}

.multi-select-trigger-exclude:hover {
  border-color: #ff7b72;
}

.multi-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 100%;
  max-height: 260px;
  overflow-y: auto;
  background: #0d1117;
  border: 1px solid #30363d;
  z-index: 50;
  margin-top: 2px;
}

.multi-select-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.8rem;
  color: #c9d1d9;
  white-space: nowrap;
}

.multi-select-option:hover {
  background: #161b22;
}

.multi-select-option input[type="checkbox"] {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* --- Sequential playback toggle --- */

.seq-toggle {
  font-size: 0.6rem;
  padding: 1px 5px;
  margin-left: 4px;
  border: 1px solid #30363d;
  background: none;
  color: #8b949e;
  cursor: pointer;
  font-family: inherit;
  vertical-align: middle;
}

.seq-toggle:hover {
  border-color: #58a6ff;
  color: #c9d1d9;
}

.seq-toggle.active {
  border-color: #3fb950;
  color: #3fb950;
}


/* =====================================================
   USER TAGS
   ===================================================== */

.user-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin: 6px 0;
}

.user-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #161b22;
  border: 1px solid #30363d;
  padding: 1px 7px;
  font-size: 0.75rem;
  color: #c9d1d9;
  border-radius: 3px;
  text-decoration: none;
  line-height: 1.5;
}

.user-tag-chip:hover { border-color: #58a6ff; }

.user-tag-chip-sm {
  padding: 0 5px;
  font-size: 0.7rem;
}

.user-tag-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.user-tag-link {
  color: inherit;
  text-decoration: none;
}

.user-tag-link:hover { text-decoration: underline; }

.user-tag-remove {
  background: none;
  border: none;
  color: #484f58;
  cursor: pointer;
  padding: 0 1px;
  font-size: 0.85rem;
  line-height: 1;
}

.user-tag-remove:hover { color: #f85149; }

.user-tags-inline {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-left: 6px;
}

.user-tag-input {
  background: #0d1117;
  color: #c9d1d9;
  border: 1px solid #30363d;
  padding: 2px 7px;
  font-size: 0.75rem;
  width: 150px;
  font-family: inherit;
  border-radius: 3px;
}

.user-tag-input:focus {
  outline: none;
  border-color: #58a6ff;
}

/* Tagify dark theme overrides */
.tagify {
  --tags-border-color: #30363d;
  --tags-hover-border-color: #484f58;
  --tags-focus-border-color: #58a6ff;
  --tags-bg: #0d1117;
  --tag-bg: #161b22;
  --tag-hover: #1f2937;
  --tag-text-color: #c9d1d9;
  --tag-text-color--edit: #c9d1d9;
  --tag-remove-bg: rgba(248,81,73,.15);
  --tag-remove-btn-color: #484f58;
  --tag-remove-btn-bg--hover: rgba(248,81,73,.25);
  --tag-inset-shadow-size: 1.1em;
  --tag-pad: 0.2em 0.5em;
  --input-color: #c9d1d9;
  --placeholder-color: #484f58;
  --placeholder-color-focus: #6e7681;
  --tags-disabled-bg: #161b22;
  --readonly-striped: 0;
  border-radius: 3px;
  min-height: 28px;
  font-size: 0.8rem;
}
.tagify:hover { border-color: var(--tags-hover-border-color); }
.tagify.tagify--focus { border-color: var(--tags-focus-border-color); }
.tagify__input { color: var(--input-color); }
.tagify__input::before { color: var(--placeholder-color); }
.tagify__tag { border-radius: 3px; }
.tagify__tag > div { line-height: 1.4; }
.tagify__tag__removeBtn:hover { background: var(--tag-remove-btn-bg--hover); }

.tagify__dropdown {
  background: #161b22;
  border: 1px solid #30363d;
  border-top: none;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.tagify__dropdown__item {
  color: #c9d1d9;
  padding: 5px 8px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tagify__dropdown__item--active { background: #21262d; }
.tagify__dropdown__item--create {
  color: #58a6ff;
  font-style: italic;
}
.tagify-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.user-tags-tagify-wrap { display: inline-block; min-width: 180px; }
.user-tags-tagify-wrap .tagify { min-height: 22px; font-size: 0.7rem; }
.user-tags-tagify-wrap .tagify .tagify__tag > div { padding: 0.1em 0.4em; }

.user-tag-edit-btn {
  background: none;
  border: none;
  color: #484f58;
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0 2px;
  line-height: 1;
}
.user-tag-edit-btn:hover { color: #58a6ff; }

.user-tags-inline-wrap { display: inline; }

.user-tag-color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 8px;
  border-top: 1px solid #30363d;
}

.user-tag-color-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.user-tag-color-dot:hover { border-color: #c9d1d9; }
.user-tag-color-dot.selected { border-color: #fff; }

.user-tag-color-manage {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}
.user-tag-color-manage .user-tag-color-dot {
  width: 14px;
  height: 14px;
}


/* =====================================================
   WATCHED ARTIST BADGE
===================================================== */

.watched-badge {
  color: #f85149;
  font-size: 0.85em;
  margin-right: 2px;
}

.song-card-watched {
  border-left: 3px solid #f85149 !important;
}

.filter-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #8b949e;
  white-space: nowrap;
}
