:root {
  --wave-music: #c3cbc7;
  --bg: #f3f5f3; --panel: #ffffff; --ink: #14201b; --muted: #5f6b66; --line: #dfe5e2;
  --brand: #016349; --brand-ink: #ffffff; --brand-soft: #e3f0eb; --head: #016349; --head-ink: #ffffff;
  --accent: #d6331f; --accent-ink: #fff; --ok: #0f7a4f; --warn: #a86500; --bad: #b3261e;
  --chip: #ebefed; --focus: #1d6fd6;
  --radius: 10px; --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --wave-music: #3f4b46;
    --bg: #0e1412; --panel: #161e1b; --ink: #e8efec; --muted: #93a19b; --line: #26322d;
    --brand: #2fbf8c; --brand-ink: #04140e; --brand-soft: #143128; --head: #0b3a2c; --head-ink: #e8f5ef;
    --accent: #ff5a3c; --accent-ink: #1a0905; --ok: #4fd194; --warn: #e6a94a; --bad: #ff7a6e;
    --chip: #1f2925; --focus: #7aa2ff; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --wave-music: #3f4b46;
  --bg: #0e1412; --panel: #161e1b; --ink: #e8efec; --muted: #93a19b; --line: #26322d;
  --brand: #2fbf8c; --brand-ink: #04140e; --brand-soft: #143128; --head: #0b3a2c; --head-ink: #e8f5ef;
  --accent: #ff5a3c; --accent-ink: #1a0905; --ok: #4fd194; --warn: #e6a94a; --bad: #ff7a6e;
  --chip: #1f2925; --focus: #7aa2ff; color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* header */
header.top { background: var(--head); color: var(--head-ink); position: sticky; top: 0; z-index: 10; }
header.top .wrap { display: flex; align-items: center; gap: 18px; min-height: 54px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .02em; text-decoration: none; white-space: nowrap; }
.brand .dot { width: 11px; height: 11px; border-radius: 50%; background: color-mix(in srgb, var(--head-ink) 45%, transparent); }
.brand .mark { font-weight: 800; letter-spacing: .04em; font-size: 17px; }
.brand .mark b { background: var(--head-ink); color: var(--head); padding: 0 6px; border-radius: 5px; margin-left: 4px; font-size: 14px; }
.brand .sub { font-weight: 500; opacity: .75; font-size: 13px; }
.brand .dot.live { background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
nav.main { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
nav.main::-webkit-scrollbar { display: none; }
nav.main a { text-decoration: none; padding: 7px 11px; border-radius: 8px; color: color-mix(in srgb, var(--head-ink) 78%, transparent); white-space: nowrap; font-weight: 500; }
nav.main a:hover { color: var(--head-ink); background: color-mix(in srgb, var(--head-ink) 12%, transparent); }
nav.main a.on { color: var(--head-ink); background: color-mix(in srgb, var(--head-ink) 18%, transparent); }
.logout { color: color-mix(in srgb, var(--head-ink) 80%, transparent); font-size: 13px; text-decoration: none; white-space: nowrap; }
.usermenu { display: flex; align-items: center; gap: 10px; }
.usermenu a.me { color: var(--head-ink); text-decoration: none; font-size: 13px; font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.themebtn { background: transparent; border: 1px solid color-mix(in srgb, var(--head-ink) 30%, transparent); color: var(--head-ink); padding: 4px 8px; border-radius: 8px; font-size: 13px; }
.themebtn:hover { background: color-mix(in srgb, var(--head-ink) 12%, transparent); }

main { padding: 22px 0 60px; }
h1 { font-size: 22px; margin: 0 0 16px; letter-spacing: -.01em; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 28px 0 10px; font-weight: 600; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.head h1 { margin: 0; }

/* flash */
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; }
.flash.ok { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 10%, var(--panel)); }
.flash.err { border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: color-mix(in srgb, var(--bad) 10%, var(--panel)); }

/* cards & lists */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card.pad { padding: 16px; }
.list > .row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.list > .row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 180px; }
.row .t { font-weight: 600; }
.row .s { color: var(--muted); font-size: 13px; }
.row .actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.empty { padding: 22px; color: var(--muted); text-align: center; }
.when { font-family: var(--mono); font-size: 13px; min-width: 104px; color: var(--muted); }
.when b { color: var(--ink); font-weight: 600; }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat { padding: 14px 16px; }
.stat .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.stat .v { font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .s { color: var(--muted); font-size: 13px; }
.bar { height: 6px; background: var(--chip); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: var(--ink); }
.bar.hot > i { background: var(--bad); }

/* live recording */
.live { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.live .row { align-items: center; }
.recdot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s infinite; flex: none; }
.recdot.off { background: var(--warn); animation: none; }
.progress { height: 4px; background: var(--chip); border-radius: 2px; overflow: hidden; margin-top: 6px; max-width: 360px; }
.progress > i { display: block; height: 100%; background: var(--accent); transition: width 1s linear; }

/* chips */
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--chip); font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.brand { background: var(--brand-soft); color: var(--brand); }
.chip.ok { color: var(--ok); } .chip.bad { color: var(--bad); } .chip.warn { color: var(--warn); } .chip.rec { color: var(--accent); }
.chip.mono { font-family: var(--mono); font-weight: 500; }

/* buttons & forms */
.btn, button { font: inherit; font-size: 14px; font-weight: 600; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 7px 12px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover, button:hover { background: var(--chip); }
.btn.primary, button.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover, button.primary:hover { opacity: .88; }
.btn.rec, button.rec { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger, button.danger { color: var(--bad); }
.btn.sm, button.sm { padding: 4px 9px; font-size: 13px; }
form.inline { display: inline; margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.form { display: grid; gap: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 14px; }
.field .help { color: var(--muted); font-size: 13px; margin-top: 4px; }
input[type=text], input[type=url], input[type=password], input[type=number], input[type=date], input[type=time], select {
  font: inherit; width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
input:focus, select:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
.cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.segctl { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--bg); }
.segctl input { display: none; }
.segctl label { padding: 8px 14px; cursor: pointer; font-weight: 600; margin: 0; color: var(--muted); }
.segctl input:checked + label { background: var(--brand); color: var(--brand-ink); }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days input { display: none; }
.days label { width: 46px; text-align: center; padding: 8px 0; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 600; margin: 0; background: var(--bg); color: var(--muted); }
.days input:checked + label { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.quick { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.quick button { font-size: 12px; padding: 3px 9px; font-weight: 500; }
.dur { display: flex; gap: 8px; align-items: center; }
.dur input { width: 80px; }
.formfoot { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 16px; }
fieldset { border: 0; padding: 0; margin: 0; }
.hidden { display: none !important; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters a { text-decoration: none; }

audio { width: 100%; max-width: 420px; height: 36px; margin-top: 6px; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }

.logs { font-family: var(--mono); font-size: 12.5px; }
.logs .row { padding: 6px 12px; gap: 10px; flex-wrap: nowrap; align-items: baseline; }
.logs .lvl { width: 64px; flex: none; }
.logs .ts { color: var(--muted); flex: none; }
.logs .m { word-break: break-word; }

.login { max-width: 360px; margin: 12vh auto; }
.login .brand { justify-content: center; font-size: 20px; margin-bottom: 18px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
code { font-family: var(--mono); font-size: 13px; background: var(--chip); padding: 1px 5px; border-radius: 4px; }

@media (max-width: 640px) {
  .brand { flex: 1; }
  .when { min-width: 0; }
  .row .actions { width: 100%; }
  .when { min-width: 92px; }
  .days label { width: 40px; }
}

/* waveform */
.wavecard canvas { display: block; width: 100%; cursor: pointer; }
#wave { height: 120px; }
#zoom { height: 64px; border-top: 1px dashed var(--line); margin-top: 4px; }
.wavehead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 10px; flex-wrap: wrap; }
.tc { font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; }
.legend { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.lg-m { background: var(--muted); } .lg-v { background: var(--accent); margin-left: 6px; }
.axis { position: relative; height: 18px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.axis span { position: absolute; transform: translateX(-50%); top: 2px; }
.axis span:first-child { transform: none; }
.zoomlabel { margin-top: 6px; }
.wavecard audio { max-width: none; margin-top: 12px; }
.seg.on { background: color-mix(in srgb, var(--accent) 9%, var(--panel)); }
.seg .play { width: 36px; height: 36px; justify-content: center; border-radius: 50%; padding: 0; flex: none; }
.seg.on .play { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.mono { font-family: var(--mono); }

/* segment editor */
.seg .grow { min-width: 0; }
.seg .actions { width: auto !important; }
.edges { flex-basis: 100%; display: flex; gap: 6px 22px; flex-wrap: wrap; padding-left: 48px; }
.edge { display: inline-flex; align-items: center; gap: 4px; }
.edge .lbl { font-size: 12px; color: var(--muted); width: 38px; }
.edge .nb { padding: 3px 7px; font-size: 12px; font-weight: 600; font-family: var(--mono); min-width: 40px; justify-content: center; }
.edge .tv { font-family: var(--mono); font-size: 13px; padding: 3px 6px; border-radius: 6px; background: var(--chip); cursor: pointer; font-variant-numeric: tabular-nums; }
.editbar { position: sticky; top: 62px; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius); background: var(--brand); color: var(--brand-ink); margin-top: 10px; font-weight: 600; }
.editbar .btn, .editbar button { border-color: transparent; }
.introbar { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.introbar .field { margin: 0; }
.btn.disabled { opacity: .45; pointer-events: none; }
#wave { height: 120px; }
#zoom { height: 80px; }
@media (max-width: 640px) {
  .editbar { top: 92px; }
  .edges { padding-left: 0; gap: 6px; }
  .edge { display: grid; grid-template-columns: 40px 1fr 1fr auto 1fr 1fr; width: 100%; }
  .edge .nb { min-width: 0; padding: 5px 0; }
  .edge .tv { font-size: 12.5px; padding: 4px 4px; }
}
.importbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.importbar .grow { flex: 1; min-width: 200px; }
.importbar .t { font-weight: 600; }
.importbar .s { font-size: 13px; }

/* live recordings: up to three per row */
.livegrid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .livegrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .livegrid { grid-template-columns: 1fr; } }
.livecard { padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.lc-top { display: flex; gap: 10px; align-items: flex-start; }
.lc-top .recdot { margin-top: 6px; }
.lc-title { min-width: 0; }
.lc-title .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-title .s { color: var(--muted); font-size: 13px; }
.onair { background: var(--chip); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.onair .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700; }
.onair .np { font-weight: 600; font-size: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.onair.empty .np { color: var(--muted); font-weight: 500; font-style: italic; }
.livecard .progress { max-width: none; margin: 0; }
.lc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lc-foot .s { color: var(--muted); font-size: 13px; }

/* settings accordion */
.acc { display: grid; gap: 10px; }
details.sect > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; position: relative; padding-right: 44px; }
details.sect > summary::-webkit-details-marker { display: none; }
details.sect > summary::after { content: ""; position: absolute; right: 18px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform .15s; }
details.sect[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
details.sect > summary:hover { background: color-mix(in srgb, var(--chip) 50%, transparent); border-radius: var(--radius); }
details.sect .st { font-weight: 700; font-size: 16px; }
details.sect .ss { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.sect .ss .ok { color: var(--ok); font-weight: 600; }
details.sect > .body { padding: 4px 16px 18px; border-top: 1px solid var(--line); padding-top: 16px; }
details.sub > summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600; }
.savebar { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; margin-top: 6px; display: flex; gap: 8px; z-index: 4; }
.savebar button { flex: none; }
.pcstatus { border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.pcstatus.on { border-style: solid; border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; }
.copyline { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.copyline code { word-break: break-all; }
.tracks { margin-top: 18px; }
.tracks > summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; justify-content: space-between; font-weight: 600; }
.tracks > summary::-webkit-details-marker { display: none; }
.tracks .list { border-top: 1px solid var(--line); max-height: 360px; overflow: auto; }
.tracks .list .row { border-top: 1px solid var(--line); padding: 8px 14px; cursor: pointer; flex-wrap: nowrap; }
.tracks .list .row:first-child { border-top: 0; }
.tracks .list .row:hover { background: var(--chip); }

/* program colors */
.pc { --pc: var(--muted); }
.pdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--pc); flex: none; vertical-align: middle; }
.list > .row.pc { box-shadow: inset 4px 0 0 var(--pc); }
.livecard.pc { border-top: 4px solid var(--pc); }
.chip.pcchip { background: color-mix(in srgb, var(--pc) 16%, var(--panel)); color: var(--pc); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches input { display: none; }
.swatches label { width: 32px; height: 32px; border-radius: 50%; background: var(--pc); cursor: pointer; border: 3px solid var(--panel); box-shadow: 0 0 0 1px var(--line); margin: 0; }
.swatches input:checked + label { box-shadow: 0 0 0 2px var(--ink); }
/* login */
.login .brandbox { background: var(--head); color: var(--head-ink); border-radius: var(--radius); padding: 18px; text-align: center; margin-bottom: 14px; }
.gbtn { width: 100%; justify-content: center; background: var(--panel); }
.gbtn svg { width: 18px; height: 18px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.themebtn { display: inline-flex; align-items: center; gap: 6px; }
.themebtn .tl { font-size: 12px; font-weight: 600; }
@media (max-width: 640px) { .themebtn .tl { display: none; } }
.onair { text-align: left; align-items: flex-start; }

/* app name + always-blinking red dot */
.brand .dot.live { background: #e3261b; animation: blink 1.2s steps(1, end) infinite; box-shadow: 0 0 6px 1px rgba(227,38,27,.7); }
.brand .dot.live.busy { animation: blink 0.6s steps(1, end) infinite; }
@keyframes blink { 50% { opacity: .15; box-shadow: none; } }
.brand .mark .w2 { font-weight: 600; opacity: .85; }
@media (max-width: 480px) { .brand .mark { font-size: 15px; } .usermenu a.me { display: none; } }
@media (max-width: 340px) { .brand .mark .w2 { display: none; } }
/* stream logos */
.slogo { width: 36px; height: 36px; border-radius: 9px; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: none; }
.slogo.sm { width: 30px; height: 30px; border-radius: 7px; }
.slogo.lg { width: 56px; height: 56px; border-radius: 12px; }
.lc-top .slogo { margin-right: 2px; }

/* ---------- navigation: desktop inline, mobile collapsible ---------- */
.menubtn { display: none; background: transparent; color: var(--head-ink); border: 1px solid color-mix(in srgb, var(--head-ink) 35%, transparent);
  padding: 7px 12px; border-radius: 9px; gap: 8px; font-weight: 600; }
.menubtn .bars, .menubtn .bars::before, .menubtn .bars::after { display: block; width: 16px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: .2s; }
.menubtn .bars::before, .menubtn .bars::after { content: ""; position: absolute; left: 0; }
.menubtn .bars::before { top: -5px; } .menubtn .bars::after { top: 5px; }
body.navopen .menubtn .bars { background: transparent; }
body.navopen .menubtn .bars::before { top: 0; transform: rotate(45deg); }
body.navopen .menubtn .bars::after { top: 0; transform: rotate(-45deg); }
.navfoot { display: none; }
.themebtn span { font-size: 12px; font-weight: 600; }
.themeseg { display: inline-flex; align-items: center; gap: 4px; }
.themeseg .lbl { font-size: 13px; opacity: .8; margin-right: 4px; }
.themeseg button { background: transparent; color: var(--head-ink); border: 1px solid color-mix(in srgb, var(--head-ink) 30%, transparent); padding: 5px 10px; font-size: 13px; }
.themeseg button.on { background: var(--head-ink); color: var(--head); border-color: var(--head-ink); }

@media (max-width: 760px) {
  header.top .wrap { flex-wrap: wrap; min-height: 54px; gap: 0 10px; }
  .brand { flex: 1; }
  .menubtn { display: inline-flex; align-items: center; }
  .usermenu { display: none; }
  nav.main { display: none; order: 3; flex-basis: 100%; flex-direction: column; gap: 2px; padding: 6px 0 14px; overflow: visible; }
  body.navopen nav.main { display: flex; }
  nav.main a { padding: 11px 12px; font-size: 16px; }
  .navfoot { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid color-mix(in srgb, var(--head-ink) 20%, transparent); margin-top: 8px; padding: 14px 12px 0; }
  .navfoot a { padding: 0 !important; font-size: 15px !important; color: var(--head-ink) !important; background: none !important; }
  .navfoot .out { opacity: .8; }
}

/* settings sub-navigation */
.subnav { display: flex; gap: 4px; margin: -4px 0 18px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { text-decoration: none; padding: 9px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.subnav a:hover { color: var(--ink); }
.subnav a.on { color: var(--brand); border-bottom-color: var(--brand); }

/* compact forms: short fields side by side */
.mini { display: grid; gap: 12px 14px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.mini .field label { font-size: 13px; margin-bottom: 4px; }
.mini .field .help { font-size: 12px; margin-top: 3px; line-height: 1.3; }
.mini input[type=number], .mini input[type=time], .mini select { padding: 8px 10px; }
.cols.tight { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.inline-check { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.swatches label { width: 28px; height: 28px; }
.menubtn:hover, body.navopen .menubtn { background: color-mix(in srgb, var(--head-ink) 14%, transparent); color: var(--head-ink); }
.themeseg button:hover { background: color-mix(in srgb, var(--head-ink) 14%, transparent); color: var(--head-ink); }
.themeseg button.on:hover { background: var(--head-ink); color: var(--head); }
@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px; }
  .stat .v { font-size: 19px; }
  .stat .k { font-size: 11px; }
  .stat .s { font-size: 12px; }
}
@media (max-width: 640px) { .mini { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; } .mini .field label { font-size: 12px; } }
.mini .field:has(input[type=text]), .mini .field:has(select) { grid-column: span 2; }
.mini[style*="2fr"] .field, .mini[style*="1.4fr"] .field { grid-column: auto; }

/* program rows: whole row tinted, fading to the theme background */
.list > .row.pc { background: linear-gradient(90deg, color-mix(in srgb, var(--pc) 26%, var(--panel)) 0%, color-mix(in srgb, var(--pc) 9%, var(--panel)) 45%, var(--panel) 100%); }
.livecard.pc { background: linear-gradient(160deg, color-mix(in srgb, var(--pc) 24%, var(--panel)) 0%, var(--panel) 70%); }
.livecard.pc .onair { background: color-mix(in srgb, var(--panel) 70%, transparent); }

/* system meters */
.sysmon .meter { display: grid; grid-template-columns: 34px 1fr 42px; align-items: center; gap: 8px; margin-top: 8px; }
.sysmon .ml { font-size: 12px; font-weight: 700; color: var(--muted); }
.sysmon .meter b { font-variant-numeric: tabular-nums; text-align: right; font-size: 15px; }
.sysmon .bar { margin: 0; height: 8px; }
.sysmon .bar i { background: var(--brand); transition: width .6s ease; }
.sysmon .bar i.warm { background: var(--warn); }
.sysmon .bar i.hot { background: var(--bad); }
.sysmon canvas { display: block; width: 100%; height: 34px; margin-top: 8px; }
.live-ind { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-left: 4px; vertical-align: middle; animation: blink 2s steps(1, end) infinite; }
@media (max-width: 640px) { .sysmon { grid-column: 1 / -1; } }

/* system info line (bottom of dashboard) */
.sysline { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; display: grid; gap: 4px; }
.sysline .muted { font-size: 13px; }
.mbar { display: inline-block; width: 54px; height: 6px; border-radius: 3px; background: var(--chip); vertical-align: middle; overflow: hidden; }
.mbar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .6s ease; }
.mbar i.warm { background: var(--warn); } .mbar i.hot { background: var(--bad); }
#cpuTxt, #memTxt { font-variant-numeric: tabular-nums; font-weight: 600; }
/* header warning */
.syswarn { background: #f5b301; color: #2a1d00; text-decoration: none; font-weight: 700; font-size: 13px; padding: 5px 10px; border-radius: 999px; white-space: nowrap; animation: warnpulse 1.8s ease-in-out infinite; }
@keyframes warnpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(245,179,1,.7); } 50% { box-shadow: 0 0 0 6px rgba(245,179,1,0); } }
.syswarn.hidden { display: none; }
@media (max-width: 760px) {
  .syswarn { margin-right: 8px; width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
  .syswarn span { display: none; }
  #memAbs { display: none; }
}
.wrap, header.top .wrap { max-width: 1200px; }
nav.main { flex: 1 1 auto; min-width: 0; }
@media (min-width: 761px) and (max-width: 1100px) { .usermenu a.me { display: none; } }

/* selection panel under the waveform */
.selpanel { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; display: grid; gap: 10px; }
.selhint { color: var(--muted); font-size: 13px; }
.selpanel > .sm { justify-self: start; }
.selhead { display: flex; align-items: center; gap: 8px; }
.selhead .selt { flex: 1; text-align: center; }
.selhead .navb { width: 36px; justify-content: center; font-size: 18px; padding: 2px 0; }
.selpanel .edges { padding-left: 0; }
.selact { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.seg.sel { box-shadow: inset 3px 0 0 var(--accent); }
.seg .times { font-size: 12.5px; }
#wave, #zoom { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.zoombar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; }
.zbtns { display: inline-flex; align-items: center; gap: 6px; }
.zbtns button { width: 34px; justify-content: center; font-size: 17px; padding: 2px 0; }
#zoom { height: 96px; }
#wave { height: 138px; }
#zoom { height: 112px; }
.editbar.inwave { position: static; margin-top: 0; }
.dlbox { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; display: grid; gap: 10px; }
.dlrow { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dlrow .lbl { font-weight: 600; font-size: 14px; margin-right: 4px; }
.dlbox .introbar { display: grid; gap: 10px; grid-template-columns: 2fr 1fr 2fr; }
.dlbox .introbar .field label { font-size: 12px; margin-bottom: 3px; }
.dlbox .introbar select, .dlbox .introbar input { padding: 7px 9px; font-size: 14px; }
@media (max-width: 640px) { .dlbox .introbar { grid-template-columns: 1fr 1fr; } .dlbox .introbar .field:first-child { grid-column: 1 / -1; } }
.dlbox .introbar { grid-template-columns: 2fr 1fr 2fr 1.4fr; align-items: end; }
.fadefield .check { margin-bottom: 6px; }
.fadefield .dur input { width: 90px; }
@media (max-width: 640px) { .dlbox .introbar { grid-template-columns: 1fr 1fr; } }
.segname { font: inherit; font-weight: 600; width: 100%; max-width: 520px; padding: 5px 8px; border: 1px dashed var(--line); border-radius: 7px; background: transparent; color: var(--ink); }
.segname:hover { border-color: var(--muted); }
.segname:focus { border-style: solid; background: var(--bg); }
.seg .fname { font-size: 12px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.livecard .listen { justify-content: center; width: 100%; }
.livecard .listen.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.stform { display: inline-flex; gap: 6px; align-items: center; }
.stform .stsel { width: auto; padding: 5px 8px; font-size: 13px; }
.infoedit { margin: -4px 0 14px; }
.infoedit > summary { list-style: none; cursor: pointer; padding: 12px 14px; font-weight: 600; }
.infoedit > summary::-webkit-details-marker { display: none; }
.infoedit[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.seg .clk { color: var(--ink); font-weight: 600; }
.seg .trash { flex: none; }
.impfields { display: grid; gap: 8px; grid-template-columns: 1.4fr 1fr 1.2fr; flex: 2; min-width: 260px; }
.impfields input { padding: 8px 10px; font-size: 14px; }
@media (max-width: 640px) { .impfields { grid-template-columns: 1fr 1fr; } .impfields input[type=datetime-local] { grid-column: 1 / -1; } }

/* waveform header: legend + save on the same line */
.wavehead { min-height: 34px; }
.headright { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.editbar.inhead { position: static; margin: 0; padding: 4px 6px 4px 12px; gap: 6px; border-radius: 9px; font-size: 13px; display: inline-flex; align-items: center; animation: none; }
.editbar.inhead.hidden { display: none; }
.editbar.inhead .ebtxt { margin-right: 4px; }
.lg-m { background: var(--wave-music) !important; }
/* "+" pin over the waveforms */
.wavewrap { position: relative; }
.addpin { position: absolute; top: 2px; transform: translateX(-50%); width: 26px; height: 26px; padding: 0; border-radius: 50%;
  justify-content: center; font-size: 18px; font-weight: 700; line-height: 1; background: var(--brand); color: var(--brand-ink);
  border: 2px solid var(--panel); box-shadow: 0 1px 4px rgba(0,0,0,.25); z-index: 2; }
.addpin:hover { background: var(--brand); filter: brightness(1.1); }
.addpin.hidden { display: none; }
@media (max-width: 640px) { .editbar.inhead .ebtxt { display: none; } }
.abbar { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin:6px 0; }

/* logo AMPROD + badge REC rosso */
.brand .mark { display: inline-flex; align-items: center; gap: 8px; }
.brand .mark .logo { height: 20px; width: auto; display: block; }
.brand .mark .w2 { opacity: .9; }
.brand .mark b.rec { background: #e3261b; color: #fff; display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px 1px 6px; margin-left: 0; border-radius: 5px; font-size: 13px; letter-spacing: .06em; }
.brand .mark b.rec .dot.live { width: 8px; height: 8px; background: #fff; box-shadow: 0 0 4px 1px rgba(255,255,255,.7); }
.login .brand .mark .logo { height: 23px; }
@media (max-width: 480px) { .brand .mark .logo { height: 17px; } }
