*{box-sizing:border-box}
:root{color-scheme:light;--ink:#17233b;--muted:#758198;--line:#e8edf4;--blue:#245fe5;--surface:#fff;--green:#157347;--red:#c0392b}
body{font:14px/1.7 -apple-system,BlinkMacSystemFont,"Segoe UI",Tahoma,sans-serif;background:#f4f7fb;color:var(--ink);margin:0}
a{color:var(--blue);text-decoration:none}a:hover{text-decoration:underline}
[hidden]{display:none!important}
header{position:sticky;top:0;z-index:10;background:#fff;border-bottom:1px solid var(--line);padding:.65rem max(5vw,calc((100vw - 1200px)/2));display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap}
.brand{display:flex;align-items:center;gap:.75rem;font-weight:800}
.brand-mark{width:40px;height:40px;display:grid;place-items:center;border-radius:13px;background:#eaf1ff;color:var(--blue);font-size:20px}
.header-end{display:flex;align-items:center;gap:.75rem}
.chip{background:#f5f7fb;padding:.3rem .75rem;border-radius:99px;color:#526078;font-size:.85rem}
.tabs{display:flex;gap:.4rem;flex-wrap:wrap;width:100%;border-top:1px solid #f0f2f6;padding-top:.45rem}
.tab{background:none;color:#526078;padding:.38rem .8rem;font-size:.85rem}
.tab:hover{background:#f2f5fa;transform:none}
.tab[aria-selected=true]{background:#edf3ff;color:#244da8}
main{max-width:1200px;margin:2rem auto;padding:0 1.25rem 3rem}
h1{font-size:clamp(1.4rem,3vw,1.9rem);line-height:1.3;margin:0 0 .3rem}
h2{font-size:1rem;margin:0;font-weight:800}
.lead{color:var(--muted);margin:0 0 1.4rem}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:16px;box-shadow:0 5px 20px #1c31500a;padding:1.25rem;margin-bottom:1rem}
.panel-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;margin-bottom:1rem}
.panel-heading p{color:var(--muted);font-size:.84rem;margin:.15rem 0 0}
.grid-2{display:grid;grid-template-columns:1fr 1.5fr;gap:1rem;align-items:start}
.count-pill,.badge{display:inline-flex;align-items:center;padding:.15rem .6rem;background:#f2f4f7;border-radius:99px;color:#667085;font-size:.76rem;white-space:nowrap}
.badge.ok{background:#e9f8ef;color:var(--green)}.badge.warn{background:#fff4e5;color:#b45f06}.badge.bad{background:#fff0ef;color:var(--red)}.badge.info{background:#edf3ff;color:#345bb5}
input,select,button{font:inherit}
input[type=text],input[type=password],input[type=tel],select{width:100%;min-width:0;padding:.7rem .8rem;border:1px solid #dce3ed;border-radius:9px;background:#fff;color:var(--ink);outline:none}
input:focus,select:focus{border-color:#79a0fa;box-shadow:0 0 0 3px #245fe51a}
button{cursor:pointer;border:0;border-radius:9px;padding:.65rem .95rem;background:var(--blue);color:#fff;font-weight:700;white-space:nowrap;transition:background .15s}
button:hover{background:#194fcc}button:disabled{opacity:.55;cursor:not-allowed}
button:focus-visible,a:focus-visible{outline:3px solid #245fe550;outline-offset:2px}
button.secondary{background:#f2f5fa;color:#43516a}button.secondary:hover{background:#e8edf5}
button.danger{background:#fff0ef;color:var(--red)}button.danger:hover{background:#ffe3e0}
button.small{padding:.32rem .65rem;font-size:.78rem}
.form-row{display:flex;gap:.55rem;align-items:center;flex-wrap:wrap}.form-row>input,.form-row>select{flex:1 1 140px}
.form-stack{display:grid;gap:.75rem}
.field-label{font-size:.84rem;font-weight:700;margin-bottom:-.4rem}
.list{list-style:none;padding:0;margin:0;display:grid;gap:.55rem}
.item{display:flex;align-items:center;justify-content:space-between;gap:.8rem;flex-wrap:wrap;border:1px solid #edf0f5;border-radius:11px;padding:.7rem .85rem;background:#fff}
.item.selected{background:#edf3ff;border-color:#cbdcff}
.item-main{min-width:0;flex:1 1 220px}.item-title{font-weight:700}.meta{color:var(--muted);font-size:.82rem}
.actions{display:flex;gap:.4rem;flex-wrap:wrap;align-items:center}
.chips{display:flex;gap:.35rem;flex-wrap:wrap;margin-top:.35rem}
.chip-room{display:inline-flex;align-items:center;gap:.3rem;background:#f5f8ff;border:1px solid #dfe8fb;border-radius:8px;padding:.1rem .2rem .1rem .5rem;font-size:.78rem}
.chip-room button{padding:.05rem .4rem;font-size:.74rem}
.empty{color:var(--muted);text-align:center;padding:1rem;border:1px dashed #dce3ed;border-radius:11px}
.hint{border-radius:10px;padding:.7rem .85rem;background:#f5f8ff;color:#667692;font-size:.84rem}
code.cmd{display:block;direction:ltr;text-align:left;background:#0f172a;color:#e2e8f0;border-radius:9px;padding:.6rem .8rem;margin:.5rem 0;overflow-x:auto;user-select:all}
#notice{position:fixed;top:1rem;left:50%;transform:translateX(-50%);z-index:50;background:#17233b;color:#fff;padding:.65rem 1.1rem;border-radius:10px;display:none;max-width:90vw}
#notice.error{background:#b42318}
table{width:100%;border-collapse:collapse;font-size:.84rem}th,td{text-align:right;padding:.5rem .6rem;border-bottom:1px solid #edf0f5}th{color:var(--muted);font-weight:700}
.table-wrap{overflow-x:auto}
.mt{margin-top:.8rem}.mt-lg{margin-top:1.2rem}
.narrow{max-width:520px}
/* login */
.center-page{min-height:100vh;display:grid;place-items:center;padding:1.25rem;background:radial-gradient(ellipse at 10% 12%,#dceaff 0,transparent 34%),#f4f7fb}
.login-card{background:#fff;padding:clamp(1.5rem,5vw,2.4rem);border:1px solid #e8edf5;border-radius:22px;box-shadow:0 24px 70px #243a5b18;width:min(430px,100%)}
.login-card .brand-mark{width:54px;height:54px;border-radius:17px;font-size:26px}
.login-card h1{margin:1.1rem 0 .25rem}.login-card .lead{margin-bottom:1.3rem}
.login-card label{display:block;font-weight:650;margin-top:.9rem}
.login-card button[type=submit]{width:100%;margin-top:1.2rem;padding:.85rem}
.form-error{color:#b42318;min-height:1.5rem;margin:.6rem 0 0}
.login-card .alt{text-align:center;margin-top:1rem;font-size:.84rem}
/* user app */
.room-card{cursor:pointer;width:100%;text-align:right;background:#fff;color:var(--ink);border:1px solid #edf0f5;border-radius:11px;padding:.75rem .9rem;display:flex;justify-content:space-between;align-items:center;gap:.6rem;white-space:normal}
.room-card:hover{background:#f7f9fc}.room-card[aria-pressed=true]{background:#edf3ff;border-color:#cbdcff}
.dropzone{border:2px dashed #c9d6ee;border-radius:14px;padding:2rem 1rem;text-align:center;background:#fbfcff;color:#526078}
.dropzone.over{background:#edf3ff;border-color:var(--blue)}
.dropzone input{display:none}
.progress{height:6px;background:#e8edf4;border-radius:99px;overflow:hidden;margin-top:.4rem;flex-basis:100%}
.progress>span{display:block;height:100%;width:0;background:var(--blue);transition:width .2s}
@media(max-width:800px){.grid-2{grid-template-columns:1fr}main{margin:1.2rem auto;padding:0 .85rem 2rem}.panel{padding:1rem}}

/* media viewer */
.viewer{position:fixed;inset:0;z-index:60;background:#0b1220cc;display:grid;place-items:center;padding:1rem}
.viewer-box{background:#fff;border-radius:14px;max-width:min(960px,100%);max-height:100%;display:flex;flex-direction:column;overflow:hidden;width:100%}
.viewer-bar{display:flex;justify-content:space-between;align-items:center;gap:.8rem;padding:.6rem .9rem;border-bottom:1px solid var(--line)}
.viewer-bar strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.viewer-body{background:#0f172a;display:grid;place-items:center;min-height:200px;overflow:auto}
.viewer-body img,.viewer-body video{max-width:100%;max-height:75vh;display:block}
.viewer .form-error{padding:0 .9rem;margin:.4rem 0}
.button-link{display:inline-block;background:#f2f5fa;color:#43516a;padding:.32rem .65rem;border-radius:9px;font-size:.78rem;font-weight:700}
.button-link:hover{background:#e8edf5;text-decoration:none}
