:root{color-scheme:dark;--bg:#0a0f1b;--panel:#111b2b;--gold:#d7c19a;--line:#334257;--text:#f2f0e9;--muted:#b6c2d1}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;background:radial-gradient(ellipse at top,#172739 0,var(--bg) 54%);color:var(--text);font:16px/1.65 "Noto Sans KR",system-ui,sans-serif;min-height:100vh}
a{color:var(--gold);text-underline-offset:.22em;overflow-wrap:anywhere}
button,input,select,textarea{font:inherit;color:inherit}
button,select,input:not([type=checkbox],[type=range]),textarea{border:1px solid #596a81;border-radius:8px;background:#182436;padding:.55rem .75rem}
button{cursor:pointer}
button:not(:disabled):hover,select:hover{border-color:var(--gold)}
button:disabled{opacity:.52;cursor:not-allowed}
:focus-visible{outline:2px solid #f4d69f;outline-offset:3px}
h1,h2,h3,p{margin-block:0 .75rem}
h1{font-size:clamp(1.65rem,4vw,2.65rem);line-height:1.2}
h2{font-size:1.3rem}
.site-bar{max-width:1120px;padding:1.15rem clamp(1rem,4vw,2.5rem);margin:auto;display:flex;justify-content:space-between;gap:1rem;align-items:center;border-bottom:1px solid var(--line)}
.site-bar a:first-child{font-family:Georgia,serif;text-decoration:none;letter-spacing:.15em;font-weight:bold}
.hai-wrap{max-width:1440px;padding:clamp(1.2rem,4vw,2.6rem) clamp(.8rem,4vw,2.5rem) 3rem;margin:auto}
.eyebrow{color:var(--gold);font-size:.75rem;letter-spacing:.16em;font-weight:700}
.muted{color:var(--muted)}
.status{min-height:1.6em;color:var(--muted)}
.warning{color:#ffcca6}
.list{padding:0;list-style:none;display:grid;gap:.8rem;margin:1rem 0}
.episode-card,.side-panel,.admin-panel,.auth-panel{border:1px solid var(--line);border-radius:14px;background:var(--panel);padding:1.1rem;min-width:0}
.episode-card h2{margin-bottom:.2rem;overflow-wrap:anywhere}
.episode-card p{margin-bottom:.25rem}
.episode-card nav{display:flex;gap:1rem;flex-wrap:wrap;margin-top:.5rem}
.player-layout{display:grid;grid-template-columns:minmax(0,960px) minmax(0,260px);justify-content:center;gap:1.3rem;align-items:start}
.player-host{min-width:0}
.side-panel{overflow-wrap:anywhere}
.side-panel dt{color:var(--muted);font-size:.85rem}
.side-panel dd{margin:0 0 .55rem}
.chat-stage{display:flex;flex-direction:column;width:100%;max-width:960px;height:clamp(380px,72svh,760px);margin-inline:auto;overflow:hidden;border:1px solid var(--line);border-radius:16px;background:#0c1523}
.chat-head{position:relative;flex:none;display:flex;gap:.75rem;align-items:center;padding:.7rem .85rem;background:#141f30;border-bottom:1px solid var(--line);font-size:.85rem;min-width:0}
.chat-head>div{flex:1;min-width:0}
.chat-mark{font:700 .75rem Georgia,serif;letter-spacing:.11em;color:var(--gold)}
.chat-title{display:block;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-head-source{font-size:.78rem}
.chat-options summary{cursor:pointer;white-space:nowrap;color:var(--gold);font-size:.75rem}
.chat-options-panel{position:absolute;z-index:1;top:calc(100% + .25rem);right:.55rem;width:min(280px,calc(100% - 1.1rem));padding:.7rem;border:1px solid var(--line);border-radius:10px;background:#141f30}
.chat-viewport{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;padding:.9rem .7rem;scrollbar-color:#526278 transparent}
.chat-messages{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:.9rem}
.chat-message{display:flex;gap:.45rem;align-items:flex-start}
.chat-message.author{flex-direction:row-reverse}
.chat-avatar{flex:0 0 34px;height:34px;display:grid;place-items:center;border-radius:50%;background:#284765;color:#eef6ff;font-size:.68rem;font-weight:700}
.author .chat-avatar{background:#644434;color:#fff0df}
.chat-message-body{min-width:0;max-width:min(88%,calc(100% - 42px))}
.chat-message-body:has(table){max-width:calc(100% - 42px)}
.author .chat-message-body{text-align:right}
.chat-speaker{display:block;color:#a8cce7;font-size:.72rem;font-weight:650;margin-bottom:.2rem}
.author .chat-speaker{color:#f1cba8}
.chat-bubble{text-align:left;min-width:1.5rem;overflow-wrap:anywhere;white-space:normal;background:#19344c;color:#eef6ff;border-radius:4px 13px 13px 13px;padding:.68rem .82rem;line-height:1.62}
.author .chat-bubble{background:#513a34;color:#fff3ea;border-radius:13px 4px 13px 13px;white-space:pre-wrap}
.chat-bubble p,.chat-bubble h1,.chat-bubble h2,.chat-bubble h3,.chat-bubble h4,.chat-bubble h5,.chat-bubble h6{font-size:1em;margin:0 0 .55rem}
.chat-bubble p:last-child,.chat-bubble ul:last-child,.chat-bubble ol:last-child{margin-bottom:0}
.chat-bubble h1,.chat-bubble h2,.chat-bubble h3{font-size:1.12em}
.chat-bubble ul,.chat-bubble ol{margin:.35em 0 .65em;padding-inline-start:1.35em;white-space:normal}
.chat-bubble blockquote{border-left:2px solid #b6c2d1;margin:.55rem 0;padding-inline-start:.65rem}
.chat-bubble a{color:#c7e6ff}
.author .chat-bubble a{color:#ffe2b7}
.chat-document{max-width:100%;overflow:auto;margin:.5rem 0;border:1px solid #72859b;border-radius:5px;white-space:normal}
.chat-document table{border-collapse:collapse;min-width:100%;width:max-content;font-size:.88rem}
.chat-document td,.chat-document th{padding:.38rem .5rem;border:1px solid #72859b;min-width:5rem;max-width:16rem;text-align:start}
.chat-document th{background:#203146}
.chat-document pre{margin:0;padding:.6rem;width:max-content;white-space:pre;font-size:.85rem}
.chat-bubble img{display:block;max-width:100%;height:auto}
.chat-warning{text-align:left;color:#ffcca6;font-size:.78rem;margin:.3rem 0;padding-left:1.1rem}
.chat-controls{flex:none;display:flex;align-items:center;justify-content:space-between;gap:.7rem;background:#141f30;border-top:1px solid var(--line);padding:.6rem .75rem}
.chat-play{min-width:5.4rem;font-size:.9rem}
.chat-progress{display:block;width:100%;margin:.1rem 0 .5rem;accent-color:var(--gold);cursor:pointer}
.chat-buttons{display:flex;gap:.35rem;align-items:center;flex-wrap:wrap;font-size:.8rem}
.chat-buttons button,.chat-buttons select{padding:.28rem .4rem;min-height:35px}
.chat-time{font-variant-numeric:tabular-nums;margin-inline-start:auto}
.chat-follow{display:flex;gap:.35rem;align-items:center;color:var(--muted);font-size:.85rem;width:max-content}
.chat-sr{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;white-space:nowrap}
.admin-layout{display:grid;grid-template-columns:minmax(0,320px) minmax(0,1fr);gap:1.25rem;align-items:start}
.admin-panel form,.auth-panel form{display:grid;gap:.4rem}
.auth-panel{max-width:480px;margin:1rem auto}
.admin-panel input[type=url],.admin-panel textarea{width:100%}
.admin-panel textarea{resize:vertical;min-height:7rem}
.admin-panel details{margin:.85rem 0}
.admin-panel summary{cursor:pointer;color:var(--gold)}
.admin-actions{display:flex;flex-wrap:wrap;gap:.6rem;margin:.75rem 0}
.admin-notices{padding-inline-start:1.3rem}
.admin-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:.8rem}
.source-compare{max-height:55vh;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;background:#0c1523;padding:.8rem;font-size:.85rem}
@media(max-width:1020px){.admin-layout{grid-template-columns:minmax(0,1fr)}}
@media(max-width:740px){
  .player-layout{grid-template-columns:minmax(0,1fr)}
  .chat-stage{height:clamp(360px,76svh,650px)}
  .chat-head{gap:.5rem;padding-inline:.65rem}
}
@media(max-height:530px) and (orientation:landscape){
  .chat-stage{height:max(260px,calc(100svh - 1rem))}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
