:root{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;color:#263441;background:#fcfaf7;font-synthesis:none;font-size:14px}*{box-sizing:border-box}body{margin:0}button,textarea{font:inherit}button,a{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:default;opacity:.45}button:focus-visible,a:focus-visible,textarea:focus-visible,.chart-scroll:focus-visible{outline:3px solid #7baaca;outline-offset:4px}main{max-width:1232px;margin:0 auto;padding:30px 38px 20px}.page-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px}.eyebrow{font-size:10px;font-weight:650;letter-spacing:2.2px;color:#8e8d87;margin:0 0 9px}h1{font-size:25px;letter-spacing:1px;margin:0;font-weight:650}h1 span{font-size:12px;letter-spacing:1px;font-weight:400;color:#899197;display:inline-block;margin-left:15px;border-left:1px solid #d8d9d5;padding-left:15px}.text-button{border:0;background:none;color:#657380;padding:10px 6px;font-size:12px}.text-button:hover:not(:disabled){color:#244f65}.text-button span{margin-left:7px}.chart-panel{border:1px solid #e6e0d7;background:#fffdf9;border-radius:18px;padding:19px 18px 16px}.orientation{display:flex;justify-content:center;gap:25px;color:#697b8d;font-size:12px;margin:0 0 20px}.orientation b{color:#254b65;font-weight:600}.chart-scroll{overflow-x:auto;border-radius:4px}.chart{min-width:740px}h2{font-size:16px;font-weight:650;letter-spacing:3px;color:#5c6c7b;text-align:center;margin:0 0 16px}.back-seats{display:flex;justify-content:center;gap:12px;margin-bottom:16px}.desk{border:1px solid #d5b694;border-radius:13px;background:#fff;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));min-width:0;height:74px;overflow:hidden}.seat{padding:10px 8px 8px;text-align:center;min-width:0}.seat+.seat{border-left:1px dashed #eee5d9}.seat-label{display:block;font-size:10px;color:#778392;white-space:nowrap;line-height:16px}.student{display:block;font-size:16px;font-weight:650;min-height:24px;line-height:24px;margin-top:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.back-seats .desk{width:238px;background:#f7f0e7;border-color:#e1b182;height:80px}.back-seats .single{width:119px;grid-template-columns:minmax(0,1fr)}.classroom{display:grid;grid-template-columns:82px minmax(0,1fr) 38px minmax(0,1fr) 38px minmax(0,1fr) 50px;grid-template-rows:auto 26px;column-gap:0;position:relative}.desk-column{display:grid;gap:10px;grid-row:1}.window{grid-column:1;grid-row:1 / 3;background:linear-gradient(90deg,#edf6fa 10px,#dcecf5 10px,#dcecf5 calc(100% - 10px),#edf6fa calc(100% - 10px));border:2px solid #7eb0cc;border-radius:14px;display:grid;place-items:center;margin-right:10px;color:#244d61;font-weight:650}.aisle{grid-row:1;background:repeating-linear-gradient(0deg,#f8efe6 0px,#f8efe6 8px,#fffdf9 8px,#fffdf9 18px);border-radius:22px;display:grid;place-items:center;font-size:12px;color:#aa896c}.aisle span{background:#fffdf9aa;padding:7px 3px}.side-aisle{grid-column:7;grid-row:1 / 3;background:#f2ece3;border-radius:15px;margin-left:10px;display:grid;place-items:center;color:#778392}.column-note{font-size:11px;line-height:26px;text-align:center;margin:0;color:#798594;grid-row:2}.window-note{grid-column:2;color:#2f6279;font-weight:650}.middle-note{grid-column:4}.left-note{grid-column:6}#right-desks{grid-column:2}#middle-desks{grid-column:4}#left-desks{grid-column:6}.podium{border-radius:14px;background:#3c5064;text-align:center;display:flex;flex-direction:column;gap:7px;padding:17px 10px 16px;color:#fff;margin-top:12px}.podium strong{font-size:16px;letter-spacing:3px}.podium span{font-size:12px;color:#d1d9e0;letter-spacing:2px}.controls{display:flex;justify-content:space-between;align-items:center;padding:22px 1px 0;gap:16px}.assignment-info{display:flex;align-items:center;gap:9px;font-size:11px;color:#828b8e}.status-dot{width:6px;height:6px;border-radius:50%;background:#81a39a}.separator{color:#d1d4d2;margin:0 3px}.actions{display:flex;gap:20px;align-items:center}.primary-button{border:1px solid #344e60;background:#344e60;border-radius:8px;color:#fff;min-height:44px;padding:11px 23px;display:inline-flex;gap:10px;align-items:center;justify-content:center;font-size:13px;letter-spacing:1px;transition:background .2s}.primary-button:hover:not(:disabled){background:#243e50}.shuffle-icon{font-size:22px;line-height:18px}.loading .shuffle-icon{animation:spin 1.5s linear infinite}#status{min-height:20px;margin:12px 0 17px;text-align:right;font-size:11px;color:#7d888c;line-height:1.8}#status.error{color:#a8543a}footer{display:flex;justify-content:space-between;border-top:1px solid #e6e2dc;padding-top:16px;font-size:10px;color:#939995;letter-spacing:.6px}footer a{color:#657c86;text-decoration:none;margin-left:6px}dialog{border:1px solid #e2d8cb;border-radius:16px;padding:26px;width:min(440px,calc(100% - 32px));color:#263441;background:#fffdf9;box-shadow:0 18px 80px #26344126}dialog::backdrop{background:#23364466;backdrop-filter:blur(3px)}.dialog-heading{display:flex;justify-content:space-between;align-items:center}.dialog-heading h2{color:#263441;text-align:left;margin:0;letter-spacing:1px}.close-button{border:0;background:none;font-size:25px;color:#798594}dialog p{font-size:12px;color:#798594;line-height:1.7}dialog label{display:flex;justify-content:space-between;font-size:12px;margin:18px 0 8px}textarea{width:100%;resize:vertical;min-height:180px;border:1px solid #d5c6b5;border-radius:8px;padding:12px;line-height:1.8;background:white;color:#263441}#roster-error{color:#a8543a;min-height:0}.dialog-note{font-size:11px}dialog .primary-button{width:100%}@keyframes spin{to{transform:rotate(360deg)}}@media(min-width:1200px){.desk{height:78px}.seat-label{font-size:11px}}@media(max-width:800px){main{padding:22px 16px}.chart-panel{padding:16px 12px 12px}.page-header{margin-bottom:20px}h1{font-size:22px}.chart{padding-bottom:5px}.orientation{gap:12px;font-size:10px}.controls{align-items:flex-start}.assignment-info{flex-wrap:wrap;max-width:145px;line-height:18px;gap:5px}.actions{gap:9px}.primary-button{padding:11px 15px}#status{font-size:11px}footer{font-size:9px}h1 span{font-size:10px;margin-left:9px;padding-left:9px}}@media print{body{background:white}main{padding:0;max-width:none}.page-header{margin-bottom:12px}.page-header button,.controls,#status,footer{display:none}.chart-panel{border:0;padding:0}.chart-scroll{overflow:visible}.chart{min-width:0}.seat-label{font-size:8px}.desk{height:65px}.student{font-size:14px}.classroom{grid-template-columns:45px minmax(0,1fr) 22px minmax(0,1fr) 22px minmax(0,1fr) 35px}.podium{print-color-adjust:exact;-webkit-print-color-adjust:exact}.chart-panel{break-inside:avoid}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

/* Sign-in and PIN management */
.header-actions{display:flex;align-items:center;gap:14px;flex-wrap:wrap;justify-content:flex-end}
.signin-page{min-height:100dvh;display:grid;place-items:center;padding:24px;background:radial-gradient(ellipse at 50% 30%,#f3ece2 0,transparent 65%),#fcfaf7}
main.signin-card{width:100%;max-width:410px;margin:auto;padding:36px;background:#fffdf9;border:1px solid #e6e0d7;border-radius:20px;box-shadow:0 12px 50px #3c506408}
.signin-mark{width:54px;height:54px;background:#edf2f2;color:#3c5064;border-radius:14px;display:grid;place-items:center;font-size:32px;margin:28px 0 22px}
.signin-card h1{font-size:24px;letter-spacing:1px}
.signin-description{color:#798594;font-size:13px;line-height:1.8;margin:12px 0 26px}
.signin-card label{display:block;font-size:12px;color:#657380;margin:0 0 9px}
input[type=password]{width:100%;min-height:48px;padding:12px 14px;border:1px solid #d5c6b5;background:#fff;border-radius:8px;color:#263441;font:inherit;letter-spacing:6px;font-size:18px}
input[type=password]::placeholder{font-size:13px;letter-spacing:1px;color:#a1a6a7}
input:focus-visible{outline:3px solid #7baaca;outline-offset:3px}
.signin-card .primary-button{width:100%;margin-top:18px;justify-content:space-between}
.auth-status{font-size:12px;color:#798594;line-height:1.8;min-height:22px;margin:16px 0}
.auth-status.error{color:#a8543a}
.signin-note{border-top:1px solid #e6e2dc;padding-top:20px;margin-top:24px;color:#939995;font-size:11px;line-height:1.9}
#pin-dialog label{margin-top:14px}
@media(max-width:600px){.header-actions{gap:4px;max-width:148px}.header-actions .text-button{padding:5px;font-size:11px}h1 span{display:none}main.signin-card{padding:28px}}
@media print{.header-actions{display:none}}

/* Manual seating and the unseated name pool */
button.student{font-family:inherit;color:inherit;width:100%;padding:0;border:0;border-radius:5px;background:transparent;text-align:center;cursor:grab;touch-action:none}
button.student:disabled{opacity:1;cursor:default}
button.student:empty{touch-action:auto;cursor:pointer}
button.student:focus-visible{outline:2px solid #7baaca;outline-offset:2px}
.seat{transition:background .15s;cursor:pointer}
.seat:hover{background:#f5f8f8}
.seat.selected-seat{background:#e4eef2;box-shadow:inset 0 0 0 2px #7baaca}
.seat.drop-target{background:#dcebf0;box-shadow:inset 0 0 0 2px #46788e}
.pool-panel{margin:0 0 22px;padding:20px;border:1px solid #e6e0d7;border-radius:14px;background:#fffdf9;min-height:140px;transition:background .15s,border-color .15s}
.pool-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.pool-heading h2{font-size:14px;letter-spacing:1px;text-align:left;margin:0;color:#3c5064}
.pool-heading h2 span{display:inline-block;color:#8c9699;font-size:11px;font-weight:400;letter-spacing:0;margin-left:8px}
.pool-help{font-size:11px;color:#879196;line-height:1.8;margin:8px 0 16px}
.pool-names{display:flex;flex-wrap:wrap;gap:9px;min-height:10px}
.name-chip{font:inherit;font-size:13px;font-weight:550;color:#3c5064;border:1px solid #ded8ce;background:#f7f3ed;border-radius:7px;padding:9px 13px;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}
.name-chip::before{content:'⠿';color:#a6a9a3;margin-right:7px;font-weight:400}
.name-chip:hover{border-color:#89a8b7;background:#edf3f4}
.name-chip[aria-pressed=true]{border-color:#46788e;background:#dcebf0;box-shadow:0 0 0 1px #46788e}
.pool-panel.drop-target{background:#edf5f5;border-color:#46788e;box-shadow:inset 0 0 0 1px #46788e}
#pool-empty{margin:8px 0 0;padding:20px 10px;border:1px dashed #d7ddd9;border-radius:8px;text-align:center;color:#8a9696;font-size:12px}
.drag-ghost{position:fixed;left:0;top:0;z-index:10000;pointer-events:none;padding:12px 20px;border-radius:9px;background:#344e60;color:white;box-shadow:0 8px 25px #26344133;font-size:16px;font-weight:600;white-space:nowrap}
.drag-source{opacity:.3!important}
.dragging-name,.dragging-name *{cursor:grabbing!important;user-select:none!important;-webkit-user-select:none!important}
@media(max-width:600px){.pool-panel{padding:16px}.pool-help{font-size:11px}.name-chip{padding:10px 12px}.pool-heading .text-button{font-size:11px}}
@media print{.pool-heading button,.pool-help{display:none}.pool-panel{break-inside:avoid;margin-top:20px}.name-chip::before{display:none}.name-chip{background:transparent;border:0;padding:4px 8px}.seat:hover{background:transparent}.drag-ghost{display:none}}
