/*
 * Red5 Pro Server Console styles.
 * Dark, dashboard-first shell (sidebar + top bar) used by the root and live webapp pages.
 * Pages that use this stylesheet include the console-* partials instead of main.css/bootstrap.
 */
:root {
  --bg: #0c0c0c; --surface: #141415; --tile: #0f0f10; --line: #38383b; --line-soft: rgba(255, 255, 255, .08);
  --text: #fff; --muted: #b1b1b1; --dim: #7a7a7a;
  --accent: #d03832; --brand: #DB1F26;
  --c-red: #f0756a; --c-blue: #6ea8f8; --c-purple: #b48af4; --c-teal: #5fd0b6; --c-amber: #f2b55c;
  --ok: #5fd0b6; --warn: #f2b55c; --crit: #f0756a;
  --sans: "Clash Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --side-w: 256px; --rail-w: 72px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box }
html, body { margin: 0 }
body.console {
  min-height: 100vh;
  color: var(--muted); font: 400 16px/24px var(--sans); -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 500px at 10% 15%, rgba(150, 70, 40, .14), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(80, 90, 160, .10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
.console a { color: inherit; text-decoration: none }
.console b, .console strong { font-weight: 500 }
.console svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none }
.hidden, [hidden] { display: none !important }

/* ================= Sidebar ================= */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 20;
  background: rgba(14, 14, 15, .92); backdrop-filter: blur(10px);
  border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; padding: 18px 12px; overflow-y: auto;
  transition: width .25s ease;
  scrollbar-width: none; /* still scrollable, scrollbar hidden */
}
.side::-webkit-scrollbar { display: none }
.brand { display: flex; align-items: center; height: 40px; padding: 0 10px; margin-bottom: 22px; overflow: hidden; flex: none }
.brand .logo-wrap { display: block; width: 98px; height: 26px; overflow: hidden; flex: none; transition: width .25s ease }
.brand .logo { display: block; width: 98px; height: 26px }
.brand .st0 { fill: var(--brand) } .brand .st1 { fill: #fff }

.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px }
.nav-sec { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim);
  padding: 16px 12px 8px; white-space: nowrap; overflow: hidden }
.item { position: relative }
.link { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 10px;
  color: var(--muted); white-space: nowrap; cursor: pointer; width: 100%;
  background: none; border: 0; font: inherit; text-align: left; transition: background .15s, color .15s }
.link:hover { background: rgba(255, 255, 255, .05); color: var(--text) }
.link.active { background: rgba(255, 255, 255, .07); color: var(--text) }
.link.active svg.i { color: var(--c-red) }
.link .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis }
.link .caret { width: 14px; height: 14px; transition: transform .2s }
.item.open > .link .caret { transform: rotate(180deg) }

.sub { list-style: none; margin: 2px 0 6px; padding: 0 0 0 22px; display: none }
.item.open > .sub { display: block }
.sub a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px 0 20px; border-left: 1px solid var(--line);
  color: var(--muted); font-size: 15px; white-space: nowrap }
.sub a:hover { color: var(--text); border-left-color: var(--muted) }
.sub a.active { color: var(--text); border-left-color: var(--c-red) }
.sub .fly-title { display: none }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 12px; border-top: 1px solid var(--line-soft) }
.collapse-btn svg.i { transition: transform .25s }

/* collapsed rail */
body.collapsed .side { width: var(--rail-w); overflow: visible }
body.collapsed .brand { padding: 0; justify-content: center }
body.collapsed .brand .logo-wrap { width: 23px }
body.collapsed .link .lbl,
body.collapsed .link .caret { display: none }
body.collapsed .nav-sec { height: 1px; padding: 0; margin: 12px 10px; background: var(--line-soft); color: transparent }
body.collapsed .link { justify-content: center; padding: 0 }
body.collapsed .collapse-btn svg.i { transform: rotate(180deg) }
body.collapsed .item > .sub { display: none }
body.collapsed .link[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 14px); top: 50%; transform: translateY(-50%);
  background: #1d1d1f; border: 1px solid var(--line); color: var(--text); font-size: 14px; line-height: 20px;
  padding: 6px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none; z-index: 30 }
body.collapsed .link[data-tip] { position: relative }
body.collapsed .item.group:hover > .sub,
body.collapsed .item.group:focus-within > .sub {
  display: block; position: absolute; left: calc(100% + 8px); top: 0; min-width: 190px; margin: 0; padding: 8px; z-index: 30;
  background: #1a1a1c; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .45) }
body.collapsed .item.group > .sub::before { content: ""; position: absolute; left: -12px; top: 0; width: 12px; height: 100% }
body.collapsed .sub .fly-title { display: block; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); padding: 6px 10px 10px }
body.collapsed .sub a { border-left: 0; border-radius: 8px; padding: 0 10px }
body.collapsed .sub a:hover { background: rgba(255, 255, 255, .06) }

/* sidebar promo card */
.side-up { margin: 0 0 10px; padding: 14px; border-radius: 14px; border: 1px solid rgba(219, 31, 38, .4);
  background: radial-gradient(160px 90px at 0% 0%, rgba(219, 31, 38, .22), transparent 70%), #121213;
  display: flex; flex-direction: column; gap: 8px; white-space: normal }
.side-up b { color: var(--text); font-weight: 500; font-size: 15px; line-height: 20px }
.side-up span { font-size: 13px; line-height: 18px; color: var(--dim) }
.side-up .btn { height: 34px; font-size: 14px; border-radius: 9px; margin-top: 4px }
.side-up-mini { display: none }
body.collapsed .side-up { display: none }
body.collapsed .side-up-mini { display: flex }
.side-up-mini svg.i { color: var(--brand) }

/* ================= Main ================= */
.main { margin-left: var(--side-w); transition: margin-left .25s ease; min-height: 100vh }
body.collapsed .main { margin-left: var(--rail-w) }
.topbar { height: 76px; display: flex; align-items: center; justify-content: flex-end; gap: 26px; padding: 0 40px; position: relative; z-index: 10 }
.topbar-link { font: 500 14px/21px var(--mono); text-transform: uppercase; color: var(--text); display: inline-flex; align-items: center; gap: 8px;
  letter-spacing: .02em; background: none; border: 0; padding: 0; cursor: pointer }
.topbar-link:hover { color: var(--c-red) }
.topbar-link .caret { width: 12px; height: 12px; transition: transform .2s }
.res { position: relative }
.res.open .caret { transform: rotate(180deg) }
.res-menu { display: none; position: absolute; right: 0; top: calc(100% + 12px); min-width: 200px; padding: 8px; list-style: none; margin: 0;
  background: #1a1a1c; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .45) }
.res.open .res-menu { display: block }
.res-menu a { display: block; padding: 8px 10px; border-radius: 8px; font: 500 13px/20px var(--mono); text-transform: uppercase; color: var(--muted) }
.res-menu a:hover { background: rgba(255, 255, 255, .06); color: var(--text) }
.menu-btn { display: none; margin-right: auto; background: none; border: 1px solid var(--line); border-radius: 10px; color: var(--text);
  width: 40px; height: 40px; align-items: center; justify-content: center; cursor: pointer }
.content { max-width: 1080px; margin: 0 auto; padding: 12px 40px 72px }

.console h1 { font: 400 40px/1.15 var(--sans); color: var(--text); margin: 0 0 14px }
.lead { margin: 0; max-width: 720px }
.lead + .lead { margin-top: 10px }

.sec-head { display: flex; align-items: center; justify-content: space-between; margin: 40px 0 16px }
.sec-head h2 { font: 500 14px/21px var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 }

/* ---- shared tile shell ---- */
.tile { background: linear-gradient(180deg, #141415, var(--tile)); border: 1.5px solid var(--line); border-radius: 18px; transition: border-color .2s, transform .2s }
.tile:hover { border-color: #55555a }

/* ---- server status tiles ---- */
.stats-live { display: inline-flex; align-items: center; gap: 8px; font: 400 13px var(--mono); color: var(--muted) }
.stats-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 2s infinite }
.stats-live.off i { background: var(--crit); animation: none }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(95, 208, 182, .6) } 70%, 100% { box-shadow: 0 0 0 8px rgba(95, 208, 182, 0) } }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px }
.stat { padding: 26px 18px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-height: 158px }
.stat-label { display: flex; align-items: center; gap: 12px; color: #d6d6d6; font: 400 19px/1 var(--sans) }
.stat-label svg.i { width: 26px; height: 26px; stroke-width: 1.8 }
.stat-value { font: 600 34px/1 var(--sans); font-variant-numeric: tabular-nums }
.stat-value small { font-size: 18px; font-weight: 500; margin-left: 2px; opacity: .8 }
.t-live svg.i, .t-live .stat-value { color: var(--c-red) }
.t-ps svg.i, .t-ps .net b { color: var(--c-amber) }
.t-ps .net b.out { color: var(--c-blue) }
.t-cpu svg.i, .t-cpu .stat-value { color: var(--c-purple) }
.t-mem svg.i, .t-mem .stat-value { color: var(--c-teal) }
.t-disk svg.i, .t-disk .stat-value { color: var(--c-amber) }
.t-net svg.i { color: var(--c-blue) }
.meter { width: 100%; max-width: 180px; display: flex; flex-direction: column; gap: 6px }
.meter-track { height: 6px; border-radius: 3px; background: #262628; overflow: hidden }
.meter-fill { height: 100%; width: 0; border-radius: 3px; background: currentColor; transition: width .6s ease }
.t-cpu .meter-fill { color: var(--c-purple) } .t-mem .meter-fill { color: var(--c-teal) } .t-disk .meter-fill { color: var(--c-amber) }
.meter-meta { display: flex; justify-content: space-between; font: 400 12px/1 var(--mono); color: var(--muted) }
.state { display: inline-flex; align-items: center; gap: 5px }
.state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok) }
.state[data-s="high"]::before { background: var(--warn) }
.state[data-s="critical"]::before { background: var(--crit) }
.net { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100% }
.net div { display: flex; flex-direction: column; align-items: center; gap: 8px }
.net span { font: 400 12px/1 var(--mono); color: var(--muted); text-transform: uppercase }
.net b { font: 600 26px/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--c-blue) }
.net b.out { color: var(--c-purple) }
.net b small { font-size: 13px; font-weight: 500; opacity: .8; margin-left: 2px }
.stats-foot { margin-top: 10px; font: 400 12px var(--mono); color: var(--dim); text-align: right }

/* expandable status tiles (console-server-details) */
.stat[data-detail] { position: relative; cursor: pointer }
.t-live { --tone: var(--c-red) } .t-ps { --tone: var(--c-amber) } .t-disk { --tone: var(--c-amber) }
.t-cpu { --tone: var(--c-purple) } .t-mem { --tone: var(--c-teal) } .t-net { --tone: var(--c-blue) }
.stat[data-detail]:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .14) }
.stat[aria-expanded="true"] { border-color: var(--tone); background: linear-gradient(180deg, #19191a, var(--tile)) }
.stat-chev { position: absolute; top: 14px; right: 14px; width: 18px !important; height: 18px !important; color: var(--dim) !important; transition: transform .2s, color .2s }
.stat[data-detail]:hover .stat-chev { color: var(--muted) !important }
.stat[aria-expanded="true"] .stat-chev { transform: rotate(180deg); color: var(--tone) !important }
.stat-detail { grid-column: 1 / -1; padding: 18px 22px 22px; border-color: var(--tone, var(--line)); animation: detail-in .2s ease }
.stat-detail:hover { border-color: var(--tone, var(--line)) }
.stat-detail[data-tone="live"] { --tone: var(--c-red) } .stat-detail[data-tone="ps"], .stat-detail[data-tone="disk"] { --tone: var(--c-amber) }
.stat-detail[data-tone="net"] { --tone: var(--c-blue) }
.stat-detail[data-tone="cpu"] { --tone: var(--c-purple) } .stat-detail[data-tone="mem"] { --tone: var(--c-teal) }
@keyframes detail-in { from { opacity: 0; transform: translateY(-6px) } }
.stat-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px }
.stat-detail-head h3 { margin: 0; font: 500 18px var(--sans); color: var(--text) }
.stat-detail-close { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer }
.stat-detail-close:hover { color: var(--text); border-color: #5a5a5f }
.stat-detail-close svg.i { width: 16px; height: 16px }
.stat-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 28px }
.stat-detail-sec h4 { margin: 0 0 4px; font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 0 }
.stat-detail-sec .kv-meter .meter-fill { color: var(--tone, var(--c-teal)) }
.stat-detail-sec .hint { padding: 6px 0 }
.stat-detail-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--muted) }
.stat-detail-link:hover { color: var(--tone, var(--text)) }
.stat-detail-link svg.i { width: 14px; height: 14px }
.stat-detail .admin-gate { padding: 0; border: 0; background: none }
/* loading placeholders, sized like a .kv row and a section heading */
.sk { display: inline-block; height: 10px; margin: 4px 0; border-radius: 4px; background: linear-gradient(90deg, #232325 25%, #2e2e31 50%, #232325 75%);
  background-size: 200% 100%; animation: sk-shimmer 1.2s ease-in-out infinite }
.sk-v { width: 18% }
.sk-h { width: 32%; height: 8px; margin: 2px 0 }
@keyframes sk-shimmer { from { background-position: 100% 0 } to { background-position: -100% 0 } }

/* ---- host address ---- */
.host { position: relative; margin-top: 28px; padding: 18px 22px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap }
.host-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(240, 117, 106, .12); color: var(--c-red); flex: none }
.host-body { flex: 1; min-width: 200px }
.host-body .label { display: block; font-size: 14px; line-height: 20px }
.host-ip { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font: 500 22px/30px var(--mono); letter-spacing: .01em; word-break: break-all }
.host-help { font-size: 14px; line-height: 20px; color: var(--dim); margin-top: 4px }
.host-help a, .link-u { color: var(--text); text-decoration: underline !important; text-underline-offset: 3px; cursor: pointer }
.host-help a { color: var(--muted) }
.host-line { display: flex; align-items: center; gap: 8px; min-width: 0 }
.icon-copy { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid transparent; background: none; color: var(--muted); transition: color .15s, border-color .15s, background .15s }
.icon-copy:hover { color: var(--text); border-color: var(--line); background: #1a1a1c }
.icon-copy svg.i { width: 16px; height: 16px }
.icon-copy.done, .host-chip button.done { color: var(--ok) }
body.insecure [data-copy]:not([data-copy-always]) { display: none !important }
.ver { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 4px 0 12px; border-radius: 999px; border: 1px solid var(--line); font: 400 12px var(--mono); color: var(--text) }
.ver-label { color: var(--dim); text-transform: uppercase; letter-spacing: .05em; font-size: 11px }
.ver .icon-copy { width: 26px; height: 26px; border-radius: 50% }
.host-chip { position: relative; display: inline-flex; align-items: center; gap: 10px; height: 38px; padding: 0 6px 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: #141415; font: 400 13px var(--mono); color: var(--muted) }
.host-chip b { color: var(--text); font-weight: 500 }
.host-chip button { all: unset; cursor: pointer; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--muted) }
.host-chip button:hover { background: rgba(255, 255, 255, .07); color: var(--text) }

/* "change host address" popover (ids are driven by ip_address_script) */
#ip-overlay, #ip-address-overlay { position: absolute; right: 0; top: calc(100% + 10px); width: 320px; max-width: calc(100vw - 32px); z-index: 40;
  padding: 18px; border-radius: 14px; background: #1a1a1c; border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
  font-size: 14px; line-height: 21px; color: var(--muted) }
#ip-overlay p, #ip-address-overlay p { margin: 0 0 10px }
#ip-address-overlay .pop-head { display: flex; align-items: center; justify-content: space-between; color: var(--text); font-weight: 500; margin-bottom: 8px }
#ip-address-overlay .pop-head a { font: 500 12px var(--mono); text-transform: uppercase; color: var(--muted) }
#ip-address-overlay .pop-head a:hover { color: var(--text) }
#ip-suggestions-table { width: 100%; border-collapse: collapse; margin-bottom: 12px }
#ip-suggestions-table td { padding: 0 }
#ip-suggestions-table a { display: block; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line-soft); margin-bottom: 6px; font-family: var(--mono); color: var(--text) }
#ip-suggestions-table a:hover { border-color: #5a5a5f }
#ip-suggestions-table .red-text { color: var(--dim); font-size: 13px }
.ip-form { display: flex; gap: 8px }
.ip-form .input { height: 38px; font-family: var(--mono); font-size: 14px }
.ip-form .btn { height: 38px }
#ip-input-error-field { color: var(--c-red) }

/* ---- feature cards ---- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px }
.features.two { grid-template-columns: repeat(2, 1fr) }
.feat { position: relative; padding: 22px 22px 18px; display: flex; flex-direction: column; overflow: hidden }
.feat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 120px; opacity: .9; pointer-events: none;
  background: radial-gradient(260px 120px at 0% 0%, var(--glow), transparent 70%) }
.feat:hover { transform: translateY(-2px) }
.feat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; position: relative }
.chip { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--tone);
  background: color-mix(in srgb, var(--tone) 14%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 30%, transparent) }
.chip svg.i { width: 22px; height: 22px }
.tag { font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 6px 9px }
.feat h3 { font: 500 22px/1.25 var(--sans); color: var(--text); margin: 0 0 8px; position: relative }
.feat h3 a::after { content: ""; position: absolute; inset: -200px -100px -400px }
.feat p { margin: 0 0 18px; font-size: 15px; line-height: 23px; position: relative }
.feat p a { position: relative; z-index: 1; color: var(--text); text-decoration: underline; text-underline-offset: 3px }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; padding: 0; list-style: none; position: relative }
.pills li { font: 400 12px/1 var(--mono); color: var(--muted); background: rgba(255, 255, 255, .04); border: 1px solid var(--line-soft); border-radius: 6px; padding: 6px 8px }
.feat .cta { margin-top: auto; display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px; border-top: 1px solid var(--line-soft); color: var(--text); font-size: 15px; position: relative; z-index: 1 }
.feat .cta svg.i { width: 18px; height: 18px; transition: transform .2s; color: var(--tone) }
.feat:hover .cta svg.i { transform: translateX(4px) }
.f-live { --tone: var(--c-red); --glow: rgba(240, 117, 106, .16) }
.f-rtc { --tone: var(--c-blue); --glow: rgba(110, 168, 248, .15) }
.f-sdk { --tone: var(--c-purple); --glow: rgba(180, 138, 244, .15) }

.foot { margin: 44px 0 0; font-size: 15px; color: var(--dim) }
.foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px }

/* ---- "go further" card ---- */
.upgrade { position: relative; margin-top: 32px; padding: 28px; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr); gap: 32px; overflow: hidden;
  border-color: rgba(219, 31, 38, .45);
  background: radial-gradient(500px 260px at 0% 0%, rgba(219, 31, 38, .20), transparent 70%), linear-gradient(180deg, #151415, #0f0f10) }
.upgrade:hover { border-color: rgba(219, 31, 38, .7) }
.ed { display: inline-flex; align-items: center; gap: 8px; font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted) }
.ed .from { padding: 6px 9px; border-radius: 999px; border: 1px solid var(--line) }
.ed .to { padding: 6px 9px; border-radius: 999px; background: var(--brand); color: #fff }
.upgrade h2 { font: 500 30px/1.15 var(--sans); color: var(--text); margin: 16px 0 10px }
.upgrade .pitch { margin: 0 0 22px; font-size: 15px; line-height: 23px }
.up-ctas { display: flex; gap: 10px; flex-wrap: wrap }
.up-fine { margin: 14px 0 0; font: 400 12px var(--mono); color: var(--dim) }
.perks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px }
.perk { display: flex; gap: 12px; padding: 14px; border-radius: 12px; background: rgba(255, 255, 255, .025); border: 1px solid var(--line-soft) }
.perk .pi { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, transparent) }
.perk .pi svg.i { width: 18px; height: 18px }
.perk b { display: block; color: var(--text); font-weight: 500; font-size: 15px; line-height: 20px; margin-bottom: 2px }
.perk span { font-size: 13px; line-height: 19px; color: var(--dim) }

/* ================= Sub-pages ================= */
.crumb { font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); margin-bottom: 12px; display: flex; gap: 8px }
.crumb a:hover { color: var(--text) }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px }
.page-head h1 { margin: 0 0 8px !important }

.field { display: flex; flex-direction: column; gap: 7px; margin: 0 }
.field > label, .field > span { font: 500 12px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted) }
.input, .select, .console select, .console input[type=text], .console input:not([type]) {
  height: 44px; border-radius: 10px; border: 1px solid var(--line); background: #0b0b0c; color: var(--text);
  font: 400 15px var(--sans); padding: 0 14px; outline: none; width: 100%; transition: border-color .15s, box-shadow .15s }
.input:focus, .select:focus, .console select:focus, .console input:focus { border-color: #6a6a70; box-shadow: 0 0 0 3px rgba(255, 255, 255, .06) }
.input::placeholder, .console input::placeholder { color: #5f5f64 }
.input:disabled, .console input:disabled { opacity: .55 }
.select, .console select { appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #888 50%), linear-gradient(135deg, #888 50%, transparent 50%);
  background-position: calc(100% - 19px) 19px, calc(100% - 14px) 19px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px }
.search { position: relative; display: block; width: 280px; max-width: 100% }
.search svg.i { position: absolute; left: 12px; top: 12px; width: 18px; height: 18px; color: var(--dim); pointer-events: none }
.search .input, .search input { padding-left: 38px !important; height: 42px !important }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--line); background: #1a1a1c; color: var(--text) !important; font: 500 15px var(--sans); cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s; text-decoration: none !important }
.btn:hover { border-color: #5a5a5f }
.btn:active { transform: scale(.98) }
.btn.primary { background: var(--accent); border-color: var(--accent) }
.btn.primary:hover { background: #e0433c }
.btn.stop { background: transparent; border-color: var(--c-red); color: var(--c-red) !important }
.btn.sm { height: 34px; padding: 0 12px; border-radius: 9px; font-size: 14px }
.btn svg.i { width: 18px; height: 18px }
.btn[disabled], .btn.button-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; transform: none }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; margin: 0 }
.toggle b { display: block; color: var(--text); font-weight: 500; font-size: 15px }
.toggle small { display: block; font-size: 13px; line-height: 18px; color: var(--dim) }
.switch { position: relative; width: 42px; height: 24px; flex: none }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; z-index: 1 }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #2a2a2d; transition: background .2s }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s }
.switch input:checked + i { background: var(--c-red) }
.switch input:checked + i::after { transform: translateX(18px) }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px rgba(255, 255, 255, .15) }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase }
.badge.live { background: rgba(240, 117, 106, .16); color: var(--c-red) }
.badge.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: blink 1.4s infinite }
.badge.idle { background: rgba(255, 255, 255, .07); color: var(--muted) }
@keyframes blink { 50% { opacity: .3 } }

.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .02); font-size: 14px; line-height: 21px }
.note svg.i { color: var(--c-blue); margin-top: 1px }
.note a { color: var(--text); text-decoration: underline; text-underline-offset: 3px }
.hint { font-size: 13px; line-height: 19px; color: var(--dim); margin: 0 }

/* ---- broadcast ---- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 0 20px; padding: 0; list-style: none; counter-reset: s }
.steps li { counter-increment: s; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 12px; font-size: 14px; line-height: 19px; background: rgba(255, 255, 255, .02) }
.steps li::before { content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 500 12px var(--mono); color: var(--text); border: 1px solid var(--line) }
.steps li.done::before { content: "\2713"; background: var(--c-teal); border-color: var(--c-teal); color: #0c0c0c }
.steps b { color: var(--text); font-weight: 500 }
.bc { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start }
.stage { overflow: hidden; padding: 0 }
.stage:hover { border-color: var(--line) }
.stage-video { position: relative; aspect-ratio: 16/9; background: #070708; overflow: hidden }
.stage-video #video-holder, .stage-video video { position: absolute; inset: 0; width: 100%; height: 100% }
.stage-video video { object-fit: contain; background: #070708 }
.overlay { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; z-index: 2 }
.timer { font: 500 13px var(--mono); color: var(--text); background: rgba(0, 0, 0, .55); padding: 5px 9px; border-radius: 8px }
.stage-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-soft); font-size: 14px }
.stage-bar .msg { flex: 1; color: var(--muted); display: flex; align-items: center; gap: 8px; min-width: 0 }
.stage-bar #status-field { margin: 0; overflow: hidden; text-overflow: ellipsis }
.stage-meta { padding: 10px 16px; border-top: 1px solid var(--line-soft); font: 400 12px/18px var(--mono); color: var(--muted) }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none }
.dot.ok { background: var(--ok) } .dot.warn { background: var(--warn) } .dot.bad { background: var(--crit) }
.logs { border-top: 1px solid var(--line-soft); background: #09090a; max-height: 220px; overflow: auto; padding: 10px 16px; font: 400 12px/19px var(--mono); color: #9a9a9f }
.logs .event-header { display: flex; align-items: center; justify-content: space-between; color: var(--muted) }
.logs .event-header p { margin: 0; text-transform: uppercase; letter-spacing: .05em }
.logs p { margin: 0 }
.logs .event-hr, .logs hr { display: none }
.panel { padding: 20px; display: flex; flex-direction: column; gap: 16px }
.panel:hover { border-color: var(--line) }
.panel h3 { margin: 0; font: 500 18px var(--sans); color: var(--text) }
#video-form { display: flex; flex-direction: column; gap: 16px }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }

/* ---- stream listings (live + VOD) ----
   Markup below .stream-menu-content is generated by r5pro-playback-block*.js. */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px }
.count { font: 400 13px var(--mono); color: var(--dim) }
.filter-section .filter-container > p:first-child { display: none }
.filter-section .filter-container, .filter-section .filter-container_input { margin: 0 }
.stream-menu-content { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; align-items: start }
.stream-menu-listing { min-width: 0 }
.stream-menu-listing-active { grid-column: 1 / -1 }
.playback-block-listing { background: linear-gradient(180deg, #141415, var(--tile)); border: 1.5px solid var(--line); border-radius: 18px; overflow: hidden;
  display: flex; flex-direction: column; transition: border-color .2s }
.playback-block-listing:hover { border-color: #55555a }
.stream-header { order: 2; margin: 0; padding: 14px 16px 2px; font: 500 16px/22px var(--sans); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none }
.playback-block-listing > .subscribe-section { order: 1 }
.playback-block-listing > .stream-rule, .playback-block-listing > hr { display: none }
.playback-block-listing > .stream-link { order: 3 }
.stream-link { margin: 0; padding: 2px 16px 0; font: 400 12px/18px var(--mono); color: var(--dim); word-break: break-all }
.playback-block-listing > .stream-link:last-child { padding-bottom: 14px }
.stream-link a { color: var(--dim) } .stream-link a:hover { color: var(--text) }
.stream-link p { margin: 0 }
.copy-clipboard { color: var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; white-space: nowrap }
.subscribe-section { display: flex; flex-direction: column }
.video-container { position: relative; width: 100% }
.video-holder { position: relative; line-height: 0; background: radial-gradient(120% 90% at 20% 10%, rgba(240, 117, 106, .18), transparent 60%), linear-gradient(160deg, #18181b, #0b0b0c) }
.frame-holder { position: relative; cursor: pointer; aspect-ratio: 16/9 }
.video-frame { width: 100%; height: 100%; display: block; opacity: .9 }
.stream-play-button { position: absolute; inset: 0; margin: auto; width: 52px; height: 52px; padding: 12px; border-radius: 50%;
  background: rgba(0, 0, 0, .45); border: 1px solid rgba(255, 255, 255, .2); transition: transform .2s }
.frame-holder:hover .stream-play-button { transform: scale(1.08) }
.loading-icon { background: none; border: 0; padding: 0 }
.red5pro-subscriber { width: 100%; max-height: 70vh; background: #000 }
.statistics-field { padding: 8px 16px; font: 400 12px/18px var(--mono); color: var(--muted); border-top: 1px solid var(--line-soft); background: #0b0b0c; line-height: 18px }
.stop-button { margin: 12px 16px 0; align-self: flex-start; height: 34px; padding: 0 12px; border-radius: 9px; font: 500 14px var(--sans);
  background: transparent; border: 1px solid var(--c-red); color: var(--c-red); cursor: pointer }
.event-container { margin: 12px 16px 0; border: 1px solid var(--line-soft); border-radius: 10px; background: #09090a; font: 400 12px/19px var(--mono); color: #9a9a9f; overflow: hidden }
.event-container .status-message { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); color: var(--muted) }
.event-container .event-log-field { padding: 8px 12px; max-height: 180px; overflow: auto }
.event-container .event-header { display: flex; justify-content: space-between; align-items: center; text-transform: uppercase; letter-spacing: .05em; color: var(--muted) }
.event-container .event-rule { display: none }
.event-container .event-log p { margin: 0 }
.event-log-error { color: var(--c-red) }
.event-clear-button, #clear-log-button { background: none; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font: 400 11px var(--mono); padding: 2px 8px; cursor: pointer }

.empty-state, .content-section-story > .no-streams-entry { text-align: center }
.empty-state { padding: 56px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px }
.empty-state .ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: rgba(240, 117, 106, .12); color: var(--c-red) }
.empty-state h3 { margin: 6px 0 0; font: 500 22px var(--sans); color: var(--text) }
.empty-state p { margin: 0; max-width: 420px; font-size: 15px }
.stream-menu-content > .no-streams-entry { grid-column: 1 / -1; margin: 0; padding: 40px 0; text-align: center; font: 400 14px var(--mono); color: var(--dim) }
.content-section-story > .no-streams-entry { margin: 0; padding: 48px 24px 8px; font: 500 22px var(--sans); color: var(--text); text-transform: none }
.content-section-story > p { text-align: center; margin: 0 auto 48px; max-width: 460px; font-size: 15px }
.content-section-story > p a { color: var(--text); text-decoration: underline; text-underline-offset: 3px }
.content-section-story > .error-notification { margin-top: 12px; padding: 12px 16px; border-radius: 12px; border: 1px solid rgba(240, 117, 106, .4); color: var(--c-red); background: rgba(240, 117, 106, .08) }

/* ---- full-page viewers (viewer.jsp / viewer-vod.jsp) ---- */
.viewer-stage .video-holder { min-height: 240px; display: grid; place-items: center }
.viewer-stage .red5pro-subscriber { display: block; width: 100%; max-height: 75vh }
.viewer-stage > .video-container > .statistics-field { border-top: 0; border-bottom: 1px solid var(--line-soft) }
.viewer-stage .stage-bar { flex-wrap: wrap }
#id-container { font: 400 13px var(--mono); color: var(--muted) }
.reports-container { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px }
.report-field { padding: 0; overflow: hidden }
.report-field:hover { border-color: var(--line) }
.report-field_header { padding: 14px 16px 10px; font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted) }
.report-field .statistics-field { border-top: 1px solid var(--line-soft) }
.report { padding: 8px 16px 14px; font: 400 12px/18px var(--mono) }
.report p { display: flex; justify-content: space-between; gap: 12px; margin: 0; padding: 4px 0; border-bottom: 1px solid var(--line-soft) }
.report p:last-child { border-bottom: 0 }
.report_key { color: var(--dim) }
.report_value { color: var(--text); text-align: right; word-break: break-all }

/* ---- license ---- */
.status-card { padding: 22px; display: flex; gap: 18px; align-items: flex-start; max-width: 720px }
.status-card:hover { border-color: var(--line) }
.license-details { max-width: 720px; margin-top: 16px }
.license-details .kv > b .badge { font-family: var(--mono) }
.status-card h3 { margin: 0 0 4px; font: 500 20px var(--sans); color: var(--text) }
.status-card p { margin: 0; font-size: 15px }
.status-card .chip { flex: none }
.status-card form { display: flex; gap: 10px; margin-top: 16px; max-width: 460px }
.status-card form .input { font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase }
.form-error { margin-top: 12px !important; font-size: 14px !important; color: var(--c-red) }

/* ---- bandwidth test ---- */
.bw .form { display: flex; flex-direction: column; gap: 14px }
.bw .form-entry { display: flex; flex-direction: column; gap: 7px }
.bw .form-entry > label { font: 500 12px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted) }
.bw .form-entry.toggle { flex-direction: row }
.bw .form-entry.toggle > label { font: inherit; letter-spacing: 0; text-transform: none; color: inherit }
.bw .form--submit .btn { width: 100% }
.bw-results { padding: 20px; display: flex; flex-direction: column; gap: 16px }
.bw-results:hover { border-color: var(--line) }
.progress-container { height: 6px; border-radius: 3px; background: #262628; overflow: hidden }
.progress-bar { height: 100%; width: 0; border-radius: 3px; background: var(--c-blue); transition: width .3s ease }
.bw-stat { display: flex; flex-direction: column; gap: 10px }
.bw-stat p { margin: 0; font: 400 13px/20px var(--mono); color: var(--muted); word-break: break-word }
.bw-stat p > span:first-child { color: var(--dim); text-transform: uppercase; letter-spacing: .05em; font-size: 12px }
.bw-stat video { width: 100%; max-height: 240px; border-radius: 12px; background: #070708; display: block }

/* ---- transcoder diagnostics ---- */
.message { display: flex; gap: 10px; padding: 12px 16px; border-radius: 12px; margin-bottom: 20px; font-size: 14px; line-height: 21px; border: 1px solid var(--line) }
.message.success { color: var(--ok); border-color: rgba(95, 208, 182, .4); background: rgba(95, 208, 182, .08) }
.message.error { color: var(--c-red); border-color: rgba(240, 117, 106, .4); background: rgba(240, 117, 106, .08) }
.message.info { color: var(--c-blue); border-color: rgba(110, 168, 248, .4); background: rgba(110, 168, 248, .08) }
.card { padding: 22px; margin-bottom: 16px }
.card:hover { border-color: var(--line) }
.card h2 { margin: 0; font: 500 18px var(--sans); color: var(--text) }
.card .header-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px }
.card .controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center }
.card .controls select { width: auto; height: 34px; padding: 0 30px 0 10px; font-size: 14px; background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px }
.card .controls label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px }
.card .form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 16px }
.card .form-group { display: flex; flex-direction: column; gap: 7px }
.card .form-group label { font: 500 12px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted) }
.card input[type="number"] { width: 84px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #0b0b0c; color: var(--text); font: 400 13px var(--mono); padding: 0 8px }
.card .form-group input[type="number"] { width: 110px; height: 44px; border-radius: 10px; font-size: 15px }
.card .hint { margin-top: 12px }
.table-wrap { overflow-x: auto; margin: 14px -22px -22px; border-top: 1px solid var(--line-soft) }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px }
.data-table th { text-align: left; font: 500 11px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); padding: 12px 10px; border-bottom: 1px solid var(--line-soft); white-space: nowrap }
.data-table td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle }
.data-table th:first-child, .data-table td:first-child { padding-left: 22px }
.data-table th:last-child, .data-table td:last-child { padding-right: 22px }
.data-table tbody tr.stream-row:hover { background: rgba(255, 255, 255, .025) }
.stream-name { color: var(--text); font-weight: 500 }
.stream-context { font: 400 12px var(--mono); color: var(--dim) }
.metric-cell { font: 400 13px var(--mono); text-align: right; color: var(--muted); white-space: nowrap }
.status-good { color: var(--ok); font-weight: 500 } .status-warn { color: var(--warn); font-weight: 500 } .status-bad { color: var(--crit); font-weight: 500 }
#lastUpdate { font: 400 12px var(--mono); color: var(--dim) }
.expand-btn { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: #141415; color: var(--muted); font: 500 14px var(--mono); cursor: pointer }
.expand-btn:hover { color: var(--text); border-color: #5a5a5f }
.details-row { display: none; background: #0b0b0c }
.details-row.expanded { display: table-row }
.details-content { padding: 6px 0 10px }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px }
.stats-section { padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(255, 255, 255, .02) }
.stats-section h4 { margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); font: 500 12px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted) }
.stat-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 13px }
.stat-row .stat-label { color: var(--dim) }
.stat-row .stat-value { font: 500 13px var(--mono); color: var(--text) }
.highlight { background: rgba(242, 181, 92, .18); border-radius: 4px }
.no-streams { padding: 28px 0 8px; text-align: center; color: var(--dim); font-size: 15px }
.legend { margin: 12px 0 0; padding: 0 0 0 18px; font-size: 14px; line-height: 23px }
.legend b { color: var(--text) }

/* ---- operator views (console-admin.hbs and the pages that use it) ---- */
.console code { font: 400 .88em var(--mono); color: var(--text); background: rgba(255, 255, 255, .06); padding: 1px 5px; border-radius: 5px; word-break: break-all }
.admin-gate { padding: 22px; display: flex; gap: 18px; align-items: flex-start; --tone: var(--c-amber) }
.admin-gate:hover { border-color: var(--line) }
.admin-gate .chip { flex: none }
.admin-gate-body { flex: 1; min-width: 0 }
.admin-gate h3 { margin: 0 0 4px; font: 500 20px var(--sans); color: var(--text) }
.admin-gate p { margin: 0; font-size: 15px }
.admin-gate .hint { margin-top: 14px; font-size: 13px }
.admin-form { display: flex; gap: 10px; margin-top: 16px; max-width: 520px }
.admin-form .input { font-family: var(--mono) }
.admin-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap }
.updated { font: 400 12px var(--mono); color: var(--dim) }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 16px }
.kv-grid > .card { margin-bottom: 0 }
.kv-card { padding: 18px 20px }
.kv-card:hover { border-color: var(--line) }
.kv-card h3 { margin: 0 0 8px; font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted) }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px }
.kv:last-child { border-bottom: 0 }
.kv > span { color: var(--dim) }
.kv > b { font: 500 13px var(--mono); color: var(--text); text-align: right; word-break: break-word }
.kv-meter { flex-wrap: wrap }
.kv-meter .meter-track { flex-basis: 100%; margin-top: 2px }
.kv-meter .meter-fill { color: var(--c-teal) }
.kv-meter .meter-track.warn .meter-fill { color: var(--warn) }
.kv-meter .meter-track.crit .meter-fill { color: var(--crit) }
.kv-inline { display: flex; flex-wrap: wrap; gap: 0 28px; margin-top: 10px }
.kv-inline .kv { border-bottom: 0; gap: 8px }
.mono { font-family: var(--mono); font-size: 13px }
.cell-sub { display: block; font: 400 11px/16px var(--mono); color: var(--dim); text-transform: none; letter-spacing: 0 }
.data-table th.num, .data-table td.num { text-align: right; font-family: var(--mono); font-size: 13px; white-space: nowrap }
.data-table td.mono { word-break: break-all }
.data-table tr.row-click { cursor: pointer }
.data-table tr.row-click:hover, .data-table tr.row-click:focus-visible { background: rgba(255, 255, 255, .03); outline: none }
.data-table tr.selected { background: rgba(240, 117, 106, .07) }
.data-table tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--c-red) }
.data-table tr.empty-row td { text-align: center; color: var(--dim); padding: 24px 10px }
.details-row td { padding-top: 4px }
.badge.ok { background: rgba(95, 208, 182, .14); color: var(--ok) }
.card > .message, .card > .hint { margin: 12px 0 0 }
.analyzer { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; font: 400 13px var(--mono) }
.analyzer .cell-sub { flex-basis: 100%; padding-left: 16px }
.json { margin: 0; padding: 12px 14px; max-height: 320px; overflow: auto; font: 400 12px/18px var(--mono); color: #b4b4b9; background: #09090a;
  border: 1px solid var(--line-soft); border-radius: 10px; white-space: pre-wrap; word-break: break-all }

/* live log view (logs.jsp) */
.log-bar { justify-content: flex-start }
.console select.log-pick { width: auto; flex: 0 1 360px; min-width: 220px; height: 42px; font: 400 14px var(--mono); background-position: calc(100% - 19px) 18px, calc(100% - 14px) 18px }
.log-bar .search { flex: 1 1 220px; width: auto }
.log-actions { display: flex; gap: 8px; margin-left: auto }
.log-actions .btn[aria-pressed="true"] { border-color: var(--warn); color: var(--warn) }
.log-view { position: relative; overflow: hidden; margin-bottom: 16px }
.log-view:hover { border-color: var(--line) }
.log-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft); font: 400 12px var(--mono); color: var(--dim); white-space: pre-wrap }
.log-meta b { color: var(--text); font-weight: 500 }
.log-lines { height: calc(100vh - 350px); min-height: 360px; overflow: auto; padding: 10px 0; background: #09090a;
  font: 400 12px/19px var(--mono); color: #b4b4b9; outline: none }
.log-lines:focus-visible { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .12) }
.log-line { padding: 0 18px; white-space: pre-wrap; word-break: break-all }
.log-line:hover { background: rgba(255, 255, 255, .03) }
.log-line.error { color: var(--crit); background: rgba(240, 117, 106, .06) }
.log-line.warn { color: var(--warn) }
.log-line.debug, .log-line.trace { color: var(--dim) }
.log-line mark { background: rgba(242, 181, 92, .3); color: var(--text); border-radius: 2px }
.log-empty { padding: 40px 18px; text-align: center; color: var(--dim); font: 400 14px var(--sans) }
.log-jump { position: absolute; right: 22px; bottom: 16px; background: #1d1d1f; box-shadow: 0 6px 20px rgba(0, 0, 0, .5) }

/* autoplay prompt (r5pro-autoplay-utils.js) */
.console .modal { background: rgba(0, 0, 0, .7); backdrop-filter: blur(4px) }
.console .modal > div { background: #1a1a1c; color: var(--muted); border: 1px solid var(--line); border-radius: 14px }
.console .modal a { color: var(--text); text-decoration: underline }
.console .modal-close { color: var(--muted) !important; text-decoration: none !important }

/* red5pro-media control bar sits on top of dark tiles */
.console .red5pro-media-container { background: #000 }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; transition: .25s; z-index: 60;
  background: #1d1d1f; border: 1px solid var(--line); color: var(--text); padding: 10px 16px; border-radius: 10px; font-size: 14px; pointer-events: none }
.toast.on { opacity: 1; transform: translateX(-50%) }

/* ================= Responsive ================= */
.scrim { display: none }
@media (max-width: 1000px) {
  .features, .tiles { grid-template-columns: repeat(2, 1fr) }
  .upgrade { grid-template-columns: 1fr; gap: 24px }
  .bc { grid-template-columns: 1fr }
  .steps { grid-template-columns: repeat(2, 1fr) }
}
@media (max-width: 760px) {
  .side { width: var(--side-w) !important; transform: translateX(-100%); transition: transform .25s ease; overflow-y: auto !important }
  body.drawer .side { transform: none }
  body.drawer .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 15 }
  .main, body.collapsed .main { margin-left: 0 }
  .collapse-btn { display: none !important }
  body.collapsed .link .lbl, body.collapsed .link .caret { display: revert }
  body.collapsed .link { justify-content: flex-start; padding: 0 12px }
  body.collapsed .nav-sec { height: auto; padding: 16px 12px 8px; margin: 0; background: none; color: var(--dim) }
  body.collapsed .item.open > .sub { display: block }
  body.collapsed .brand { padding: 0 10px; justify-content: flex-start }
  body.collapsed .brand .logo-wrap { width: 98px }
  body.collapsed .side-up { display: flex } body.collapsed .side-up-mini { display: none }
  .menu-btn { display: inline-flex }
  .topbar { padding: 0 16px; gap: 16px }
  .content { padding: 4px 16px 56px }
  .console h1 { font-size: 32px }
  .features, .features.two, .steps, .perks, .reports-container, .tiles { grid-template-columns: 1fr }
  .stat { min-height: 0 }
  .status-card { flex-direction: column } .status-card form { flex-direction: column }
  .upgrade { padding: 20px } .upgrade h2 { font-size: 25px }
  .search { width: 100% }
  .ip-form { flex-direction: column }
  .admin-gate { flex-direction: column } .admin-form { flex-direction: column }
  .kv-grid { grid-template-columns: 1fr }
  .console select.log-pick { flex-basis: 100% }
  .log-actions { margin-left: 0 }
  .log-lines { height: 60vh; min-height: 280px }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important }
}
