:root {
  --ink: #1e252c;
  --muted: #6f777f;
  --paper: #f5f0e8;
  --card: #fffdf9;
  --white: #fff;
  --line: #e7dfd4;
  --orange: #dc6b2f;
  --orange-soft: #fff0e5;
  --green: #2f6f5b;
  --green-soft: #eaf4ef;
  --yellow: #f2c55c;
  --danger: #a74431;
  --shadow: 0 18px 50px rgba(64, 44, 29, .09);
}

* { box-sizing: border-box; }
html { background: var(--paper); color-scheme: light; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(220, 107, 47, .12), transparent 28rem),
    radial-gradient(circle at 92% 6%, rgba(47, 111, 91, .1), transparent 24rem),
    var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}
.orientation-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background: #f3f3ef;
  color: #17191a;
}
.orientation-gate[hidden] { display: none; }
.orientation-gate-card {
  width: min(520px, 100%);
  display: grid;
  gap: 20px;
  justify-items: start;
}
.orientation-gate-icon {
  width: 64px;
  height: 64px;
  fill: none;
  stroke: #173fc8;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.orientation-gate-kicker {
  color: #e45138;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .08em;
}
.orientation-gate h2 {
  margin: 8px 0 10px;
  font-size: clamp(30px, 9vw, 48px);
  line-height: 1.15;
  letter-spacing: -.05em;
}
.orientation-gate p {
  max-width: 38em;
  margin: 0;
  color: #58656c;
  font-size: 16px;
  line-height: 1.7;
}
.orientation-gate-action {
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid #173fc8;
  border-radius: 8px;
  background: #173fc8;
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.orientation-gate-action:focus-visible { outline: 3px solid rgba(23,63,200,.28); outline-offset: 3px; }
html.device-portrait body { overflow: hidden; touch-action: pan-x; }
button, input, textarea { font: inherit; }
[hidden] { display: none !important; }
button { touch-action: manipulation; }
a { color: inherit; }
.svg-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: inline-block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
}
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.upload-icon .svg-icon { width: 26px; height: 26px; stroke-width: 1.6; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(10px, env(safe-area-inset-top)) 24px 10px;
  background: rgba(255, 253, 249, .9);
  border-bottom: 1px solid rgba(231, 223, 212, .9);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: .01em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center; color: white; font-size: 16px;
  background: linear-gradient(135deg, var(--orange), #ef9a54);
  box-shadow: 0 8px 20px rgba(220, 107, 47, .28);
}
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.72);
  color: var(--muted); font-size: 11.5px;
}
.pill.ok { color: var(--green); border-color: #c9dfd5; background: var(--green-soft); }
.pill.warn { color: #84591b; border-color: #ead7a6; background: #fff8e8; }
.page { width: min(1140px, 100%); margin: 0 auto; padding: 24px 22px 72px; }
.page.narrow { width: min(920px, 100%); }

.hero-note {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 14px 16px; margin-bottom: 18px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 26px rgba(72, 50, 30, .04);
}
.hero-note .avatar {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px;
  background: var(--orange-soft); display: grid; place-items: center;
  color: var(--orange); font-weight: 800;
}
.hero-note strong { display: block; margin-bottom: 3px; font-size: 12px; color: var(--orange); }
.hero-note p { margin: 0; line-height: 1.7; font-size: 14px; }
#coachText.coach-copy-enter { animation: coachCopyIn .5s ease both; }
@keyframes coachCopyIn {
  from { opacity: .15; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.stepper {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px; margin-bottom: 18px;
}
.stepper-help {
  margin: -10px 0 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}
.step { text-align: center; min-width: 0; }
button.step {
  min-height: 52px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
button.step:hover .dot { border-color: var(--orange); color: var(--orange); }
button.step:focus-visible { outline: 3px solid rgba(220,107,47,.32); outline-offset: 3px; border-radius: 9px; }
.step .dot {
  width: 28px; height: 28px; border-radius: 50%; margin: 0 auto 5px;
  font-size: 11px; display: grid; place-items: center;
  border: 1px solid #d9d0c5; background: rgba(255,255,255,.6); color: #92877c;
}
.step .dot .svg-icon { width: 15px; height: 15px; stroke-width: 1.7; }
.step.done .dot { background: var(--green); border-color: var(--green); color: white; }
.step.current .dot { background: var(--orange); border-color: var(--orange); color: white; box-shadow: 0 0 0 5px rgba(220,107,47,.12); }
.step.forward-button .dot { border-color: var(--orange); color: var(--orange); }
.step.forward-button .label { color: var(--ink); }
.step .label { font-size: 10.5px; color: #8d8378; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step.current .label { color: var(--ink); font-weight: 700; }

.panel {
  background: rgba(255,253,249,.94);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(18px, 3vw, 30px);
  box-shadow: var(--shadow);
}
.panel h1, .panel h2, .panel h3 { margin-top: 0; }
.panel h1 { margin-bottom: 8px; font-size: clamp(22px, 3vw, 32px); letter-spacing: -.03em; }
.panel h2 { font-size: clamp(20px, 2.5vw, 27px); letter-spacing: -.025em; }
.panel h3 { font-size: 17px; }
.lead { color: var(--muted); line-height: 1.75; margin: 0 0 18px; font-size: 14px; }
.fine { color: var(--muted); font-size: 12px; line-height: 1.7; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 20px; }
.btn {
  min-height: 44px; padding: 10px 17px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--white); color: var(--ink); cursor: pointer;
  font-size: 13.5px; font-weight: 650;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(52,40,28,.08); }
.btn:focus-visible, .card-button:focus-visible, .chip:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(220,107,47,.32); outline-offset: 2px;
}
.btn.primary { background: var(--ink); border-color: var(--ink); color: white; }
.btn.orange { background: var(--orange); border-color: var(--orange); color: white; }
.btn.green { background: var(--green); border-color: var(--green); color: white; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 36px; padding: 7px 11px; font-size: 12px; border-radius: 9px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.field-label {
  display: block;
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}
.control-field-row {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.control-field-row .field-label { margin: 0; white-space: nowrap; }
body.modal-open { overflow: hidden; }

.upload-zone {
  min-height: 350px; border: 1.5px dashed #d7c8b8; border-radius: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 13px; text-align: center; padding: 28px; background: #fffaf4;
}
.upload-icon { width: 64px; height: 64px; border-radius: 20px; background: var(--orange-soft); display: grid; place-items: center; font-size: 26px; }
.upload-zone p { max-width: 440px; margin: 0; color: var(--muted); line-height: 1.75; }
.preview-stage {
  position: relative; background: #ebe5dd; border: 1px solid var(--line);
  border-radius: 16px; padding: 10px; display: grid; place-items: center;
}
.preview-stage img { display: block; max-width: 100%; max-height: 560px; width: auto; height: auto; object-fit: contain; border-radius: 10px; }
.crop-overlay { position: absolute; border: 2px solid var(--orange); background: rgba(220,107,47,.08); pointer-events: none; }
.crop-overlay span { position: absolute; top: -26px; left: -2px; padding: 3px 7px; background: var(--orange); color: white; border-radius: 6px 6px 0 0; font-size: 10px; white-space: nowrap; }
.analysis-board {
  margin-top: 14px; padding: 16px; border: 1px solid #d6c8b8;
  border-radius: 17px; background:
    linear-gradient(135deg, rgba(220,107,47,.08), transparent 48%),
    #fffaf4;
}
.analysis-head { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.analysis-head-actions { display: grid; justify-items: end; gap: 7px; }
.analysis-head-actions .btn { min-height: 44px; }
.analysis-category { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.analysis-category strong { font-size: 19px; letter-spacing: -.02em; }
.analysis-confidence { font-size: 10.5px; color: var(--muted); }
.analysis-quote { margin: 9px 0 0; font-size: 14px; line-height: 1.72; }
.analysis-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.analysis-cell { padding: 9px 10px; border-radius: 11px; background: rgba(255,255,255,.8); border: 1px solid #eee2d4; }
.analysis-cell span { display: block; color: var(--muted); font-size: 9.5px; margin-bottom: 3px; }
.analysis-cell b { display: block; font-size: 11.5px; line-height: 1.45; }
.analysis-more { margin-top: 10px; border-top: 1px solid #eadccc; padding-top: 9px; }
.analysis-more summary { cursor: pointer; color: #75543b; font-size: 11.5px; font-weight: 700; list-style-position: inside; }
.analysis-more p { margin: 7px 0 0; color: #5d6570; font-size: 11.5px; line-height: 1.7; }
.analysis-upgrade-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #e5caa7;
  border-radius: 11px;
  background: #fff6e8;
}
.analysis-upgrade-banner > div { display: grid; gap: 2px; color: #73512e; font-size: 10.5px; line-height: 1.55; }
.analysis-upgrade-banner b { color: #4f351c; font-size: 12px; }
.analysis-upgrade-banner .btn { flex: 0 0 auto; min-height: 44px; }
.analysis-evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}
.analysis-evidence-card {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #eadccc;
  border-radius: 10px;
  background: rgba(255,255,255,.8);
}
.analysis-evidence-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--orange);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
}
.analysis-evidence-card b {
  display: block;
  color: #36332e;
  font-size: 11px;
  line-height: 1.55;
}
.analysis-anchor-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 9px;
}
.analysis-anchor-row > span {
  display: inline-grid;
  grid-template-columns: 18px auto;
  gap: 1px 6px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid #d7cab9;
  border-radius: 9px;
  background: rgba(255,255,255,.82);
}
.analysis-anchor-row i {
  grid-row: 1 / 3;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #252521;
  color: #fff;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
}
.analysis-anchor-row b { font-size: 10px; color: var(--ink); }
.analysis-anchor-row em { max-width: 230px; overflow: hidden; color: var(--muted); font-size: 8.5px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.shot-map-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}
.shot-map-head > div { display: grid; gap: 2px; }
.shot-map-head b { color: var(--ink); font-size: 13px; }
.shot-map-head .analysis-confidence { text-align: right; }
.shot-map-stage { margin-top: 8px; }
.visual-anchor {
  position: absolute;
  z-index: 2;
  border: 1px dashed rgba(37,37,33,.72);
  border-radius: 4px;
  pointer-events: none;
}
.visual-anchor b {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #252521;
  color: #fff;
  font-size: 7px;
}
.visual-anchor span {
  position: absolute;
  left: 3px;
  bottom: 3px;
  max-width: 130px;
  padding: 2px 5px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255,255,255,.9);
  color: #252521;
  font-size: 8px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crop-overlay {
  transition: opacity .18s ease, border-color .18s ease, background .18s ease;
}
.crop-overlay.selected {
  z-index: 3;
  border-width: 3px;
  background: rgba(220,107,47,.11);
}
.crop-overlay.muted {
  z-index: 1;
  border-style: dashed;
  opacity: .42;
}
.crop-overlay span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.crop-overlay span b { font-size: 8px; opacity: .82; }
.shot-card .choice-body { display: flex; flex-direction: column; gap: 8px; }
.shot-card img { height: 170px; }
.shot-card-select {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.shot-card-select:focus-visible {
  outline: 3px solid rgba(220,107,47,.32);
  outline-offset: -3px;
}
.shot-card-select:disabled { cursor: not-allowed; }
.shot-read {
  margin: 0;
  color: #3e3a34;
  font-size: 12px;
  font-weight: 620;
  line-height: 1.65;
}
.shot-facts {
  display: grid;
  gap: 5px;
}
.shot-facts > span {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 5px;
  color: #656059;
  font-size: 9.5px;
  line-height: 1.5;
}
.shot-facts b { color: #8e7b68; font-size: 9px; font-weight: 760; }
.shot-anchor-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.shot-anchor-tags span {
  padding: 3px 7px;
  border: 1px solid #d9e3dd;
  border-radius: 999px;
  background: #f1f7f3;
  color: #315d4c;
  font-size: 9px;
}
.scheme-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.scheme-no { flex: 0 0 auto; width: 27px; height: 27px; border-radius: 9px; background: var(--orange); color: white; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.shot-type { color: var(--orange); font-size: 10.5px; font-weight: 800; letter-spacing: .04em; margin-bottom: 2px; }
.shot-title { font-size: 15px; font-weight: 750; line-height: 1.45; }
.shot-dim { color: var(--muted); font-size: 10px; }
.shot-section { border-top: 1px solid #eee6dc; padding-top: 7px; }
.shot-section span { display: block; font-size: 9.5px; font-weight: 750; color: #8e7b68; margin-bottom: 3px; }
.shot-section p { margin: 0; font-size: 11.5px; color: #4f5860; line-height: 1.65; }
.shot-section.pro p { color: #4b443d; font-weight: 560; }
.shot-question { padding: 9px 10px; border-radius: 10px; background: var(--orange-soft); color: #8a4b27; font-size: 11.5px; line-height: 1.62; }
.principle-list { display: flex; flex-wrap: wrap; gap: 5px; }
.principle-list span { background: var(--green-soft); color: var(--green); }
.shot-details {
  margin: 0 13px 13px;
  padding-top: 9px;
  border-top: 1px solid #eee6dc;
}
.shot-details summary {
  color: #75543b;
  font-size: 10px;
  font-weight: 760;
  cursor: pointer;
  list-style-position: inside;
}
.shot-details[open] summary { margin-bottom: 7px; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-top: 16px; }
.choice-card {
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: var(--white); padding: 0; text-align: left; cursor: pointer;
  color: var(--ink); display: flex; flex-direction: column; min-height: 100%;
}
.choice-card:hover { border-color: #cbb9a6; }
.choice-card.selected { border: 2px solid var(--green); box-shadow: 0 0 0 4px rgba(47,111,91,.08); }
.choice-card.blocked { opacity: .62; cursor: not-allowed; }
.choice-card.blocked:hover { border-color: var(--line); }
.choice-card img { width: 100%; height: 190px; object-fit: contain; background: #f1ece5; display: block; }
.choice-body { padding: 13px; }
.choice-body h3 { margin: 0 0 5px; font-size: 15px; }
.choice-meta { color: var(--muted); font-size: 10.5px; display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.choice-body p { margin: 0 0 7px; font-size: 11.5px; line-height: 1.62; color: #59616a; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.tag { display: inline-flex; padding: 3px 7px; border-radius: 999px; font-size: 9.5px; background: #f4f0ea; color: #6d655d; }
.tag.real { background: var(--green-soft); color: var(--green); }
.tag.local { background: #fff3dc; color: #84591b; }
.tag.direction { background: var(--orange-soft); color: #994b24; }

.reason-box { margin-top: 15px; padding: 14px; border-radius: 14px; background: #faf5ee; border: 1px solid var(--line); }
.reason-title { font-weight: 700; font-size: 13px; margin-bottom: 9px; }
.reference-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.reference-strip .ref-mini { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: white; }
.reference-strip .ref-mini.selected { outline: 2px solid var(--green); outline-offset: 1px; }
.reference-strip img { width: 100%; height: 110px; object-fit: contain; background: #f1ece5; display: block; }
.reference-strip span { display: block; padding: 6px 7px; font-size: 10px; color: var(--muted); }
.medium-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-top:16px; }
.medium-card { border:1px solid var(--line); border-radius:14px; background:white; padding:14px; text-align:left; cursor:pointer; font-family:inherit; color:var(--ink); min-height:138px; }
.medium-card:hover { border-color:#cbb9a6; }
.medium-card.selected { border:2px solid var(--green); box-shadow:0 0 0 4px rgba(47,111,91,.08); }
.medium-card b { display:block; font-size:16px; margin-bottom:6px; }
.medium-card p { color:#606870; font-size:11.5px; line-height:1.65; margin:0 0 8px; }
.medium-count { font-size:10px; color:var(--orange); font-weight:700; }
.crop-context { display:grid; grid-template-columns:180px minmax(0,1fr); gap:14px; align-items:center; margin:14px 0 18px; padding:10px; border-radius:14px; background:#f7f1e9; }
.crop-context img { width:100%; height:130px; object-fit:contain; border-radius:10px; background:#eae2d8; }
.crop-context h3 { margin:0 0 5px; }
.crop-context p { margin:0; color:var(--muted); font-size:11.5px; line-height:1.65; }
.style-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:11px; margin-top:14px; }
.style-skill-card { border:1px solid var(--line); border-radius:14px; background:white; overflow:hidden; display:flex; flex-direction:column; }
.style-skill-card.selected { border:2px solid var(--green); }
.style-skill-card > img { width:100%; height:190px; object-fit:contain; background:#f1ece5; }
.style-reference-missing {
  width: 100%; height: 190px; background: #f4eee6;
  display: grid; place-content: center; gap: 5px; text-align: center;
  color: var(--muted); font-size: 11px;
}
.style-reference-missing b { color: var(--ink); font-size: 14px; }
.style-skill-body { padding:12px; display:flex; flex-direction:column; gap:7px; flex:1; }
.style-skill-body h3 { margin:0; font-size:14px; }
.style-skill-body .family { color:var(--orange); font-size:10px; font-weight:700; }
.style-skill-body p { margin:0; color:#59616a; font-size:11px; line-height:1.6; }
.style-skill-body .btn { margin-top:auto; width:100%; }
.result-stage { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(250px,.8fr); gap:20px; align-items:start; }
.result-next-step {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.result-next-step > .btn { min-height: 48px; padding-inline: 20px; }
.result-adjustments { position: relative; }
.result-adjustments > summary {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.result-adjustments > summary::-webkit-details-marker { display: none; }
.result-adjustments[open] > summary { color: var(--ink); }
.result-adjustments .actions {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 12;
  width: min(320px, calc(100vw - 32px));
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 8px;
  border: 1px solid #d8cfc4;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 44px rgba(20,20,20,.16);
}
.result-adjustments:not([open]) .actions { display: none; }
.result-adjustments .btn { width: 100%; }
.result-media { min-width: 0; }
.result-media > img { width:100%; max-height:620px; object-fit:contain; border-radius:16px; background:#ebe5dd; display:block; }
.compare-strip { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:9px; }
.compare-strip figure { margin:0; border:1px solid var(--line); border-radius:11px; overflow:hidden; background:white; }
.compare-strip img { width:100%; height:118px; object-fit:contain; background:#f1ece5; display:block; }
.compare-strip figcaption { padding:6px 8px; color:var(--muted); font-size:10px; }
.result-info h2 { margin-top:0; }
.result-info p { color:#59616a; line-height:1.75; font-size:13px; }
.teaching-banner {
  display:grid; gap:3px; margin:14px 0; padding:12px 14px;
  border:1px solid #d4dfd6; border-radius:12px;
  background:#f2f7f1; color:#405446; font-size:12.5px; line-height:1.65;
}
.teaching-banner b { color:var(--green); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 9px; }
.chip { border: 1px solid #dfd4c7; border-radius: 999px; padding: 7px 10px; background: white; color: #5e574f; font-size: 11.5px; cursor: pointer; }
.chip.selected { background: var(--green); color: white; border-color: var(--green); }
.input, .textarea {
  width: 100%; border: 1px solid #ddd2c5; border-radius: 10px;
  background: white; padding: 10px 12px; color: var(--ink); font-size: 13px;
}
.textarea { min-height: 72px; resize: vertical; }

.loading-state, .wait-state, .done-state {
  min-height: 390px; border-radius: 18px; border: 1px solid var(--line);
  background: #fffaf4; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 30px; gap: 13px;
}
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid #eee3d6; border-top-color: var(--orange);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state.cinema-loading {
  position: relative;
  min-height: clamp(450px, 58vh, 610px);
  display: grid;
  grid-template-columns: minmax(215px, 280px) minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  overflow: hidden;
  padding: clamp(32px, 4vw, 58px) clamp(26px, 5vw, 70px);
  column-gap: clamp(30px, 5vw, 72px);
  text-align: left;
  background: #fafaf8;
}
.cinema-stage {
  position: relative;
  z-index: 1;
  width: min(270px, 100%);
  margin: 0;
  justify-self: end;
}
.cinema-loader-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.cinema-loader-svg .cinema-track {
  fill: none;
  stroke: #e3e3de;
  stroke-width: 1.2;
}
.cinema-loader-svg .cinema-progress {
  fill: none;
  stroke: #171717;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 18 82;
  animation: cinemaProgress 2.4s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.cinema-loader-svg .cinema-core {
  fill: #171717;
  animation: cinemaCore 2.4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.cinema-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}
.cinema-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 14px;
  color: #696963;
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 10.5px;
  font-weight: 680;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.cinema-copy h2 {
  max-width: 680px;
  margin: 0;
  color: #171717;
  font-size: clamp(27px, 2.6vw, 36px);
  font-weight: 790;
  line-height: 1.16;
  letter-spacing: -.05em;
  text-wrap: balance;
}
.cinema-wait-line {
  min-height: 3.3em;
  max-width: 620px;
  margin: 18px 0 0;
  color: #3e3e39;
  font-size: clamp(15px, 1.35vw, 17px);
  font-weight: 560;
  line-height: 1.68;
}
.cinema-wait-line.copy-in { animation: cinemaCopyIn .55s ease both; }
.cinema-detail {
  max-width: 620px;
  margin: 8px 0 0 18px;
  color: #858580;
  font-size: 12px;
  line-height: 1.62;
}
.cinema-detail p { margin: 3px 0; }
.cinema-reassurance {
  max-width: 620px;
  margin: 20px 0 0;
  padding: 11px 14px;
  border: 1px solid #e2e2dc;
  border-radius: 8px;
  background: #f2f2ee;
  color: #73736c;
  font-size: 12px;
  line-height: 1.65;
}
.cinema-actions {
  justify-content: flex-start;
  margin-top: 20px;
}
@keyframes cinemaProgress {
  to { transform: rotate(360deg); }
}
@keyframes cinemaCore {
  0%, 100% { transform: scale(.82); opacity: .64; }
  50% { transform: scale(1); opacity: 1; }
}
@keyframes cinemaCopyIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
.error-banner, .warning-banner {
  padding: 12px 14px; border-radius: 12px; font-size: 12.5px; line-height: 1.65;
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
.error-banner > span, .warning-banner > span { min-width: 0; }
.error-banner { color: var(--danger); background: #fff0ed; border: 1px solid #efc8bf; }
.warning-banner { color: #80551d; background: #fff7e6; border: 1px solid #ecd5a2; }
.warning-banner.connection-banner {
  width: fit-content;
  max-width: min(680px, 100%);
  min-height: 42px;
  margin-inline: auto;
  padding: 7px 8px 7px 13px;
  border-color: #ded7cb;
  background: #f8f6f1;
  color: var(--muted);
}
.connection-banner .btn { min-height: 32px; padding: 4px 10px; }

.slideshow { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; }
.slide {
  aspect-ratio: 16 / 9; padding: 0;
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 0; align-items: stretch; overflow: hidden;
  background: #fffaf4;
}
.slide.no-media { grid-template-columns: 1fr; }
.slide.slide-rendered {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 1.4vw, 18px);
  background: #ece7df;
}
.slide.slide-rendered img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.slide-render-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  align-items: stretch;
  overflow: hidden;
  background: #fffaf4;
}
.slide-render-fallback[hidden] { display: none; }
.slide-render-fallback.no-media { grid-template-columns: 1fr; }
.slide-image-note {
  position: absolute;
  inset: 18px;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
  background: #eee8df;
}
.slide-image-note[hidden] { display: none; }
.slide-copy {
  min-width: 0;
  align-self: center;
  padding: clamp(24px, 4vw, 48px);
}
.slide .eyebrow { color: var(--orange); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.slide h2 { margin: 7px 0 6px; font-size: clamp(20px, 3vw, 32px); letter-spacing: -.03em; }
.slide .subtitle { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.slide ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.slide li { display: flex; gap: 8px; font-size: clamp(12px, 1.4vw, 15px); line-height: 1.65; }
.slide li::before { content: ""; flex: 0 0 6px; height: 6px; margin-top: .58em; border-radius: 50%; background: var(--orange); }
.slide-visual {
  position: relative;
  min-width: 0;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #eee8df;
}
.slide-visual img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-visual figcaption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  max-width: calc(100% - 28px);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  color: #55554f;
  font-size: 9.5px;
  line-height: 1.35;
  backdrop-filter: blur(8px);
}
.slide-controls { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-top: 1px solid var(--line); background: #fffdf9; }
.slide-count { font-size: 11.5px; color: var(--muted); }
.dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.dot-btn { width: 7px; height: 7px; border: 0; padding: 0; border-radius: 50%; background: #d9cec1; cursor: pointer; }
.dot-btn.active { background: var(--orange); transform: scale(1.25); }

.handoff-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 20px);
  margin-top: 18px;
  align-items: stretch;
}
.handoff-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: 0 10px 28px rgba(20, 20, 20, .045);
}
.handoff-media {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  margin: 0;
  overflow: hidden;
  background: #f2ece4;
}
.handoff-media img,
.handoff-placeholder {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.handoff-placeholder {
  display: grid;
  place-items: center;
  text-align: center;
}
.handoff-media figcaption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  color: #55554f;
  font-size: 9.5px;
  font-weight: 650;
  backdrop-filter: blur(8px);
}
.handoff-card .body { padding: 15px 17px 17px; flex: 1; }
.handoff-card h3 { margin: 0 0 5px; font-size: 16px; letter-spacing: -.02em; }
.handoff-card p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.6; }

.drawing-mode-modal,
.lesson-player-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(20, 20, 18, .62);
  backdrop-filter: blur(8px);
}
.lesson-player-modal { z-index: 140; }
.drawing-mode-modal.open,
.lesson-player-modal.open { display: grid; }
body.lesson-player-open { overflow: hidden; overscroll-behavior: none; }
body.lesson-player-open .board-canvas-wrap,
body.lesson-player-open .companion-fab { pointer-events: none; }
.drawing-mode-box {
  width: min(920px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: clamp(18px, 3vw, 30px);
  border-radius: 22px;
  background: #fafaf8;
  box-shadow: 0 30px 100px rgba(0, 0, 0, .32);
}
.drawing-mode-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.drawing-mode-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.drawing-mode-card {
  min-height: 190px;
  padding: 22px;
}
.drawing-mode-card:hover {
  border-color: #aaa9a2;
  box-shadow: 0 14px 30px rgba(20, 20, 20, .08);
}
.drawing-mode-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 50%;
  background: var(--ink);
  color: white;
}
.drawing-mode-icon .svg-icon { width: 22px; height: 22px; }
.drawing-mode-card strong { display: block; font-size: 24px; letter-spacing: -.04em; }
.drawing-mode-card p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.lesson-player-box {
  width: min(1240px, 100%);
  max-height: 94vh;
  overflow: auto;
  border-radius: 20px;
  padding: 14px;
  background: #f7f7f4;
  box-shadow: 0 30px 100px rgba(0, 0, 0, .34);
}
.lesson-player-head,
.lesson-player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 4px 12px;
}
.lesson-player-head > div { display: flex; align-items: baseline; gap: 10px; }
.lesson-player-head span { color: var(--muted); font-size: 11px; }
.lesson-player-box .slide { border-radius: 13px; }
.lesson-player-controls { padding: 12px 4px 2px; }

.hand-drawing-head,
.board-workbench-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.hand-drawing-head h1,
.board-workbench-head h1 { margin: 5px 0 0; }
.hand-lesson-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 12px 0 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ece8e0;
  color: white;
  cursor: pointer;
}
.hand-lesson-stage img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.hand-lesson-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(18,18,16,.06), rgba(18,18,16,.58));
}
.hand-play-button {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: #171717;
  transform: translate(-50%, -58%);
  box-shadow: 0 18px 50px rgba(0,0,0,.22);
}
.hand-play-button svg { width: 28px; height: 28px; fill: currentColor; }
.hand-play-copy {
  position: absolute;
  left: 50%;
  bottom: 13%;
  transform: translateX(-50%);
  display: grid;
  gap: 3px;
  text-align: center;
}
.hand-play-copy b { font-size: 22px; }
.hand-play-copy small { color: rgba(255,255,255,.76); font-size: 11px; }

body.board-mode .topbar,
body.board-mode .stepper,
body.board-mode .hero-note,
body.board-mode .companion-fab { display: none; }
body.drawing-stage .stepper,
body.drawing-stage .stepper-help,
body.drawing-stage .hero-note,
body.drawing-stage .course-brief { display: none; }
.page.board-workbench { width: min(100%, 1800px); padding-top: 8px; padding-bottom: 18px; }
.page.board-workbench .panel { padding: 12px; border-radius: 16px; }
.board-workbench-head { align-items: flex-end; margin-bottom: 7px; }
.board-workbench-head h1 { margin-top: 2px; font-size: clamp(24px, 2.6vw, 34px); }
.board-workbench-head .fine { margin-top: 4px; margin-bottom: 0; font-size: 10.5px; }
.board-workbench-head .actions {
  margin-top: 0;
  align-items: center;
  justify-content: flex-end;
}
.board-pressure {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid #d6cec3;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.board-ppt-tray {
  padding: 7px 9px 6px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}
.board-ppt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.board-ppt-head > div:first-child { display: grid; gap: 2px; }
.board-ppt-head b { font-size: 12px; }
.board-ppt-head span { color: var(--muted); font-size: 9.5px; }
.board-reference-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.board-mini-action {
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid #d4ccc1;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.board-mini-action:hover { border-color: #a89f94; }
.board-mini-action:focus-visible { outline: 3px solid rgba(30,37,44,.18); outline-offset: 2px; }
.board-mini-action:disabled { color: #9b9b95; cursor: default; background: #f2f1ed; }
.board-courseware-open {
  border-color: #252521;
  background: #252521;
  color: #fff;
}
.board-courseware-open:hover { border-color: #252521; background: #3c3c36; }
.board-flow {
  display: grid;
  grid-template-columns: minmax(170px, 0.45fr) minmax(0, 1.55fr);
  align-items: center;
  gap: 12px;
  margin-top: 7px;
  padding: 8px 9px;
  border: 1px solid #d8d0c5;
  border-radius: 13px;
  background: #fffdf9;
}
.board-flow-title {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.board-flow-title span,
.board-flow-title small {
  color: #7a5b42;
  font-size: 9px;
}
.board-flow-title b {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-flow-nav {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.board-flow-arrow,
.board-flow-open,
.board-flow-steps button {
  min-height: 44px;
  border: 1px solid #d4ccc1;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.board-flow-steps {
  display: grid;
  grid-template-columns: repeat(9, minmax(30px, 1fr));
  gap: 4px;
  min-width: 0;
}
.board-flow-steps button {
  min-width: 0;
  padding: 0 3px;
}
.board-flow-steps button.active {
  border-color: #252521;
  background: #252521;
  color: #fff;
}
.board-flow-arrow:disabled,
.board-flow-steps button:disabled {
  opacity: .38;
  cursor: default;
}
.board-flow-open {
  padding: 0 12px;
  border-color: #c8b8a7;
  background: #f2ece4;
}
.board-slide-strip {
  display: flex;
  gap: 7px;
  margin-top: 7px;
  padding-bottom: 2px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.board-slide-thumb {
  position: relative;
  flex: 0 0 118px;
  min-height: 82px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafaf8;
  color: var(--ink);
  cursor: grab;
}
.board-slide-thumb:active { cursor: grabbing; }
.board-slide-open {
  position: relative;
  flex: 1;
  min-height: 58px;
  padding: 6px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 4px;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.board-slide-open:focus-visible,
.board-slide-use:focus-visible {
  outline: 3px solid rgba(30,37,44,.2);
  outline-offset: -3px;
}
.board-slide-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: .14;
}
.board-slide-no,
.board-slide-copy { position: relative; z-index: 1; }
.board-slide-no { color: #8b5d3f; font-family: "SFMono-Regular", monospace; font-size: 9px; }
.board-slide-copy { align-self: end; }
.board-slide-copy b {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 10px;
  line-height: 1.35;
}
.board-slide-copy small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #777770;
  font-size: 8px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.board-slide-use {
  min-height: 24px;
  border: 0;
  border-top: 1px solid var(--line);
  background: #f2efe8;
  color: #6b523f;
  font-size: 8.5px;
  font-weight: 750;
  cursor: pointer;
}
.board-slide-use:hover { background: #e9e2d8; }
.board-editor {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr) 202px;
  gap: 10px;
  margin-top: 10px;
  height: clamp(520px, calc(100dvh - 168px), 940px);
  min-height: 0;
}
.board-toolbar,
.board-layers-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.board-toolbar { overflow-y: auto; overscroll-behavior: contain; }
.board-layers-panel { overflow-y: auto; }
.board-panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.board-panel-heading b { font-size: 12px; }
.board-panel-heading span { color: var(--muted); font-size: 8.5px; text-align: right; line-height: 1.35; }
.board-panel-heading.compact { margin-top: 3px; }
.board-brush-current {
  min-height: 54px;
  width: 100%;
  padding: 6px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  border: 1px solid #cfc7bb;
  border-radius: 10px;
  background: #fffdf8;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.board-brush-current:hover { border-color: #8f887e; }
.board-brush-current:focus-visible { outline: 3px solid rgba(30,37,44,.2); outline-offset: 2px; }
.board-brush-current-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #efede7;
}
.board-brush-current-icon img { width: 34px; height: 34px; object-fit: contain; image-rendering: auto; }
.board-brush-current > span:nth-child(2) { min-width: 0; display: grid; gap: 1px; }
.board-brush-current b,
.board-brush-current small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-brush-current b { font-size: 10.5px; }
.board-brush-current small { color: var(--muted); font-size: 8px; }
.board-brush-current em {
  padding: 5px 7px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 8.5px;
  font-style: normal;
  font-weight: 750;
}
.board-tool-group { display: grid; grid-template-columns: 1fr; gap: 5px; }
.board-tool-group.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.board-tool-group-secondary { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.board-tool {
  min-height: 46px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafaf8;
  color: var(--ink);
  cursor: pointer;
}
.board-tool b { font-size: 10.5px; font-weight: 750; }
.board-tool small { color: #8a8a83; font-size: 8.5px; font-weight: 700; }
.board-tool:hover { border-color: #aaa297; background: #fff; }
.board-tool.active { background: var(--ink); border-color: var(--ink); color: white; }
.board-tool.active small { color: rgba(255,255,255,.66); }
.board-tool.danger { color: var(--danger); }
.board-tool:disabled { cursor: default; color: #aaa9a3; background: #f1f0ec; }
.board-tool:focus-visible,
.board-mini-action:focus-visible,
.board-zoom-controls button:focus-visible,
.board-layer-select:focus-visible,
.board-layer-eye:focus-visible,
.board-swatches button:focus-visible {
  outline: 3px solid rgba(30,37,44,.2);
  outline-offset: 2px;
}
.board-control { display: grid; gap: 5px; color: var(--muted); font-size: 9.5px; font-weight: 650; }
.board-control input[type="color"] { width: 100%; height: 40px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.board-control input[type="range"] { width: 100%; min-height: 30px; accent-color: #252521; }
.board-swatches {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}
.board-swatches button {
  width: 100%;
  min-width: 0;
  aspect-ratio: 1;
  border: 2px solid #d5cec4;
  border-radius: 50%;
  background: var(--swatch);
  cursor: pointer;
}
.board-swatches button.active { border-color: var(--ink); transform: scale(.88); }
.board-canvas-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.board-canvas-bar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px 7px 12px;
  border-bottom: 1px solid var(--line);
}
.board-canvas-bar > div:first-child { display: grid; gap: 1px; }
.board-canvas-bar b { font-size: 11px; }
.board-save-status { color: var(--muted); font-size: 8.5px; }
.board-save-status[data-state="saving"] { color: #7b5a25; }
.board-save-status[data-state="saved"] { color: var(--green); }
.board-save-status[data-state="error"] { color: var(--danger); font-weight: 750; }
.board-zoom-controls { display: flex; align-items: center; gap: 4px; }
.board-zoom-controls button {
  min-width: 44px;
  min-height: 44px;
  padding: 5px 8px;
  border: 1px solid #d5cec4;
  border-radius: 8px;
  background: #faf9f6;
  color: var(--ink);
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}
.board-canvas-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background-color: #e6e1d8;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,.42) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,.42) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,.42) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.42) 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}
.board-canvas-wrap canvas {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  max-height: none;
  touch-action: none;
  cursor: crosshair;
  box-shadow: 0 18px 52px rgba(31, 26, 20, .24);
  will-change: transform;
}
.board-canvas-help {
  min-height: 38px;
  margin: 0;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}
.board-layer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafaf7;
}
.board-layer-row.active { border-color: #7f7f77; background: #fff; box-shadow: 0 5px 16px rgba(30,30,28,.06); }
.board-layer-select {
  min-width: 0;
  min-height: 46px;
  padding: 4px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.board-layer-index {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #e9e4da;
  color: #6d645a;
  font-size: 9px;
  font-weight: 800;
}
.board-layer-row.active .board-layer-index { background: var(--ink); color: white; }
.board-layer-select > span:last-child { min-width: 0; display: grid; gap: 1px; }
.board-layer-select b { overflow: hidden; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.board-layer-select small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.board-layer-eye {
  min-width: 42px;
  min-height: 44px;
  padding: 4px 6px;
  border: 1px solid #d8d1c6;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 8.5px;
  cursor: pointer;
}
.board-layer-eye[aria-pressed="true"] { color: var(--green); border-color: #c7d9d0; background: var(--green-soft); }
.board-layer-opacity { margin-top: 3px; }
.board-reference-panel {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.board-reference-panel .board-mini-action { width: 100%; }

.board-brush-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(20, 20, 18, .62);
  backdrop-filter: blur(8px);
}
.board-brush-modal.open { display: grid; }
.board-brush-dialog {
  width: min(1120px, 100%);
  max-height: 90vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px;
  overflow: hidden;
  border-radius: 20px;
  background: #fafaf8;
  box-shadow: 0 30px 100px rgba(0, 0, 0, .32);
}
.board-brush-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.board-brush-dialog-head h2 { margin: 0; font-size: 25px; letter-spacing: -.04em; }
.board-brush-dialog-head p { max-width: 760px; margin: 5px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.65; }
.board-brush-categories {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.board-brush-categories button {
  min-height: 40px;
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid #d6cec4;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.board-brush-categories button span { margin-left: 4px; color: var(--muted); font-size: 8px; }
.board-brush-categories button.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.board-brush-categories button.active span { color: rgba(255,255,255,.65); }
.board-brush-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  overflow-y: auto;
  padding: 2px 4px 10px 2px;
  overscroll-behavior: contain;
}
.board-brush-item {
  min-width: 0;
  min-height: 128px;
  padding: 7px;
  display: grid;
  grid-template-rows: 78px auto auto;
  gap: 2px;
  border: 1px solid #ded7cc;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.board-brush-item:hover { border-color: #8d877e; transform: translateY(-1px); }
.board-brush-item.active { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.board-brush-item:focus-visible { outline: 3px solid rgba(30,37,44,.2); outline-offset: 2px; }
.board-brush-item-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  background: #f0eee8;
}
.board-brush-item-preview img { width: 72px; height: 72px; object-fit: contain; }
.board-brush-item b { overflow: hidden; font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.board-brush-item small { color: var(--muted); font-size: 8px; }
.board-brush-empty { margin: 20px; color: var(--muted); font-size: 12px; }
.board-brush-source { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }

@media (max-width: 1120px) {
  .board-editor { grid-template-columns: 164px minmax(0, 1fr) 182px; }
  .board-tool b { font-size: 10px; }
}

@media (max-width: 900px) {
  .board-editor {
    grid-template-columns: 1fr;
    grid-template-areas:
      "canvas"
      "tools"
      "layers";
    height: auto;
  }
  .board-toolbar { grid-area: tools; overflow: visible; }
  .board-canvas-panel { grid-area: canvas; height: min(74dvh, 760px); min-height: 520px; }
  .board-layers-panel { grid-area: layers; overflow: visible; }
  .board-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); }
  .board-toolbar > .board-tool-group:not(.board-tool-group-secondary) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .board-toolbar > .board-tool-group.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .board-tool-group-secondary { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; }
  .board-color-control { grid-template-columns: 80px minmax(0, 1fr); align-items: center; }
  .board-swatches { max-width: 390px; }
  .board-layers-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, .65fr); align-items: start; }
  .board-layers-panel .board-panel-heading:first-child { grid-column: 1; grid-row: 1; }
  .board-layers-panel #boardLayerList { grid-column: 1; grid-row: 2; }
  .board-layers-panel .board-layer-opacity { grid-column: 2; grid-row: 1; align-self: end; }
  .board-layers-panel .board-reference-panel { grid-column: 2; grid-row: 2; align-self: start; }
  .board-brush-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.waiting-games-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(18, 18, 16, .62);
  backdrop-filter: blur(8px);
}
.waiting-games-modal.open { display: grid; }
.waiting-games-box {
  position: relative;
  width: min(1080px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: clamp(18px, 3vw, 30px);
  border-radius: 22px;
  background: #fafaf8;
  box-shadow: 0 30px 100px rgba(0, 0, 0, .34);
}
.waiting-games-head {
  position: relative;
  display: block;
  padding-right: 96px;
  margin-bottom: 18px;
}
.waiting-games-head > .btn {
  position: absolute;
  top: 0;
  right: 0;
}
.waiting-games-copy {
  width: min(760px, 100%);
  margin: 0 auto;
  text-align: center;
}
.waiting-production-note {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #7a5b42;
  font-size: 11px;
  line-height: 1.5;
}
.waiting-production-icon {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #f3ece4;
  color: #9a5a32;
}
.waiting-production-icon::after {
  position: absolute;
  inset: -3px;
  border: 1.5px solid transparent;
  border-top-color: #b76b3e;
  border-right-color: rgba(183, 107, 62, .35);
  border-radius: 50%;
  content: "";
  animation: waiting-production-spin 1.8s linear infinite;
}
.waiting-production-icon .svg-icon {
  width: 20px;
  height: 20px;
}
@keyframes waiting-production-spin {
  to { transform: rotate(360deg); }
}
.waiting-games-head h2 { margin: 5px 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.05em; }
.waiting-games-head p { margin: 0; color: var(--muted); font-size: 12px; }
.waiting-games-menu {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.waiting-game-card {
  min-height: 154px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.waiting-game-card:hover {
  border-color: #aaa9a2;
  box-shadow: 0 12px 24px rgba(20, 20, 20, .07);
  transform: translateY(-1px);
}
.waiting-game-source {
  display: block;
  color: #8c8c85;
  font-family: "SFMono-Regular", monospace;
  font-size: 8px;
  line-height: 1.4;
}
.waiting-game-card strong { display: block; margin-top: 16px; font-size: 18px; letter-spacing: -.03em; }
.waiting-game-card p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.waiting-game-library-toggle {
  min-height: 74px; border: 1px dashed #cfc8bd; border-radius: 16px;
  padding: 12px; background: #f4f0e9; color: var(--ink); cursor: pointer;
  display: grid; place-content: center; gap: 4px; text-align: center;
  font: inherit; font-size: 13px; font-weight: 750;
}
.waiting-game-library-toggle span { color: var(--muted); font-size: 10.5px; font-weight: 500; }
.waiting-game-head { display: flex; align-items: center; gap: 14px; margin-bottom: 13px; }
.waiting-game-head > div { display: grid; gap: 3px; }
.waiting-game-head span { color: var(--muted); font-size: 11px; }
.mini-game-status { margin-bottom: 10px; color: #686861; font-size: 12px; text-align: center; }
.mini-game-status + button, #waitingGameMount > .btn { margin-top: 12px; }
.mini-grid.three { display: grid; grid-template-columns: repeat(3, 88px); justify-content: center; gap: 6px; margin: 10px 0; }
.mini-board-cell { width: 88px; height: 88px; border: 1px solid #d8d8d2; border-radius: 10px; background: #fff; color: var(--ink); font-size: 34px; font-weight: 750; cursor: pointer; }
.mini-board-cell.win { background: #171717; color: #fff; }
.gomoku-board { display: grid; grid-template-columns: repeat(9, 38px); justify-content: center; background: #eadfcb; padding: 7px; border-radius: 10px; }
.gomoku-board button { width: 38px; height: 38px; border: 0; border-right: 1px solid #aa9879; border-bottom: 1px solid #aa9879; background: transparent; font-size: 27px; line-height: 1; cursor: pointer; }
.gomoku-board button.black { color: #171717; }
.gomoku-board button.white { color: #fff; text-shadow: 0 0 1px #555; }
.connect-board { display: grid; grid-template-columns: repeat(7, 48px); justify-content: center; gap: 4px; padding: 8px; border-radius: 12px; background: #efefeb; }
.connect-board > button { width: 48px; height: 32px; border: 0; border-radius: 999px; background: transparent; color: #555; cursor: pointer; }
.connect-board > span { width: 48px; height: 48px; display: block; border-radius: 50%; background: #fff; border: 1px solid #d9d9d3; }
.connect-board > span.red { background: #b34d40; border-color: #b34d40; }
.connect-board > span.yellow { background: #d6b241; border-color: #d6b241; }
.mini-2048 { display: grid; grid-template-columns: repeat(4, 74px); justify-content: center; gap: 6px; }
.mini-2048 span { width: 74px; height: 74px; display: grid; place-items: center; border-radius: 9px; background: #eeeee9; color: #171717; font-weight: 750; }
.mini-2048 span:not([class="tile-0"]) { background: #d8c7a9; }
.mini-arrow-pad { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.mini-arrow-pad button { width: 52px; height: 44px; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; }
.memory-grid { display: grid; grid-template-columns: repeat(4, 82px); justify-content: center; gap: 7px; }
.memory-grid button { width: 82px; height: 82px; border: 1px solid #d8d8d2; border-radius: 10px; background: #171717; color: white; font-size: 28px; cursor: pointer; }
.memory-grid button.done { background: #d7c8af; color: #171717; }
.mini-sudoku { width: 300px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); border: 2px solid #171717; }
.mini-sudoku span, .mini-sudoku input { aspect-ratio: 1; border: 1px solid #d4d4ce; background: #fff; text-align: center; font-size: 25px; font-weight: 700; }
.slide-grid { width: 306px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.slide-grid button { aspect-ratio: 1; border: 1px solid #d6d6d0; border-radius: 9px; background: #fff; font-size: 24px; font-weight: 700; cursor: pointer; }
.slide-grid button.empty { background: #e8e7e1; border-color: transparent; }
.mine-grid { width: 330px; margin: 0 auto; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.mine-grid button { aspect-ratio: 1; border: 1px solid #d2d2cc; border-radius: 6px; background: #fff; font-size: 17px; font-weight: 700; cursor: pointer; }
.mine-grid button.open { background: #f0efea; cursor: default; }
.difference-grid { width: min(420px, 100%); margin: 0 auto; display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.difference-grid button { aspect-ratio: 1; border: 0; border-radius: 5px; cursor: pointer; }
.simon-pad { width: min(330px, 100%); margin: 0 auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.simon-pad button { aspect-ratio: 1; border: 1px solid #d4d4ce; border-radius: 16px; cursor: pointer; opacity: .55; transition: opacity .12s, transform .12s; }
.simon-pad button.lit { opacity: 1; transform: scale(.97); }
.simon-0 { background: #b45045; }.simon-1 { background: #d0ae45; }.simon-2 { background: #537565; }.simon-3 { background: #58729a; }
.mini-win { padding: 40px 20px; text-align: center; font-size: 24px; font-weight: 750; }
.waiting-games-countdown {
  position: sticky;
  bottom: -30px;
  z-index: 2;
  margin: 16px -30px -30px;
  padding: 18px 24px;
  background: #171717;
  color: white;
  text-align: center;
}
.waiting-games-countdown b { display: block; font-size: 18px; }
.waiting-games-countdown span { display: block; margin-top: 4px; color: rgba(255,255,255,.72); font-size: 12px; }
.material-wait-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.material-wait-head h1 { margin: 5px 0 6px; }
.material-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.material-review-grid article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.material-review-grid article > span { color: var(--muted); font-size: 10px; font-weight: 750; }
.material-review-grid img {
  width: 100%;
  height: 190px;
  margin: 8px 0;
  border-radius: 10px;
  object-fit: contain;
  background: #f1eee8;
}
.material-review-grid b { display: block; font-size: 15px; }
.material-review-grid p { margin: 5px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.65; }
.student-job-card {
  max-width: 620px;
  margin: 0 0 12px 18px;
  padding: 11px 13px;
  border: 1px solid #e2e2dc;
  border-radius: 9px;
  background: #fff;
  text-align: left;
}
.student-job-card > div:first-child { display: flex; justify-content: space-between; gap: 12px; font-size: 11.5px; }
.student-job-card p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.student-job-progress { height: 4px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: #e8e8e3; }
.student-job-progress i { display: block; height: 100%; border-radius: inherit; background: #171717; transition: width .3s ease; }

/* Teacher */
.teacher-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr) 350px; gap: 16px; align-items: start; }
.sidebar-panel, .main-panel, .detail-panel {
  background: rgba(255,253,249,.95); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); padding: 16px;
}
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.section-title h2, .section-title h3 { margin: 0; }
.student-list { display: grid; gap: 8px; }
.student-row {
  border: 1px solid var(--line); border-radius: 13px; padding: 11px;
  display: flex; justify-content: space-between; gap: 9px; cursor: pointer; background: white;
}
.student-row:hover { border-color: #cdbca9; }
.student-row.selected { border: 2px solid var(--green); }
.student-row strong { display: block; font-size: 13px; }
.student-row small { color: var(--muted); font-size: 10.5px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #c7bfb6; margin-top: 4px; flex: 0 0 auto; }
.status-dot.ready { background: var(--green); }
.status-dot.waiting { background: var(--yellow); }
.status-dot.teacher { background: var(--orange); }
.status-dot.drawing { background: #5b79b7; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-bottom: 14px; }
.stat { background: white; border: 1px solid var(--line); border-radius: 13px; padding: 12px; }
.stat b { display: block; font-size: 22px; margin-top: 3px; }
.stat span { color: var(--muted); font-size: 12px; }
.control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.detail-block { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.detail-block:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.student-now-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.student-now-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.student-now-head > div { display: grid; gap: 2px; }
.student-now-head span { color: var(--muted); font-size: 12px; font-weight: 700; }
.student-now-head h3 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.student-intervention { margin: 8px 0 0; color: #7a5225; font-size: 12px; font-weight: 700; }
.student-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 13px;
}
.student-choice-grid > div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border-radius: 10px;
  background: #f6f4ef;
}
.student-choice-grid span { color: var(--muted); font-size: 12px; }
.student-choice-grid b { font-size: 13px; line-height: 1.45; }
.student-reasons,
.student-share,
.student-tech-detail {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.student-reasons > summary,
.student-share > summary,
.student-tech-detail > summary {
  min-height: 36px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.student-reasons p,
.student-tech-detail p { margin: 5px 0 0; font-size: 12px; line-height: 1.65; }
.student-share .copy-actions { margin-top: 4px; }
.teacher-view-tabs {
  position: sticky;
  top: 66px;
  z-index: 24;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(1180px, calc(100% - 32px));
  margin: 12px auto 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 249, .95);
  box-shadow: 0 10px 30px rgba(20,20,20,.06);
  backdrop-filter: blur(14px);
}
.teacher-view-tab {
  min-width: 0;
  min-height: 52px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 7px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}
.teacher-view-tab span { color: inherit; font-size: 13px; font-weight: 800; }
.teacher-view-tab small { overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.teacher-view-tab:hover { background: #f5f2ed; color: var(--ink); }
.teacher-view-tab.active { background: var(--ink); color: white; }
.teacher-view-tab.active small { color: rgba(255,255,255,.66); }
.teacher-view-tab:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.teacher-shell { position: relative; }
.teacher-view[hidden] { display: none; }
.teacher-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(270px, .65fr);
  gap: 14px;
  align-items: start;
}
.teacher-overview-main,
.teacher-overview-side { padding: 20px; }
.teacher-overview-main .stats { margin-bottom: 16px; }
.teacher-overview-side { position: sticky; top: 140px; }
.teacher-rituals { display: grid; gap: 0; margin: 8px 0 18px; padding: 0; list-style: none; counter-reset: ritual; }
.teacher-rituals li {
  counter-increment: ritual;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 2px 9px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.teacher-rituals li::before {
  grid-row: 1 / span 2;
  content: counter(ritual);
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-size: 10px;
  font-weight: 800;
}
.teacher-rituals b { font-size: 13px; }
.teacher-rituals span { color: var(--muted); font-size: 12px; line-height: 1.6; }
.teacher-enter-btn { width: 100%; min-height: 46px; }
.overview-roster { display: grid; gap: 0; border-top: 1px solid var(--line); }
.overview-student-line {
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(110px, .7fr) auto minmax(90px, 1fr) minmax(80px, auto);
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 9px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.overview-student-line:hover { background: #faf8f4; }
.overview-student-line:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.overview-student-line > span:first-child { display: grid; gap: 2px; }
.overview-student-line b { font-size: 13px; }
.overview-student-line small,
.overview-student-line em { color: var(--muted); font-size: 10.5px; font-style: normal; }
.overview-progress { height: 5px; overflow: hidden; border-radius: 99px; background: #e5e1da; }
.overview-progress i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.exception-queue { display: grid; gap: 8px; margin-top: 12px; }
.exception-item {
  width: 100%;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e2cfba;
  border-radius: 12px;
  background: #fff9f2;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.exception-item:hover { border-color: #c89c75; background: #fff6ec; }
.exception-item span { display: grid; gap: 3px; min-width: 0; }
.exception-item b { font-size: 14px; }
.exception-item small { color: #725b47; font-size: 12px; line-height: 1.5; }
.exception-item em { flex: 0 0 auto; color: var(--orange); font-size: 12px; font-style: normal; font-weight: 800; }
.exception-empty {
  display: grid;
  justify-items: start;
  gap: 5px;
  padding: 20px 16px;
  border: 1px solid #d8e3db;
  border-radius: 14px;
  background: var(--green-soft);
}
.exception-empty > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-weight: 800;
}
.exception-empty b { font-size: 14px; }
.exception-empty p { margin: 0; color: #526258; font-size: 12px; line-height: 1.6; }
.class-command-head,
.after-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.class-command-head h2,
.after-head h2 { margin: 0; font-size: 28px; letter-spacing: -.04em; }
.class-command-head p,
.after-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.draft-review-control { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.student-card-grid,
.after-student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.student-card,
.after-student-card {
  min-width: 0;
  min-height: 148px;
  display: grid;
  align-content: space-between;
  gap: 7px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,253,249,.96);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 24px rgba(20,20,20,.045);
  cursor: pointer;
}
.student-card:hover,
.after-student-card:hover { border-color: #b9afa2; transform: translateY(-1px); }
.student-card:focus-visible,
.after-student-card:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.student-card.selected { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), 0 10px 28px rgba(20,20,20,.07); }
.student-card-top,
.after-card-title,
.student-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.student-card-top b,
.after-card-title b { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.student-card > strong { font-size: 20px; letter-spacing: -.035em; }
.student-card > small,
.after-student-card > small { color: var(--muted); font-size: 12px; line-height: 1.55; }
.student-card-foot { color: var(--muted); font-size: 12px; }
.student-card-foot span:last-child { color: var(--ink); font-weight: 700; }
.teacher-command-bar {
  position: sticky;
  bottom: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(150px, .45fr) minmax(0, 1.55fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid #c8c0b6;
  border-radius: 15px;
  background: rgba(255, 253, 249, .97);
  box-shadow: 0 18px 48px rgba(20,20,20,.14);
  backdrop-filter: blur(16px);
}
.command-selected { display: grid; gap: 2px; min-width: 0; }
.command-selected span { color: var(--muted); font-size: 12px; font-weight: 700; }
.command-selected b { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.command-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.command-actions .btn { min-height: 44px; }
.teacher-control-more { position: relative; }
.teacher-control-more > summary {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.teacher-control-more > summary::-webkit-details-marker { display: none; }
.teacher-control-more > summary::after { content: " ▾"; color: var(--muted); }
.teacher-control-more[open] > summary::after { content: " ▴"; }
.teacher-control-more-actions {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: 210px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #d5ccc0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(20,20,20,.16);
}
.teacher-control-more-actions .btn { width: 100%; }
.teacher-advanced {
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.55);
}
.teacher-advanced > summary,
.drawer-section > summary,
.drawer-chat > summary,
.drawer-events > summary {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}
.teacher-advanced .control-field-row { margin-top: 8px; }
.after-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.after-summary span { padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--muted); font-size: 10.5px; }
.after-summary b { color: var(--ink); font-size: 13px; }
.after-student-card { min-height: 164px; }
.after-student-card > strong { font-size: 15px; }
.after-card-link { margin-top: 8px; color: var(--green); font-size: 11px; font-weight: 750; }
.teacher-student-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  width: min(440px, calc(100% - 18px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-left: 1px solid var(--line);
  background: var(--paper);
  box-shadow: -22px 0 60px rgba(20,20,20,.18);
  transform: translateX(102%);
  transition: transform 190ms ease-out;
}
.teacher-student-drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,253,249,.98);
}
.drawer-head span { color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.drawer-head h2 { margin: 2px 0 0; font-size: 23px; }
.drawer-body { overflow: auto; padding: 18px; overscroll-behavior: contain; }
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(19,18,16,.34);
  backdrop-filter: blur(2px);
}
.drawer-scrim[hidden] { display: none; }
body.drawer-open { overflow: hidden; }
.drawer-chat,
.drawer-events {
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.drawer-chat[open] > summary { margin-bottom: 5px; }
.drawer-section { padding: 11px 0 0; }
.drawer-section > summary { justify-content: space-between; }
.drawer-section-body { padding-top: 10px; }
.drawer-subtitle { margin-top: 16px; }
.student-reason {
  margin-top: 9px;
  padding: 10px 11px;
  border-radius: 9px;
  background: #f2f0eb;
}
.student-reason b { font-size: 10.5px; }
.student-reason p { margin: 4px 0 0; color: #55554f; font-size: 12px; line-height: 1.65; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 11.5px; }
.kv span:first-child { color: var(--muted); }
.courseware-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: white; margin-top: 8px; }
.courseware-item .top { display: flex; justify-content: space-between; gap: 8px; }
.courseware-item strong { font-size: 12px; }
.courseware-item small { color: var(--muted); font-size: 10px; }
.courseware-item .tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.preview-modal {
  position: fixed; inset: 0; z-index: 60; display: none; place-items: center;
  background: rgba(25,22,18,.58); backdrop-filter: blur(5px); padding: 18px;
}
.preview-modal.open { display: grid; }
.preview-modal .box { width: min(1000px, 100%); max-height: 92vh; overflow: auto; background: var(--paper); border-radius: 20px; padding: 18px; box-shadow: 0 25px 80px rgba(0,0,0,.3); }
.preview-actions { display: flex; align-items: center; gap: 8px; }
.courseware-editor { display: grid; gap: 12px; }
.courseware-editor-toolbar {
  display: flex; align-items: end; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 13px; background: white;
}
.courseware-editor-toolbar label { display: grid; gap: 5px; min-width: 160px; color: var(--muted); font-size: 11px; font-weight: 650; }
.courseware-editor-note { color: var(--muted); font-size: 11px; line-height: 1.55; text-align: right; }
.courseware-editor-grid { display: grid; gap: 10px; }
.courseware-editor-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 650; }
.courseware-editor-grid input,
.courseware-editor-grid textarea,
.courseware-editor-toolbar select {
  width: 100%; box-sizing: border-box; border: 1px solid var(--line);
  border-radius: 10px; background: white; color: var(--ink);
  font: inherit; padding: 10px 11px;
}
.courseware-editor-grid textarea { min-height: 88px; resize: vertical; line-height: 1.65; }
.courseware-editor-grid input:focus,
.courseware-editor-grid textarea:focus,
.courseware-editor-toolbar select:focus {
  outline: 2px solid rgba(65, 111, 85, .2); border-color: var(--green);
}
.courseware-editor-help { margin: -2px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.6; }
.courseware-editor-steps { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.courseware-editor-steps .actions { margin: 0; }
.courseware-editor-dirty { color: var(--orange); font-size: 11px; font-weight: 700; }

.login-overlay {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  padding: 20px; background:
    radial-gradient(circle at 30% 20%, rgba(220,107,47,.2), transparent 25rem),
    #f2ece4;
}
.login-card { width: min(420px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); }
.login-card h1 { margin: 12px 0 8px; font-size: 25px; }
.login-card p { color: var(--muted); line-height: 1.7; }
.learner-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 8px;
}
.learner-option {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
  cursor: pointer;
}
.learner-option:has(input:checked) {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.learner-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--ink);
}
.learner-option span { display: grid; gap: 2px; min-width: 0; }
.learner-option b { font-size: 13px; }
.learner-option small {
  color: var(--muted);
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wait-state.compact {
  min-height: 130px;
  padding: 16px;
}

/* AI companion, lesson archive and artwork report */
.companion-fab {
  position: fixed; right: 22px; bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 45; border: 0; border-radius: 999px; min-height: 52px;
  padding: 8px 17px 8px 9px; color: white; cursor: pointer;
  background: var(--ink); box-shadow: 0 16px 38px rgba(30,37,44,.28);
  display: flex; align-items: center; gap: 8px; font-weight: 750;
}
.companion-fab span {
  width: 35px; height: 35px; display: grid; place-items: center;
  border-radius: 50%; background: var(--orange); font-size: 11px;
}
.companion-fab[aria-expanded="true"] {
  opacity: 0;
  pointer-events: none;
}
.companion-drawer {
  position: fixed; z-index: 55; left: 50%; right: auto; bottom: 12px;
  width: min(760px, calc(100vw - 24px)); max-height: min(66vh, 680px);
  display: none; grid-template-rows: auto auto auto minmax(180px, 1fr) auto;
  overflow: hidden; border: 1px solid #d6cab9; border-radius: 22px;
  transform: translateX(-50%);
  background: #fffdf9; box-shadow: 0 26px 80px rgba(36,28,20,.28);
}
.companion-drawer.open { display: grid; }
.companion-head { display: flex; justify-content: space-between; gap: 12px; padding: 15px 16px 10px; }
.companion-head strong { font-size: 16px; }
.companion-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.privacy-note { margin: 0 14px 10px; padding: 8px 10px; border-radius: 9px; background: var(--orange-soft); color: #7b4b2b; font-size: 10.5px; line-height: 1.55; }
.companion-quick {
  display: flex;
  gap: 6px;
  margin: 0 14px 9px;
  overflow-x: auto;
  scrollbar-width: none;
}
.companion-quick::-webkit-scrollbar { display: none; }
.companion-quick button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 5px 11px;
  border: 1px solid #ded5c8;
  border-radius: 999px;
  background: #fff;
  color: #5e5a54;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.companion-quick button:hover { border-color: #a99d8e; background: #faf7f2; }
.companion-messages, .teacher-chat {
  overflow: auto; padding: 8px 14px 12px; scroll-behavior: smooth;
}
.companion-messages { min-height: 180px; max-height: 38vh; }
.teacher-chat { max-height: 360px; min-height: 90px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.chat-empty, .chat-error { min-height: 100px; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 11.5px; line-height: 1.7; padding: 18px; }
.chat-error { color: var(--danger); }
.chat-message { max-width: 88%; margin: 7px 0; padding: 9px 11px; border-radius: 12px; font-size: 12px; line-height: 1.65; }
.chat-message p { margin: 0; }
.chat-message.student { margin-left: auto; background: var(--ink); color: white; border-bottom-right-radius: 4px; }
.chat-message.assistant { background: #f4eee6; border: 1px solid #e8ded0; border-bottom-left-radius: 4px; }
.chat-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 9.5px; opacity: .78; }
.chat-tag { padding: 2px 5px; border-radius: 999px; font-size: 8.5px; font-weight: 700; }
.chat-tag.real { color: var(--green); background: var(--green-soft); }
.chat-tag.local { color: #84591b; background: #fff3d6; }
.companion-compose { padding: 10px 14px 14px; border-top: 1px solid var(--line); background: #fff; }
.companion-compose .textarea { min-height: 62px; max-height: 130px; }
.companion-compose-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.companion-compose-foot span { color: var(--muted); font-size: 10px; line-height: 1.4; }
.companion-voice-hint {
  min-height: 0;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.companion-voice-hint.is-error { color: var(--danger); }
.companion-mic { flex: 0 0 auto; margin-left: auto; }
.companion-mic.listening {
  border-color: #cdddd5;
  background: var(--green-soft);
  color: var(--green);
}
.companion-mic.listening .svg-icon { animation: companionMicPulse 1.2s ease-in-out infinite; }
@keyframes companionMicPulse {
  0%, 100% { opacity: .55; transform: scale(.92); }
  50% { opacity: 1; transform: scale(1); }
}

.archive-modal {
  position: fixed; inset: 0; z-index: 65; display: none; padding: 20px;
  background: rgba(26,22,17,.62); backdrop-filter: blur(6px);
}
.archive-modal.open { display: grid; place-items: center; }
.archive-box { width: min(1040px, 100%); max-height: 92vh; overflow: auto; border-radius: 22px; padding: 20px; background: var(--paper); box-shadow: 0 30px 90px rgba(0,0,0,.34); }
.archive-box .section-title p { margin: 4px 0 0; }
.archive-box .section-title > .btn { flex: 0 0 auto; white-space: nowrap; }
.archive-learner { display: flex; gap: 12px; align-items: center; padding: 13px 15px; margin: 4px 0 14px; border-radius: 14px; background: white; border: 1px solid var(--line); }
.archive-learner h3, .archive-learner p { margin: 0; }
.archive-learner p { color: var(--muted); font-size: 11px; margin-top: 3px; }
.archive-learner .avatar { width: 42px; height: 42px; border-radius: 13px; background: var(--orange-soft); color: var(--orange); display: grid; place-items: center; font-weight: 800; }
.archive-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.archive-card { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: white; }
.archive-card-head { display: flex; justify-content: space-between; gap: 8px; }
.archive-card-head h3 { margin: 4px 0 0; font-size: 15px; }
.archive-summary { color: #4d565e; font-size: 12px; line-height: 1.68; }
.archive-review-summary {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}
.archive-review-summary > div {
  padding: 8px 9px;
  border-radius: 9px;
  background: #f7f5f1;
}
.archive-review-summary span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.archive-review-summary p { margin: 0; color: #4d565e; font-size: 13px; line-height: 1.6; }
.archive-report-disclosure { margin-top: 11px; }
.archive-report-disclosure > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.archive-report-disclosure[open] > summary { margin-bottom: 10px; }
.archive-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.archive-facts div { padding: 8px; border-radius: 9px; background: #faf5ee; }
.archive-facts span { display: block; color: var(--muted); font-size: 9px; }
.archive-facts b { display: block; font-size: 11px; margin-top: 3px; }
.archive-artwork { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.archive-artwork > img { width: 100%; height: 150px; object-fit: contain; border-radius: 10px; background: #f1ece5; }
.archive-artwork h4 { margin: 0; }
.archive-summary-button { margin-top: 10px; }
.teaching-summary {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #cfc6b8;
  border-radius: 12px;
  background: #fbf8f2;
}
.teaching-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.teaching-summary-head h4 { margin: 3px 0 0; font-size: 17px; }
.teaching-summary-lead {
  margin: 10px 0;
  color: #4d4d47;
  font-size: 13px;
  line-height: 1.75;
}
.teaching-summary-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 10px 0;
}
.teaching-summary-counts span {
  padding: 8px;
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
}
.teaching-summary-counts b {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 18px;
}
.teaching-summary-block {
  margin-top: 9px;
  padding: 9px 10px;
  border-radius: 9px;
  background: #fff;
}
.teaching-summary-block b { font-size: 12px; }
.teaching-summary-block p,
.teaching-summary-block ul {
  margin: 5px 0 0;
  color: #55554f;
  font-size: 12px;
  line-height: 1.65;
}
.teaching-summary-block ul { padding-left: 18px; }
.teaching-summary-missing {
  display: flex;
  gap: 8px;
  margin-top: 9px;
  padding: 8px 10px;
  border-radius: 9px;
  background: #fff2df;
  color: #7c5a33;
  font-size: 12px;
}
.photo-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: none;
  place-items: center;
  padding: 16px;
  background: rgba(18, 18, 16, .72);
  backdrop-filter: blur(8px);
}
.photo-editor-modal.open { display: grid; }
.photo-editor-dialog {
  width: min(1320px, 100%);
  max-height: 94vh;
  overflow: auto;
  padding: clamp(14px, 2vw, 22px);
  border-radius: 20px;
  background: #faf9f6;
  box-shadow: 0 30px 100px rgba(0, 0, 0, .38);
}
.photo-editor-head,
.photo-editor-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.photo-editor-head h2 { margin: 4px 0; font-size: clamp(25px, 3vw, 36px); }
.photo-editor-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.photo-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 16px;
  align-items: start;
  margin: 14px 0;
}
.photo-editor-stage {
  position: relative;
  justify-self: center;
  overflow: hidden;
  border-radius: 14px;
  background:
    linear-gradient(45deg, #e8e5df 25%, transparent 25%),
    linear-gradient(-45deg, #e8e5df 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e8e5df 75%),
    linear-gradient(-45deg, transparent 75%, #e8e5df 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  touch-action: none;
}
.photo-editor-stage > img {
  display: block;
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
}
.photo-editor-tint {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: soft-light;
}
.photo-editor-crop {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(15, 15, 14, .5);
  cursor: move;
  touch-action: none;
}
.photo-editor-crop:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}
.photo-editor-handle {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
}
.photo-editor-handle::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #252521;
}
.photo-editor-handle.nw { top: -22px; left: -22px; cursor: nwse-resize; }
.photo-editor-handle.ne { top: -22px; right: -22px; cursor: nesw-resize; }
.photo-editor-handle.sw { bottom: -22px; left: -22px; cursor: nesw-resize; }
.photo-editor-handle.se { right: -22px; bottom: -22px; cursor: nwse-resize; }
.photo-editor-controls {
  display: grid;
  gap: 12px;
  max-height: min(62vh, 620px);
  overflow-y: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  overscroll-behavior: contain;
}
.photo-editor-tool-group {
  display: grid;
  gap: 7px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}
.photo-editor-tool-group > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .08em;
}
.photo-editor-tool-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}
.photo-editor-tool {
  min-height: 44px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf9f6;
  color: var(--ink);
  font: inherit;
  font-size: 10.5px;
  font-weight: 720;
  cursor: pointer;
}
.photo-editor-tool:hover { border-color: #bdb7ac; }
.photo-editor-tool.active {
  border-color: #252521;
  background: #252521;
  color: #fff;
}
.photo-editor-controls label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 720;
}
.photo-editor-controls output {
  min-width: 40px;
  color: var(--muted);
  text-align: right;
}
.photo-editor-controls input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 44px;
  accent-color: #252521;
}
.photo-editor-controls .btn {
  min-height: 44px;
}
.photo-editor-actions {
  align-items: center;
  justify-content: flex-end;
  position: sticky;
  bottom: -22px;
  z-index: 3;
  margin-top: 2px;
  padding: 12px 0 2px;
  border-top: 1px solid var(--line);
  background: #faf9f6;
}
.photo-editor-actions .btn {
  min-height: 44px;
}

.voice-input-field {
  padding-right: 52px !important;
}
.voice-dictate-button {
  position: absolute;
  right: 5px;
  z-index: 4;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid #d9d4ca;
  border-radius: 9px;
  background: rgba(255, 255, 255, .94);
  color: #59564f;
  box-shadow: 0 2px 8px rgba(28, 27, 24, .08);
  cursor: pointer;
}
.voice-dictate-button[data-field-type="single"] {
  top: 50%;
  transform: translateY(-50%);
}
.voice-dictate-button[data-field-type="multiline"] {
  bottom: 4px;
}
.voice-dictate-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.voice-dictate-button:hover {
  border-color: #8c877c;
  color: #1f1e1b;
}
.voice-dictate-button.listening {
  border-color: #df5f31;
  background: #fff0e8;
  color: #c6491d;
  animation: voice-listening-pulse 1.1s ease-in-out infinite;
}
.voice-input-status {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 190;
  max-width: min(440px, calc(100vw - 32px));
  padding: 9px 14px;
  border-radius: 999px;
  background: #24231f;
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .18s ease, transform .18s ease;
}
.voice-input-status.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.voice-input-status[data-kind="error"] {
  background: #8f321e;
}
@keyframes voice-listening-pulse {
  50% { box-shadow: 0 0 0 5px rgba(223, 95, 49, .16); }
}

.artwork-panel { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: #fffaf4; }
.artwork-panel .section-title p { margin: 4px 0 0; }
.artwork-upload-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.artwork-upload-grid label, .teacher-review-form label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 650; }
.artwork-review-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, .8fr); gap: 14px; align-items: start; }
.review-block { padding: 12px; border-radius: 12px; border: 1px solid #dce6df; background: #f4f8f5; font-size: 12px; line-height: 1.7; }
.review-block.teacher { border-color: #ead7b1; background: #fff9eb; margin-top: 10px; }
.review-block.report-complete { border-color: #bed8ca; background: #edf6f0; margin-top: 10px; }
.review-block.report-complete { border-color: #bfd7cb; background: #edf7f1; margin-top: 10px; }
.work-report { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.report-page { padding: 15px; margin-top: 10px; border: 1px solid #d8cbbb; border-radius: 14px; background: #fffdf9; }
.report-page-head { display: flex; justify-content: space-between; gap: 8px; color: var(--orange); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.report-page-head b { color: var(--ink); letter-spacing: 0; font-weight: 650; }
.report-hero { margin-top: 10px; padding: 8px; border-radius: 12px; background: #f1e9de; display: grid; place-items: center; min-height: 260px; }
.report-hero img { width: 100%; max-height: 480px; object-fit: contain; border-radius: 8px; }
.report-meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.report-meta-grid div { padding: 9px; border-radius: 9px; background: #faf5ee; }
.report-meta-grid span { display: block; color: var(--muted); font-size: 9px; margin-bottom: 3px; }
.report-meta-grid b { display: block; font-size: 11px; line-height: 1.6; }
.report-evidence-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.report-evidence-strip figure { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.report-evidence-strip img { width: 100%; height: 100px; display: block; object-fit: contain; background: #f1ece5; }
.report-evidence-strip figcaption { padding: 5px 7px; color: var(--muted); font-size: 9px; }
.report-detail-crop { position: relative; width: 100%; height: 190px; margin-top: 10px; overflow: hidden; border-radius: 11px; background: #eee6dc; }
.report-detail-crop img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.report-detail-crop span { position: absolute; right: 8px; bottom: 8px; padding: 4px 7px; border-radius: 999px; background: rgba(30,37,44,.8); color: white; font-size: 9px; }
.report-review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 10px; }
.report-timeline { display: grid; gap: 4px; margin-top: 10px; padding: 10px; border-radius: 9px; background: #faf5ee; font-size: 10px; }
.report-timeline b { margin-bottom: 3px; }
.report-timeline span { color: var(--muted); }
.report-chat { margin-top: 10px; padding: 10px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-size: 10px; }
.report-chat summary { cursor: pointer; color: var(--orange); font-weight: 750; }
.artwork-version-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
}
.artwork-version-compare figure {
  margin: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafaf8;
}
.artwork-version-compare img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  background: #eee;
}
.artwork-version-missing {
  display: grid;
  place-items: center;
  min-height: 110px;
  border-radius: 6px;
  background: #eee;
  color: var(--muted);
  font-size: 11px;
}
.artwork-version-compare figcaption {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 750;
}
.artwork-version-compare p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
.report-chat p { margin: 7px 0 0; line-height: 1.65; color: #59616a; }
.review-block ul { margin: 7px 0; padding-left: 19px; }
.review-block p { margin: 6px 0; }
.teacher-review-form { display: grid; gap: 9px; margin-top: 10px; padding: 11px; border-radius: 12px; background: #f7f1e9; }
.teacher-review-form textarea,
.teacher-review-form input {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  user-select: text;
}
.criteria-review {
  display: grid;
  gap: 9px;
  margin: 2px 0 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.criteria-review legend { padding: 0 6px; color: var(--ink); font-size: 12px; font-weight: 750; }
.criteria-review-row {
  display: grid;
  gap: 6px;
  padding: 9px;
  border-top: 1px solid var(--line);
}
.criteria-review-row:first-of-type { border-top: 0; }
.criteria-review-row b { font-size: 13px; line-height: 1.55; }
.criteria-review-row label { font-size: 12px; }
.criteria-review-row .textarea { min-height: 68px; }
.frame-replace-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #dfcdbd;
  border-radius: 11px;
  background: #fff8f2;
}
.frame-replace-box b { font-size: 13px; }
.frame-replace-box p { margin: 3px 0 0; }
.voice-review-box {
  padding: 10px;
  border: 1px solid #ddd5ca;
  border-radius: 10px;
  background: #fff;
}
.voice-review-box .section-title { margin-bottom: 8px; }
.voice-review-box .actions { justify-content: flex-start; margin-top: 0; }
.voice-review-box audio { width: 100%; margin-top: 8px; }
.voice-review-box #voiceReviewStatus { margin: 8px 0 0; }
.review-block audio { width: 100%; margin-top: 8px; }
.check-line { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 7px !important; }
.report-json { max-height: 300px; overflow: auto; padding: 10px; border-radius: 9px; background: #262d33; color: #e8ecef; font-size: 9.5px; line-height: 1.55; white-space: pre-wrap; }

@media (max-width: 1050px) {
  .teacher-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .detail-panel { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar {
    height: auto;
    min-height: 60px;
    padding: max(10px, env(safe-area-inset-top)) 14px 10px;
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .brand { min-width: 0; }
  .top-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .top-actions .pill { font-size: 10px; padding: 4px 8px; }
  .page { padding: 16px 12px 56px; }
  .input, .textarea { font-size: 16px; }
  .stepper { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 10px; }
  .card-grid,
  .handoff-grid,
  .material-review-grid { grid-template-columns: 1fr; }
  .analysis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .medium-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-stage { grid-template-columns: 1fr; }
  .result-next-step { align-items: stretch; flex-direction: column-reverse; }
  .result-adjustments > summary { width: 100%; justify-content: center; }
  .result-adjustments .actions { position: static; width: 100%; margin-top: 6px; box-shadow: none; }
  .choice-card img { height: 230px; }
  .slide,
  .slide-render-fallback { grid-template-columns: 1fr; }
  .slide { aspect-ratio: auto; min-height: 0; }
  .slide-copy { padding: 24px 20px; }
  .slide-visual { aspect-ratio: 4 / 3; min-height: 0; }
  .teacher-layout { grid-template-columns: 1fr; }
  .sidebar-panel, .main-panel, .detail-panel { padding: 13px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .actions { justify-content: stretch; }
  .actions .btn { flex: 1 1 140px; }
  .archive-grid { grid-template-columns: 1fr; }
  .artwork-review-layout { grid-template-columns: 1fr; }
  .artwork-upload-grid { grid-template-columns: 1fr; }
  .report-review-grid { grid-template-columns: 1fr; }
  .drawing-mode-choice { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .waiting-games-menu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drawing-mode-card { min-height: 150px; }
  .board-workbench-head { align-items: flex-start; flex-direction: column; }
  .board-workbench-head .actions { justify-content: flex-start; }
  .board-flow { grid-template-columns: 1fr; gap: 7px; }
  .board-flow-nav { grid-template-columns: 44px minmax(0, 1fr) 44px; }
  .board-flow-open { grid-column: 1 / -1; }
  .board-ppt-head { align-items: flex-start; }
  .loading-state.cinema-loading {
    min-height: 520px;
    grid-template-columns: 1fr;
    row-gap: 8px;
    padding: 30px 24px;
  }
  .cinema-stage { width: min(215px, 58vw); }
  .cinema-stage { justify-self: center; }
  .cinema-copy { align-items: center; text-align: center; }
  .cinema-kicker { justify-content: center; }
  .cinema-copy h2 { max-width: 620px; font-size: clamp(24px, 6vw, 31px); }
  .cinema-wait-line {
    min-height: 4.2em;
    max-width: 600px;
    padding: 13px 0 0;
    border-top: 1px solid #deded8;
    border-left: 0;
    font-size: 14px;
  }
  .cinema-detail { max-width: 600px; margin: 8px auto 0; font-size: 12px; }
  .cinema-reassurance {
    max-width: 600px;
    margin-top: 13px;
    padding: 9px 10px;
    font-size: 12px;
    text-align: left;
  }
  .cinema-actions { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .btn, .choice-card, .chip, .dot-btn { transition: none; }
  .spinner { animation-duration: 2.4s; }
  .cinema-loader-svg *,
  .cinema-wait-line.copy-in {
    animation: none !important;
  }
  #coachText.coach-copy-enter { animation: none; }
}
@media (max-width: 430px) {
  .brand { font-size: 14px; }
  #imageStatus { display: none; }
  .panel { border-radius: 17px; padding: 16px; }
  .choice-card img { height: 200px; }
  .style-grid, .medium-grid { grid-template-columns: 1fr; }
  .crop-context { grid-template-columns: 110px minmax(0, 1fr); }
  .crop-context img { height: 100px; }
  .step .label { font-size: 9px; }
  .step .dot { width: 25px; height: 25px; font-size: 10px; }
  .compare-strip img { height: 92px; }
  .error-banner, .warning-banner {
    align-items: flex-start;
    flex-direction: column;
  }
  .slide-copy { padding: 20px 16px; }
  .slide h2 { font-size: 22px; }
  .handoff-card { border-radius: 15px; }
  .handoff-card .body { padding: 13px 14px 15px; }
  .drawing-mode-modal,
  .lesson-player-modal { padding: 8px; }
  .waiting-games-modal { padding: 7px; }
  .drawing-mode-box,
  .lesson-player-box { border-radius: 16px; padding: 12px; }
  .waiting-games-box { padding: 14px; border-radius: 16px; }
  .drawing-mode-choice { grid-template-columns: 1fr; }
  .waiting-games-head h2 { font-size: 27px; }
  .waiting-game-card { min-height: 132px; padding: 12px; }
  .waiting-game-card strong { font-size: 16px; margin-top: 10px; }
  .waiting-game-card p { font-size: 10.5px; }
  .waiting-games-countdown { margin: 14px -14px -14px; }
  .mini-grid.three { grid-template-columns: repeat(3, 74px); }
  .mini-board-cell { width: 74px; height: 74px; }
  .gomoku-board { grid-template-columns: repeat(9, 32px); }
  .gomoku-board button { width: 32px; height: 32px; font-size: 22px; }
  .connect-board { grid-template-columns: repeat(7, 36px); }
  .connect-board > button,
  .connect-board > span { width: 36px; }
  .connect-board > span { height: 36px; }
  .mini-2048 { grid-template-columns: repeat(4, 64px); }
  .mini-2048 span { width: 64px; height: 64px; }
  .memory-grid { grid-template-columns: repeat(4, 66px); }
  .memory-grid button { width: 66px; height: 66px; }
  .drawing-mode-card { min-height: 136px; padding: 17px; }
  .drawing-mode-card strong { font-size: 21px; }
  .hand-play-button { width: 58px; height: 58px; }
  .hand-play-copy b { font-size: 17px; }
  .board-workbench-head .actions { width: 100%; }
  .board-workbench-head .actions .btn { flex: 1 1 130px; }
  .board-pressure { width: 100%; justify-content: center; }
  .board-ppt-head { flex-direction: column; }
  .board-reference-actions { width: 100%; }
  .board-reference-actions .board-mini-action { width: 100%; }
  .board-canvas-panel { height: 64dvh; min-height: 460px; }
  .board-canvas-bar { align-items: flex-start; flex-direction: column; }
  .board-zoom-controls { width: 100%; }
  .board-zoom-controls button:nth-child(2) { flex: 1; }
  .board-toolbar > .board-tool-group:not(.board-tool-group-secondary) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-toolbar > .board-tool-group.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-tool-group-secondary { grid-template-columns: 1fr; }
  .board-tool { min-height: 48px; }
  .board-layers-panel { display: flex; }
  .board-layer-eye { min-width: 48px; }
  .board-brush-modal { padding: 8px; }
  .board-brush-dialog { max-height: 94vh; padding: 12px; border-radius: 15px; }
  .board-brush-dialog-head { flex-direction: column; gap: 8px; }
  .board-brush-dialog-head .btn { width: 100%; }
  .board-brush-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .board-brush-item { min-height: 112px; grid-template-rows: 62px auto auto; padding: 5px; }
  .board-brush-item-preview img { width: 58px; height: 58px; }
  .companion-fab { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .companion-drawer {
    right: 8px; left: 8px; bottom: 76px; width: auto;
    max-height: calc(100vh - 92px); border-radius: 17px;
    transform: none;
  }
  .archive-modal { padding: 8px; }
  .archive-box { border-radius: 17px; padding: 13px; }
  .archive-artwork { grid-template-columns: 1fr; }
  .archive-artwork > img { height: 220px; }
  .teaching-summary-head { flex-direction: column; }
  .teaching-summary-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-editor-layout { grid-template-columns: 1fr; }
  .photo-editor-controls { order: -1; }
  .report-meta-grid, .report-evidence-strip { grid-template-columns: 1fr; }
  .loading-state.cinema-loading { min-height: 500px; padding: 24px 15px; }
  .cinema-stage { width: min(190px, 62vw); }
  .cinema-kicker { font-size: 9px; }
  .cinema-copy h2 { font-size: 23px; }
  .cinema-wait-line { min-height: 5.4em; }
  .cinema-actions { width: 100%; }
  .cinema-actions .btn { flex: 1 1 100%; }
}
@media print {
  body { background: white; }
  .topbar, .companion-fab, .companion-drawer, .archive-modal > .archive-box > .section-title,
  .report-page > .section-title, .btn, .actions { display: none !important; }
  .page, .archive-box { width: 100%; max-width: none; padding: 0; margin: 0; box-shadow: none; }
  .archive-modal { position: static; display: block; background: white; padding: 0; }
  .archive-box { max-height: none; overflow: visible; background: white; }
  .archive-card { break-inside: avoid; page-break-inside: avoid; box-shadow: none; }
  .report-page { break-before: page; page-break-before: always; min-height: 250mm; border: 0; }
  .report-page:first-of-type { break-before: auto; page-break-before: auto; }
}

/* 2026-11-25 visual reference pass: monochrome editorial resource workspace. */
@media screen {
  :root {
    --ink: #171717;
    --muted: #858580;
    --paper: #f2f2ef;
    --card: #ffffff;
    --white: #ffffff;
    --line: #e4e4df;
    --orange: #171717;
    --orange-soft: #f1f1ee;
    --green: #171717;
    --green-soft: #ededeb;
    --yellow: #d8d8d2;
    --shadow: 0 18px 50px rgba(20, 20, 20, .06);
  }

  body {
    background-color: var(--paper);
    background-image: radial-gradient(circle, rgba(23, 23, 23, .11) .55px, transparent .7px);
    background-size: 18px 18px;
    font-family: "Avenir Next", "SF Pro Display", -apple-system, BlinkMacSystemFont,
      "PingFang SC", "Microsoft YaHei", sans-serif;
  }

  .topbar {
    min-height: 62px;
    background: rgba(248, 248, 246, .94);
    border-bottom-color: var(--line);
  }

  .brand {
    font-size: 15px;
    font-weight: 720;
    letter-spacing: -.025em;
  }

  .brand-mark {
    border-radius: 9px;
    background: var(--ink);
    box-shadow: none;
  }

  .pill,
  .btn {
    border-color: var(--line);
    background: #fff;
  }

  .pill.ok,
  .pill.warn {
    color: var(--ink);
    background: #f1f1ee;
    border-color: #deded8;
  }

  .page {
    width: min(1320px, 100%);
    padding-top: 22px;
  }

  .page.narrow {
    width: min(1140px, 100%);
  }

  .panel,
  .sidebar-panel,
  .main-panel,
  .detail-panel {
    background: #fff;
    border-color: var(--line);
    box-shadow: 0 10px 32px rgba(20, 20, 20, .045);
  }

  .panel {
    border-radius: 18px;
  }

  .panel h1 {
    font-size: clamp(28px, 3.4vw, 44px);
    line-height: 1.08;
    letter-spacing: -.055em;
  }

  .panel h2 {
    letter-spacing: -.04em;
  }

  .lead {
    color: #74746f;
  }

  .hero-note {
    border-left: 0;
    border-radius: 12px;
    box-shadow: none;
  }

  .hero-note .avatar {
    border-radius: 50%;
    background: var(--ink);
    color: white;
    font-size: 9px;
  }

  .hero-note strong {
    color: var(--ink);
  }

  .step .dot {
    border-color: #d7d7d1;
    background: #fff;
    color: #9a9a94;
  }

  .step.done .dot,
  .step.current .dot {
    background: var(--ink);
    border-color: var(--ink);
    box-shadow: none;
  }

  .step .label {
    color: #979791;
  }

  .btn {
    border-radius: 10px;
    font-weight: 620;
    box-shadow: none;
  }

  .btn.small {
    min-height: 44px;
    padding: 9px 13px;
  }

  .btn:hover {
    border-color: #bfbfb9;
    background: #f8f8f6;
    box-shadow: 0 8px 18px rgba(20, 20, 20, .07);
  }

  .btn.primary,
  .btn.orange,
  .btn.green {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
  }

  .btn.primary:hover,
  .btn.orange:hover,
  .btn.green:hover {
    background: #000;
    border-color: #000;
  }

  .btn.ghost {
    background: transparent;
  }

  .btn:active {
    transform: translateY(1px) scale(.99);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .14);
  }

  .btn:focus-visible,
  .chip:focus-visible,
  .student-row:focus-visible,
  input:focus-visible,
  textarea:focus-visible,
  select:focus-visible {
    outline: 3px solid rgba(23, 23, 23, .28);
    outline-offset: 2px;
  }

  .upload-zone,
  .loading-state,
  .wait-state,
  .done-state,
  .artwork-panel,
  .reason-box {
    background: #fafaf8;
    border-color: var(--line);
  }

  .upload-zone {
    border-color: #cfcfc9;
  }

  .upload-icon {
    border-radius: 50%;
    background: var(--ink);
    color: white;
  }

  .analysis-board {
    background: #fafaf8;
    border-color: var(--line);
  }

  .analysis-cell,
  .stat,
  .archive-card,
  .courseware-item,
  .student-row,
  .choice-card,
  .medium-card,
  .style-skill-card,
  .handoff-card {
    border-color: var(--line);
    box-shadow: none;
  }

  .choice-card.selected,
  .medium-card.selected,
  .style-skill-card.selected,
  .student-row.selected {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(20, 20, 20, .06);
  }

  .tag,
  .tag.local,
  .tag.direction {
    color: #666660;
    background: #f1f1ee;
  }

  .tag.real {
    color: var(--ink);
    background: #e8e8e4;
  }

  .teaching-banner {
    background: #f4f4f1;
    border-color: #ddddD7;
    color: #4e4e49;
  }

  .teaching-banner b {
    color: var(--ink);
  }

  .chip {
    border-color: #d9d9d3;
    color: #5f5f5a;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .input,
  .textarea,
  select.input {
    min-height: 44px;
  }

  .chip.selected {
    background: var(--ink);
    border-color: var(--ink);
  }

  .crop-context,
  .report-meta-grid div,
  .report-timeline,
  .teacher-review-form {
    background: #f6f6f3;
  }

  .slide {
    background:
      linear-gradient(90deg, var(--ink) 0 5px, transparent 5px),
      #fbfbf9;
  }

  .teacher-layout {
    grid-template-columns: 250px minmax(0, 1fr) 330px;
    gap: 14px;
  }

  .sidebar-panel,
  .main-panel,
  .detail-panel {
    border-radius: 15px;
    padding: 15px;
  }

  .status-dot.ready,
  .status-dot.teacher {
    background: var(--ink);
  }

  .status-dot.drawing {
    background: #777772;
  }

  .companion-fab {
    min-height: 48px;
    background: var(--ink);
    box-shadow: 0 12px 28px rgba(20, 20, 20, .2);
  }

  .companion-fab span {
    width: 31px;
    height: 31px;
    background: #fff;
    color: var(--ink);
  }

  .companion-drawer {
    border-color: #d6d6d0;
    background: #fff;
    box-shadow: 0 24px 70px rgba(20, 20, 20, .22);
  }

  .privacy-note {
    background: #f1f1ee;
    color: #60605b;
  }

  .chat-message.assistant,
  .review-block {
    background: #f5f5f2;
    border-color: #dfdfd9;
  }

  .chat-message.student {
    background: var(--ink);
  }

  .review-block.teacher {
    background: #ececea;
    border-color: #d8d8d2;
  }

  .review-block.report-complete {
    background: #e9e9e5;
    border-color: #d5d5ce;
  }

  .archive-modal,
  .preview-modal {
    background: rgba(20, 20, 20, .55);
  }

  .archive-box,
  .preview-modal .box {
    background: var(--paper);
  }

  .archive-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  }

  .login-overlay {
    background: #ececea;
  }
}

@media screen and (max-width: 1100px) and (min-width: 761px) {
  .teacher-layout {
    grid-template-columns: 205px minmax(0, 1fr) 280px;
    gap: 11px;
  }

  .detail-panel {
    grid-column: auto;
  }

  .sidebar-panel,
  .main-panel,
  .detail-panel {
    padding: 12px;
  }

  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .stat {
    padding: 9px;
  }

  .stat b {
    font-size: 19px;
  }
}

@media screen and (orientation: landscape) and (max-height: 600px) {
  .topbar {
    min-height: 52px;
    padding-top: max(6px, env(safe-area-inset-top));
    padding-bottom: 6px;
  }

  .page {
    padding-top: 10px;
    padding-bottom: 30px;
  }

  .stepper {
    margin-bottom: 10px;
  }

  .hero-note {
    margin-bottom: 10px;
    padding: 9px 12px;
  }

  .panel {
    padding: 16px 20px;
  }

  .companion-drawer {
    top: auto;
    right: auto;
    bottom: 8px;
    left: 50%;
    width: min(760px, calc(100vw - 20px));
    max-height: calc(100vh - 16px);
    transform: translateX(-50%);
  }

  .companion-messages {
    min-height: 110px;
    max-height: none;
  }

  .teacher-layout {
    grid-template-columns: 190px minmax(0, 1fr) 270px;
  }

  .detail-panel {
    grid-column: auto;
  }

  .stats {
    margin-bottom: 8px;
  }

  .detail-block {
    padding-top: 10px;
    margin-top: 10px;
  }
}

@media screen and (max-width: 760px) {
  .teacher-layout {
    grid-template-columns: 1fr;
  }

  .sidebar-panel,
  .main-panel,
  .detail-panel {
    width: 100%;
    min-width: 0;
  }

  .stats,
  .control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-actions {
    width: 100%;
  }

  .courseware-editor-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .courseware-editor-note {
    text-align: left;
  }

  .preview-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

/* SaaS account and tenant consoles */
[hidden] { display: none !important; }
.auth-page {
  background: #e8e8e3;
}
.auth-layout {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 64px) 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
  gap: 18px;
  align-items: stretch;
}
.auth-story {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  padding: clamp(28px, 5vw, 56px);
  color: #f7f7f3;
  border-radius: 24px;
  background:
    radial-gradient(circle at 82% 18%, rgba(255,255,255,.16), transparent 17rem),
    linear-gradient(145deg, #101010, #30302d);
  overflow: hidden;
  position: relative;
}
.auth-story::before {
  content: "";
  position: absolute;
  width: 290px;
  height: 290px;
  right: -70px;
  top: 54px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 50%;
  box-shadow:
    0 0 0 34px rgba(255,255,255,.04),
    0 0 0 76px rgba(255,255,255,.025);
}
.auth-story .brand { position: relative; z-index: 1; margin-bottom: auto; }
.auth-story .lead { color: rgba(255,255,255,.72); max-width: 600px; font-size: 15px; }
.auth-story h1 {
  position: relative;
  z-index: 1;
  max-width: 660px;
  margin: 0;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.08;
  letter-spacing: -.055em;
}
.auth-kicker {
  margin: 0;
  color: var(--muted);
  font: 700 10.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.auth-story .auth-kicker { color: rgba(255,255,255,.58); }
.auth-capabilities { display: flex; flex-wrap: wrap; gap: 7px; position: relative; z-index: 1; }
.auth-capabilities span {
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  color: rgba(255,255,255,.76);
  font-size: 11px;
}
.auth-card {
  align-self: center;
  box-shadow: 0 24px 70px rgba(20,20,20,.12);
}
.auth-card h2 { margin: 7px 0 7px; font-size: clamp(25px, 3vw, 36px); letter-spacing: -.04em; }
.console-page {
  width: min(1220px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(22px, 4vw, 48px) 0 80px;
}
.console-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.console-hero h1 {
  margin: 5px 0 7px;
  font-size: clamp(30px, 5vw, 54px);
  letter-spacing: -.055em;
  line-height: 1.05;
}
.console-hero .lead { margin-bottom: 0; max-width: 720px; }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.metric-card:first-child {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}
.metric-card:first-child span { color: rgba(255, 255, 255, .78); }
.metric-card {
  min-height: 112px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
}
.metric-card span { color: var(--muted); font-size: 11.5px; }
.metric-card strong { font-size: clamp(28px, 4vw, 42px); letter-spacing: -.055em; }
.console-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr);
  gap: 14px;
  align-items: start;
}
.admin-ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}
.admin-tabs {
  position: sticky;
  top: 64px;
  z-index: 18;
  display: flex;
  gap: 4px;
  width: min(1180px, calc(100% - 32px));
  margin: 12px auto 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 253, 249, .95);
  box-shadow: 0 9px 28px rgba(20,20,20,.05);
  backdrop-filter: blur(12px);
}
.admin-tab {
  min-height: 44px;
  padding: 8px 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.admin-tab:hover { background: #f3f1ed; color: var(--ink); }
.admin-tab.active { background: var(--ink); color: white; }
.admin-tab:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.skill-console { padding-top: 20px; }
.skill-console-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0 18px;
}
.skill-console-head h1 { margin: 0 0 8px; font-size: 34px; letter-spacing: -.045em; }
.skill-console-head .lead { max-width: 720px; margin: 0; }
.skill-workspace {
  display: grid;
  grid-template-columns: minmax(280px, .72fr) minmax(0, 1.4fr);
  gap: 14px;
  align-items: start;
}
.skill-list-panel { position: sticky; top: 126px; }
.skill-filter { width: 144px; }
.skill-filter .input { width: 100%; min-height: 38px; }
.skill-list { display: grid; gap: 4px; margin-top: 8px; }
.skill-list-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 68px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.skill-list-item:hover { border-color: var(--line); background: #faf8f4; }
.skill-list-item.selected { border-color: var(--ink); background: white; }
.skill-list-item:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.skill-list-thumb {
  width: 52px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: #ece8e1;
}
.skill-list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.skill-list-copy { display: grid; gap: 3px; min-width: 0; }
.skill-list-copy b { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.skill-list-copy small { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.skill-form { display: grid; gap: 10px; }
.skill-form > label,
.skill-form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}
.skill-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.skill-form .input,
.skill-form .textarea {
  width: 100%;
  box-sizing: border-box;
  color: var(--ink);
  font-size: 13px;
}
.skill-form .textarea { min-height: 84px; resize: vertical; line-height: 1.6; }
.skill-form .skill-prompt { min-height: 126px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.skill-assets {
  margin: 4px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.skill-assets legend { padding: 0 6px; font-size: 12px; font-weight: 800; }
.skill-asset-grid {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.skill-upload {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  border: 1px dashed #c9c1b7;
  border-radius: 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}
.skill-upload input { width: 100%; font: inherit; }
.skill-upload small { color: var(--muted); font-size: 10.5px; font-weight: 500; line-height: 1.5; }
.skill-preview {
  min-width: 0;
  margin: 0;
  display: grid;
  grid-template-rows: 150px auto;
  gap: 6px;
}
.skill-preview img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f0ede7;
}
.skill-preview img[hidden] { display: none; }
.skill-preview figcaption { color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.skill-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.skill-actions .btn { min-height: 44px; }
.audit-panel { margin-top: 14px; }
.ops-row { align-items: flex-start; }
.ops-row .data-row-main { flex: 1; }
.ops-status {
  flex: 0 0 150px;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.ops-status .input { min-width: 0; }
.console-panel { min-width: 0; box-shadow: 0 14px 40px rgba(20,20,20,.06); }
.create-panel { position: sticky; top: 78px; }
.console-form { display: grid; gap: 8px; margin-top: 14px; }
.console-form label { margin-top: 4px; font-size: 12px; font-weight: 700; }
.console-form .btn { width: 100%; margin-top: 8px; }
.data-list { display: grid; gap: 0; margin-top: 10px; }
.data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}
.data-row:last-child { border-bottom: 0; }
.data-row-main { min-width: 0; }
.data-row-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.data-row-title b { font-size: 14px; }
.data-row p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.copy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}
.status-badge, .role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
}
.status-badge.active { background: #e9ece7; color: #313b31; }
.status-badge.disabled { background: #ece8e5; color: #7c4c45; }
.role-badge { background: #f1f1ee; color: #5d5d57; }
.action-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.btn.danger { color: #8a3f34; border-color: #dfc7c0; background: #fff8f6; }
.empty-console {
  min-height: 190px;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 5px;
  color: var(--muted);
}
.empty-console b { color: var(--ink); font-size: 15px; }
.empty-console p { margin: 0; font-size: 12px; }
.console-toast {
  position: fixed;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 150;
  width: min(420px, calc(100% - 40px));
  box-shadow: 0 18px 50px rgba(20,20,20,.16);
}
.console-dialog {
  width: min(430px, calc(100% - 32px));
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(20,20,20,.28);
}
.console-dialog::backdrop { background: rgba(20,20,20,.5); backdrop-filter: blur(5px); }

.inspection-page-body .topbar { background: rgba(245, 240, 232, .94); }
.exception-item.danger,
.danger-block {
  border-color: #d98b78;
  background: #fff4f0;
}
.danger-block {
  border-left-width: 4px;
}
.inspection-page { padding-top: clamp(26px, 4vw, 46px); }
.inspection-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.inspection-heading h1 {
  max-width: 780px;
  margin: 0 0 8px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: .98;
  letter-spacing: -.06em;
  text-wrap: balance;
}
.inspection-heading .lead { max-width: 760px; margin: 0; }
.inspection-shell {
  display: grid;
  grid-template-columns: minmax(250px, .72fr) minmax(0, 1.8fr);
  gap: 14px;
  align-items: start;
}
.inspection-rail { padding: 20px; }
.inspection-role-rail { display: grid; gap: 7px; margin-top: 14px; }
.inspection-role-button {
  width: 100%;
  min-height: 70px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.inspection-role-button:hover { background: #f6f1e9; }
.inspection-role-button.selected {
  border-color: var(--ink);
  background: #fff;
  box-shadow: 0 8px 22px rgba(64, 44, 29, .06);
}
.inspection-role-icon,
.inspection-large-icon {
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--orange-soft);
  color: var(--orange);
}
.inspection-role-icon { width: 36px; height: 36px; }
.inspection-role-icon .svg-icon { width: 18px; height: 18px; }
.inspection-role-button b { display: block; font-size: 13px; }
.inspection-role-button small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.inspection-role-button em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}
.inspection-detail { min-height: 590px; }
.inspection-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.inspection-title-lockup { display: flex; align-items: flex-start; gap: 13px; }
.inspection-large-icon { flex: 0 0 auto; width: 48px; height: 48px; }
.inspection-large-icon .svg-icon { width: 23px; height: 23px; }
.inspection-title-lockup h2 { margin: 0 0 4px; font-size: 30px; letter-spacing: -.04em; }
.inspection-title-lockup p { max-width: 620px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.inspection-feature-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  padding: 22px 0;
}
.inspection-feature-group h3,
.inspection-accounts h3 { margin: 0 0 10px; font-size: 15px; }
.inspection-feature-group ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.inspection-feature-group li {
  position: relative;
  padding-left: 17px;
  color: #505860;
  font-size: 12.5px;
  line-height: 1.55;
}
.inspection-feature-group li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .56em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}
.inspection-boundary {
  padding: 13px 14px;
  border: 1px solid #e8d7c6;
  border-radius: 11px;
  background: #fff8f1;
}
.inspection-boundary b { color: #7c4b2c; font-size: 12px; }
.inspection-boundary p { margin: 5px 0 0; color: #69584b; font-size: 12px; line-height: 1.65; }
.inspection-accounts { margin-top: 22px; }
.inspection-accounts .section-title .pill { flex: 0 0 auto; white-space: nowrap; }
.inspection-account-list { display: grid; gap: 0; margin-top: 8px; }
.inspection-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.inspection-account-row:last-child { border-bottom: 0; }
.inspection-account-row p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.inspection-account-row .btn { flex: 0 0 auto; min-width: 124px; }
.inspection-note {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 16px;
  padding: 16px 2px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.inspection-note strong { color: var(--ink); font-size: 12px; }
.inspection-note p { margin: 5px 0 0; font-size: 12px; line-height: 1.65; }
.inspection-note code { color: var(--ink); font-size: 12px; }
.inspection-return-top { background: var(--orange-soft); color: #8b4824; border-color: #e9c7b0; }

@media screen and (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; max-width: 720px; }
  .auth-story { min-height: 350px; }
  .console-grid { grid-template-columns: 1fr; }
  .admin-ops-grid { grid-template-columns: 1fr; }
  .create-panel { position: static; }
  .skill-workspace { grid-template-columns: 1fr; }
  .skill-list-panel { position: static; }
  .inspection-shell { grid-template-columns: 1fr; }
  .inspection-detail { min-height: 0; }
}

@media screen and (max-width: 760px) {
  .console-page { width: min(100% - 24px, 680px); }
  .console-hero { align-items: stretch; flex-direction: column; }
  .console-hero .btn { width: 100%; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: 96px; }
  .admin-tabs { top: 58px; width: min(100% - 20px, 680px); overflow-x: auto; }
  .admin-tab { flex: 1 0 auto; }
  .skill-console-head { align-items: stretch; flex-direction: column; gap: 12px; }
  .skill-console-head h1 { font-size: 30px; }
  .skill-console-head .btn { width: 100%; }
  .skill-form-grid,
  .skill-asset-grid { grid-template-columns: 1fr; }
  .skill-preview { grid-template-rows: 180px auto; }
  .skill-preview img { height: 180px; }
  .skill-actions .btn { flex: 1 1 42%; }
  .data-row { align-items: flex-start; flex-direction: column; }
  .ops-status { width: 100%; flex-basis: auto; }
  .action-row { width: 100%; justify-content: flex-start; }
  .action-row .btn { flex: 1; }
  .auth-layout { width: min(100% - 20px, 640px); padding-top: 10px; }
  .auth-story { min-height: 330px; padding: 24px; }
  .auth-story h1 { font-size: clamp(31px, 10vw, 46px); }
  .auth-card { padding: 22px; }
  .inspection-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .inspection-heading h1 { font-size: clamp(32px, 10vw, 48px); }
  .inspection-role-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inspection-role-button { grid-template-columns: 34px minmax(0, 1fr); min-height: 82px; }
  .inspection-role-button em { grid-column: 2; }
  .inspection-feature-columns,
  .inspection-note { grid-template-columns: 1fr; gap: 16px; }
  .inspection-detail-head { flex-direction: column; }
  .inspection-account-row { align-items: flex-start; flex-direction: column; }
  .inspection-account-row .btn { width: 100%; }
}

@media screen and (orientation: landscape) and (max-height: 600px) {
  .auth-layout { grid-template-columns: minmax(0, 1fr) minmax(330px, .8fr); padding: 10px 0; }
  .auth-story { min-height: 0; padding: 22px; }
  .auth-story h1 { font-size: clamp(28px, 4vw, 40px); }
  .auth-story .lead { font-size: 12.5px; }
  .console-page { padding-top: 14px; }
  .console-hero h1 { font-size: clamp(26px, 4vw, 38px); }
  .metric-card { min-height: 82px; }
}

/* PBL goals, process evidence and learner reflection. */
.course-brief {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}
.course-brief-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.course-brief-head span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.course-brief-head b { font-size: 16px; letter-spacing: -.025em; }
.course-driving {
  margin: 7px 0;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.55;
}
.course-goal {
  margin: 0;
  color: #5f5f59;
  font-size: 13px;
  line-height: 1.65;
}
.course-goal b { margin-right: 6px; color: var(--ink); }
.course-brief details { margin-top: 7px; }
.course-brief summary {
  min-height: 36px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}
.course-brief ul { margin: 2px 0 0; padding-left: 20px; color: #5f5f59; font-size: 13px; line-height: 1.7; }

.pbl-config {
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.pbl-config > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 750;
}
.pbl-config-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.pbl-config-grid .textarea { min-height: 76px; }
.pbl-config-inline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0;
}
.pbl-config-inline .field-label { display: grid; gap: 5px; }
.pbl-overview {
  margin: 12px 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fafaf8;
}
.pbl-overview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.pbl-overview-head > div { display: grid; gap: 3px; }
.pbl-overview-head span { color: var(--muted); font-size: 12px; }
.pbl-overview-head b { font-size: 17px; letter-spacing: -.025em; }
.pbl-driving { margin: 9px 0; font-size: 14px; font-weight: 650; line-height: 1.55; }
.pbl-goal-row { display: grid; gap: 3px; color: #55554f; font-size: 13px; line-height: 1.6; }
.pbl-goal-row b { color: var(--ink); }
.pbl-goal-details { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 5px; }
.pbl-goal-details summary { min-height: 36px; display: flex; align-items: center; cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 700; }
.pbl-goal-details .pbl-goal-row { margin-top: 5px; }
.pbl-goal-details ol { margin: 8px 0 0; padding-left: 21px; color: #55554f; font-size: 13px; line-height: 1.7; }
.batch-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.batch-toolbar > div:first-child { display: grid; gap: 2px; }
.batch-toolbar b { font-size: 13px; }
.batch-toolbar span { color: var(--muted); font-size: 12px; }
.batch-toolbar .actions { margin: 0; flex-wrap: nowrap; }

.process-evidence-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.creation-completion {
  margin-top: 14px;
  padding: 0 14px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.creation-completion > summary {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}
.creation-completion > summary::-webkit-details-marker { display: none; }
.creation-completion > summary b { font-size: 13px; }
.creation-completion > summary span { color: var(--muted); font-size: 10px; }
.creation-completion[open] > summary { border-bottom: 1px solid var(--line); }
.creation-completion .process-evidence-panel { margin-top: 0; padding-top: 12px; border-top: 0; }
.process-evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  margin-top: 12px;
}
.process-evidence-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.process-evidence-complete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #b9cdbd;
  border-radius: 12px;
  background: #f2f8f3;
}
.process-evidence-complete > div { display: grid; gap: 3px; }
.process-evidence-complete b { font-size: 13px; }
.process-evidence-complete span { color: #5f675f; font-size: 11px; line-height: 1.55; }
.process-evidence-complete .btn { flex: 0 0 auto; }
.drawing-snapshots-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.drawing-snapshot-command {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}
.drawing-snapshot-command span {
  color: var(--muted);
  font-size: 12px;
}
.drawing-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}
.drawing-snapshot-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.drawing-snapshot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.drawing-snapshot-head span {
  font-size: 13px;
  font-weight: 780;
}
.drawing-snapshot-head em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.drawing-snapshot-card figure,
.drawing-snapshot-empty {
  height: 170px;
  margin: 0 0 9px;
  overflow: hidden;
  border: 1px dashed #cfc7bd;
  border-radius: 10px;
  background: #f4f2ee;
}
.drawing-snapshot-card figure img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
.drawing-snapshot-empty {
  display: grid;
  place-items: center;
  color: #948a7e;
  font-size: 12px;
}
.drawing-snapshot-card .btn { width: 100%; }
.process-evidence-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 7px;
}
.process-evidence-head span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-size: 12px;
  font-weight: 750;
}
.process-evidence-head b { font-size: 15px; }
.process-evidence-head em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.process-evidence-card > p { margin: 9px 0; color: #5f5f59; font-size: 13px; line-height: 1.6; }
.process-evidence-card .textarea { min-height: 82px; }
.process-evidence-card figure {
  margin: 9px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f4f2ee;
}
.process-evidence-card figure img { width: 100%; height: 140px; display: block; object-fit: cover; }
.process-evidence-card figure figcaption { padding: 6px 8px; color: var(--muted); font-size: 12px; }
.process-evidence-card .actions { justify-content: flex-start; margin-top: 9px; }
.teacher-process-list { display: grid; gap: 8px; }
.teacher-process-list article {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 9px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafaf8;
}
.teacher-process-list img { width: 74px; height: 74px; object-fit: cover; border-radius: 7px; }
.teacher-process-list b { font-size: 13px; }
.teacher-process-list p { margin: 4px 0 0; color: #5f5f59; font-size: 12px; line-height: 1.55; }

.review-block.self-assessment { border-color: #d8d8d0; background: #f7f7f4; margin-top: 10px; }
.review-block.self-assessment .textarea { margin-bottom: 8px; }
.criteria-self-review {
  display: grid;
  gap: 8px;
  margin: 9px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.criteria-self-review legend { padding: 0 6px; color: var(--ink); font-size: 12px; font-weight: 750; }
.criteria-self-row {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.criteria-self-row:first-of-type { padding-top: 0; border-top: 0; }
.criteria-self-row b { font-size: 13px; line-height: 1.55; }
.criteria-self-row label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 650; }
.criteria-self-row .textarea { min-height: 64px; margin: 0; }
.criteria-self-summary { display: grid; gap: 6px; margin-top: 8px; }
.criteria-self-summary p { margin: 0; padding: 7px 8px; border-radius: 8px; background: #fff; }
.criteria-self-summary span { display: block; margin-top: 2px; color: #5f5f59; line-height: 1.55; }
.report-course-brief {
  margin-bottom: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f7f7f4;
}
.report-course-brief span { color: var(--muted); font-size: 12px; font-weight: 700; }
.report-course-brief b { display: block; margin-top: 3px; font-size: 16px; }
.report-course-brief p { margin: 5px 0 0; color: #55554f; font-size: 13px; line-height: 1.6; }
.report-course-brief details { margin-top: 5px; }
.report-course-brief summary { min-height: 34px; display: flex; align-items: center; cursor: pointer; font-size: 12px; font-weight: 700; }
.report-course-brief ul { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.65; }
.report-process-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.report-process-strip figure { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: white; }
.report-process-strip img { width: 100%; height: 110px; object-fit: cover; }
.report-process-strip figcaption { display: grid; gap: 2px; padding: 7px 8px; }
.report-process-strip figcaption b { font-size: 12px; }
.report-process-strip figcaption span { color: #5f5f59; font-size: 12px; line-height: 1.5; }
.report-criteria {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.report-criteria h3 { margin: 0 0 2px; font-size: 16px; }
.report-criterion {
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.report-criterion b { font-size: 12px; line-height: 1.5; }
.report-criterion p { margin: 4px 0 0; color: #55554f; font-size: 12px; line-height: 1.55; }
.report-criterion span { display: inline-block; min-width: 60px; color: var(--ink); font-weight: 700; }

.consent-check {
  min-height: 52px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  margin-top: 8px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f7f7f4;
  color: #55554f;
  font-size: 13px;
  line-height: 1.6;
}
.consent-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); }
.consent-check {
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
}
.consent-check input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 44px;
  height: 44px;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.consent-check input::after {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1.5px solid #777770;
  border-radius: 5px;
  background: #fff;
}
.consent-check input:checked::after {
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: inset 0 0 0 4px #fff;
}
.consent-check input:focus-visible {
  outline: 3px solid rgba(20,20,20,.25);
  outline-offset: -4px;
  border-radius: 10px;
}
.consent-check a { text-underline-offset: 3px; }
.danger-zone {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #dfc7c0;
  border-radius: 11px;
  background: #fff8f6;
}
.danger-zone > summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: #7a3d34;
  font-size: 13px;
  font-weight: 750;
}
.danger-zone p { margin: 2px 0 10px; }
.danger-zone p a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.privacy-page .panel { max-width: 900px; }
.privacy-page h1 { margin: 8px 0 10px; }
.privacy-page section {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.privacy-page section:first-of-type { margin-top: 18px; }
.privacy-page h2 { margin: 0 0 8px; font-size: 20px; letter-spacing: -.025em; }
.privacy-page p { color: #55554f; font-size: 15px; line-height: 1.8; }
.privacy-page ul { margin: 0; padding-left: 22px; color: #55554f; font-size: 15px; line-height: 1.8; }
.privacy-page a { text-underline-offset: 3px; }
.not-found-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.not-found-page .panel { width: min(620px, 100%); }
.not-found-page h1 { margin: 8px 0 10px; }
.not-found-page .actions { justify-content: flex-start; }
.success-banner {
  padding: 12px 14px;
  border: 1px solid #c7d9cf;
  border-radius: 12px;
  background: #eef6f1;
  color: #245b46;
  font-size: 13px;
  line-height: 1.65;
}
.welcome-page {
  background-color: #f2f2ef;
  background-image: none;
}
.welcome-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px clamp(16px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(248, 248, 246, .94);
  backdrop-filter: blur(16px);
}
.welcome-nav nav {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.welcome-nav nav > a:not(.btn) {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: #55554f;
  font-size: 13px;
  text-decoration: none;
}
.welcome-hero {
  width: min(1280px, calc(100% - 40px));
  min-height: min(760px, calc(100vh - 66px));
  margin: 0 auto;
  padding: clamp(46px, 8vw, 112px) 0 clamp(54px, 7vw, 92px);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: clamp(36px, 7vw, 100px);
  align-items: center;
}
.welcome-hero h1 {
  max-width: 850px;
  margin: 12px 0 22px;
  font-size: clamp(46px, 7vw, 92px);
  line-height: .98;
  letter-spacing: -.07em;
  text-wrap: balance;
}
.welcome-lead {
  max-width: 730px;
  margin: 0;
  color: #5d5d57;
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.75;
}
.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 26px;
}
.welcome-note { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.welcome-proof {
  position: relative;
  display: grid;
  gap: 0;
  border: 1px solid #cfcfc8;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(20, 20, 20, .09);
  overflow: hidden;
}
.welcome-proof::before {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -110px;
  top: -110px;
  border: 1px solid #deded8;
  border-radius: 50%;
  box-shadow: 0 0 0 32px rgba(20,20,20,.025), 0 0 0 70px rgba(20,20,20,.018);
  pointer-events: none;
}
.proof-stage {
  position: relative;
  padding: 22px 22px 24px;
  border-bottom: 1px solid var(--line);
}
.proof-stage:last-child { border-bottom: 0; }
.proof-stage span { color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: .08em; }
.proof-stage b { display: block; margin: 7px 0 5px; font-size: 22px; letter-spacing: -.035em; }
.proof-stage small { display: block; max-width: 300px; color: #5d5d57; font-size: 13px; line-height: 1.65; }
.welcome-section {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(56px, 8vw, 100px) 0;
  border-top: 1px solid var(--line);
}
.welcome-section-head {
  display: grid;
  grid-template-columns: minmax(180px, .42fr) minmax(0, 1fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 30px;
}
.welcome-section h2,
.welcome-trial h2 {
  margin: 0;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.03;
  letter-spacing: -.055em;
  text-wrap: balance;
}
.welcome-flow {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid #bdbdb6;
}
.welcome-flow li {
  min-height: 200px;
  padding: 18px 18px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid var(--line);
}
.welcome-flow li + li { padding-left: 18px; }
.welcome-flow li:last-child { border-right: 0; }
.welcome-flow b { font-size: 20px; letter-spacing: -.03em; }
.welcome-flow span { color: #5d5d57; font-size: 14px; line-height: 1.7; }
.welcome-trust {
  display: grid;
  grid-template-columns: minmax(260px, .75fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 90px);
  align-items: start;
}
.trust-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.trust-list p { margin: 0; padding: 17px 0; border-top: 1px solid var(--line); }
.trust-list b { display: block; margin-bottom: 5px; font-size: 16px; }
.trust-list span { color: #5d5d57; font-size: 14px; line-height: 1.7; }
.welcome-trial {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(56px, 8vw, 100px) 0;
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(340px, 1fr);
  gap: clamp(32px, 7vw, 100px);
  border-top: 1px solid var(--line);
}
.welcome-trial-copy p { max-width: 620px; color: #5d5d57; font-size: 15px; line-height: 1.75; }
.welcome-page p a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.welcome-trial-copy h2 { margin-bottom: 18px; }
.welcome-form {
  display: grid;
  gap: 9px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(20,20,20,.07);
}
.welcome-form-row { display: grid; gap: 5px; }
.welcome-form-row label { color: var(--ink); font-size: 12px; font-weight: 700; }
.welcome-form .textarea { min-height: 94px; }
.welcome-form .btn { width: 100%; margin-top: 3px; }
.welcome-footer {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.welcome-footer a { min-height: 44px; display: inline-flex; align-items: center; }
.auth-card .fine a,
.top-actions a.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.privacy-page .brand,
.privacy-page p a,
a.brand,
.panel p a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* Accessibility and readability floor. */
@media screen {
  :root {
    --muted: #666660;
  }

  .lead,
  .cinema-detail,
  .analysis-more p,
  .shot-section p,
  .choice-body p,
  .medium-card p,
  .crop-context p,
  .style-skill-body p,
  .handoff-card p,
  .waiting-game-card p,
  .archive-summary,
  .data-row p {
    color: #666660;
  }

  .cinema-detail,
  .cinema-reassurance,
  .waiting-game-source,
  .step .label {
    color: #666660;
  }

  .cinema-reassurance { color: #5d5d57; }

  .pill,
  .step .label,
  .analysis-confidence,
  .analysis-cell span,
  .analysis-more summary,
  .shot-type,
  .shot-dim,
  .shot-section span,
  .choice-meta,
  .tag,
  .reference-strip span,
  .medium-count,
  .style-skill-body .family,
  .compare-strip figcaption,
  .slide-count,
  .waiting-games-head span,
  .waiting-game-source,
  .waiting-game-library-toggle span,
  .waiting-game-head span,
  .student-job-card > div:first-child,
  .kv,
  .courseware-item small,
  .courseware-editor-toolbar label,
  .courseware-editor-note,
  .courseware-editor-grid label,
  .courseware-editor-help,
  .courseware-editor-dirty,
  .companion-head p,
  .privacy-note,
  .chat-meta,
  .chat-tag,
  .companion-compose-foot span,
  .archive-learner p,
  .archive-facts span,
  .report-page-head,
  .report-meta-grid span,
  .report-evidence-strip figcaption,
  .report-detail-crop span,
  .metric-card span,
  .data-row p,
  .status-badge,
  .role-badge,
  .auth-kicker {
    font-size: 12px;
  }

  .hero-note p,
  .analysis-more p,
  .shot-section p,
  .shot-question,
  .choice-body p,
  .medium-card p,
  .crop-context p,
  .style-skill-body p,
  .handoff-card p,
  .waiting-game-card p,
  .chat-message,
  .chat-empty,
  .chat-error,
  .archive-summary,
  .archive-facts b,
  .report-meta-grid b,
  .report-timeline,
  .report-chat {
    font-size: 14px;
    line-height: 1.65;
  }

  .auth-capabilities span,
  .top-actions .pill,
  .learner-option small,
  .student-row small,
  .stat span {
    font-size: 12px;
  }

  .hero-note .avatar {
    font-size: 12px;
  }

  .kv a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .cinema-detail,
  .cinema-reassurance,
  .analysis-more p,
  .board-canvas-help {
    font-size: 13px;
  }

  .step .dot {
    color: #666660;
  }

  .dots {
    gap: 0;
  }

  .dot-btn {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
  }

  .dot-btn::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8a8a84;
  }

  .dot-btn.active {
    background: transparent;
    transform: none;
  }

  .dot-btn.active::before {
    width: 10px;
    height: 10px;
    background: var(--ink);
  }

  .gomoku-board {
    width: max-content;
    max-width: 100%;
    grid-template-columns: repeat(9, 44px);
    overflow: auto;
  }

  .gomoku-board button {
    width: 44px;
    height: 44px;
  }

  .connect-board > button {
    width: 44px;
    height: 44px;
  }
}

@media screen and (max-width: 760px) {
  .control-field-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .control-field-row .field-label {
    margin-bottom: -2px;
  }

  .control-field-row .btn {
    width: 100%;
  }

  .analysis-head-actions {
    width: 100%;
    justify-items: start;
  }
  .analysis-head-actions .btn {
    width: 100%;
  }
  .analysis-evidence-grid {
    grid-template-columns: 1fr;
  }
  .analysis-upgrade-banner,
  .shot-map-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .analysis-upgrade-banner .btn {
    width: 100%;
  }
  .shot-map-head .analysis-confidence {
    text-align: left;
  }

  .process-evidence-grid,
  .report-process-strip {
    grid-template-columns: 1fr;
  }

  .welcome-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .welcome-nav nav {
    width: 100%;
    justify-content: flex-start;
  }

  .welcome-hero,
  .welcome-section,
  .welcome-trial,
  .welcome-footer {
    width: min(100% - 24px, 680px);
  }

  .welcome-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .welcome-section-head,
  .welcome-trust,
  .welcome-trial {
    grid-template-columns: 1fr;
  }

  .welcome-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .welcome-flow li:nth-child(2) { border-right: 0; }

  .welcome-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }

  .batch-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .batch-toolbar .actions {
    flex-wrap: wrap;
  }

  .batch-toolbar .btn {
    flex: 1;
  }

  .process-evidence-card figure img,
  .report-process-strip img {
    height: 180px;
  }
  .drawing-snapshot-grid { grid-template-columns: 1fr; }
}

@media screen and (max-width: 430px) {
  .companion-compose-foot { flex-wrap: wrap; }
  .companion-compose-foot > span { flex: 1 1 100%; font-size: 12px; }
  .companion-mic,
  #companionSend { flex: 1 1 0; margin-left: 0; }

  .course-brief-head,
  .pbl-overview-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .pbl-config-inline {
    grid-template-columns: 1fr;
  }

  .welcome-hero h1 { font-size: 45px; }

  .welcome-flow,
  .trust-list {
    grid-template-columns: 1fr;
  }

  .welcome-flow li,
  .welcome-flow li + li {
    min-height: 0;
    padding: 16px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .welcome-flow li:last-child { border-bottom: 0; }

  .gomoku-board {
    grid-template-columns: repeat(9, 44px);
  }

  .gomoku-board button {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }

  .connect-board {
    grid-template-columns: repeat(7, 42px);
  }

  .connect-board > button,
  .connect-board > span {
    width: 44px;
  }

  .connect-board > button {
    height: 44px;
  }

  .connect-board > span {
    height: 44px;
  }
}

/* Required UI/UX remediation: touch, readability and landscape task focus. */
.analysis-evidence-card span,
.analysis-anchor-row em,
.shot-facts > span,
.shot-facts b,
.shot-anchor-tags span {
  font-size: 12px;
}
.analysis-evidence-card b,
.analysis-anchor-row b {
  font-size: 13px;
}
.visual-anchor b { font-size: 11px; }
.visual-anchor span { max-width: 180px; font-size: 12px; }
.analysis-more summary,
.shot-details summary,
.creation-completion > summary,
.self-extra > summary,
.course-brief > details > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
}
.analysis-more summary:focus-visible,
.shot-details summary:focus-visible,
.creation-completion > summary:focus-visible,
.self-extra > summary:focus-visible {
  outline: 3px solid rgba(220,107,47,.32);
  outline-offset: 2px;
}
.dot-btn {
  width: 44px;
  height: 44px;
}
.dots {
  max-width: 100%;
  overflow-x: auto;
  gap: 8px;
  padding-bottom: 4px;
}

@media screen and (orientation: landscape) and (max-height: 600px) {
  .page { padding-top: 8px; }
  .stepper { margin: 2px auto 5px; }
  .stepper .label,
  .stepper-help { display: none; }
  .hero-note {
    display: none;
  }
  .hero-note p {
    margin: 1px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .course-brief {
    display: none;
  }
  .course-brief .course-driving,
  .course-brief .course-goal,
  .course-brief details,
  .course-brief-head p { display: none; }
  .course-brief-head {
    min-height: 34px;
    margin: 0;
  }
  .panel { padding: 13px; }
  .panel h1 { font-size: clamp(22px, 3.2vw, 30px); }
  .panel > .lead { display: none; }
  .analysis-board {
    margin-top: 4px;
    padding: 10px;
  }
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shot-card img { height: 118px; }
  .shot-card .choice-body { gap: 6px; padding: 9px; }
  .shot-read,
  .shot-question { font-size: 12px; }
  .companion-fab {
    right: auto;
    left: 10px;
    bottom: max(8px, env(safe-area-inset-bottom));
  }
  .board-workbench-head {
    margin: 0;
    min-height: 42px;
  }
  .board-workbench-head h1 {
    margin: 0;
    font-size: 17px;
    line-height: 1.15;
  }
  .board-workbench-head .eyebrow,
  .board-workbench-head .fine,
  .board-pressure { display: none; }
  .board-workbench-head .actions { gap: 5px; }
  .board-workbench-head .actions .btn {
    min-height: 40px;
    padding: 6px 10px;
  }
  .board-ppt-tray {
    margin-top: 3px;
    padding: 2px 0;
    border: 0;
    background: transparent;
  }
  .board-ppt-head > div:first-child { display: none; }
  .board-ppt-head { justify-content: flex-end; }
  .board-flow {
    margin-top: 3px;
    padding: 4px 6px;
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 6px;
  }
  .board-flow-title small { display: none; }
  .board-flow-nav {
    grid-template-columns: 44px minmax(0, 1fr) 44px auto;
    gap: 4px;
  }
  .board-editor { margin-top: 4px; }
  .creation-completion > summary { min-height: 44px; }
  .teacher-command-bar {
    position: static;
    margin-top: 12px;
  }
  .photo-editor-controls > label { order: 1; }
  .photo-editor-controls .photo-editor-tool-group { order: 2; }
  .photo-editor-controls #photoEditorReset { order: 3; }
  .photo-editor-controls > .fine { order: 4; }
}

.teacher-critical-banner {
  position: sticky;
  top: 62px;
  z-index: 38;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: min(100% - 24px, 1440px);
  margin: 8px auto;
  padding: 11px 14px;
  border: 1px solid #d6a08f;
  border-radius: 12px;
  background: #fff0eb;
  color: #6e281b;
  box-shadow: 0 10px 30px rgba(84, 28, 18, .12);
}
.teacher-critical-banner > div { display: grid; gap: 2px; }
.teacher-critical-banner b { font-size: 13px; }
.teacher-critical-banner span { font-size: 12px; line-height: 1.5; }
.teacher-critical-banner.danger {
  border-width: 2px;
  background: #8e2f20;
  color: #fff;
}
.teacher-shell details > summary,
.teacher-shell .drawer-section > summary,
.teacher-shell details summary {
  min-height: 44px;
  display: flex;
  align-items: center;
}
.teacher-analysis-source { padding: 6px; margin-bottom: 9px; }
.teacher-analysis-source img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
}
.teacher-analysis-crops,
.teacher-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0;
}
.teacher-analysis-crops figure,
.teacher-snapshot-grid figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.teacher-analysis-crops img,
.teacher-snapshot-grid img {
  display: block;
  width: 100%;
  height: 104px;
  object-fit: contain;
  background: #eee8df;
}
.teacher-analysis-crops figcaption,
.teacher-snapshot-grid figcaption {
  display: grid;
  gap: 2px;
  padding: 6px 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.teacher-analysis-crops figcaption b { color: var(--ink); }
.teacher-analysis-anchors { margin: 8px 0; }
.teacher-analysis-anchors p {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 8px;
  margin: 5px 0;
  font-size: 12px;
}
.drawer-student-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}
.drawer-student-actions .btn {
  flex: 1 1 100px;
  min-height: 44px;
}
.teacher-view[data-teacher-panel="class"] {
  padding-bottom: 92px;
}
@media screen and (max-width: 760px) {
  .teacher-critical-banner {
    top: 58px;
    align-items: stretch;
    flex-direction: column;
  }
  .teacher-critical-banner .btn { width: 100%; }
  .teacher-view[data-teacher-panel="class"] { padding-bottom: 140px; }
}

