:root { --bg:#f6f7f9; --card:#fff; --line:#dadce0; --text:#202124; --muted:#5f6368; --blue:#1a73e8; --red:#b3261e; --green:#188038; --amber:#b06000; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px system-ui, -apple-system, "Segoe UI", sans-serif; }
[hidden] { display: none !important; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 14px; margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 12px; }
input { height: 38px; border: 1px solid #c4c7c5; border-radius: 8px; padding: 0 12px; font: inherit; min-width: 0; background: #fff; }
input:focus { outline: 2px solid var(--blue); border-color: transparent; }
button { height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: 500 14px system-ui, sans-serif; color: var(--text); cursor: pointer; white-space: nowrap; }
button:hover { background: #f1f3f4; }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
button.primary:hover { background: #1765cc; }
button.subtle { border-color: transparent; background: transparent; color: var(--muted); }
button.danger { color: var(--red); }
button.wide { width: 100%; margin-top: 18px; }
button.small { height: 28px; padding: 0 10px; font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.row input { flex: 1; }
.grow { flex: 1; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.narrow { width: min(380px, 100%); }
.narrow label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 6px; }
.narrow input { width: 100%; }
.error { color: var(--red); margin-top: 12px; min-height: 18px; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.spacer { flex: 1; }
.page { max-width: 900px; margin: 24px auto; padding: 0 16px; display: grid; gap: 16px; }
.class-list { display: grid; gap: 10px; }
.class-item { display: flex; align-items: center; gap: 12px; text-align: left; height: auto; padding: 16px; border-radius: 12px; width: 100%; }
.class-item .name { font-size: 16px; font-weight: 600; flex: 1; }
.code-pill { background: #e8f0fe; color: #174ea6; padding: 4px 10px; border-radius: 999px; font-size: 13px; }
.code-pill b { letter-spacing: 2px; font-size: 15px; }
.controls { display: flex; gap: 8px; padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.controls .row { min-width: 280px; }
.controls form.row { flex: 1 1 420px; }
.controls form.row input { min-width: 200px; }
.layout { display: grid; grid-template-columns: 1fr 320px; min-height: calc(100vh - 130px); }
.layout main { padding: 20px; }
.alerts { border-left: 1px solid var(--line); background: #fff; padding: 4px 16px 16px; overflow: auto; max-height: calc(100vh - 130px); }
.alerts ol, .history { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.alerts li, .history li { padding: 8px 10px; border-radius: 8px; background: var(--bg); font-size: 13px; line-height: 1.35; word-break: break-word; }
.alerts li.blocked, .history li.blocked { background: #fce8e6; }
.alerts li.clipboard, .history li.clipboard { background: #fef7e0; }
.alerts .who { font-weight: 600; }
.time { color: var(--muted); font-size: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.student { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; display: grid; gap: 6px; text-align: left; height: auto; font-weight: 400; }
.student:hover { border-color: var(--blue); background: #fff; }
.student .top { display: flex; align-items: center; gap: 8px; }
.student .name { font-weight: 600; font-size: 15px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student .page-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student .host { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student.offline { opacity: .55; }
.student.alerting { border-color: #f28b82; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #9aa0a6; flex: none; }
.dot.on { background: var(--green); }
.badge { background: var(--red); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 600; }
.status { font-size: 13px; color: var(--muted); }
.empty { padding: 24px 4px; }
.modal { position: fixed; inset: 0; background: rgba(32,33,36,.55); display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal-card { background: #fff; border-radius: 12px; width: min(1200px, 100%); height: min(820px, 100%); display: flex; flex-direction: column; overflow: hidden; }
.detail-body { flex: 1; display: grid; grid-template-columns: 1fr 340px; min-height: 0; }
.screen-wrap { background: #202124; display: grid; place-items: center; padding: 12px; min-height: 0; }
.screen-wrap img { max-width: 100%; max-height: 100%; border-radius: 4px; }
.screen-wrap .muted { color: #bdc1c6; }
.detail-side { padding: 0 16px 16px; overflow: auto; border-left: 1px solid var(--line); }
.tabs { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.tabs li { display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: var(--bg); border-radius: 8px; }
.tabs li.active { outline: 2px solid var(--blue); }
.tabs .t { flex: 1; min-width: 0; }
.tabs .t div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #202124; color: #fff; padding: 10px 16px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 20; }
.toast.show { opacity: 1; }
@media (max-width: 900px) { .layout, .detail-body { grid-template-columns: 1fr; } .alerts { border-left: none; border-top: 1px solid var(--line); } }

select { height: 38px; border: 1px solid #c4c7c5; border-radius: 8px; padding: 0 8px; font: inherit; background: #fff; }
textarea { width: 100%; border: 1px solid #c4c7c5; border-radius: 8px; padding: 10px 12px; font: inherit; resize: vertical; }
.hours { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: #e6f4ea; color: #0d652d; }
.hours.off { background: #f1f3f4; color: var(--muted); }
.small-card { width: min(640px, 100%); height: auto; max-height: 100%; }
.pad { padding: 4px 20px 16px; overflow: auto; }
.pad h2:first-child { margin-top: 12px; }
.end { justify-content: flex-end; }
.days { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.days label { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; }
.check input { height: auto; margin-top: 3px; }
#s-links .row { margin-bottom: 6px; }
#s-links input:first-child { flex: 0 0 34%; }
.help-box { background: #fef7e0; border-radius: 8px; padding: 10px 12px; margin-top: 14px; display: grid; gap: 6px; }
.help-box button { justify-self: start; }
#help-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
#help-list li { background: #fef7e0; padding: 8px 10px; border-radius: 8px; font-size: 13px; display: grid; gap: 4px; }
#help-list .acts { display: flex; gap: 6px; }
.badge.help { background: #f9ab00; color: #202124; }
.student.after { opacity: .7; }
button.focus-on { background: #e6f4ea; border-color: #34a853; color: #0d652d; }

.bl-body { flex: 1; display: grid; grid-template-columns: 1fr 360px; min-height: 0; }
.bl-body > section, .bl-body > aside { padding: 16px 20px; overflow: auto; }
.bl-body > aside { border-left: 1px solid var(--line); background: #fafbfc; }
.bl-check { min-height: 22px; margin: 8px 0 4px; font-size: 13px; }
.bl-check.ok { color: var(--green); } .bl-check.warn { color: var(--amber); } .bl-check.bad { color: var(--red); }
.bl-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.bl-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--bg); border-radius: 8px; font-size: 13px; }
.bl-list li .site { font-family: ui-monospace, Consolas, monospace; font-size: 13px; flex: 1; word-break: break-all; }
.bl-list.compact li { padding: 4px 8px; }
.bl-list li.off .site { text-decoration: line-through; color: var(--muted); }
.day { margin-bottom: 14px; }
.day h3 { font-size: 13px; margin: 0 0 6px; color: var(--muted); font-weight: 600; }
.day .item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 10px; background: var(--bg); border-radius: 8px; margin-bottom: 6px; }
.day .item .site { font-family: ui-monospace, Consolas, monospace; font-weight: 600; }
.day .item .why { grid-column: 1; font-size: 13px; color: var(--muted); }
.day .item button { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.day .item.off .site { text-decoration: line-through; color: var(--muted); }
.tag { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: #e8eaed; color: #3c4043; margin-left: 6px; font-family: system-ui, sans-serif; font-weight: 500; }
details summary { cursor: pointer; margin-top: 18px; font-size: 13px; color: var(--muted); }
details .bl-list { margin-top: 8px; }
@media (max-width: 900px) { .bl-body { grid-template-columns: 1fr; } .bl-body > aside { border-left: none; border-top: 1px solid var(--line); } }
/* Classroom (multi-teacher) additions */
a { color: var(--blue); }
.session { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: #e6f4ea; color: #0d652d; }
.session.off { background: #f1f3f4; color: var(--muted); }
#session-btn.end { background: #fce8e6; border-color: #f28b82; color: var(--red); }
.controls.disabled { opacity: .55; }
.notice { background: #fef7e0; border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; }
.student.notinclass { opacity: .75; }
.student.notinclass .dot { background: #fbbc04; }
#t-list li .site { font-family: inherit; }
.wide + .wide { margin-top: 8px; }
@media (max-width: 700px) { .topbar h1 { font-size: 17px; } .controls form.row { flex-basis: 100%; } }

/* Writing reports */
.wdoc { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0; background: #fff; }
.wdoc.flagged { border-color: #f29900; background: #fef7e0; }
.wdoc .wtitle { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; font-weight: 500; }
.wdoc .wtitle a { color: var(--blue); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wdoc .wstats { font-size: 12px; color: var(--muted); margin: 4px 0; line-height: 1.4; }
.wdoc .wnote { font-size: 13px; margin-top: 4px; line-height: 1.35; }
.wchart { width: 100%; height: 48px; display: block; background: var(--bg); border-radius: 4px; }
.badge.write { background: #f29900; }
