/* Ricardas Radio — broadcast operations workspace */
:root {
  color-scheme: dark;
  --bg: #111311;
  --surface: #191c19;
  --surface-raised: #20241f;
  --surface-soft: #252a24;
  --line: #343a32;
  --line-soft: #2a3029;
  --text: #eceee5;
  --muted: #a2a99b;
  --faint: #71796d;
  --accent: #d9f078;
  --accent-ink: #18200c;
  --live: #ff6559;
  --ok: #b7d878;
  --warn: #f1bf68;
  --danger: #ff9188;
  --radius: 7px;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 15px/1.55 var(--sans); }
body::before { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--accent) 0 18%, transparent 18%); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { width: min(1180px, 100%); margin: 0 auto; padding: 0 28px 72px; }

/* Header and navigation */
.masthead { display: flex; align-items: center; gap: 28px; min-height: 82px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.mark { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 11px 11px 11px 3px; color: var(--accent-ink); background: var(--accent); font-size: 20px; font-weight: 850; }
.name { color: var(--text); font-weight: 800; font-size: 12px; letter-spacing: .12em; line-height: 1.3; }
.name small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 450; letter-spacing: .02em; }
.channels { display: flex; align-items: center; gap: 4px; }
.channels a { padding: 8px 11px; border-radius: 5px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.channels a:hover { color: var(--text); background: var(--surface-raised); text-decoration: none; }
.channels a.on { color: var(--text); background: var(--surface-raised); box-shadow: inset 0 -2px var(--accent); }
.side { margin-left: auto; display: flex; align-items: center; gap: 15px; white-space: nowrap; }
.side .ghost, .linklike { color: var(--muted); font-size: 12px; }
.linklike { padding: 0; border: 0; background: none; cursor: pointer; }
.linklike:hover, .side .ghost:hover { color: var(--text); }
.lamp { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font: 11px var(--mono); }
.led { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.lamp.live .led { background: var(--live); box-shadow: 0 0 9px #ff655988; }
.lamp.auto .led { background: var(--accent); box-shadow: 0 0 9px #d9f07866; }
.lamp.down .led { background: var(--danger); }

/* Page heading and primary station card */
main { padding-top: 30px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 0 0 24px; }
.pagehead h1, h1 { margin: 0; font-size: clamp(25px, 3vw, 34px); line-height: 1.15; letter-spacing: -.035em; font-weight: 720; }
.pagehead p { margin: 6px 0 0; }
.kicker { margin: 0 0 8px !important; color: var(--accent); font: 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.muted { color: var(--muted); }
.deck { position: relative; display: grid; grid-template-columns: minmax(0,1fr) minmax(240px,310px); gap: 24px; margin: 0 0 18px; padding: 27px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.deck::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); }
.deckmain { min-width: 0; }
.decksig { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.decksig .now { margin: 0; color: var(--muted); font-size: 13px; }
.onairsign { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-raised); color: var(--muted); font: 10px var(--mono); letter-spacing: .08em; }
.onairsign::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.onairsign.live { color: var(--live); border-color: #653b37; background: #2b1b19; }
.onairsign.auto { color: var(--accent); border-color: #4b5830; background: #22291a; }
.onairsign.down { color: var(--danger); }
.onairsign small { display: none; }
.track { margin: 0; overflow-wrap: anywhere; font-size: clamp(23px, 3.3vw, 39px); font-weight: 700; letter-spacing: -.035em; line-height: 1.14; }
.source { min-height: 24px; margin: 8px 0 21px; color: var(--muted); font-size: 14px; }
.deckcontrols { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
audio { display: block; width: min(390px, 100%); height: 40px; }
.skipbtn, .btn { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 38px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: var(--surface-raised); font-size: 13px; font-weight: 600; cursor: pointer; }
.skipbtn { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.skipbtn:hover, .btn.primary:hover { filter: brightness(1.07); }
.skipbtn:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; }
.skipbtn.ghost { border-color: var(--line); background: transparent; color: var(--text); }
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn.primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); border-color: #63403d; background: #281b1a; }
.btn.small { min-height: 30px; padding: 5px 9px; font-size: 12px; }

/* Stream status side card */
.meters { display: flex; flex-direction: column; justify-content: center; gap: 12px; min-width: 0; padding: 18px; border: 1px solid var(--line-soft); border-radius: 5px; background: #141714; }
.meters .caps { color: var(--faint); font: 10px var(--mono); letter-spacing: .11em; text-transform: uppercase; }
.meters .signal-title { font-size: 13px; font-weight: 650; }
.meters .signal-detail { color: var(--muted); font-size: 12px; }
.meters .signal-state { display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 4px; background: var(--surface-raised); color: var(--muted); font: 11px var(--mono); }
.signal-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.signal-state.live::before, .signal-state.auto::before { background: var(--ok); }
.signal-state.down::before { background: var(--danger); }

/* Info cards */
.readout { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.readout > div { min-width: 0; padding: 17px 20px; border-left: 1px solid var(--line-soft); }
.readout > div:first-child { border-left: 0; }
.readout span { display: block; color: var(--muted); font-size: 12px; }
.readout strong { display: block; margin-top: 4px; font-size: 23px; font-variant-numeric: tabular-nums; line-height: 1.25; }
.readout small { display: block; margin-top: 4px; color: var(--faint); font-size: 11px; }
.twocol { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.panel { min-width: 0; margin-bottom: 18px; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.twocol .panel { margin-bottom: 0; }
.sectionhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
h2 { margin: 0 0 8px; font-size: 16px; letter-spacing: -.01em; }
.sectionhead h2 { margin: 0; }
#updated { font-size: 11px; white-space: nowrap; }
.notice, .msg { margin: 0 0 18px; padding: 11px 14px; border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 4px; background: var(--surface); color: var(--text); font-size: 13px; }
.msg { border-left-color: var(--ok); }
.msg.bad { border-left-color: var(--danger); }
.chip { display: inline-block; padding: 2px 7px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font: 11px var(--mono); }
.servicegrid { display: grid; gap: 11px; margin: 10px 0 14px; color: var(--muted); font-size: 13px; }
.servicegrid .ok { color: var(--ok); }
.servicegrid .bad { color: var(--danger); }
.ok { color: var(--ok); }
.bad { color: var(--danger); }

/* Recently played */
ul.history { list-style: none; margin: 0; padding: 0; }
ul.history li { display: flex; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
ul.history li:last-child { border-bottom: 0; }
ul.history .hno { color: var(--faint); font: 10px var(--mono); }
ul.history .htitle { flex: 1; overflow-wrap: anywhere; }
ul.history li:first-child .htitle { color: var(--accent); }
ul.history .htime { color: var(--faint); font: 11px var(--mono); }

/* Library */
.dirs { display: flex; gap: 5px; margin-bottom: 12px; }
.dirs button { padding: 7px 11px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.dirs button.on { border-color: var(--line); background: var(--surface-raised); color: var(--text); }
.dirs button:disabled { opacity: .5; }
.drop { padding: 30px 18px; border: 1px dashed #56604c; border-radius: 5px; text-align: center; background: #1c2119; transition: background .15s, border-color .15s; }
.drop.drag { border-color: var(--accent); background: #252d1c; }
.drop h2 { margin: 7px 0 2px; }
.drop p { margin: 5px 0; font-size: 12px; }
.upload-icon { display: grid; place-items: center; width: 34px; height: 34px; margin: auto; border: 1px solid var(--line); border-radius: 50%; color: var(--accent); font-size: 18px; }
#uploads { margin-top: 12px; }
#uploads .uploadrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
#uploads p { display: flex; flex: 1; flex-wrap: wrap; gap: 9px; margin: 0; }
#uploads progress { width: min(180px, 32%); height: 8px; accent-color: var(--accent); }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--muted); text-align: left; font-size: 11px; font-weight: 550; }
td { padding: 10px; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
td:last-child { text-align: right; white-space: nowrap; }
td:last-child .btn + .btn { margin-left: 5px; }
td.empty { padding: 28px; text-align: center; color: var(--muted); }
.row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.row input[type="search"] { width: min(230px, 100%); }
input[type="search"], input[type="text"], input[type="password"] { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 5px; outline: 0; background: #121512; color: var(--text); }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px #d9f07822; }
label { display: block; margin: 13px 0 5px; color: var(--muted); font-size: 12px; }

/* Logs / settings */
details summary { margin: -21px; padding: 17px 21px; cursor: pointer; font-weight: 650; }
details[open] summary { margin-bottom: 16px; }
pre#logs { max-height: 320px; overflow: auto; padding: 13px; border: 1px solid var(--line-soft); border-radius: 4px; background: #111411; color: var(--muted); font: 11px/1.5 var(--mono); white-space: pre-wrap; }
.stack > * + * { margin-top: 14px; }

/* Login */
.loginbox { display: grid; min-height: calc(100vh - 3px); place-items: center; padding: 24px; }
.loginbox .card { position: relative; width: min(400px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 20px 70px #0007; }
.loginbox h1 { margin: 26px 0 4px; font-size: 24px; }
.loginbox .sub { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.loginbox .row { margin-top: 17px; }
.loginbox .btn.primary { width: 100%; }
.loginbox .band { height: 3px; background: linear-gradient(90deg,var(--accent) 0 22%,var(--line) 22% 100%); }

/* Listener page */
.listener { width: min(980px, 100%); margin: 0 auto; padding: 38px 28px 0; }
.listener h1.big { max-width: 700px; margin: 54px 0 12px; font-size: clamp(38px, 7vw, 68px); font-weight: 750; line-height: 1.02; letter-spacing: -.055em; }
.listener .intro { max-width: 500px; margin: 0 0 36px; color: var(--muted); font-size: 16px; }
.listener .deck { padding: 28px; }
.listener footer { width: min(980px, 100%); margin: 34px auto 0; padding: 17px 28px 28px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
  .wrap { padding-right: 20px; padding-left: 20px; }
  .masthead { align-items: flex-start; gap: 14px; flex-wrap: wrap; }
  .channels { order: 3; width: 100%; overflow-x: auto; }
  .side { margin-left: auto; }
  .deck { grid-template-columns: 1fr 245px; padding: 21px; }
}
@media (max-width: 680px) {
  .wrap { padding: 0 15px 48px; }
  .masthead { min-height: unset; padding: 14px 0 10px; }
  .brand { flex: 1; }
  .channels { gap: 0; padding-bottom: 3px; }
  .channels a { padding: 8px 9px; font-size: 12px; }
  .side { gap: 10px; }
  .side .ghost { display: none; }
  main { padding-top: 23px; }
  .pagehead { align-items: flex-start; flex-direction: column; gap: 13px; margin-bottom: 18px; }
  .pagehead h1 { font-size: 27px; }
  .deck { grid-template-columns: 1fr; gap: 15px; padding: 18px; }
  .meters { padding: 13px; }
  .readout { grid-template-columns: 1fr; }
  .readout > div { border-left: 0; border-top: 1px solid var(--line-soft); padding: 12px 15px; }
  .readout > div:first-child { border-top: 0; }
  .readout strong { font-size: 20px; }
  .twocol { grid-template-columns: 1fr; gap: 0; }
  .panel { padding: 16px; }
  .hide-sm { display: none; }
  .drop { padding: 23px 13px; }
  .listener { padding: 25px 16px 0; }
  .listener h1.big { margin-top: 40px; }
  .listener .deck { padding: 17px; }
  .listener footer { padding-right: 16px; padding-left: 16px; }
  #uploads .uploadrow { align-items: flex-start; flex-direction: column; }
  #uploads progress { width: 100%; }
  td:last-child .btn { margin: 3px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }

/* Music-library upload workspace */
.library-panel { padding: 24px; }
.library-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.library-head h2, .library-files-head h2 { margin: 0; }
.library-head .kicker, .library-files-head .kicker { margin-bottom: 5px !important; }
.library-head .dirs { margin: 0; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: #121512; }
.library-head .dirs button { min-width: 90px; padding: 8px 13px; }
.library-head .dirs button.on { border-color: var(--line); color: var(--accent-ink); background: var(--accent); }
.dir-note { margin: 12px 0 18px; color: var(--muted); font-size: 13px; }
.drop { padding: 30px 18px 21px; }
.drop h2 { margin-top: 11px; font-size: 17px; }
.drop > .btn { margin-top: 12px; }
.upload-formats { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 18px 0 9px; }
.upload-formats span { padding: 3px 7px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font: 10px var(--mono); }
.upload-limit { color: var(--faint); font-size: 11px !important; }
.queue { margin-top: 19px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #151815; }
.queue-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.queue-head > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.queue-head strong { font-size: 13px; }
.queue-head .muted { font-size: 11px; }
.upload-list { list-style: none; margin: 0; padding: 0; }
.upload-item { display: grid; grid-template-columns: minmax(150px,1fr) minmax(170px, .9fr) auto; align-items: center; gap: 14px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
.upload-item:last-child { border-bottom: 0; }
.upload-item-main { min-width: 0; }
.upload-item-title { overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.upload-item-meta { margin-top: 3px; color: var(--faint); font-size: 10px; }
.upload-progress-wrap { display: flex; align-items: center; gap: 9px; min-width: 0; }
.upload-progress-wrap progress { width: min(115px, 42%); height: 7px; accent-color: var(--accent); }
.upload-state { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.upload-item.done .upload-state { color: var(--ok); }
.upload-item.failed .upload-state { color: var(--danger); }
.upload-item.failed .upload-progress-wrap progress { accent-color: var(--danger); }
.upload-item-actions { display: flex; align-items: center; gap: 5px; }
.queue-remove { width: 28px; height: 28px; padding: 0; border: 1px solid transparent; border-radius: 4px; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.queue-remove:hover { border-color: var(--line); color: var(--danger); }
.library-files { padding: 20px 22px; }
.library-files-head { align-items: center; }
.library-actions { flex-wrap: nowrap; }
.library-actions input[type="search"] { width: min(280px, 48vw); }
.file-name { display: flex; align-items: center; gap: 10px; }
.file-type { flex: 0 0 auto; min-width: 37px; padding: 4px 5px; border: 1px solid var(--line); border-radius: 3px; color: var(--accent); text-align: center; font: 9px var(--mono); }
.file-name > span:last-child { min-width: 0; }
.file-actions { min-width: 150px; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
@media (max-width: 700px) {
  .library-panel, .library-files { padding: 16px; }
  .library-head { align-items: flex-start; flex-direction: column; }
  .library-head .dirs { width: 100%; }
  .library-head .dirs button { flex: 1; }
  .queue-head { align-items: flex-start; flex-direction: column; }
  .queue-head .row { width: 100%; }
  .queue-head .row .btn { flex: 1; }
  .upload-item { grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
  .upload-progress-wrap { grid-column: 1; grid-row: 2; }
  .upload-progress-wrap progress { width: 72px; }
  .upload-item-actions { grid-column: 2; grid-row: 1 / span 2; }
  .library-files-head { align-items: flex-start; }
  .library-actions { width: 100%; }
  .library-actions input[type="search"] { flex: 1; width: auto; min-width: 0; }
  .library-actions .btn { flex: 0 0 auto; }
  .file-actions { min-width: 0; }
}
.artist-avatar { display: grid; flex: 0 0 36px; width: 36px; height: 36px; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 50%; background: #283022; color: var(--accent); font-size: 13px; font-weight: 700; }
.artist-avatar img { width: 100%; height: 100%; object-fit: cover; }
.track-description { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.track-description strong { overflow: hidden; color: var(--text); font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.track-description small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.track-description .original-filename { color: var(--faint); font: 10px var(--mono); }

/* ---- Bibliotekos aplankai ---- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-top: 6px; }
.crumb { border: 0; background: none; color: var(--muted); font: 600 12px var(--sans, sans-serif); cursor: pointer; padding: 3px 7px; border-radius: 6px; }
.crumb:hover { background: rgba(255,255,255,.06); color: var(--text); }
.crumb.on { background: var(--accent, #8fbf5a); color: #14210d; }
.crumb-sep { color: var(--faint); font-size: 11px; }
.folderview { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 14px; }
.folderview[hidden] { display: none; }
.foldercard { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.03); padding: 8px 10px; }
.folderopen { display: flex; flex: 1; min-width: 0; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer; text-align: left; padding: 0; color: inherit; }
.folderopen:hover .foldericon { transform: scale(1.15); }
.foldericon { font-size: 22px; transition: transform .12s; }
.folderinfo { display: flex; min-width: 0; flex-direction: column; }
.folderinfo strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.folderinfo small { color: var(--muted); font-size: 11px; }
.folderactions { display: flex; flex: 0 0 auto; gap: 4px; }
