:root{
  --bg:#f6f8fb; --card:#fff; --ink:#1f2937; --muted:#6b7280; --line:#e2e8f0; --accent:#4f83f0; --accent-ink:#fff;
  --good:#2f9e63; --amber:#e9a23b; --bad:#d93a2f; --side:#f9fafc;
  --A:#3f6df0; --B:#3fa968; --C:#7a3fc0; --D:#e0673a;
  --radius:12px;
}
*{ box-sizing:border-box; }
html,body{ margin:0; }
body{ font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif; background:var(--bg); color:var(--ink); line-height:1.55; font-size:16px; -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility; }
a{ color:var(--accent); text-decoration:none; }
a:hover{ text-decoration:underline; }
h1{ font-size:24px; margin:0 0 4px; } h2{ font-size:18px; margin:0 0 8px; } h3{ font-size:16.5px; margin:0 0 6px; }
.muted{ color:var(--muted); } .small{ font-size:13.5px; }
.btn, button.btn{ display:inline-flex; align-items:center; gap:6px; padding:8px 14px; border-radius:9px; border:1px solid var(--line); background:#fff; color:var(--ink); font:inherit; font-weight:600; font-size:13.5px; cursor:pointer; text-decoration:none; }
.btn:hover{ background:#f1f5f9; text-decoration:none; }
.btn.primary{ background:var(--accent); border-color:var(--accent); color:#fff; } .btn.primary:hover{ background:#3f72e0; }
.btn.danger{ color:var(--bad); } .btn.small{ padding:4px 10px; font-size:12px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea{
  width:100%; padding:9px 11px; border:1px solid #cbd5e1; border-radius:9px; font:inherit; background:#fff; color:var(--ink); }
textarea{ resize:vertical; }
input:focus, select:focus, textarea:focus{ outline:2px solid #bfd3ff; border-color:var(--accent); }
input:disabled, select:disabled, textarea:disabled{ background:#f1f5f9; color:#475569; cursor:not-allowed; }
label.chk{ display:flex; align-items:flex-start; gap:9px; cursor:pointer; }
label.chk input{ width:auto; margin-top:4px; }

/* layouts */
.layout{ display:flex; min-height:100vh; }
.side{ width:236px; background:var(--side); border-right:1px solid var(--line); padding:18px 14px; display:flex; flex-direction:column; position:sticky; top:0; height:100vh; flex:none; }
.brand{ display:flex; align-items:center; gap:10px; font-weight:800; color:var(--accent); font-size:19px; margin-bottom:4px; }
.brand img{ width:38px; height:38px; }
.side .sub{ color:var(--muted); font-size:13px; margin-bottom:14px; padding-bottom:14px; border-bottom:1px solid var(--line); }
.side nav a{ display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px; color:#475569; font-weight:500; margin-bottom:3px; }
.side nav a:hover{ background:#eef2f9; text-decoration:none; }
.side nav a.active{ background:var(--accent); color:#fff; }
.side .who{ margin-top:auto; background:#e8edf5; border-radius:12px; padding:12px; font-size:13px; }
.side .who b{ display:block; font-size:15px; margin-bottom:8px; }
.main{ flex:1; min-width:0; padding:26px 30px 60px; }
.topbar{ display:flex; align-items:center; gap:12px; padding:10px 20px; background:#fff; border-bottom:1px solid var(--line); position:sticky; top:0; z-index:30; flex-wrap:wrap; }
.topbar .brand{ margin:0; font-size:17px; } .topbar .brand img{ width:32px; height:32px; }
.topbar nav{ display:flex; gap:4px; margin-left:12px; }
.topbar nav a{ padding:7px 12px; border-radius:9px; color:#475569; font-weight:600; font-size:14px; }
.topbar nav a.active{ background:#e8f0ff; color:var(--accent); }
.topbar .right{ margin-left:auto; display:flex; gap:10px; align-items:center; }
.topbar select{ width:auto; padding:6px 10px; }
.wrap{ max-width:1180px; width:100%; box-sizing:border-box; margin:0 auto; padding:22px 20px 70px; }
.wide{ max-width:1180px; }
.card{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:18px; }
.grid{ display:grid; gap:14px; }
.grid.cols3{ grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); }
.grid.stats{ grid-template-columns:repeat(auto-fit, minmax(160px, 1fr)); }
.stat b{ display:block; font-size:28px; line-height:1.1; } .stat span{ color:var(--muted); font-size:13px; }
table.t{ width:100%; border-collapse:collapse; background:#fff; border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; }
table.t th{ text-align:left; font-size:12px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); padding:10px 12px; background:#f8fafc; border-bottom:1px solid var(--line); }
table.t td{ padding:10px 12px; border-bottom:1px solid var(--line); vertical-align:middle; }
table.t tr:last-child td{ border-bottom:none; }
.flash{ padding:10px 14px; border-radius:10px; margin-bottom:14px; font-weight:500; }
.flash.ok{ background:#e6f6ec; color:#1e6b43; } .flash.error{ background:#fdeceb; color:#a32a22; }
.flash.pw{ background:#fff7e0; color:#6b4f00; font-family:ui-monospace, Menlo, monospace; }
.pill{ display:inline-block; padding:2px 10px; border-radius:20px; font-size:12px; font-weight:700; background:#eef2f9; color:#475569; }
.pill.good{ background:#e1f4ea; color:#1e6b43; } .pill.amber{ background:#fdf0d8; color:#8a5a06; } .pill.bad{ background:#fdeceb; color:#a32a22; } .pill.lock{ background:#eef; color:#334; }
.bar{ height:8px; border-radius:6px; background:#e8edf5; overflow:hidden; } .bar i{ display:block; height:100%; background:var(--good); }
.pillrow{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:16px; }
.pillrow select{ width:auto; }

/* login */
.loginbox{ max-width:380px; margin:9vh auto; padding:0 18px; }
.loginbox .card{ padding:26px; }
.loginbox .logo{ display:block; width:92px; margin:0 auto 10px; }
.loginbox h1{ text-align:center; font-size:22px; }

/* workspace */
.wshead{ display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin-bottom:12px; }
.wshead h1{ margin:0; flex:1; min-width:200px; font-size:22px; }
.saveind{ font-size:13px; font-weight:600; color:var(--muted); min-width:120px; text-align:right; margin-left:auto; align-self:center; padding-right:6px; }
.saveind.ok{ color:var(--good); } .saveind.err{ color:var(--bad); }
.tabs{ display:flex; gap:6px; flex-wrap:wrap; margin-bottom:0; border-bottom:2px solid var(--line); position:sticky; top:0; z-index:20; background:var(--bg); padding-top:6px; }
.tab{ border:none; background:#e9eef6; color:#475569; padding:11px 20px; font:inherit; font-weight:700; border-radius:10px 10px 0 0; cursor:pointer; display:flex; align-items:center; gap:8px; }
.tab .dot{ width:10px; height:10px; border-radius:50%; background:#cbd5e1; display:inline-block; }
.tab .dot.progress{ background:var(--amber); } .tab .dot.done{ background:var(--good); }
.tab.active{ color:#fff; }
.tab[data-c=A].active{ background:var(--A); } .tab[data-c=B].active{ background:var(--B); }
.tab[data-c=C].active{ background:var(--C); } .tab[data-c=D].active{ background:var(--D); }
.tab .dot{ box-shadow:0 0 0 2px rgba(255,255,255,.7); }
.panel{ background:#fff; border:1px solid var(--line); border-top:none; border-radius:0 0 var(--radius) var(--radius); padding:20px; }
.panel .crit-head{ border-left:6px solid var(--cc, var(--accent)); padding:4px 0 4px 14px; margin-bottom:18px; }
.panel .crit-head h2{ margin:0 0 4px; }
.strand{ border:1px solid var(--line); border-radius:12px; margin-bottom:18px; overflow:hidden; }
.strand > header{ background:#f8fafc; padding:12px 16px; border-bottom:1px solid var(--line); display:flex; gap:10px; align-items:center; }
.strand > header .key{ background:var(--cc); color:#fff; border-radius:8px; padding:2px 9px; font-weight:800; font-size:13px; }
.strand > header h3{ margin:0; flex:1; }
.strand .body{ padding:16px; display:flex; flex-direction:column; gap:16px; }
.strand footer{ border-top:1px solid var(--line); padding:12px 16px; background:#fcfdfe; }
.block .lbl{ font-weight:700; margin-bottom:3px; } .block .help{ color:var(--muted); font-size:13.5px; margin-bottom:7px; }
.infobox{ background:#eef4ff; border:1px solid #d3e2ff; border-radius:10px; padding:12px 14px; }
.infobox img{ max-width:100%; border-radius:8px; margin-top:8px; display:block; }
.md p{ margin:0 0 8px; } .md ul, .md ol{ margin:0 0 8px; padding-left:22px; } .md :last-child{ margin-bottom:0; }
.lockbanner{ background:#fff3d6; border:1px solid #f0d58a; color:#7a5800; padding:10px 14px; border-radius:10px; margin-bottom:14px; font-weight:600; }
.previewbanner{ background:#e8edff; border:1px solid #c7d3ff; color:#2b3f9e; padding:10px 14px; border-radius:10px; margin-bottom:14px; font-weight:600; }
table.entry{ width:100%; border-collapse:collapse; }
table.entry th{ text-align:left; background:#f1f5f9; padding:8px 10px; font-size:13px; border:1px solid var(--line); }
table.entry td{ border:1px solid var(--line); padding:0; }
table.entry td.rl{ background:#f8fafc; padding:8px 10px; font-weight:600; width:25%; }
table.entry td textarea, table.entry td input{ border:none; border-radius:0; min-height:42px; display:block; }
table.entry td .x{ width:34px; text-align:center; }
.photos{ display:grid; grid-template-columns:repeat(auto-fill, minmax(190px, 1fr)); gap:12px; }
.photo{ border:1px solid var(--line); border-radius:10px; overflow:hidden; background:#f8fafc; }
.photo img{ width:100%; height:150px; object-fit:cover; display:block; cursor:zoom-in; }
.photo .cap{ padding:6px; } .photo .cap input{ padding:6px 8px; font-size:13px; }
.photo .rm{ display:block; width:100%; border:none; background:#fff; border-top:1px solid var(--line); color:var(--bad); padding:6px; cursor:pointer; font:inherit; font-size:13px; }
.addphoto{ margin-top:10px; }
.gradebox{ background:#f8fafc; border:1px solid var(--line); border-radius:12px; padding:16px; margin-top:8px; }
.gradebox .lvl{ display:inline-block; font-size:30px; font-weight:800; color:var(--cc); }
.gradebox.row{ display:grid; grid-template-columns:140px 1fr; gap:14px; align-items:start; }
.lightbox{ position:fixed; inset:0; background:rgba(0,0,0,.85); display:none; align-items:center; justify-content:center; z-index:99; }
.lightbox.on{ display:flex; } .lightbox img{ max-width:94vw; max-height:92vh; border-radius:8px; }
.nav-students{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:14px; }
.nav-students select{ width:auto; min-width:200px; }

/* builder */
.bsplit{ display:grid; grid-template-columns:1fr; gap:14px; }
.bmeta{ display:grid; grid-template-columns:2fr 1fr; gap:12px; margin-bottom:12px; }
.bblock{ border:1px solid var(--line); border-radius:10px; background:#fff; margin-bottom:10px; }
.bblock > .bh{ display:flex; align-items:center; gap:8px; padding:8px 10px; background:#f8fafc; border-bottom:1px solid var(--line); border-radius:10px 10px 0 0; }
.bblock .tag{ font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; color:#fff; background:#64748b; padding:2px 8px; border-radius:6px; }
.bblock .tag.info{ background:#4f83f0; } .bblock .tag.text{ background:#3fa968; } .bblock .tag.short{ background:#64a63f; }
.bblock .tag.table{ background:#7a3fc0; } .bblock .tag.photos{ background:#e0673a; } .bblock .tag.checklist{ background:#0f9aa8; } .bblock .tag.dropdown{ background:#8a6d1b; }
.bblock .bb{ padding:12px; display:grid; gap:9px; }
.bblock .bb label{ font-size:12.5px; font-weight:700; color:#475569; display:block; margin-bottom:3px; }
.ibtn{ border:1px solid var(--line); background:#fff; border-radius:7px; width:30px; height:28px; cursor:pointer; font-size:13px; }
.ibtn:hover{ background:#eef2f9; }
.bstrand{ border:2px solid var(--line); border-radius:12px; margin-bottom:16px; background:#fbfcfe; }
.bstrand.off{ opacity:.55; }
.bstrand > .sh{ display:flex; gap:10px; align-items:center; padding:10px 12px; border-bottom:1px solid var(--line); background:#fff; border-radius:12px 12px 0 0; }
.bstrand .sh .key{ background:var(--cc); color:#fff; border-radius:8px; padding:3px 10px; font-weight:800; }
.bstrand .sb{ padding:12px; }
.addrow{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:8px; }
.addrow select{ width:auto; }
.togg{ display:inline-flex; align-items:center; gap:6px; font-size:13px; font-weight:600; cursor:pointer; white-space:nowrap; }
.togg input{ width:auto; }
.stickybar{ position:sticky; top:0; z-index:20; background:var(--bg); padding:10px 0; display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

/* analysis grid */
.agrid{ border-collapse:separate; border-spacing:0; background:#fff; border:1px solid var(--line); border-radius:12px; overflow:hidden; }
.agrid th, .agrid td{ border-bottom:1px solid var(--line); border-right:1px solid var(--line); padding:8px 12px; text-align:center; }
.agrid th.name, .agrid td.name{ text-align:left; position:sticky; left:0; background:#fff; z-index:2; white-space:nowrap; font-weight:600; }
.agrid th.c{ color:#fff; font-size:12.5px; letter-spacing:.05em; text-transform:uppercase; }
.agrid th.c[data-c=A]{ background:var(--A); } .agrid th.c[data-c=B]{ background:var(--B); } .agrid th.c[data-c=C]{ background:var(--C); } .agrid th.c[data-c=D]{ background:var(--D); }
.agrid th.s{ font-size:12px; background:#f1f5f9; } .agrid td.A{ background:#edf2ff; } .agrid td.B{ background:#e8f6ee; } .agrid td.C{ background:#f1eafa; } .agrid td.D{ background:#fcefe9; }
.cellok{ color:var(--good); font-size:19px; font-weight:800; } .cellx{ color:var(--bad); font-size:19px; font-weight:800; }
.celldot{ display:inline-block; width:15px; height:15px; border-radius:50%; background:var(--amber); }
.agrid a.cell{ display:block; text-decoration:none; }
.agrid .lvl{ font-weight:800; }
.legend{ display:flex; gap:16px; margin:10px 0 14px; font-size:13px; align-items:center; flex-wrap:wrap; }

@media (max-width: 780px){
  .layout{ flex-direction:column; } .side{ width:100%; height:auto; position:static; flex-direction:column; }
  .main{ padding:18px 14px 50px; } .bmeta{ grid-template-columns:1fr; } .gradebox.row{ grid-template-columns:1fr; }
  .tab{ padding:10px 14px; }
}
@media print{
  .side, .topbar, .nav-students, .pillrow, .noprint{ display:none !important; }
  .main, .wrap{ padding:0; max-width:none; }
  body{ background:#fff; }
}

.infobox .lbl{ font-weight:800; margin-bottom:4px; }

/* ---- rich text (toolbar + editable boxes) ---- */
.rt-bar{ display:flex; flex-wrap:wrap; align-items:center; gap:3px; background:#f8fafc; border:1px solid var(--line); border-bottom:none; border-radius:10px 10px 0 0; padding:4px 6px; position:sticky; top:6px; z-index:6; }
.rt-b{ font:inherit; font-size:13.5px; min-width:30px; height:30px; padding:0 8px; background:#fff; border:1px solid var(--line); border-radius:7px; cursor:pointer; color:var(--ink,#1e293b); display:inline-flex; align-items:center; justify-content:center; }
.rt-b:hover{ background:#eef4ff; border-color:#bfd3ff; }
.rt-sep{ width:1px; height:20px; background:var(--line); margin:0 3px; }
.rt-m{ position:relative; display:inline-block; }
.rt-pop{ position:absolute; top:34px; left:0; z-index:20; background:#fff; border:1px solid var(--line); border-radius:10px; box-shadow:0 8px 24px rgba(15,23,42,.15); padding:6px; min-width:150px; display:grid; gap:2px; }
.rt-pop[hidden]{ display:none; }
.rt-i{ font:inherit; text-align:left; background:none; border:none; padding:7px 10px; border-radius:6px; cursor:pointer; }
.rt-i:hover{ background:#eef4ff; }
.rt-sw{ display:flex; flex-wrap:wrap; gap:6px; width:190px; align-items:center; }
.rt-sw .sw{ width:24px; height:24px; border-radius:50%; border:1px solid rgba(0,0,0,.2); cursor:pointer; padding:0; font-size:12px; line-height:1; color:#64748b; background:#fff; }
.rt-sw .sw-custom{ width:28px; height:28px; padding:0; border:none; background:none; cursor:pointer; }
.rt-edit{ background:#fff; border:1px solid var(--line); border-radius:0 0 10px 10px; padding:10px 12px; line-height:1.5; min-height:60px; overflow-wrap:anywhere; }
.rt > .rt-edit{ display:block; }
.rt-edit:focus{ outline:2px solid #bfd3ff; border-color:var(--accent); }
.rt-edit[data-ph]:empty::before{ content:attr(data-ph); color:#94a3b8; pointer-events:none; }
.rt-edit ul, .rt-edit ol{ margin:4px 0; padding-left:24px; }
.rt-edit p, .rt-edit div{ margin:0; }
.rt-edit a{ color:var(--accent); text-decoration:underline; }
.rt-ro{ background:#f1f5f9; border-radius:10px; }
table.entry td .rt-edit{ border:none; border-radius:0; min-height:42px; padding:8px 10px; background:transparent; }
table.entry td .rt-edit:focus{ outline:2px solid #bfd3ff; outline-offset:-2px; background:#fff; }
.bb .rt-edit{ background:#fff; }

/* ---- table tools ---- */
.tblbox{ overflow-x:auto; border:1px solid var(--line); border-top:none; border-radius:0 0 10px 10px; }
table.entry.fx{ table-layout:fixed; }
table.entry th.hd{ position:relative; padding:0; }
table.entry th.hd .hin{ width:100%; border:none; background:transparent; font-weight:700; font-size:13px; padding:8px 14px 8px 10px; border-radius:0; }
table.entry th.hd:not(:has(.hin)){ padding:8px 10px; }
table.entry .grip{ position:absolute; top:0; right:-4px; width:9px; height:100%; cursor:col-resize; z-index:3; touch-action:none; }
table.entry .grip:hover, table.entry .grip:active{ background:rgba(79,131,240,.35); }
table.entry td.sel{ background:#dbeafe; outline:2px solid #60a5fa; outline-offset:-2px; }
table.entry td.sel .rt-edit{ background:transparent; }
.rt-tools{ display:flex; flex-wrap:wrap; gap:4px; align-items:center; background:#f8fafc; border:1px solid var(--line); border-top:none; padding:4px 6px; }
.rt-tools .rt-b.on{ background:#dbeafe; border-color:#60a5fa; }
.rt-tools .rt-hint{ flex-basis:100%; margin-top:2px; font-size:12px; }
.rt-tools + .tblbox{ border-top:1px solid var(--line); border-radius:0 0 10px 10px; }

/* ---- student grades page ---- */
.gp-hero{ display:grid; grid-template-columns:1.3fr auto auto; gap:22px; align-items:center; background:linear-gradient(135deg,#f8fafc,#e9eef7); border:1px solid var(--line); border-radius:16px; padding:22px 26px; }
.gp-name{ font-size:22px; font-weight:800; }
.gp-tips{ display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.gp-tip{ font-size:13px; padding:4px 10px; border-radius:999px; background:#fff; border:1px solid var(--line); }
.gp-nums{ display:flex; gap:12px; }
.gp-num{ background:#fff; border-radius:12px; padding:14px 20px; text-align:center; min-width:110px; box-shadow:0 1px 3px rgba(15,23,42,.06); }
.gp-num .v{ font-size:30px; font-weight:800; color:var(--accent); line-height:1.1; } .gp-num .l{ font-size:12.5px; color:var(--muted); margin-top:2px; }
.gp-overall{ background:#fff; border-radius:14px; padding:16px 24px; text-align:center; box-shadow:0 4px 14px rgba(15,23,42,.08); min-width:190px; }
.gp-overall .pct{ font-size:44px; font-weight:800; color:#6366f1; line-height:1; } .gp-overall .lbl{ color:var(--muted); margin:4px 0 6px; }
.gp-lvl{ font-size:20px; font-weight:800; margin-bottom:8px; } .gp-lvl span{ font-size:13px; color:var(--muted); font-weight:600; }
.gp-pill{ display:inline-block; color:#fff; font-weight:700; font-size:13px; padding:5px 12px; border-radius:8px; text-shadow:0 1px 1px rgba(0,0,0,.18); }
.gp-pill.sm{ font-size:11.5px; padding:3px 9px; }
.gp-h{ margin:26px 0 10px; font-size:18px; }
.gp-avgs{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
.gp-avg{ position:relative; overflow:hidden; border-radius:14px; padding:16px 16px 14px; color:#fff; background:var(--cc); min-height:170px; }
.gp-avg::after{ content:""; position:absolute; inset:0; background:linear-gradient(135deg,rgba(255,255,255,.14),rgba(0,0,0,.14)); pointer-events:none; }
.gp-avg > *{ position:relative; z-index:1; }
.gp-avg .k{ position:absolute; right:12px; top:4px; font-size:42px; font-weight:800; opacity:.28; z-index:1; }
.gp-avg .ttl{ font-weight:600; font-size:14px; max-width:78%; }
.gp-avg .big{ font-size:34px; font-weight:800; margin:8px 0 6px; } .gp-avg .big span{ font-size:13px; font-weight:600; opacity:.9; }
.gp-avg .bar{ height:9px; background:rgba(255,255,255,.35); border-radius:99px; overflow:hidden; } .gp-avg .bar i{ display:block; height:100%; background:#fff; border-radius:99px; }
.gp-avg .sub{ font-size:12.5px; margin:6px 0 8px; opacity:.95; }
.gp-avg.empty{ opacity:.55; } .gp-avg .big.na{ font-size:26px; }
.gp-avg .gp-pill{ background:rgba(0,0,0,.28) !important; }
.gp-unit{ background:var(--card); border:1px solid var(--line); border-radius:14px; padding:16px 18px; margin-bottom:14px; }
.gp-unit header{ display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
.gp-unit h3{ margin:0; font-size:18px; }
.gp-tot{ display:flex; align-items:baseline; gap:10px; } .gp-tot b{ font-size:20px; color:var(--accent); }
.gp-pct{ background:#eef2ff; color:#4338ca; font-weight:800; font-size:13px; padding:3px 9px; border-radius:8px; }
.gp-cells{ display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:10px; }
.gp-cell{ border:1px solid var(--line); border-top:5px solid var(--cc); border-radius:10px; padding:10px 12px; background:#fafbfd; }
.gp-cell .ck{ font-weight:700; font-size:12.5px; color:var(--cc); }
.gp-cell .lv{ font-size:28px; font-weight:800; line-height:1.15; } .gp-cell .lv span{ font-size:12px; color:var(--muted); font-weight:600; }
.gp-cell .lv.na{ color:#cbd5e1; }
.gp-cell .bar{ height:6px; background:#e2e8f0; border-radius:99px; overflow:hidden; margin:6px 0 3px; } .gp-cell .bar i{ display:block; height:100%; background:var(--cc); border-radius:99px; }
.gp-cell .sub{ font-size:12px; color:var(--muted); margin-bottom:5px; }
.gp-cell.empty{ opacity:.7; }
.gp-fb{ margin-top:12px; border-top:1px dashed var(--line); padding-top:10px; }
.gp-fb summary{ cursor:pointer; font-weight:700; font-size:14px; }
.gp-fb .row{ border-left:4px solid var(--cc); padding:6px 12px; margin-top:8px; background:#f8fafc; border-radius:0 8px 8px 0; white-space:pre-wrap; }
.gp-fb .row b{ color:var(--cc); font-size:13px; display:block; }
.gp-scale{ margin-top:18px; background:var(--card); border:1px solid var(--line); border-radius:14px; padding:14px 18px; }
.gp-scale summary{ cursor:pointer; font-weight:700; }
.gp-scale .pills{ display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
@media (max-width:860px){
  .gp-hero{ grid-template-columns:1fr; text-align:center; } .gp-tips, .gp-nums{ justify-content:center; }
  .gp-avgs{ grid-template-columns:1fr 1fr; }
}
@media (max-width:480px){ .gp-avgs{ grid-template-columns:1fr; } .gp-avg{ min-height:0; } }

/* ---- publish board + strand pills (unit builder) ---- */
.pubboard{ background:#fff; border:1px solid var(--line); border-radius:14px; padding:14px 16px; margin-bottom:16px; }
.pubboard .pbh{ display:flex; flex-direction:column; gap:2px; margin-bottom:10px; }
.pbgrid{ display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.pbcol{ border-top:4px solid var(--cc); background:#f8fafc; border-radius:10px; padding:10px; display:flex; flex-direction:column; gap:6px; }
.pbt{ display:flex; justify-content:space-between; align-items:baseline; gap:6px; }
.pbs{ font:inherit; font-size:12.5px; text-align:left; display:flex; align-items:flex-start; gap:7px; padding:7px 9px; border-radius:8px; border:1px solid var(--line); background:#fff; cursor:pointer; line-height:1.3; }
.pbs b{ color:var(--cc); margin-right:2px; }
.pbs .dot{ flex:0 0 10px; width:10px; height:10px; border-radius:50%; margin-top:4px; background:#cbd5e1; }
.pbs.on{ border-color:#86d3a3; background:#f0fbf4; } .pbs.on .dot{ background:#22a559; }
.pbs.off{ color:#94a3b8; } .pbs.off b{ opacity:.55; }
.pbs:hover{ filter:brightness(.97); }
.pbrow{ display:flex; gap:6px; margin-top:2px; }
.pubpill{ font:inherit; font-size:12.5px; font-weight:700; border-radius:999px; padding:5px 12px; cursor:pointer; border:1px solid; white-space:nowrap; }
.pubpill.on{ background:#e7f7ed; color:#15803d; border-color:#86d3a3; } .pubpill.off{ background:#f1f5f9; color:#64748b; border-color:#cbd5e1; }
.bstrand.off{ opacity:.7; }
@media (max-width:980px){ .pbgrid{ grid-template-columns:1fr 1fr; } }
@media (max-width:520px){ .pbgrid{ grid-template-columns:1fr; } }

/* ---- locked (teacher) cells, modal ---- */
table.entry td.locked{ background:#f1f5f9; }
.rt-edit.rt-lock{ background:transparent !important; color:#334155; cursor:default; }
table.entry th.hd.locked{ background:#e8eef6; }
.hin[readonly]{ cursor:default; }
.bblock .rt-edit{ background:#fff; }
.bblock table.entry td .rt-edit{ background:transparent; }
.modal-ov{ position:fixed; inset:0; background:rgba(15,23,42,.45); display:flex; align-items:center; justify-content:center; z-index:100; padding:16px; }
.modal{ background:#fff; border-radius:14px; padding:20px 22px; width:min(440px,100%); box-shadow:0 20px 50px rgba(0,0,0,.3); }
.pubboard > summary{ cursor:pointer; font-weight:800; font-size:16px; display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; }
.pubboard > summary .pbcount{ font-weight:600; font-size:13px; color:var(--muted); }

/* ---- analysis: lock state ---- */
.lockstat{ margin:0 0 10px; padding:9px 14px; border-radius:10px; background:#f1f5f9; border:1px solid var(--line); font-size:14px; }
.lockstat.on{ background:#fff7e6; border-color:#f3d79b; }
.lockbadge{ display:inline-block; font-size:12px; font-weight:700; padding:3px 9px; border-radius:999px; background:#e7f7ed; color:#15803d; margin-right:6px; }
.lockbadge.on{ background:#fde8e8; color:#b42318; } .lockbadge.part{ background:#fff1d6; color:#9a6700; }
.lockbtn, .critlock{ width:auto !important; padding:0 9px !important; font-size:12.5px; font-weight:700; }
.critlock{ background:#fff; color:#1e293b; }
.agrid tr.rowlocked td{ background:#fff7f5; } .agrid tr.rowlocked td.name{ background:#fff7f5; }

.teambar{background:#eef3ff;border:1px solid #c9d6fb;border-radius:10px;padding:10px 14px;margin-bottom:12px}
.teambadge{display:inline-block;margin-left:8px;font-size:.72rem;font-weight:600;background:#e3ecff;color:#2c4fb0;border-radius:99px;padding:1px 8px;vertical-align:middle}

/* numbered table rows: the number is shown, not typed, so students never edit it */
table.entry td.numd{ position:relative; }
table.entry td.numd::before{ content:attr(data-n) "."; position:absolute; left:10px; top:9px; font-weight:600; color:#64748b; pointer-events:none; }
table.entry td.numd .rt-edit{ padding-left:40px; }

/* unit overview tabs */
.ovhost{margin:0 0 14px;}
.ovbar{display:flex;gap:6px;overflow-x:auto;padding-bottom:4px;-webkit-overflow-scrolling:touch;}
.ovtab{flex:0 0 auto;border:1px solid var(--line,#d9dde3);background:var(--card,#fff);color:inherit;border-radius:999px;padding:5px 12px;font:inherit;font-size:.85rem;cursor:pointer;white-space:nowrap;}
.ovtab.on{background:var(--accent,#2b6cb0);color:#fff;border-color:transparent;}
.ovtab.pin:not(.on){border-color:var(--accent,#2b6cb0);}
.ovbody{border:1px solid var(--line,#d9dde3);border-radius:10px;background:var(--card,#fff);padding:10px 14px;margin-top:6px;max-height:260px;overflow-y:auto;}
.ovbody h4{margin:0 0 6px;}
.ovtext{line-height:1.5;}
.ovtext p{margin:0 0 .6em;}

/* strand rubric: compact bar, opens on hover / tap */
.rubric{border-top:1px solid var(--line);background:#fafbfd;}
.rubbtn{all:unset;box-sizing:border-box;display:block;width:100%;padding:7px 16px;cursor:pointer;font-size:13px;font-weight:700;color:#475569;}
.rubbtn:hover,.rubric.open .rubbtn{background:#eef2f9;}
.rubhint{font-weight:400;color:var(--muted);font-size:12px;margin-left:6px;}
.rubpanel{display:grid;grid-template-columns:repeat(4,1fr);gap:1px;background:var(--line);border-top:1px solid var(--line);max-height:320px;overflow-y:auto;}
.rubpanel[hidden]{display:none;}
.rubcol{background:#fff;padding:8px 10px;font-size:12.5px;line-height:1.4;}
.rubcol b{display:block;margin-bottom:4px;color:var(--cc,var(--accent));}
.rubtxt{white-space:pre-line;}
@media(max-width:760px){.rubpanel{grid-template-columns:1fr 1fr;}}

/* pictures inside table cells: fit the cell */
.rt-edit img, table td img{ display:block; max-width:100%; height:auto; max-height:360px; object-fit:contain; margin:4px 0; border-radius:6px; }

/* camera button in each answer cell */
td:has(> .cellcam){ position:relative; }
.cellcam{ position:absolute; top:3px; right:3px; border:1px solid var(--line); background:#fff; border-radius:8px; font-size:13px; line-height:1; padding:3px 6px; cursor:pointer; opacity:.35; }
td:hover .cellcam, td:focus-within .cellcam, .cellcam:focus{ opacity:1; }
@media (hover:none){ .cellcam{ opacity:.8; } }
.rt-b.photobtn{ background:#eef4ff; border-color:#bfd3ff; }

td.dropping{ outline:3px dashed var(--accent); outline-offset:-3px; background:#eef4ff; }

/* per-student criterion lock buttons (Analysis) */
.ibtn.cl{ padding:0 4px; font-size:11px; line-height:1.4; display:block; margin:2px auto 0; }
.ibtn.cl.on{ background:#fee2e2; color:#991b1b; font-weight:700; }
.ibtn.cl.ext{ background:#f1f5f9; color:#94a3b8; }
.ibtn.cl:disabled{ cursor:not-allowed; }

.ibtn.cl{ color:#16a34a; background:#f0fdf4; border:1px solid #bbf7d0; }
.ibtn.cl:hover{ background:#dcfce7; }
.ibtn.cl.on{ background:#fee2e2; color:#b91c1c; border-color:#fecaca; }
.ibtn.cl.ext{ background:#f1f5f9; color:#94a3b8; border-color:#e2e8f0; }
.ibtn.cl .lk{ display:block; margin:0 auto; }

table.entry th.hd .hal{ position:absolute; right:16px; top:50%; transform:translateY(-50%); border:none; background:transparent; color:#64748b; font-size:13px; cursor:pointer; opacity:.35; padding:2px 4px; border-radius:4px; }
table.entry th.hd:hover .hal, table.entry th.hd .hal:focus{ opacity:1; background:#eef4ff; }
table.entry th.hd .hin{ padding-right:34px; }

div.dropping{ outline:3px dashed var(--accent); outline-offset:2px; background:#eef4ff; border-radius:10px; }

/* activity panel: fills the page area next to the sidebar */
#actpanel{ position:fixed; right:0; bottom:0; z-index:60; background:var(--bg,#f6f8fc); display:flex; flex-direction:column; }
#actpanel[hidden]{ display:none; }
#actpanel .ap-bar{ display:flex; align-items:center; gap:8px; padding:10px 22px; border-bottom:1px solid var(--line); background:#fff; }
#actpanel .ap-title{ font-size:15px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
#actpanel .ap-sp{ flex:1; }
#actpanel .ap-b{ font:inherit; font-size:14px; padding:6px 12px; border:1px solid var(--line); border-radius:8px; background:#fff; color:var(--ink,#1e293b); cursor:pointer; text-decoration:none; white-space:nowrap; }
#actpanel .ap-b:hover{ background:#eef4ff; }
#actpanel .ap-x{ background:var(--accent); border-color:var(--accent); color:#fff; }
#actpanel .ap-x:hover{ background:var(--accent); opacity:.9; }
#actpanel .ap-frame{ flex:1; width:100%; border:0; background:#fff; }
@media print{ #actpanel{ display:none !important; } }

table.entry th.hd textarea.hin{ display:block; resize:none; overflow:hidden; font-family:inherit; line-height:1.35; white-space:normal; min-height:34px; box-sizing:border-box; }
table.entry th.hd{ vertical-align:top; }

.tblwrap{ position:relative; }
.cgrip{ position:absolute; top:0; bottom:0; width:9px; cursor:col-resize; z-index:4; touch-action:none; }
.cgrip:hover, .cgrip:active{ background:rgba(79,131,240,.35); }

/* student dashboard */
.hero-banner{ background:linear-gradient(135deg,#1e40af,#3b82f6); color:#fff; border-radius:16px; padding:22px 24px; }
.hero-banner h2{ margin:10px 0 6px; font-size:26px; color:#fff; }
.hero-banner .hb-top{ display:flex; gap:8px; flex-wrap:wrap; }
.hero-banner .hb-soi{ margin:6px 0 10px; max-width:820px; line-height:1.55; opacity:.97; }
.hero-banner .hb-chips{ display:flex; gap:8px; flex-wrap:wrap; }
.hero-banner .hb-chips span{ background:rgba(255,255,255,.16); border-radius:99px; padding:4px 12px; font-size:13px; }
.grid.dash2{ grid-template-columns:1fr 1.3fr; align-items:start; }
@media (max-width:780px){ .grid.dash2{ grid-template-columns:1fr; } }
details.lk{ border-top:1px solid var(--line); padding:6px 0; }
details.lk:first-of-type{ border-top:none; }
details.lk > summary{ cursor:pointer; font-weight:600; padding:4px 0; }
details.lk ul{ margin:4px 0 6px; padding-left:20px; }
details.lk.sub{ margin-left:14px; border-top:none; }
details.lk.sub > summary{ font-weight:500; color:#475569; }

/* resource carousels */
.rc-row{ margin:14px 0 20px; }
.rc-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:8px; }
.rc-head h3{ margin:0; font-size:16px; }
.rc-btn{ border:1px solid var(--line); background:#fff; border-radius:99px; width:34px; height:34px; cursor:pointer; margin-left:6px; font-size:13px; }
.rc-btn:hover{ background:#eef4ff; }
.rc-strip{ display:flex; gap:14px; overflow-x:auto; scroll-snap-type:x mandatory; padding:4px 2px 12px; scrollbar-width:thin; -webkit-overflow-scrolling:touch; }
.rc-card{ flex:0 0 250px; scroll-snap-align:start; background:#fff; border:1px solid var(--line); border-radius:14px; overflow:hidden; color:inherit; text-decoration:none; display:block; transition:transform .12s, box-shadow .12s; }
.rc-card:hover{ transform:translateY(-2px); box-shadow:0 6px 16px rgba(30,64,175,.14); text-decoration:none; }
.rc-thumb{ position:relative; aspect-ratio:16/9; background:linear-gradient(135deg,#dbeafe,#bfdbfe); overflow:hidden; }
.rc-thumb img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:1; }
.rc-fallback{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:44px; font-weight:800; color:#3b82f6; opacity:.55; }
.rc-play{ position:absolute; z-index:2; left:50%; top:50%; transform:translate(-50%,-50%); width:46px; height:46px; border-radius:50%; background:rgba(0,0,0,.62); color:#fff; display:flex; align-items:center; justify-content:center; font-size:18px; }
.rc-tag{ position:absolute; z-index:2; top:8px; left:8px; background:#1e40af; color:#fff; font-size:12px; font-weight:700; border-radius:99px; padding:2px 9px; }
.rc-title{ padding:10px 12px 2px; font-weight:600; font-size:14px; line-height:1.3; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; min-height:2.6em; }
.rc-host{ padding:0 12px 11px; font-size:12px; color:#64748b; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rc-modal{ position:fixed; inset:0; background:rgba(15,23,42,.78); z-index:80; display:flex; align-items:center; justify-content:center; padding:20px; }
.rc-modal[hidden]{ display:none; }
.rc-box{ background:#0f172a; border-radius:14px; width:min(960px,100%); overflow:hidden; }
.rc-bar{ display:flex; justify-content:space-between; align-items:center; gap:10px; padding:8px 12px; background:#fff; font-size:13px; }
.rc-box iframe{ display:block; width:100%; aspect-ratio:16/9; border:0; background:#000; }

/* design cycle strip */
.dcycle{ margin:0 0 12px; }
.dc-bar{ display:flex; gap:4px; align-items:stretch; }
.dc-seg{ flex:1; display:flex; align-items:center; gap:8px; padding:7px 12px; border:0; border-radius:8px; color:#fff; cursor:pointer; text-align:left; font:inherit; font-size:13px;
  background:linear-gradient(90deg,var(--c),var(--d)); opacity:.62; transition:opacity .15s; min-width:0; }
.dc-seg b{ font-size:16px; color:#fde047; }
.dc-seg span{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-weight:600; }
.dc-seg:hover{ opacity:.9; } .dc-seg.cur{ opacity:1; box-shadow:0 0 0 2px #fff, 0 0 0 4px var(--c); }
.dc-seg.off{ opacity:.25; cursor:default; }
.dc-tog{ border:1px solid var(--line); background:#fff; border-radius:8px; padding:0 12px; font:inherit; font-size:12px; color:#475569; cursor:pointer; white-space:nowrap; }
.dc-tog:hover{ background:#eef4ff; }
.dc-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:4px; margin-top:6px; }
.dc-col{ display:flex; flex-direction:column; gap:4px; }
.dc-card{ background:linear-gradient(180deg,var(--c),var(--d)); color:#fff; border-radius:8px; padding:8px 10px; font-size:12px; line-height:1.35; }
.dc-card .dc-t{ font-weight:700; } .dc-card em{ font-style:normal; color:#fde047; font-weight:800; }
.dc-card .dc-d{ opacity:.9; margin-top:3px; }
@media (max-width:780px){ .dc-seg span{ display:none; } .dc-grid{ grid-template-columns:1fr 1fr; } }

/* collapsible teacher sidebar */
.side .nt{ white-space:nowrap; }
.side .ni{ display:inline-block; width:22px; text-align:center; flex:none; }
.side-tog{ position:absolute; top:14px; right:-13px; z-index:5; width:26px; height:26px; border-radius:50%; border:1px solid var(--line); background:#fff; cursor:pointer; font-size:12px; color:#475569; line-height:1; padding:0; box-shadow:0 1px 4px rgba(0,0,0,.08); }
.side-tog:hover{ background:#eef4ff; }
.side{ transition:width .15s; }
.layout.side-collapsed .side{ width:64px; padding:18px 8px; }
.layout.side-collapsed .side .brand{ font-size:0; justify-content:center; gap:0; }
.layout.side-collapsed .side .brand img{ width:36px; height:36px; }
.layout.side-collapsed .side .sub, .layout.side-collapsed .side .nt, .layout.side-collapsed .side .who .muted, .layout.side-collapsed .side .who b{ display:none; }
.layout.side-collapsed .side nav a{ justify-content:center; padding:10px 0; }
.layout.side-collapsed .side .who{ padding:8px 4px; background:transparent; }
.layout.side-collapsed .side .who .btn{ font-size:0; padding:8px 0; }
.layout.side-collapsed .side .who .btn::before{ content:"⏻"; font-size:16px; }
@media (max-width:780px){ .side-tog{ display:none; } }
.layout.side-collapsed .side-tog{ top:70px; }

/* design cycle strip v2: four equal columns, details appear on hover */
.dc-bar{ display:grid !important; grid-template-columns:repeat(4,1fr); gap:6px; }
.dc-wrap{ position:relative; min-width:0; }
.dc-seg{ width:100%; opacity:.82 !important; }
.dc-seg.cur{ opacity:1 !important; }
.dc-seg.off{ opacity:.3 !important; }
.dc-seg:hover{ opacity:1 !important; }
.dc-pop{ display:none; position:absolute; top:calc(100% + 4px); left:0; width:100%; min-width:260px; z-index:40; flex-direction:column; gap:4px; padding:6px; background:#fff; border:1px solid var(--line); border-radius:12px; box-shadow:0 10px 28px rgba(15,23,42,.22); }
.dc-wrap:hover .dc-pop, .dc-wrap:focus-within .dc-pop{ display:flex; }
.dc-wrap:last-child .dc-pop, .dc-wrap:nth-child(3) .dc-pop{ left:auto; right:0; }
.dc-wrap.off:hover .dc-pop{ display:none; }
@media (max-width:780px){ .dc-seg span{ display:none; } .dc-seg{ justify-content:center; } }
.dc-pop::before{ content:""; position:absolute; top:-8px; left:0; right:0; height:8px; }

.dc-cap{ font-size:11px; font-weight:800; letter-spacing:.16em; color:#94a3b8; margin:0 0 5px 2px; }
.dcycle{ margin:0 0 14px; }

/* resources v2: one compact row, left to right, grouped by criterion */
.rc-card{ flex:0 0 172px !important; border-radius:12px; }
.rc-title{ font-size:13px; padding:8px 10px 2px; }
.rc-host{ font-size:11px; padding:0 10px 9px; }
.rc-fallback{ font-size:30px !important; opacity:.7 !important; }
.rc-play{ width:36px; height:36px; font-size:14px; }
.rc-strip{ align-items:stretch; }
.rc-group{ flex:0 0 96px; scroll-snap-align:start; border-radius:12px; color:#fff; display:flex; flex-direction:column; justify-content:center; padding:10px 12px; gap:2px; }
.rc-group b{ font-size:26px; color:#fde047; line-height:1; }
.rc-group span{ font-size:12px; font-weight:600; line-height:1.25; }
.rc-A{ background:linear-gradient(160deg,#1f6fe5,#12397a); } .rc-B{ background:linear-gradient(160deg,#2f9e2f,#14501a); }
.rc-C{ background:linear-gradient(160deg,#7a35c4,#3d1a66); } .rc-D{ background:linear-gradient(160deg,#e0561c,#7a2a0b); }

/* resources v3: one flip board per criterion */
.fb-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(215px,1fr)); gap:14px; margin:10px 0 6px; }
.fb{ background:#fff; border:1px solid var(--line); border-radius:14px; overflow:hidden; display:flex; flex-direction:column; }
.fb-head{ display:flex; align-items:center; gap:8px; padding:8px 12px; color:#fff; }
.fb-head b{ font-size:20px; color:#fde047; line-height:1; }
.fb-head span{ font-size:13px; font-weight:600; }
.fb-A .fb-head{ background:linear-gradient(90deg,#1f6fe5,#12397a); } .fb-B .fb-head{ background:linear-gradient(90deg,#2f9e2f,#14501a); }
.fb-C .fb-head{ background:linear-gradient(90deg,#7a35c4,#3d1a66); } .fb-D .fb-head{ background:linear-gradient(90deg,#e0561c,#7a2a0b); }
.fb-stage{ perspective:900px; padding:10px 10px 4px; }
.fb .rc-card{ flex:none !important; width:100%; border:1px solid var(--line); transform-origin:50% 50%; backface-visibility:hidden; }
.fb .rc-card:hover{ transform:none; box-shadow:0 4px 12px rgba(30,64,175,.14); }
.fb-hidden{ display:none !important; }
.fb-out-up{ animation:fbOutUp .24s ease-in forwards; } .fb-in-up{ animation:fbInUp .26s ease-out; }
.fb-out-down{ animation:fbOutDown .24s ease-in forwards; } .fb-in-down{ animation:fbInDown .26s ease-out; }
@keyframes fbOutUp{ from{ transform:rotateX(0); opacity:1; } to{ transform:rotateX(-90deg); opacity:.2; } }
@keyframes fbInUp{ from{ transform:rotateX(90deg); opacity:.2; } to{ transform:rotateX(0); opacity:1; } }
@keyframes fbOutDown{ from{ transform:rotateX(0); opacity:1; } to{ transform:rotateX(90deg); opacity:.2; } }
@keyframes fbInDown{ from{ transform:rotateX(-90deg); opacity:.2; } to{ transform:rotateX(0); opacity:1; } }
.fb-foot{ display:flex; align-items:center; justify-content:center; gap:14px; padding:2px 10px 10px; }
.fb-count{ font-size:12px; color:#64748b; min-width:42px; text-align:center; }
.fb-foot .rc-btn{ margin:0; width:30px; height:30px; }
.fb[data-n="1"] .fb-foot .rc-btn{ visibility:hidden; }

.foldbtn{ border:1px solid var(--line); background:#fff; border-radius:8px; padding:3px 10px; font-size:12px; font-weight:700; cursor:pointer; color:var(--ink,#1f2937); }
.foldbtn:hover{ background:#eef2ff; } .foldbtn[hidden]{ display:none; }
.strand.folded > .body, .strand.folded > .rubric{ display:none; }
.strand.folded > header{ border-bottom:0; }

/* ---- Ideas cards + Framed table (v39) ---- */
.bblock .tag.ideas{ background:#c0603a; } .bblock .tag.framed{ background:#1f2a44; }
.fin{ width:100%; background:#fffdf9; border:1px solid #d8cfbd; border-radius:6px; padding:7px 9px; font:inherit; font-size:15px; color:#1f2937; }
.fin:focus{ outline:2px solid #bcd0f7; outline-offset:0; border-color:#8fb0ee; }
.fin:disabled{ background:#faf7f0; color:#334155; opacity:1; -webkit-text-fill-color:#334155; }
textarea.fin{ resize:vertical; min-height:36px; line-height:1.4; }
.ideas{ display:grid; grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)); gap:14px; align-items:start; }
.icard{ background:#fffdf9; border:1px solid #d8cfbd; border-radius:9px; padding:12px 13px; }
.icard h4{ margin:0 0 8px; color:#1f2a44; font-size:16px; }
.icard .ql{ font-weight:700; color:#1f2a44; font-size:14px; margin:10px 0 4px; }
.islot{ margin-top:12px; border:2px dashed #d8cfbd; border-radius:8px; min-height:92px; display:grid; place-items:center; position:relative; background:#fffdf9; overflow:hidden; }
.islot .iadd{ border:none; background:transparent; color:#1f2a44; font:inherit; font-weight:700; font-size:14px; cursor:pointer; width:100%; min-height:92px; }
.islot .iadd:hover{ background:#f6efe0; }
.islot.has{ border-style:solid; border-color:#d8cfbd; }
.islot.has img{ width:100%; max-height:240px; object-fit:contain; display:block; cursor:zoom-in; background:#fff; }
.islot .irm{ position:absolute; top:6px; right:6px; width:26px; height:26px; border-radius:50%; border:none; background:rgba(31,42,68,.85); color:#fff; font-size:17px; line-height:1; cursor:pointer; }
.islot.empty{ border-style:solid; min-height:48px; }
.fscroll{ overflow-x:auto; }
table.framed{ border-collapse:separate; border-spacing:0; width:100%; min-width:480px; }
table.framed th{ background:#e8dcc4; color:#1f2a44; font-weight:700; text-align:left; padding:9px 10px; font-size:14px; border:1px solid #d8cfbd; }
table.framed th:not(:first-child){ border-left:0; }
table.framed td{ padding:5px; vertical-align:top; border:1px solid #d8cfbd; border-top:0; background:#fff; }
table.framed td:not(:first-child){ border-left:0; }
table.framed th.x, table.framed td.x{ width:34px; min-width:34px; text-align:center; padding:5px 2px; }
table.framed td.x{ border-top:0; }
.fdel{ border:none; background:transparent; color:#c0392b; font-size:22px; line-height:1; cursor:pointer; padding:4px 6px; border-radius:6px; }
.fdel:hover{ background:#fdecea; }
.faddrow{ margin-top:8px; border:2px dashed #d8cfbd; background:transparent; color:#1f2a44; font:inherit; font-weight:700; font-size:14px; padding:8px 16px; border-radius:8px; cursor:pointer; }
.faddrow:hover{ background:#f6efe0; }

/* ---- team member cards (group units) ---- */
.mates{ display:flex; gap:12px; flex-wrap:wrap; margin:0 0 14px; }
.mcard{ flex:1 1 230px; max-width:340px; background:#fff; border:1px solid var(--line); border-radius:12px; padding:10px 12px; cursor:pointer; }
.mcard:hover{ border-color:#9db7f2; }
.mcard.sel{ border:2px solid #1f2a44; padding:9px 11px; background:#f6f8ff; }
.mcard .mtop{ display:flex; gap:10px; align-items:center; margin-bottom:6px; }
.mcard .memoji{ font-size:28px; line-height:1; }
.mcard .mwho b{ color:#1f2a44; }
.mcard .you{ margin-left:auto; background:#1f2a44; color:#fff; font-size:11px; font-weight:800; border-radius:6px; padding:2px 7px; letter-spacing:.05em; }
.mbar{ display:grid; grid-template-columns:16px 1fr 56px; gap:8px; align-items:center; font-size:12px; margin:3px 0; }
.mbar .k{ font-weight:800; color:var(--cc); }
.mbar .track{ height:6px; background:#e8edf5; border-radius:4px; overflow:hidden; display:block; }
.mbar .track i{ display:block; height:100%; border-radius:4px; }
.mbar .pct{ text-align:right; color:var(--muted); }
.mbar .pct.ok{ color:#2f9e63; font-weight:800; }
.viewbanner{ background:#fff3bf; border:1px solid #f0d36b; color:#5c4a00; border-radius:10px; padding:10px 14px; margin-bottom:12px; display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; font-weight:700; }

/* ---- the framed look for the student workspace (v39+) ---- */
#ws .strand > header .key{ background:#1f2a44; letter-spacing:.03em; }
#ws .strand > header .hwrap{ flex:1; min-width:0; }
#ws .strand > header h3{ color:#1f2a44; }
#ws .strand > header .sintro{ color:#6b7280; font-size:14px; margin-top:2px; font-weight:400; }
#ws .strand > header .sintro p{ margin:2px 0; }
#ws .block .lbl{ font-weight:800; color:#1f2a44; margin-bottom:5px; }
#ws .block .help, #ws .infobox{ background:#eaf2fd; border:0; border-left:4px solid #1f2a44; border-radius:6px; padding:9px 13px; color:#1f2a44; font-size:14px; }
#ws .block .help{ margin-bottom:8px; }
#ws .block > input[type=text], #ws .block > select, #ws .block > textarea{ background:#fffdf9; border:1px solid #d8cfbd; border-radius:6px; }
#ws .block > input[type=text]:disabled, #ws .block > select:disabled{ background:#faf7f0; color:#334155; opacity:1; -webkit-text-fill-color:#334155; }
#ws .block .rt-bar{ background:#f6efe0; border-color:#d8cfbd; border-radius:8px 8px 0 0; }
#ws .block .rt-edit{ background:#fffdf9; border:1px solid #d8cfbd; border-radius:6px; }
#ws .block .rt > .rt-edit{ border-radius:0 0 8px 8px; }
#ws .block .rt-edit.rt-lock{ background:#faf7f0 !important; }
#ws table.entry{ border-collapse:separate; border-spacing:0; }
#ws table.entry th{ background:#e8dcc4; color:#1f2a44; font-weight:700; border-color:#d8cfbd; }
#ws table.entry th.hd .hin{ color:#1f2a44; }
#ws table.entry td{ border-color:#d8cfbd; background:#fffdf9; }
#ws table.entry td.rl, #ws table.entry td.locked{ background:#f3ecdc; }
#ws table.entry th.hd.locked{ background:#e8dcc4; }
#ws .photo{ border-color:#d8cfbd; background:#fffdf9; border-radius:9px; }
#ws .photo .cap input{ background:#fffdf9; border:1px solid #d8cfbd; border-radius:6px; }
#ws .addphoto .btn{ border:2px dashed #d8cfbd; background:#fffdf9; color:#1f2a44; font-weight:700; border-radius:8px; }
#ws .addphoto .btn:hover{ background:#f6efe0; }
#ws .chk span{ color:#1f2a44; }

/* ---- Find your team (student survey + teacher Team finder) ---- */
.svwrap{ max-width:860px; margin:0 auto; }
.svtr{ color:#2c4fb0; font-size:.82em; font-weight:400; margin-top:2px; }
.svintro{ font-size:1.05rem; }
.svrow{ background:#fffdf9; border:1px solid #d8cfbd; border-radius:10px; padding:10px 14px; margin:8px 0; }
.svst{ font-weight:700; color:#1f2a44; margin-bottom:6px; }
.svlv{ display:flex; gap:8px; flex-wrap:wrap; }
.svlevel{ border:1px solid #d8cfbd; background:#fff; border-radius:999px; padding:5px 12px; cursor:pointer; font-size:.9rem; }
.svlevel input{ position:absolute; opacity:0; pointer-events:none; }
.svlevel.on{ background:#1f2a44; color:#fff; border-color:#1f2a44; }
.svq{ margin:14px 0; }
.svlbl{ font-weight:800; color:#1f2a44; margin-bottom:5px; }
.svq select{ width:100%; max-width:520px; background:#fffdf9; border:1px solid #d8cfbd; border-radius:6px; padding:9px; }
.svmsg{ display:inline-block; margin-left:12px; font-weight:700; }
.svmsg.ok{ color:#2f9e63; } .svmsg.bad{ color:#c0392b; }
.svres{ background:#eaf2fd; border-left:4px solid #1f2a44; border-radius:6px; padding:10px 16px; margin-top:14px; }
.svbar{ display:grid; grid-template-columns:minmax(150px,230px) 1fr 60px; gap:10px; align-items:center; margin:6px 0; }
.svtrack{ height:10px; background:#d6e2f5; border-radius:6px; overflow:hidden; display:block; }
.svtrack i{ display:block; height:100%; background:#1f2a44; border-radius:6px; }
.svbp{ text-align:right; font-size:.85rem; color:#555; }
.tfteams{ display:grid; grid-template-columns:repeat(auto-fill,minmax(420px,1fr)); gap:14px; margin:14px 0; }
.tfteam{ background:#fff; border:1px solid var(--line); border-radius:12px; padding:10px 12px; }
.tfteam h4{ margin:0 0 6px; display:flex; justify-content:space-between; align-items:center; color:#1f2a44; }
.tfmatch{ font-size:.8rem; font-weight:800; border-radius:999px; padding:2px 10px; background:#e3f5ea; color:#1f7a46; }
.tfmatch.mid{ background:#fff3bf; color:#7a5c00; } .tfmatch.low{ background:#fde2e2; color:#a12a2a; }
.tfm{ display:grid; grid-template-columns:1fr auto; gap:6px; align-items:center; padding:5px 0; border-top:1px solid #eef0f4; }
.tfm select{ font-size:.82rem; padding:3px 5px; margin:2px 4px 0 0; }
.tfsub{ font-size:.76rem; color:#667085; }
.svbanner{ display:block; background:#eaf2fd; border:1px solid #c7dcf7; border-left:4px solid #1f2a44; border-radius:8px; padding:10px 14px; margin:0 0 12px; color:#1f2a44; font-weight:800; text-decoration:none; }
.svbanner:hover{ background:#dce9fb; }

/* resources, colour palette and font helpers */
.resbox{ border:1px solid #d3e2ff; border-radius:12px; padding:12px 14px; background:#f7faff; }
.resbox .lbl{ font-weight:800; margin-bottom:4px; }
.resgrid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:10px; margin-top:8px; }
.rescard{ display:flex; flex-direction:column; gap:4px; padding:10px 12px; background:#fff; border:1px solid #cfdcf3; border-left:4px solid #5b8def; border-radius:10px; color:inherit; text-decoration:none; }
.rescard:hover{ border-color:#5b8def; box-shadow:0 2px 8px rgba(60,100,200,.15); }
.rescard.seen{ border-left-color:#3aa56b; background:#f6fcf8; }
.restag{ align-self:flex-start; font-size:.72rem; font-weight:700; background:#e8efff; color:#2f4f9e; border-radius:20px; padding:1px 8px; }
.resnote{ font-size:.85rem; color:#5b6477; }
.restick{ font-size:.8rem; font-weight:700; color:#2f6fe0; margin-top:2px; }
.rescard.seen .restick{ color:#2c8a57; }
.helper{ border:1px solid #d8cfbd; border-radius:12px; padding:12px 14px; background:#fffdf9; }
.helperbar{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:10px; }
.helperbar input[type=color]{ width:44px; height:34px; padding:0; border:1px solid #cfc6b3; border-radius:8px; }
.helperbar input[type=text]{ max-width:280px; }
.swrow{ display:flex; flex-wrap:wrap; gap:8px; margin:6px 0 10px; }
.sw{ position:relative; width:112px; height:82px; border-radius:10px; padding:8px; display:flex; flex-direction:column; justify-content:flex-end; font-size:.78rem; cursor:pointer; border:1px solid rgba(0,0,0,.12); }
.sw.empty{ background:#f3efe6; color:#a39a86; align-items:center; justify-content:center; cursor:default; border-style:dashed; }
.swx{ position:absolute; top:3px; right:4px; border:0; background:rgba(255,255,255,.55); border-radius:50%; width:20px; height:20px; line-height:18px; cursor:pointer; font-size:.7rem; }
.fontgrid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:10px; margin-bottom:8px; }
.fcard{ background:#fff; border:1px solid #d8cfbd; border-radius:10px; padding:10px 12px; }
.fcard.chosen{ border-color:#3aa56b; box-shadow:0 0 0 2px #cfeedd; }
.fcard .btn.on{ background:#3aa56b; color:#fff; border-color:#3aa56b; }

/* "Ask to finish" flags */
.flagbanner{ background:#fff1e6; border:1px solid #f3b27a; border-left:5px solid #e8590c; color:#7a2f00; border-radius:10px; padding:10px 14px; margin:0 0 12px; }
.flagtbar{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:0 0 10px; }
.flagchip{ background:#fff1e6; border:1px solid #f3b27a; color:#7a2f00; border-radius:20px; padding:3px 10px; font-size:.85rem; }
.flagchip.ready{ background:#eaf8ef; border-color:#8fd3a8; color:#1f6b3b; }
.pillrow .btn.on{ background:#1f2a44; color:#fff; }

/* optional strand colour (Builder: Strand colour) - same soft colours as the table box; --sc = accent, --st = tint */
.scol-aqua{ --sc:#3aa88f; --st:#e2f4ef; } .scol-green{ --sc:#4c9f4a; --st:#e6f3e5; } .scol-red{ --sc:#d9694f; --st:#fbe9e5; } .scol-yellow{ --sc:#d4a30a; --st:#fef8dc; }
.scol-blue{ --sc:#4a7fe0; --st:#e8effd; } .scol-purple{ --sc:#8a63d6; --st:#f0ebfb; } .scol-orange{ --sc:#e8873a; --st:#fef0e2; } .scol-grey{ --sc:#7b8494; --st:#f0f2f6; }
.scol-pink{ --sc:#d6336c; --st:#fde8f0; }
.scol-custom{ --st:color-mix(in srgb, var(--sc) 14%, #fff); }
.strand.scol{ background:var(--st); border-color:var(--sc); border-left:6px solid var(--sc); }
.strand.scol > header{ background:transparent; border-bottom-color:rgba(0,0,0,.08); }
#ws .strand.scol > header h3{ color:var(--sc); filter:brightness(.75); }
#ws .strand.scol > header .key{ background:var(--sc); }
.strand.scol footer{ background:transparent; }
.bstrand.scol{ border-left:6px solid var(--sc); }
.colpick{ width:26px; height:26px; border-radius:50%; border:2px solid #fff; box-shadow:0 0 0 1px #b8c2d6; cursor:pointer; background:var(--sc); padding:0; line-height:22px; font-size:13px; color:#6b7280; }
.colpick.none{ background:#fff; }
.colpick.on{ box-shadow:0 0 0 2px #1f2a44; }

/* table-box cell colours (teacher layout) */
table.entry .fill-aqua{ background:#bfe8de !important; } table.entry .fill-green{ background:#c9e8c8 !important; } table.entry .fill-red{ background:#f6d3cb !important; }
table.entry .fill-yellow{ background:#fdf0b8 !important; } table.entry .fill-blue{ background:#d3e2fb !important; } table.entry .fill-purple{ background:#e4daf7 !important; }
table.entry .fill-orange{ background:#fde0c4 !important; } table.entry .fill-grey{ background:#e6e9ef !important; }
.fillpick{ width:22px; height:22px; border-radius:6px; border:1px solid #b8c2d6; cursor:pointer; padding:0; vertical-align:middle; margin:0 1px; line-height:18px; font-size:12px; color:#6b7280; }
.fillpick.fill-aqua{ background:#bfe8de; } .fillpick.fill-green{ background:#c9e8c8; } .fillpick.fill-red{ background:#f6d3cb; } .fillpick.fill-yellow{ background:#fdf0b8; }
.fillpick.fill-blue{ background:#d3e2fb; } .fillpick.fill-purple{ background:#e4daf7; } .fillpick.fill-orange{ background:#fde0c4; } .fillpick.fill-grey{ background:#e6e9ef; } .fillpick.none{ background:#fff; }
table.entry td.fill .rt-edit, #ws .block table.entry td.fill .rt-edit, #ws .block table.entry td.fill .rt-edit.rt-lock{ background:transparent !important; border:none !important; border-radius:0 !important; }

.fillpick.on{ box-shadow:0 0 0 2px #1f2a44; }
.colcustom{ width:30px; height:26px; padding:0; border:1px solid #b8c2d6; border-radius:6px; background:#fff; cursor:pointer; }
.colcustom.on{ box-shadow:0 0 0 2px #1f2a44; }

#ws .strand.scol-custom > header h3{ color:color-mix(in srgb, var(--sc) 40%, #000); filter:none; }
#ws .strand.scol-custom > header .key{ color:color-mix(in srgb, var(--sc) 25%, #000); }
/* inside table cells the text editor is flat: no inner box (the general #ws rich-text box style used to leak in and made empty cells look boxed) */
#ws .block table.entry td .rt-edit, #ws .block table.entry td .rt-edit.rt-lock{ background:transparent !important; border:none !important; border-radius:0 !important; }
#ws .block table.entry td .rt-edit:focus{ background:#fff !important; outline:2px solid #bfd3ff; outline-offset:-2px; }

/* a student's new row keeps the shading of a column that is locked above and below it */
table.entry td.shadecont{ background:#f1f5f9; }
#ws table.entry td.shadecont{ background:#f3ecdc; }
/* Find your team (spec v2): role cards, tap buttons, choice badges, results */
.svintro p{ margin:0 0 8px; } .svrole{ margin:18px 0 4px; font-size:1.15rem; font-weight:800; color:#1f2a44; } .svhint{ font-size:.85rem; color:#555; margin:0 0 4px; }
.svcards{ display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:10px; margin:8px 0; }
.svcard{ border:2px solid #d8cfbd; background:#fffdf9; border-radius:12px; padding:12px; cursor:pointer; text-align:left; font:inherit; color:#1f2a44; } .svcard .ic{ font-size:1.8rem; display:block; } .svcard b{ display:block; margin:4px 0 2px; } .svcard small{ color:#555; display:block; }
.svcard.on{ border-color:#1f2a44; background:#eaf2fd; box-shadow:0 0 0 2px #1f2a44 inset; }
.svopts{ display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:8px; margin:6px 0; }
.svopt{ position:relative; border:2px solid #d8cfbd; background:#fffdf9; border-radius:10px; padding:10px 12px 10px 12px; cursor:pointer; text-align:left; font:inherit; color:#1f2a44; min-height:46px; } .svopt.on{ border-color:#1f2a44; background:#eaf2fd; }
.svopt .bdg{ position:absolute; top:-9px; right:8px; background:#1f2a44; color:#fff; border-radius:999px; font-size:.72rem; padding:2px 9px; font-weight:800; } .svopt .bdg.b2{ background:#2c7bd6; }
.svbtn{ border:1px solid #d8cfbd; background:#fff; border-radius:999px; padding:7px 14px; cursor:pointer; font:inherit; font-size:.9rem; color:#1f2a44; } .svbtn.on{ background:#1f2a44; color:#fff; border-color:#1f2a44; }
.svq.miss, .svrow.miss{ outline:2px solid #e3b4ae; border-radius:10px; }
.svclosed{ background:#fdecea; border-left:4px solid #c0392b; border-radius:6px; padding:10px 14px; margin:10px 0; font-weight:700; }
.svpick{ background:#fff3bf; border:2px solid #f0c33c; border-radius:10px; padding:9px 12px; margin:6px 0 10px; font-weight:800; color:#5c4400; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.svpick .svcount{ margin-left:auto; background:#fff; border-radius:999px; padding:2px 12px; font-size:.85rem; color:#1f2a44; }
.svpick.bad{ background:#fdecea; border-color:#c0392b; color:#8a1f12; }

.svdesc{ background:#eef6ff; border-left:4px solid #1f2a44; border-radius:6px; padding:8px 12px; margin:4px 0 8px; font-size:.98rem; }

/* choice board */
.chb{ margin:6px 0; } .chnote{ font-weight:700; color:#1f2a44; margin:0 0 8px; } .chnote.ok{ color:#1d7a46; } .chnote.warn{ color:#a8483a; }
.chcards{ display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:10px; }
.chcard{ position:relative; text-align:left; display:flex; flex-direction:column; gap:4px; padding:12px; border:2px solid #d8dee9; border-radius:12px; background:#fff; cursor:pointer; font:inherit; color:inherit; }
.chcard:hover:not(:disabled){ border-color:#1f2a44; } .chcard.on{ border-color:#1d7a46; background:#f0faf4; } .chcard small{ color:#5b6472; }
.chcard .chic{ font-size:1.6rem; } .chtick{ position:absolute; top:8px; right:10px; color:#fff; background:#1d7a46; border-radius:50%; width:22px; height:22px; text-align:center; line-height:22px; font-weight:800; }
.chwork{ margin-top:14px; padding:12px; border:1px solid #cfe5d8; border-left:5px solid #1d7a46; border-radius:10px; background:#fcfffd; }
.chwork h4{ margin:0 0 6px; } .chprompt{ background:#eef6ff; border-radius:6px; padding:6px 10px; margin-bottom:8px; }
.chpics{ display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; } .chpic{ position:relative; width:110px; height:110px; border-radius:8px; overflow:hidden; border:1px solid #d8dee9; }
.chpic img{ width:100%; height:100%; object-fit:cover; cursor:zoom-in; } .chpic .irm{ position:absolute; top:3px; right:3px; }
.bblock .tag.choice{ background:#1d7a46; }

/* builder: collapse + hide activity */
.bblock.bcol > .bb{ display:none; } .bblock.bcol > .bh{ border-bottom:0; border-radius:10px; }
.bblock.bhid{ border-style:dashed; opacity:.72; } .bblock.bhid > .bh{ background:#fff4e5; }
.bhidtag{ font-size:11.5px; font-weight:800; color:#9a5b00; background:#ffe8c2; padding:2px 8px; border-radius:6px; white-space:nowrap; }
.bblock .bfold{ min-width:26px; }

.chprompt p{ margin:0 0 6px; } .chprompt ul,.chprompt ol{ margin:4px 0 6px 20px; padding:0; } .chprompt li{ margin:2px 0; } .chprompt > :last-child{ margin-bottom:0; }

/* Keep feedback editors and long Hub comments within their page columns. */
.main { min-width:0; }
.gradebox, .gradebox > *, .grade-fields > *, .ai-instructions { min-width:0; max-width:100%; }
.grade-fields { display:grid; grid-template-columns:120px minmax(0,1fr); gap:14px; align-items:start; }
.gradebox { overflow-wrap:anywhere; }
.gradebox textarea, .ai-instructions textarea { display:block; width:100%; max-width:100%; min-width:0; white-space:pre-wrap; overflow-wrap:anywhere; }
.ai-instructions { margin-top:10px; }
.ai-instructions summary { font-weight:700; cursor:pointer; }
.ai-instructions textarea { margin:8px 0; }
.class-feedback { min-width:0; max-width:100%; overflow-wrap:anywhere; }
.class-feedback .card { min-width:0; max-width:100%; }
.class-feedback textarea { min-width:0; max-width:100%; white-space:pre-wrap; overflow-wrap:anywhere; }
.feedback-table-scroll { max-width:100%; overflow-x:auto; }
.feedback-table-scroll table { width:100%; table-layout:fixed; }
.feedback-table-scroll td { overflow-wrap:anywhere; }
@media(max-width:700px) { .grade-fields { grid-template-columns:minmax(0,1fr); } }
