@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&family=Source+Serif+4:wght@400;500;600;700&display=swap');

:root {
  --brand-blue: #124874;
  --brand-red: #cf373d;
  --ink: #19354e;
  --muted: #7b8b9d;
  --line: #e2e8ef;
  --page: #f7f9fc;
  --font: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --heading: 'Source Serif 4', Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font: 13px var(--font); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; border: 0; color: inherit; }
a { color: inherit; text-decoration: none; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, a:focus-visible { outline: 3px solid #6794ba; outline-offset: 4px; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }

.site-header { background: var(--brand-blue); border-bottom: 3px solid var(--brand-red); }
.header-inner { max-width: 1320px; min-height: 100px; margin: 0 auto; padding: 15px 40px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand-lockup { display: flex; align-items: center; gap: 23px; flex-shrink: 0; }
.university-mark { display: flex; align-items: center; justify-content: center; padding: 3px 7px; border-radius: 3px; background: #f5f4fa; }
.university-mark img { display: block; width: 106px; height: auto; }
.brand-divider { width: 1px; height: 38px; background: #ffffff57; }
.fmedu-mark { display: block; width: 128px; height: auto; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.header-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: #e5edf5; background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 10px 13px; font-size: 11px; line-height: 1.5; }
.header-button svg { width: 16px; height: 16px; }
.header-button:hover { background: #ffffff12; }
.header-button-outlined { border-color: #ffffff38; }

.studio { max-width: 1320px; margin: 0 auto; padding: 34px 40px 0; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.eyebrow { display: flex; gap: 8px; align-items: center; color: #8a98a7; font-size: 9px; font-weight: 500; letter-spacing: 1.4px; margin: 0 0 8px; }
.eyebrow > span { width: 14px; height: 2px; background: var(--brand-red); }
h1 { font-family: var(--heading); color: var(--brand-blue); font-weight: 600; font-size: 38px; letter-spacing: -.9px; line-height: 1.25; margin: 0; }
.unit-name { font-size: 12px; color: var(--muted); line-height: 1.7; margin: 10px 0 0; }
.heading-actions { display: flex; align-items: center; gap: 9px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 6px; padding: 11px 17px; font-size: 11px; line-height: 1.5; font-weight: 500; white-space: nowrap; transition: background .15s, box-shadow .15s; }
.button svg { width: 16px; height: 16px; }
.button-white { background: #fff; color: var(--brand-blue); border: 1px solid #dce4ec; }
.button-white:hover { background: #eef3f8; }
.button-primary { background: var(--brand-red); color: #fff; box-shadow: 0 3px 12px #00000012; }
.button-primary:hover { background: #b82f35; }
.button-blue { background: var(--brand-blue); color: #fff; }
.button-blue:hover { background: #0e3b60; }
.full-width { width: 100%; margin-top: 20px; justify-content: space-between; }
.icon-button { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 6px; background: transparent; color: #8394a5; }
.icon-button svg { width: 17px; height: 17px; }
.icon-button:hover { color: var(--brand-blue); background: #eef3f8; }
.focus-button { height: 40px; width: 40px; border: 1px solid #dce4ec; background: #fff; }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 0; color: var(--brand-blue); background: transparent; font-size: 10px; }
.text-button > svg { width: 15px; height: 15px; }
.text-button > .small-arrow { width: 12px; height: 12px; margin-left: 4px; color: #8c9bad; }

.stream-column { min-width: 0; }
.player { position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 340px; max-height: calc(100svh - 302px); overflow: hidden; border-radius: 9px; color: #fff; background: #0b2237; isolation: isolate; box-shadow: 0 8px 25px #16355208; }
.player::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 48%, #173b58 0, #0b2237 68%); z-index: -1; }
#live-video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; }
body[data-state=live] #live-video { background: #050c13; }
.player-top { position: absolute; top: 22px; left: 23px; right: 23px; display: flex; align-items: center; z-index: 2; pointer-events: none; }
.room-status { display: inline-flex; align-items: center; gap: 7px; background: #07182866; border: 1px solid #8ba7bf24; border-radius: 4px; padding: 7px 9px; color: #a9bfd0; font-size: 9px; line-height: 1.5; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: #8294a7; }
.room-status.is-live { color: #fff; border-color: #f18b8f35; background: #7e202549; }
.room-status.is-live .status-dot { background: #f15a60; box-shadow: 0 0 0 3px #cf373d22; }
.empty-state { position: absolute; inset: 65px 22px 65px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.signal-emblem { display: grid; place-items: center; height: 66px; width: 66px; border: 1px solid #7597b62e; border-radius: 50%; color: #b9cedf; margin-bottom: 21px; }
.signal-emblem svg { width: 30px; height: 30px; stroke-width: 1.3; }
.empty-state h2 { font-family: var(--heading); font-size: 27px; font-weight: 500; letter-spacing: -.3px; line-height: 1.5; margin: 0 0 9px; }
.empty-state p { max-width: 440px; font-size: 11px; line-height: 1.9; color: #91a9bf; margin: 0 0 24px; }
.empty-state .button { font-size: 11px; padding: 11px 19px; }
.player-controls { position: absolute; bottom: 0; left: 0; right: 0; height: 59px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; background: linear-gradient(0deg, #020c17b8, transparent); z-index: 3; }
.control-left, .control-right { display: flex; align-items: center; gap: 10px; }
.control-button { display: grid; place-items: center; width: 30px; height: 33px; color: #c1cfdd; background: transparent; border-radius: 5px; }
.control-button:hover { color: #fff; background: #ffffff17; }
.control-button svg { width: 17px; height: 17px; }
.control-divider { width: 1px; height: 13px; background: #ffffff24; margin: 0 3px; }
.live-label { display: flex; align-items: center; gap: 6px; font-size: 8px; letter-spacing: .6px; color: #8499ad; }
.live-label > span:first-child { width: 4px; height: 4px; border-radius: 50%; background: #6d8196; }
.live-label.is-live { color: #fff; }
.live-label.is-live > span:first-child { background: var(--brand-red); }
.quality-label { border: 1px solid #ffffff24; border-radius: 3px; font-size: 8px; letter-spacing: .5px; color: #bbcbd9; padding: 3px 5px; }
.resume-video { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 4; }
.is-connecting .signal-emblem svg { animation: pulse 1.5s ease-in-out infinite; }
.stream-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 17px 1px; gap: 14px; }
.viewer-count { display: flex; align-items: center; gap: 7px; color: #8795a5; font-size: 10px; }
.viewer-count svg { height: 15px; width: 15px; color: #9baaba; }
.site-footer { margin-top: 18px; padding: 22px 0 25px; display: flex; align-items: center; justify-content: space-between; gap: 22px; border-top: 1px solid var(--line); color: #99a5b2; font-size: 9px; line-height: 1.8; }
.site-footer > span:last-child { white-space: nowrap; }

dialog { border: 1px solid #dce5ee; border-radius: 12px; padding: 28px; width: min(480px, calc(100vw - 28px)); max-height: calc(100dvh - 36px); color: var(--ink); background: #fff; box-shadow: 0 20px 100px #102b4833; overflow: auto; }
dialog::backdrop { background: #071d3459; backdrop-filter: blur(5px); }
.dialog-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.dialog-top .eyebrow { font-size: 8px; color: #879aaf; margin: 0; }
dialog h2 { font: 600 29px / 1.4 var(--heading); color: var(--brand-blue); letter-spacing: -.5px; margin: 0 0 10px; }
.dialog-description { color: #8291a3; font-size: 11px; line-height: 1.9; margin: 0 0 24px; }
.settings-dialog form label { display: block; font-size: 11px; font-weight: 500; margin: 23px 0 9px; }
.settings-dialog form label > span { color: #a3afbb; font-size: 9px; font-weight: 400; margin-left: 4px; }
.settings-dialog input { width: 100%; display: block; border: 1px solid #d7e1eb; border-radius: 6px; padding: 12px 13px; color: var(--ink); background: #fcfdff; font-size: 11px; outline: 0; }
.settings-dialog input::placeholder { color: #a6b1bf; }
.settings-dialog input:focus { border-color: #628bb1; box-shadow: 0 0 0 3px #1248740b; }
.field-hint { color: #97a4b3; font-size: 9px; line-height: 1.9; margin: 8px 0 0; }
.form-error { color: var(--brand-red); font-size: 10px; line-height: 1.9; margin-top: 12px; }
.form-error:empty { display: none; }
.settings-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); color: #99a6b3; }
.settings-note svg { height: 16px; width: 16px; margin-top: 2px; }
.settings-note p { margin: 0; font-size: 9px; line-height: 1.9; }
.help-dialog { width: min(590px, calc(100vw - 28px)); }
.tabs { display: flex; gap: 23px; border-bottom: 1px solid var(--line); margin-bottom: 25px; }
.tabs > button { background: transparent; padding: 10px 0 12px; border-bottom: 2px solid transparent; color: #93a1b0; font-size: 11px; }
.tabs > button[aria-selected=true] { color: var(--brand-blue); border-bottom-color: var(--brand-red); }
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; gap: 15px; margin-bottom: 22px; }
.steps li > span { display: grid; place-items: center; width: 26px; height: 26px; background: #eff4f9; border-radius: 50%; flex-shrink: 0; font-size: 9px; color: #7593af; margin-top: 1px; }
.steps li > div { min-width: 0; }
.steps h3 { font-size: 11px; font-weight: 600; margin: 3px 0 8px; }
.steps p, .help-bottom-note { color: #8191a3; font-size: 10px; line-height: 1.95; margin: 0 0 8px; }
.steps strong { color: var(--brand-blue); font-weight: 500; }
code { background: #eff4f9; border-radius: 3px; padding: 2px 4px; color: var(--brand-blue); font: 9px ui-monospace, 'SFMono-Regular', monospace; overflow-wrap: anywhere; }
.copy-field { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 4px 5px 4px 10px; margin-bottom: 10px; background: #f3f7fb; border: 1px solid var(--line); border-radius: 6px; }
.copy-field code { background: transparent; padding: 0; }
.copy-field .icon-button { flex-shrink: 0; }
.notice { display: flex; align-items: flex-start; gap: 10px; background: #f8f4f3; border: 1px solid #eee2df; color: #a07f77; border-radius: 7px; padding: 12px 13px; margin: 17px 0 23px; }
.notice svg { width: 16px; height: 16px; margin-top: 2px; }
.notice p { font-size: 10px; line-height: 1.9; margin: 0; }
.latency-target { background: #f1f5fa; border-radius: 8px; padding: 20px; margin-bottom: 26px; }
.latency-target > span { color: #7d96af; font-size: 8px; letter-spacing: 1px; }
.latency-target strong { display: block; font-size: 43px; font-weight: 500; color: var(--brand-blue); letter-spacing: -2px; margin-top: 8px; }
.latency-target small { font-size: 20px; letter-spacing: 0; }
.latency-target p { color: #8da0b4; font-size: 9px; line-height: 1.8; margin-bottom: 0; }
.connection-state { display: flex; align-items: center; gap: 11px; padding: 0 0 21px; border-bottom: 1px solid var(--line); }
.connection-state-icon { display: grid; place-items: center; width: 34px; height: 34px; background: #eff4f9; border-radius: 50%; color: #7391ad; }
.connection-state-icon svg { width: 17px; height: 17px; }
.connection-state strong { font-size: 11px; font-weight: 500; }
.connection-state p { font-size: 9px; line-height: 1.8; color: #9aa8b6; margin: 4px 0 0; }
.diagnostic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.diagnostic-grid > div { display: flex; flex-direction: column; gap: 9px; padding: 16px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.diagnostic-grid span { color: #91a0b0; font-size: 9px; }
.diagnostic-grid strong { font-size: 11px; font-weight: 500; line-height: 1.7; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bitrate-chart { margin-top: 22px; padding: 0 0 7px; }
.bitrate-chart > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 7px; letter-spacing: 1px; color: #a0adbb; }
.bitrate-chart > div > span:last-child { letter-spacing: 0; font-size: 8px; }
.bitrate-chart > svg { width: 100%; height: 45px; display: block; margin-top: 12px; }
.chart-grid { stroke: #e8eef5; stroke-width: 1; stroke-dasharray: 3 5; }
#chart-path { stroke: var(--brand-blue); stroke-width: 1.7; fill: none; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 9px; max-width: calc(100vw - 30px); padding: 13px 20px; border: 1px solid #2e5c82; border-radius: 7px; background: var(--brand-blue); color: #edf3f8; box-shadow: 0 8px 25px #102b4825; font-size: 10px; line-height: 1.8; }
.toast svg { width: 16px; height: 16px; color: #c5d8e9; }

.focus-mode .site-header, .focus-mode .channel-heading, .focus-mode .site-footer { display: none; }
.focus-mode .studio { max-width: 1700px; padding-top: 18px; }
.focus-mode .page-heading { justify-content: flex-end; margin-bottom: 14px; }
.focus-mode .player { max-height: calc(100svh - 137px); }
.focus-mode #focus-button { background: #e8eff7; color: var(--brand-blue); }
.player:fullscreen { aspect-ratio: auto; border-radius: 0; max-height: none; }
.player:fullscreen .empty-state h2 { font-size: 34px; }
.player:fullscreen .empty-state p { font-size: 14px; }
.player:fullscreen .player-controls { height: 70px; }
@keyframes pulse { 50% { opacity: .4; transform: scale(.9); } }

@media (max-width: 950px) {
  .header-inner { min-height: 90px; padding: 13px 28px; }
  .studio { padding: 30px 28px 0; }
  h1 { font-size: 34px; }
  .university-mark img { width: 95px; }
  .fmedu-mark { width: 115px; }
  .brand-lockup { gap: 18px; }
  .player { max-height: none; min-height: 300px; }
  .empty-state h2 { font-size: 25px; }
  .site-footer { font-size: 8px; }
}
@media (max-width: 600px) {
  .header-inner { min-height: 82px; padding: 13px 18px; gap: 12px; }
  .brand-lockup { gap: 14px; }
  .university-mark { padding: 2px 5px; }
  .university-mark img { width: 80px; }
  .brand-divider { height: 29px; }
  .fmedu-mark { width: 93px; }
  .header-actions { gap: 5px; }
  .header-button { height: 34px; width: 34px; padding: 0; }
  .header-button > span { display: none; }
  .header-button svg { height: 16px; width: 16px; }
  .studio { padding: 27px 18px 0; }
  .page-heading { flex-wrap: wrap; gap: 17px; margin-bottom: 21px; }
  .channel-heading { width: 100%; }
  .eyebrow { font-size: 8px; letter-spacing: 1.1px; margin-bottom: 8px; }
  h1 { font-size: 30px; letter-spacing: -.65px; }
  .unit-name { font-size: 11px; margin-top: 8px; }
  .heading-actions { margin-left: auto; }
  .heading-actions .button { font-size: 10px; padding: 8px 12px; }
  .focus-button { height: 34px; width: 34px; }
  .player { aspect-ratio: 4 / 3; min-height: 0; border-radius: 7px; }
  body[data-state=live] .player { aspect-ratio: 16 / 9; }
  .player-top { top: 13px; left: 13px; right: 13px; }
  .room-status { font-size: 7px; padding: 5px 7px; gap: 6px; }
  .status-dot { width: 4px; height: 4px; }
  .empty-state { inset: 48px 15px 43px; }
  .signal-emblem { width: 35px; height: 35px; margin-bottom: 10px; }
  .signal-emblem svg { width: 19px; height: 19px; }
  .empty-state h2 { font-size: 20px; margin-bottom: 6px; line-height: 1.4; }
  .empty-state p { font-size: 9px; line-height: 1.8; margin-bottom: 13px; }
  .empty-state .button { padding: 8px 13px; font-size: 9px; }
  .player-controls { height: 42px; padding: 0 8px; }
  .control-left, .control-right { gap: 4px; }
  .control-button { width: 26px; height: 29px; }
  .control-button svg { width: 15px; height: 15px; }
  .control-divider { margin: 0 3px; }
  .live-label { font-size: 6px; gap: 5px; }
  .quality-label { font-size: 6px; padding: 3px 4px; }
  .stream-toolbar { padding-top: 14px; padding-bottom: 14px; }
  .viewer-count { font-size: 8px; gap: 5px; }
  .viewer-count svg { width: 13px; height: 13px; }
  .text-button { font-size: 9px; gap: 6px; }
  .text-button > svg { height: 13px; width: 13px; }
  .text-button > .small-arrow { display: none; }
  .site-footer { margin-top: 12px; font-size: 8px; gap: 15px; padding-top: 17px; }
  .site-footer > span:first-child { max-width: 255px; }
  dialog { padding: 23px; }
  dialog h2 { font-size: 26px; }
  .tabs { gap: 20px; }
  .tabs > button { font-size: 10px; }
  .diagnostic-grid { gap: 0 14px; }
  .focus-mode .page-heading { flex-wrap: nowrap; }
}
@media (max-width: 360px) {
  .brand-lockup { gap: 10px; }
  .university-mark img { width: 68px; }
  .fmedu-mark { width: 77px; }
  .header-inner { padding-left: 15px; padding-right: 15px; }
  h1 { font-size: 27px; }
  .empty-state h2 { font-size: 18px; }
  .empty-state p { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
