:root{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#292f38;background:#f8f9fb;font-synthesis:none}*{box-sizing:border-box}body{margin:0;overflow:hidden}button,input,select,textarea{font:inherit}button,select{cursor:pointer}button{color:inherit}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #a69cf1;outline-offset:3px}button{border:0;background:none}button:disabled{opacity:.3;cursor:default}[hidden]{display:none!important}.topbar{height:82px;background:#fff;display:flex;align-items:center;padding:0 30px;border-bottom:1px solid #e7e9ee;gap:36px;position:relative;z-index:3}.brand{display:flex;align-items:center;gap:10px;font-size:29px;font-weight:750;letter-spacing:-1.5px;text-decoration:none;color:#252c35}.logo{display:grid;place-items:center;background:#7560d4;color:white;width:35px;height:35px;border-radius:11px;font-size:29px;line-height:1;transform:rotate(-7deg)}.beta{font-size:9px;letter-spacing:1.6px;margin-left:2px;color:#9297a2;font-weight:600;align-self:flex-end;padding-bottom:6px}.document{display:flex;flex-direction:column;gap:4px;border-left:1px solid #e8e9ed;padding-left:28px}.document input{border:0;outline:none;font-size:14px;font-weight:600;width:235px;color:#353c47;background:transparent}.document span{font-size:11px;color:#9298a3;padding-left:2px}.header-actions{margin-left:auto;display:flex;align-items:center;gap:16px}.local-badge{font-size:11px;color:#7b8390;display:flex;gap:7px;align-items:center}.local-badge i,.note-dot{width:6px;height:6px;background:#7da795;border-radius:50%}.button{padding:11px 16px;border:1px solid #e3e4e9;border-radius:9px;background:white;font-size:12px;font-weight:550}.button:hover{background:#f4f1fd}.button span{margin-left:15px}.icon-button{width:38px;height:38px;border-radius:8px;font-size:23px;display:inline-grid;place-items:center}.icon-button:hover{background:#f1eefb}#workspace{position:relative;height:calc(100dvh - 82px);overflow:hidden}#board{position:absolute;width:100%;height:100%;touch-action:none;outline:none}.top-note{position:absolute;top:26px;left:28px;display:flex;align-items:center;gap:9px;font-size:11px;color:#9a9eab;pointer-events:none}.note-dot{background:#b8afdf;width:5px;height:5px}.toolbar{position:absolute;left:22px;top:77px;display:flex;flex-direction:column;padding:7px;background:#fff;border:1px solid #e8e9ee;border-radius:15px;box-shadow:0 5px 22px #2c314908;gap:3px}.tool{width:42px;height:41px;border-radius:9px;display:grid;place-items:center;color:#747b88}.tool:hover{background:#f5f3fa}.tool.active{background:#ede8fc;color:#7458ce}.tool svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.divider{height:1px;background:#eeedf3;margin:5px 8px}.properties{position:absolute;left:94px;top:77px;background:#fff;width:182px;border:1px solid #e8e9ee;border-radius:13px;padding:17px;box-shadow:0 5px 22px #2c314906}.panel-heading{display:flex;justify-content:space-between;align-items:center;font-size:12px;font-weight:650;margin-bottom:17px}.shortcut{font-size:10px;color:#a5a8b1;border:1px solid #eeedf3;border-radius:4px;padding:2px 5px;font-weight:400}.colors{display:grid;grid-template-columns:repeat(4,1fr);gap:12px 10px}.swatch{width:24px;height:24px;border-radius:50%;background:var(--swatch);border:3px solid white;box-shadow:0 0 0 1px transparent}.swatch.active{box-shadow:0 0 0 1.5px var(--swatch)}.custom-color{display:flex;align-items:center;justify-content:space-between;font-size:10px;color:#969ba6;margin-top:15px}input[type=color]{border:0;background:none;width:24px;height:24px;padding:0;cursor:pointer}.property-label{display:flex;justify-content:space-between;font-size:10px;color:#949aa5;margin-top:20px}input[type=range]{width:100%;height:3px;accent-color:#8065d5;margin-top:16px}.stroke-preview{height:29px;display:grid;place-items:center;overflow:hidden}.stroke-preview span{width:75%;border-radius:20px;background:#292f38;height:3px}.touch-toggle{border-top:1px solid #eeedf3;padding-top:15px;margin-top:8px;display:flex;gap:6px;align-items:center;font-size:10px;color:#68717d}.touch-toggle input{accent-color:#8065d5;margin:0}.pencil-info{font-size:10px;color:#a1a6af;line-height:1.65;margin-top:12px}.delete-selection{margin-top:12px;font-size:10px;width:100%;color:#ad4e55}.welcome{position:absolute;top:43%;left:53%;transform:translate(-50%,-50%);pointer-events:none;text-align:center;min-width:360px}.eyebrow{font-size:9px;letter-spacing:2.4px;color:#b0a7c5;font-weight:600}.welcome h1{font-size:52px;line-height:1.15;letter-spacing:-2px;font-weight:550;color:#656276;margin:23px 0 17px}.welcome h1 span{display:block;color:#a299be}.welcome p{font-size:13px;line-height:1.9;color:#a2a3af}.welcome-detail{display:inline-flex;gap:10px;align-items:center;border-top:1px solid #e8e5ef;padding:20px 25px;margin-top:20px;font-size:10px;color:#aaa7b8}.welcome-detail span{font-size:20px;color:#b3a7d4}.bottom-left{position:absolute;bottom:24px;left:23px;display:flex;gap:12px}.history-controls,.zoom-controls{display:flex;align-items:center;background:white;border:1px solid #e7e8ee;border-radius:11px;padding:3px;box-shadow:0 3px 14px #2c314905}.bottom-left select{border:1px solid #e7e8ee;border-radius:10px;background:#fff;padding:0 12px;color:#767e8b;font-size:11px}.bottom-tip{position:absolute;bottom:40px;left:50%;transform:translateX(-50%);color:#a2a6b0;font-size:10px;pointer-events:none}.zoom-controls{position:absolute;bottom:24px;right:24px}.zoom-controls span{height:18px;width:1px;background:#eeedf3}.zoom-value{font-size:11px;min-width:48px}.menu{position:absolute;right:22px;top:10px;background:white;padding:8px;width:240px;border-radius:12px;box-shadow:0 8px 40px #20233820;border:1px solid #e8e9ee;z-index:5}.menu button{display:block;width:100%;text-align:left;padding:12px;border-radius:6px;font-size:12px}.menu button:hover{background:#f2eefb}.menu p{font-size:10px;line-height:1.7;color:#8d929d;padding:8px 12px;border-top:1px solid #eee}#toast{position:absolute;bottom:85px;left:50%;transform:translateX(-50%);padding:13px 20px;border-radius:10px;background:#333346;color:#fff;font-size:12px;max-width:85%;z-index:8}dialog{border:1px solid #e9e6f0;border-radius:18px;padding:25px;width:min(430px,90vw);box-shadow:0 20px 100px #26213230}dialog::backdrop{background:#29233640}dialog h2{font-size:19px;margin-top:0}textarea{width:100%;resize:vertical;border:1px solid #ddd8e9;border-radius:8px;padding:12px;line-height:1.5}dialog label{font-size:12px;display:flex;gap:12px;align-items:center;margin-top:15px}dialog input{width:70px;padding:6px;border:1px solid #ddd8e9;border-radius:5px}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:22px}.primary{background:#7961ce;color:white;border-color:#7961ce}.primary:hover{background:#6850bd}@media(max-height:800px){.toolbar{top:58px;gap:1px}.tool{height:34px}.divider{margin:3px 8px}.properties{top:58px}.welcome h1{font-size:44px}}@media(max-width:1000px){.local-badge{display:none}.topbar{gap:20px;padding:0 20px}.properties{width:160px;padding:14px}.welcome{left:61%}.bottom-tip{display:none}.beta{display:none}}@media(max-width:650px){.topbar{height:68px;padding:0 12px;gap:12px}.brand{font-size:23px}.logo{width:29px;height:29px}.document{padding-left:12px}.document input{width:135px;font-size:12px}.document span{font-size:9px}.header-actions{gap:2px}.header-actions>.button{font-size:0;padding:8px}.header-actions>.button span{font-size:20px;margin:0}#workspace{height:calc(100dvh - 68px)}.top-note{left:14px;top:18px;font-size:9px}.toolbar{left:10px;top:45px;padding:4px}.tool{width:34px;height:32px}.properties{top:45px;left:60px;width:131px;padding:11px}.colors{gap:8px 4px}.swatch{width:20px;height:20px}.pencil-info{font-size:9px}.welcome{left:59%;top:61%;min-width:200px}.welcome h1{font-size:30px;letter-spacing:-1px}.welcome .eyebrow{font-size:7px;letter-spacing:1px}.welcome p{font-size:10px}.welcome-detail{display:none}.bottom-left{left:10px;bottom:12px;gap:5px}.bottom-left select{max-width:96px;font-size:10px;padding:0 4px}.zoom-controls{right:10px;bottom:12px}.icon-button{width:32px;height:34px}.zoom-value{min-width:42px}.zoom-controls .icon-button:last-child,.zoom-controls span{display:none}}
@media(max-width:650px){.welcome{top:auto;bottom:100px;left:61%;transform:translateX(-50%)}.welcome h1{font-size:27px;margin:12px 0}.welcome .eyebrow{display:none}.welcome p{font-size:9px}.properties{box-shadow:0 5px 22px #2c314910}}
@media(max-width:650px) and (max-height:720px){.welcome{display:none}}
@media(max-height:600px) and (min-width:651px){.toolbar{flex-direction:row;top:auto;bottom:80px;left:50%;transform:translateX(-50%)}.divider{width:1px;height:22px;margin:6px 3px}.properties{top:50px;left:22px}.tool{width:34px}.welcome h1{font-size:35px}}
.settings-toggle{position:absolute;top:16px;left:25px;width:46px;height:35px;background:white;border:1px solid #e8e9ee;border-radius:10px;color:#7961ce;font-size:21px;box-shadow:0 3px 12px #2c314909}.settings-toggle[aria-expanded=true]{background:#ede8fc}.panel-heading{gap:8px}.panel-heading .shortcut{margin-left:auto}#properties-close{font-size:21px;color:#9a93aa;padding:0 2px}.menu-link{display:block;color:inherit;text-decoration:none;padding:12px;font-size:12px}.dialog-note{font-size:12px;line-height:1.6;color:#7c8290}.link-label{display:block!important}.link-label input{display:block;width:100%;margin:8px 0 13px;font-size:11px}#teacher-password{width:100%;margin:8px 0 20px}#create-room-form label{display:block}.permission{padding:18px 0}.permission input{width:auto;accent-color:#7961ce}#room-error{font-size:12px;line-height:1.5;color:#a14d57}.header-actions .primary{white-space:nowrap}.properties{z-index:2}.settings-toggle{z-index:2}#room-dialog{max-height:90dvh;overflow:auto}body.readonly #board{cursor:grab}body.readonly .toolbar{opacity:.65}
@media(max-width:650px){.settings-toggle{top:5px;left:12px;width:38px;height:30px}.header-actions #room-button{font-size:10px;padding:8px;max-width:85px;white-space:normal}.document input{width:110px}.topbar{gap:8px}.brand{font-size:20px}.header-actions{gap:3px}.properties{top:45px}}

#workspace,#board{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}#board{touch-action:none}

/* Обновлённые кнопки истории и выравнивание панели настроек */
.history-button{width:46px;height:46px;border-radius:13px;display:grid;place-items:center;color:#66707e;background:#fff;border:1px solid #e1e4ea}.history-button:hover{background:#f4f1fd;color:#7458ce}.history-button svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}.history-button:disabled{color:#b9bec7;background:#fff;opacity:1}.history-controls{display:flex;gap:8px;padding:8px;border:1px solid #e1e4ea;border-radius:22px;background:#fff;box-shadow:0 5px 22px #2c314908}.settings-toggle{left:22px;top:16px;width:92px;height:55px;border-radius:19px;display:grid;place-items:center}.settings-toggle+ .properties{left:94px}
.auth-page,.boards-page{background:#fbfaf7}.auth-card{width:min(390px,calc(100% - 32px));margin:12vh auto;background:#fff;padding:42px;border-radius:24px;box-shadow:0 16px 60px #3b344014;text-align:center}.auth-card .logo{margin:auto}.auth-card h1{margin:20px 0 8px}.auth-card p{color:#85838a;line-height:1.6}.auth-card form{display:grid;gap:12px;margin:28px 0}.auth-card input{border:1px solid #e4e1e7;border-radius:10px;padding:13px;font-size:14px}.auth-card a{color:#7458ce;font-size:13px}.boards-main{max-width:1400px;margin:0 auto;padding:55px 40px}.boards-heading h1{font-size:42px;margin:10px 0 40px;color:#29272a}.boards-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:48px 46px}.board-card{text-decoration:none;color:#29272a}.board-thumb{height:260px;border-radius:22px;background:#fff4c9;position:relative;padding:48px 28px 22px;box-shadow:0 2px 4px #4441}.board-thumb:after{content:'';position:absolute;inset:48px 0 0 48px;background:#fff;border-radius:8px 0 18px 0}.board-thumb i{position:relative;z-index:1;display:inline-block;width:62px;height:72px;background:#f1f0ed;margin:2px 10px 16px 0;border-radius:0 0 22px 0}.view-only{position:absolute;z-index:2;top:28px;left:12px;background:#fff;border-radius:20px;padding:8px 15px;font-weight:650}.board-card h2{font-size:24px;margin:22px 0 10px}.board-card p{color:#797878;margin:0;font-size:15px}@media(max-width:650px){.boards-main{padding:30px 18px}.boards-grid{grid-template-columns:1fr 1fr;gap:25px 14px}.board-thumb{height:180px;padding:35px 14px 10px}.board-thumb:after{inset:35px 0 0 28px}.board-thumb i{width:34px;height:42px;margin-right:4px}.board-card h2{font-size:16px}.board-card p{font-size:11px}}

.board-card{border:0;text-align:left;background:none;padding:0;cursor:pointer;font:inherit}

/* Финальная настройка интерфейса доски */
.topbar{min-height:82px;border-bottom:1px solid #e5e8ee;background:rgba(255,255,255,.96)}
.brand{font-size:30px;letter-spacing:-1.8px}.brand .logo{width:42px;height:42px;border-radius:13px;font-size:31px}.beta{font-size:10px;letter-spacing:2px}
.toolbar{top:76px;left:22px;padding:8px;border-radius:20px;gap:4px;box-shadow:0 8px 28px #252a3512}.tool{width:48px;height:44px;border-radius:13px}.tool.active{background:#eee9ff}.settings-toggle{left:22px;top:12px;width:48px;height:48px;border-radius:15px;font-size:23px;box-shadow:0 8px 22px #252a3510}.settings-toggle+ .properties{left:82px;top:76px}
.bottom-left{align-items:center;gap:14px}.history-controls{gap:8px;padding:7px;border-radius:18px}.history-button{width:48px;height:48px;border-radius:14px}.bottom-left select{height:64px;min-width:210px;padding:0 18px;border-radius:12px;font-size:16px;background:#fff}
.zoom-controls{padding:7px;border-radius:18px;gap:7px}.zoom-controls .icon-button{width:48px;height:48px}.zoom-value{height:48px!important;padding:0 16px;border-radius:12px;font-size:14px}
@media(max-width:650px){.brand{font-size:22px}.brand .logo{width:32px;height:32px;font-size:24px}.toolbar{left:12px;top:52px}.tool{width:40px;height:38px}.settings-toggle{left:12px;top:5px;width:40px;height:40px}.settings-toggle+ .properties{left:62px;top:52px}.bottom-left select{min-width:105px;height:44px;font-size:11px}.history-button{width:40px;height:40px}.history-controls{padding:5px}.zoom-controls .icon-button{width:38px;height:38px}.zoom-value{height:38px!important}}
/* Возвращаем компактную панель доски: элементы не должны растягиваться на iPad. */
.toolbar{top:77px;left:22px;padding:7px;border-radius:15px;gap:3px}
.tool{width:42px;height:41px;border-radius:9px}
.settings-toggle{left:25px;top:16px;width:46px;height:35px;border-radius:10px;font-size:21px}
.settings-toggle+ .properties{left:94px;top:77px}
.bottom-left{bottom:24px;left:23px;gap:12px}
.history-controls{gap:8px;padding:7px;border-radius:22px}
.history-button{width:46px;height:46px;border-radius:13px}
.bottom-left select{height:auto;min-width:0;padding:0 12px;border-radius:10px;font-size:11px}
.zoom-controls{padding:3px;border-radius:11px;gap:0}
.zoom-controls .icon-button{width:38px;height:38px}
.zoom-value{height:auto!important;padding:0 8px;font-size:11px}
@media(max-width:650px){
 .toolbar{left:10px;top:45px;padding:4px;gap:1px}
 .tool{width:34px;height:32px}
 .settings-toggle{top:5px;left:12px;width:38px;height:30px;font-size:18px}
 .settings-toggle+ .properties{left:60px;top:45px}
 .bottom-left{left:10px;bottom:12px;gap:5px}
 .bottom-left select{height:auto;min-width:0;max-width:96px;font-size:10px;padding:0 4px}
 .history-button{width:40px;height:40px}
 .zoom-controls .icon-button{width:32px;height:34px}
}
/* Unified tool dock: sized against the viewport, with a reserved bottom control row. */
#workspace{--dock-left:16px;--dock-size:clamp(34px,calc((100dvh - 260px)/12),44px)}
#workspace .toolbar{top:16px;bottom:auto;left:var(--dock-left);transform:none;display:flex;flex-direction:column;gap:2px;padding:6px;width:calc(var(--dock-size) + 14px);max-height:calc(100% - 100px - env(safe-area-inset-bottom));overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;border:1px solid #e4e5ed;border-radius:18px;background:#fffffffa;box-shadow:0 6px 24px #35304f0b;z-index:2}
#workspace .toolbar .tool,#workspace .toolbar .settings-toggle{position:static;flex:none;width:var(--dock-size);height:var(--dock-size);min-height:var(--dock-size);border:0;border-radius:11px;box-shadow:none;display:grid;place-items:center;background:transparent;color:#767b8b;margin:0;padding:0;font-size:21px;transition:background .12s,color .12s}
#workspace .toolbar .tool svg{width:21px;height:21px}
#workspace .toolbar .tool:hover,#workspace .toolbar .settings-toggle:hover{background:#f5f2fc;color:#765ad1}
#workspace .toolbar .active,#workspace .toolbar .settings-toggle[aria-expanded=true]{background:#eee8ff;color:#795bd5}
#workspace .toolbar .divider{flex:none;width:auto;height:1px;min-height:1px;margin:3px 8px;background:#eeecf4}
#workspace .properties{left:calc(var(--dock-left) + var(--dock-size) + 24px);top:16px;width:190px;padding:16px;max-height:calc(100% - 100px);overflow:auto;border-radius:16px}
#workspace .bottom-left{left:16px;bottom:calc(16px + env(safe-area-inset-bottom));gap:10px;align-items:center}
#workspace .history-controls{padding:4px;gap:2px;border-radius:14px;border:1px solid #e4e5ed;box-shadow:0 4px 18px #35304f08}
#workspace .history-button{width:40px;height:40px;border:0;border-radius:10px;background:transparent}
#workspace .history-button svg{width:22px;height:22px}
#workspace .bottom-left select{height:50px;max-width:none;min-width:110px;padding:0 10px;font-size:12px;border-radius:14px;border-color:#e4e5ed}
#workspace .zoom-controls{right:16px;bottom:calc(16px + env(safe-area-inset-bottom));height:50px;padding:4px;border-radius:14px;border-color:#e4e5ed}
#workspace .zoom-controls .icon-button{width:36px;height:40px}
#workspace .bottom-tip{bottom:34px}
@media(max-height:680px){
 #workspace{--dock-size:40px}
 #workspace .toolbar{display:grid;grid-template-columns:repeat(2,40px);width:96px;gap:3px;padding:6px;align-content:start}
 #workspace .toolbar .settings-toggle{grid-column:1 / -1;width:100%;height:36px;min-height:36px}
 #workspace .toolbar .divider{grid-column:1 / -1;margin:2px 6px}
 #workspace .properties{left:122px}
}
@media(max-width:650px){
 #workspace{--dock-left:10px}
 #workspace .toolbar{top:12px}
 #workspace .properties{top:12px;width:170px}
 #workspace .bottom-left{left:10px;bottom:calc(12px + env(safe-area-inset-bottom));gap:6px}
 #workspace .bottom-left select{min-width:88px;width:88px;font-size:10px;padding:0 5px}
 #workspace .zoom-controls{right:10px;bottom:calc(12px + env(safe-area-inset-bottom))}
 #workspace .history-button{width:36px}
 #workspace .zoom-controls .icon-button{width:30px}
 #workspace .zoom-value{min-width:38px;padding:0 3px}
}

/* iPadOS must not select board labels or show the long-press copy callout. */
body.whiteboard-page,body.whiteboard-page *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
body.whiteboard-page input,body.whiteboard-page textarea,body.whiteboard-page [contenteditable="true"]{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}
body.whiteboard-page #board{touch-action:none}

/* Compact board header; other pages retain their own layout. */
.whiteboard-page{--board-header-height:66px}
.whiteboard-page .topbar{height:var(--board-header-height);min-height:var(--board-header-height);padding:0 22px;gap:24px}
.whiteboard-page #workspace{height:calc(100dvh - var(--board-header-height))}
.whiteboard-page .topbar .brand{font-size:25px;gap:8px}
.whiteboard-page .topbar .logo{width:31px;height:31px;font-size:25px;border-radius:10px}
.whiteboard-page .topbar .document{padding-left:22px;min-width:0;flex:1}
.whiteboard-page .topbar .document input{max-width:100%;width:235px}
.whiteboard-page .topbar #save-status{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.whiteboard-page .header-actions{flex:none;margin-left:auto}
.whiteboard-page #room-button{padding:9px 16px;white-space:nowrap}
.whiteboard-page #menu{display:none!important}
@media(max-width:650px){
 .whiteboard-page{--board-header-height:58px}
 .whiteboard-page .topbar{padding:0 12px;gap:12px}
 .whiteboard-page .topbar .brand{font-size:21px}
 .whiteboard-page .topbar .logo{width:28px;height:28px;font-size:23px}
 .whiteboard-page .topbar .document{padding-left:12px}
 .whiteboard-page .topbar .document input{width:100%;font-size:12px}
 .whiteboard-page #room-button{padding:8px 10px;font-size:11px}
}

#workspace .background-setting{display:flex;flex-direction:column;gap:8px;margin-top:16px;padding-top:14px;border-top:1px solid #eeecf4;font-size:12px;color:#8b90a0}
#workspace .background-setting select{width:100%;height:38px;padding:0 9px;border:1px solid #e4e5ed;border-radius:10px;background:#fff;color:#626979;font:inherit}

#photo-tools{position:absolute;z-index:4;display:flex;gap:4px;padding:5px;background:#fff;border:1px solid #e4e5ed;border-radius:13px;box-shadow:0 5px 20px #35304f15}#photo-tools button{padding:10px 12px;border-radius:8px;font-size:13px}#photo-tools button:hover{background:#eee8ff}#photo-crop-dialog{width:min(760px,94vw)}#photo-crop-canvas{display:block;width:auto;height:auto;max-width:100%;max-height:65dvh;touch-action:none}
.board-entry{min-width:0;position:relative}.board-entry .board-card{display:block;width:100%}.board-delete{margin-top:14px;padding:9px 12px;border:1px solid #ecdada;border-radius:9px;color:#ad4545;background:#fff;font-size:13px}.board-delete:hover{background:#fff0f0}.boards-page{overflow:auto}

#crop-overlay{position:absolute;z-index:3;overflow:visible;touch-action:none;background:transparent}
#crop-frame{position:absolute;outline:2px solid #8065d5;box-shadow:0 0 0 200vmax #ffffffa6;clip-path:inset(-100vmax);pointer-events:none}
#crop-overlay{overflow:hidden}
.crop-handle{position:absolute;transform:translate(-50%,-50%);width:26px;height:26px;border:7px solid transparent;background:#fff;background-clip:padding-box;outline:1px solid #9e97af;pointer-events:auto;touch-action:none}
#crop-overlay #crop-frame{box-shadow:0 0 0 200vmax #ffffffb0}
#photo-tools{z-index:5}
.boards-heading{display:flex;align-items:center;gap:24px;margin-bottom:32px}.boards-heading h1{margin:8px 0 0}.boards-heading #create-board{flex:none;margin-top:20px}
#room-dialog{width:min(440px,calc(100vw - 32px));padding:28px;border-radius:22px;color:#292f38}
#room-sharing h2{font-size:23px;margin:0 0 10px}#room-sharing .dialog-note{color:#9296a3;font-size:14px;line-height:1.5;margin:0 0 22px}
#room-sharing .link-label{display:flex;flex-direction:column;align-items:stretch;gap:8px;font-size:12px;color:#777d8b}#room-sharing .link-label input{width:100%;min-width:0;padding:12px;background:#f8f7fc;border:1px solid #e7e2f3;border-radius:10px;font-size:14px}
#copy-student{width:100%;margin-top:12px;padding:12px}#room-sharing .permission{padding:16px 0 4px;gap:10px;font-size:14px}#room-sharing .permission input{width:18px;height:18px;accent-color:#7961ce}
#room-dialog .dialog-actions{margin-top:20px;padding-top:16px;border-top:1px solid #efedf4}
@media(max-width:650px){.boards-heading{gap:12px}.boards-heading h1{font-size:28px}.boards-heading #create-board{font-size:12px;padding:10px}.boards-heading .eyebrow{font-size:7px;letter-spacing:1px}}

.boards-page .topbar #logout{margin-left:auto;flex-shrink:0}

.board-options{position:absolute;top:12px;right:12px;z-index:3;display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:#fffffff0;font-size:28px;line-height:1;color:#555260}.board-options:hover,.board-options[aria-expanded=true]{background:#eee8ff;color:#795bd5}.board-options-menu{position:absolute;top:58px;right:12px;z-index:6;width:190px;background:#fff;padding:6px;border-radius:14px;box-shadow:0 8px 35px #29233626;border:1px solid #ece9f1}.board-options-menu button{display:block;width:100%;text-align:left;padding:12px;border-radius:8px;font-size:14px}.board-options-menu button:hover{background:#f5f2fb}.board-options-menu .danger{color:#b34d52;border-top:1px solid #eee;border-radius:0 0 8px 8px}.board-entry:has(.board-options[aria-expanded=true]){z-index:4}

.board-filters{display:flex;align-items:flex-end;flex-wrap:wrap;gap:16px;margin:0 0 30px}.board-sort-label,.student-filter{display:flex;flex-direction:column;gap:8px;font-size:12px;color:#7e788b}.board-filters select{display:block;min-width:210px;padding:11px 32px 11px 12px;border:1px solid #e4e0eb;border-radius:11px;background:#fff;color:#40394d;font:inherit;font-size:14px}.student-filter select:disabled{background:#f4f2f6;color:#aaa4b2;cursor:not-allowed;opacity:1}.soon-badge{margin-left:6px;border-radius:6px;padding:2px 6px;background:#eee8ff;color:#8a73c9;font-size:10px}.sort-direction{font-size:12px;color:#9c96a7;align-self:flex-end;padding-bottom:13px}@media(max-width:650px){.board-filters{gap:12px}.board-filters select{min-width:0;width:100%;font-size:12px}.board-sort-label{flex:1 1 170px}.student-filter{flex:1 1 135px}.sort-direction{display:none}}

.boards-account-actions{margin-left:auto;display:flex;align-items:center;gap:10px}.board-student-name{display:block;color:#8065c5;font-size:13px;margin:0 0 8px}#assign-student{width:100%;margin-top:10px;padding:12px;border:1px solid #e4e0eb;border-radius:10px;background:#fff}@media(max-width:650px){.boards-account-actions{gap:6px}.boards-account-actions .button{padding:9px 10px;font-size:11px}}

.list-dialog{width:min(460px,calc(100vw - 32px));padding:30px;border:1px solid #eee9f5;border-radius:24px;color:#302b3b;max-height:90dvh;overflow:auto}.list-dialog::backdrop{background:#30243e66;backdrop-filter:blur(4px)}.dialog-eyebrow{font-size:10px;letter-spacing:1.5px;color:#9b87c4}.list-dialog h2{font-size:26px;margin:10px 0}.dialog-description{font-size:14px;line-height:1.6;color:#91899e;margin-bottom:24px}.list-dialog label{display:block;margin:16px 0 8px;font-size:13px;color:#756c83}.list-dialog input,.list-dialog select{width:100%;height:46px;border:1px solid #e4deee;border-radius:12px;background:#faf9fd;padding:0 13px;font-size:16px;color:#393142}.list-dialog .dialog-actions{margin-top:24px;gap:10px}.list-dialog .dialog-actions .button{flex:1;padding:12px}.form-error{color:#b34d52;font-size:13px;line-height:1.5}.form-error:empty{display:none}
.board-filters select,.list-dialog select{appearance:none;-webkit-appearance:none;min-height:44px;padding:12px 40px 12px 15px;border-radius:13px;box-shadow:0 2px 6px #37294f05;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23816ba6' stroke-width='1.8'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 14px center}.board-filters select:hover{border-color:#b8a7d8}.board-filters label{font-weight:500;color:#8d819f}

/* Board list: centered title, actions in the header, compact content spacing. */
.boards-page .topbar{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:18px;height:86px;padding:0 24px}
.boards-page .topbar .brand{justify-self:start}
.boards-header-title{text-align:center;min-width:0}.boards-header-title .eyebrow{font-size:8px;letter-spacing:1.6px;white-space:nowrap}.boards-header-title h1{margin:5px 0 0;font-size:25px;line-height:1.1;font-weight:650;letter-spacing:-.6px}
.boards-page .boards-account-actions{justify-self:end;margin:0;gap:8px;white-space:nowrap}.boards-page .boards-account-actions .button{font-size:12px;padding:10px 12px}
.boards-page .boards-main{padding:18px 32px 32px}.boards-page .board-filters{margin-bottom:20px;gap:14px}.boards-page .board-sort-label,.boards-page .student-filter{gap:6px}
@media(max-width:1000px){.boards-page .topbar{padding:0 16px;gap:12px}.boards-page .topbar .brand{font-size:24px}.boards-page .boards-account-actions .button{font-size:11px;padding:10px}.boards-header-title h1{font-size:23px}.boards-header-title .eyebrow{font-size:7px;letter-spacing:1px}}
@media(max-width:820px){.boards-page .topbar{height:auto;min-height:86px;padding:12px 16px;row-gap:12px}.boards-header-title{grid-column:2;grid-row:1}.boards-page .boards-account-actions{grid-column:1 / -1;grid-row:2;justify-self:end}.boards-page .boards-main{padding:16px 18px 24px}}

/* Center filter captions and fit five cards on desktop. */
.boards-page .board-sort-label,.boards-page .student-filter>label{text-align:center}
.boards-page .board-filters select{text-align:left}
.boards-page .boards-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:32px 24px}
.boards-page .board-thumb{height:auto;aspect-ratio:1.12;padding:18% 10% 8%;overflow:hidden}
.boards-page .board-thumb:after{inset:18% 0 0 15%}
.boards-page .board-thumb i{width:25%;height:auto;aspect-ratio:.86;margin:0 5% 8% 0;border-radius:0 0 18px 0}
.boards-page .board-card h2{font-size:20px;overflow-wrap:anywhere}
.boards-page .board-card p{font-size:12px}
@media(max-width:1050px){.boards-page .boards-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:28px 18px}}
@media(max-width:820px){.boards-page .boards-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:24px 16px}}
@media(max-width:600px){.boards-page .boards-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 14px}.boards-page .board-card h2{font-size:16px}.boards-page .board-card p{font-size:11px}}

.student-list{max-height:30vh;overflow:auto;margin-top:20px}.student-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid #eee8f4}.student-row span{overflow-wrap:anywhere}.student-row .danger{color:#b94747;flex-shrink:0}

#users-dialog{max-height:90dvh;overflow:auto}#users-list{margin:0 0 20px}#add-user-form{margin-top:20px}#users-list small{color:#81768f}.boards-account-actions{flex-wrap:wrap}

#users-error.success{color:#437b60}@media(min-width:821px) and (max-width:1150px){.boards-page .topbar{grid-template-columns:auto 1fr;height:auto;min-height:86px;padding-top:12px;padding-bottom:12px}.boards-header-title{justify-self:end}.boards-page .boards-account-actions{grid-column:1 / -1;justify-self:end}}
