/* Solution Studio page styling (everything except the LEAP-style response box, which lives in leap.css). */
:root {
  --ink: #1c2430;
  --muted: #5b6676;
  --line: #d5dbe3;
  --bg: #f3f5f8;
  --card: #ffffff;
  --brand: #1f5fbf;
  --brand-dark: #174a96;
  --good: #1b7a43;
  --good-bg: #e5f4ea;
  --warn: #b3261e;
  --warn-bg: #fdeceb;
  --amber-bg: #fff4d6;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0.5em 0; }
a { color: var(--brand); }
[hidden] { display: none !important; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.logo { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.logo span { color: var(--brand); }
.topbar-right { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; color: var(--muted); }
.wrap { max-width: 900px; margin: 0 auto; padding: 22px 16px 80px; }
.wrap.wide { max-width: 1060px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.center-card { max-width: 440px; margin: 7vh auto 0; text-align: center; padding: 30px 26px; }
.center-card h1 { margin-bottom: 6px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 16px;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1px solid #b9c2ce;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: #f1f4f8; }
.btn:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #9cc0f5; outline-offset: 1px; }
.btn.primary { color: #fff; background: var(--brand); border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--warn); border-color: #e3b5b1; }
.btn.danger:hover { background: var(--warn-bg); }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 0.875rem; }
.btn.big { min-height: 50px; padding: 10px 24px; font-size: 1.1rem; }
.btn:disabled { opacity: 0.55; cursor: default; }
.linkbtn { padding: 0; font: inherit; color: var(--brand); background: none; border: none; text-decoration: underline; cursor: pointer; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.row.spread { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }

/* forms */
label.field { display: block; text-align: left; font-weight: 600; margin-bottom: 14px; }
label.field > span { display: block; margin-bottom: 5px; }
.hint { display: block; font-weight: 400; font-size: 0.875rem; color: var(--muted); }
input[type="text"], input[type="password"], select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid #aab4c1;
  border-radius: 8px;
}
input.code-input {
  text-align: center;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  min-height: 60px;
}
input.num-input { font-size: 1.3rem; font-weight: 600; }
.msg { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; font-size: 0.95rem; text-align: left; }
.msg.error { color: var(--warn); background: var(--warn-bg); }
.msg.ok { color: var(--good); background: var(--good-bg); }
.msg.info { color: #5a4300; background: var(--amber-bg); }
fieldset { margin: 0 0 16px; padding: 0; border: none; }
legend { padding: 0; margin-bottom: 6px; font-weight: 600; }
.choice { display: flex; align-items: flex-start; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; cursor: pointer; }
.choice input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.choice:has(input:checked) { border-color: var(--brand); background: #eef4fd; }
.choice b { display: block; }

/* student page */
.who {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: #eef4fd;
  border: 1px solid #c6d9f5;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
}
.session-head { margin-bottom: 16px; }
.qcard { padding: 18px 18px 20px; }
.qlabel { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand); margin-bottom: 8px; }
.prompt { margin-bottom: 14px; }
.prompt .content-view { font-size: 18px; }
.prompt img, .qimg { display: block; max-width: 100%; max-height: 520px; height: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: 6px; }
.answer-label { font-weight: 600; margin: 4px 0 6px; }
.submitted {
  padding: 12px 14px;
  background: #f7fbf8;
  border: 1px solid #bfe0cb;
  border-radius: 8px;
}
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; }
.badge.good { color: var(--good); background: var(--good-bg); }
.badge.warn { color: var(--warn); background: var(--warn-bg); }
.badge.neutral { color: var(--muted); background: #e9edf2; }
.confirm { margin-top: 10px; padding: 10px 12px; background: var(--amber-bg); border-radius: 8px; }
.others { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.others h3 { margin-bottom: 8px; }
.other-post { padding: 9px 12px; margin-bottom: 8px; background: #f6f8fb; border: 1px solid var(--line); border-radius: 8px; }

/* teacher */
.session-list { display: grid; gap: 12px; }
.session-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; margin: 0; color: inherit; text-decoration: none; }
.session-item:hover { border-color: #9db7dd; }
.session-item .title { font-weight: 700; font-size: 1.05rem; }
.codechip { font: 700 1rem ui-monospace, Consolas, monospace; letter-spacing: 0.12em; padding: 2px 9px; background: #eef2f7; border-radius: 6px; }
.bigcode { font: 800 2.4rem ui-monospace, Consolas, monospace; letter-spacing: 0.18em; color: var(--brand); }
.periods-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.periods-grid label { font-size: 0.875rem; font-weight: 600; }
.periods-grid input { min-height: 38px; margin-top: 2px; }
.qedit { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fafbfd; margin-bottom: 12px; }
.qedit .rb-box { min-height: 110px; }
.qedit-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.imgprev { position: relative; display: inline-block; margin-top: 10px; }
.imgprev img { display: block; max-width: 100%; max-height: 260px; border: 1px solid var(--line); border-radius: 6px; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; }
.stat { padding: 8px 14px; background: #f6f8fb; border: 1px solid var(--line); border-radius: 8px; }
.stat b { display: block; font-size: 1.3rem; }
.period-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin: 16px 0 6px; padding-bottom: 4px; border-bottom: 2px solid var(--line); }
.resp-row { display: grid; grid-template-columns: 74px 1fr auto; gap: 12px; align-items: start; padding: 9px 4px; border-bottom: 1px solid #e9edf2; }
.resp-row .who-num { font-weight: 700; }
.resp-row.missing { background: #fff8f7; }
.resp-row .content-view { font-size: 16px; }
.resp-time { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.present {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2vh;
  background: #fff;
  text-align: center;
  padding: 20px;
}
.present .url { font-size: clamp(1.2rem, 3.2vw, 2.6rem); font-weight: 600; }
.present .code { font: 800 clamp(3rem, 14vw, 11rem) ui-monospace, Consolas, monospace; letter-spacing: 0.14em; color: var(--brand); line-height: 1.1; }
.modal-back { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20, 28, 40, 0.45); }
.modal { width: min(480px, 100%); max-height: 92vh; overflow: auto; margin: 0; }

@media (max-width: 560px) {
  .resp-row { grid-template-columns: 56px 1fr; }
  .resp-row .resp-side { grid-column: 2; }
  .card { padding: 16px; }
}
