:root {
  color-scheme: light;
  --oak-050: #fbf6ed;
  --oak-100: #f3e5cd;
  --oak-200: #e8c995;
  --oak-300: #d6ad70;
  --oak-500: #a96f36;
  --cream: #f8f5ed;
  --paper: #fffdf8;
  --ink: #25312d;
  --muted: #6f7772;
  --line: #e7dfd0;
  --green: #244b3c;
  --green-2: #35634f;
  --green-soft: #dce8de;
  --sage: #769782;
  --blue: #4a718b;
  --blue-soft: #e1ebf1;
  --amber: #c78025;
  --amber-soft: #f9e9c7;
  --red: #b65c4d;
  --red-soft: #f5dfda;
  --violet: #765e8e;
  --violet-soft: #ebe4f1;
  --shadow-sm: 0 2px 10px rgb(56 43 27 / 8%);
  --shadow-md: 0 12px 32px rgb(56 43 27 / 12%);
  --shadow-lg: 0 20px 60px rgb(32 38 34 / 22%);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --nav-h: 78px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-rounded, "SF Pro Rounded", "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  background: #d8cbb5;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 10%, rgb(255 255 255 / 70%), transparent 25rem),
    #e8e1d5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
[role="button"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgb(74 113 139 / 35%);
  outline-offset: 2px;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.icon.fill {
  fill: currentColor;
  stroke: none;
}

#app {
  width: 100%;
  min-height: 100svh;
  background: var(--cream);
  position: relative;
  overflow: hidden;
}

.app-shell {
  min-height: 100svh;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom));
  background:
    linear-gradient(90deg, rgb(88 63 31 / 2%) 1px, transparent 1px),
    linear-gradient(var(--cream), var(--cream));
  background-size: 7px 100%, 100% 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: calc(12px + var(--safe-top)) 18px 14px;
  color: #2f352f;
  background:
    linear-gradient(96deg, rgb(255 255 255 / 22%), transparent 24%, rgb(119 72 25 / 8%) 58%, transparent),
    repeating-linear-gradient(2deg, rgb(106 69 30 / 4%) 0 1px, transparent 1px 7px),
    linear-gradient(135deg, #ecc991, #dfb474);
  box-shadow: 0 1px 0 rgb(112 71 30 / 12%), 0 8px 22px rgb(74 49 26 / 8%);
}

.topbar-row {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark,
.topbar-icon {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgb(255 253 247 / 82%);
  box-shadow: 0 3px 10px rgb(65 39 18 / 12%);
}

.brand-mark {
  color: var(--green);
}

.topbar-icon {
  margin-left: auto;
  color: #5d4225;
}

.topbar-copy {
  min-width: 0;
  flex: 1;
}

.eyebrow {
  display: block;
  margin-bottom: 3px;
  color: rgb(63 51 37 / 68%);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-subtitle {
  width: fit-content;
  padding: 0;
  border: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  color: #6d5335;
  font-size: 0.78rem;
  font-weight: 650;
  background: transparent;
}

.topbar-subtitle .icon {
  width: 14px;
  height: 14px;
}

.topbar-status {
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgb(95 58 23 / 10%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgb(255 253 247 / 75%);
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.topbar-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5e9a73;
  box-shadow: 0 0 0 4px rgb(94 154 115 / 15%);
}

.page {
  width: 100%;
  padding: 18px 16px 28px;
  animation: page-in 180ms ease-out;
}

.page.edge {
  padding-inline: 0;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 2px 12px;
}

.section-head h2,
.section-head h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.text-button {
  border: 0;
  padding: 4px;
  background: transparent;
  color: var(--blue);
  font-size: 0.77rem;
  font-weight: 800;
  white-space: nowrap;
}

.hero-card {
  position: relative;
  min-height: 170px;
  padding: 20px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 86% 20%, rgb(255 255 255 / 13%) 0 4rem, transparent 4.1rem),
    linear-gradient(145deg, #315f4e, #193b30);
  box-shadow: var(--shadow-md);
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -35px;
  width: 142px;
  height: 142px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 50%;
  box-shadow: 0 0 0 22px rgb(255 255 255 / 4%), 0 0 0 48px rgb(255 255 255 / 3%);
}

.hero-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgb(255 255 255 / 72%);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-card h2 {
  max-width: 290px;
  margin: 16px 0 7px;
  font-size: 1.52rem;
  line-height: 1.14;
  letter-spacing: -0.035em;
}

.hero-card p {
  max-width: 270px;
  margin: 0;
  color: rgb(255 255 255 / 70%);
  font-size: 0.82rem;
  line-height: 1.45;
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.home-classes,
.home-schedule {
  margin-top: 22px;
}

.home-classes .section-head,
.home-schedule .section-head {
  margin-bottom: 10px;
}

.home-classes .text-button,
.home-schedule .text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.home-classes .text-button .icon,
.home-schedule .text-button .icon {
  width: 14px;
  height: 14px;
}

.class-switcher {
  margin-inline: -16px;
  padding: 1px 16px 5px;
  display: flex;
  gap: 9px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.class-switcher::-webkit-scrollbar {
  display: none;
}

.class-switch-card {
  min-width: min(78vw, 290px);
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  scroll-snap-align: start;
}

.class-switch-card.active {
  border-color: #8eaf9e;
  background:
    linear-gradient(140deg, rgb(255 255 255 / 72%), transparent),
    var(--green-soft);
}

.class-switch-card.add {
  border-style: dashed;
  color: var(--green);
  background: rgb(255 253 248 / 56%);
}

.class-switch-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
}

.class-switch-card.active .class-switch-icon {
  color: white;
  background: var(--green);
}

.class-switch-card.add .class-switch-icon {
  border: 1px dashed #9eb5a8;
  background: white;
}

.class-switch-icon .icon {
  width: 19px;
  height: 19px;
}

.class-switch-copy {
  min-width: 0;
  flex: 1;
}

.class-switch-copy strong,
.class-switch-copy small {
  display: block;
}

.class-switch-copy strong {
  font-size: 0.8rem;
}

.class-switch-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.61rem;
}

.class-switch-card > .icon {
  width: 15px;
  height: 15px;
  color: #939a96;
}

.active-class-badge {
  padding: 5px 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--green);
  background: white;
  font-size: 0.52rem;
  font-weight: 900;
}

.active-class-badge .icon {
  width: 11px;
  height: 11px;
}

.weekday-picker {
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 15px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  background: #ebe7de;
}

.weekday-picker button {
  min-height: 42px;
  padding: 5px 2px;
  border: 0;
  border-radius: 11px;
  color: #7b807d;
  background: transparent;
  font-size: 0.68rem;
  font-weight: 850;
}

.weekday-picker button span,
.weekday-picker button small {
  display: block;
}

.weekday-picker button small {
  margin-top: 1px;
  font-size: 0.49rem;
  font-weight: 750;
  text-transform: uppercase;
}

.weekday-picker button.active {
  color: white;
  background: var(--green);
  box-shadow: 0 4px 10px rgb(36 75 60 / 18%);
}

.schedule-card {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.schedule-row {
  width: 100%;
  min-height: 68px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #ece7dd;
  display: grid;
  grid-template-columns: 45px 12px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 7px;
  text-align: left;
  background: transparent;
}

.schedule-row:last-child {
  border-bottom: 0;
}

.schedule-row.active {
  background: #f2f7f3;
}

.schedule-time strong,
.schedule-time small {
  display: block;
}

.schedule-time strong {
  color: var(--ink);
  font-size: 0.75rem;
}

.schedule-time small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.56rem;
}

.schedule-line {
  position: relative;
  align-self: stretch;
  display: grid;
  place-items: center;
}

.schedule-line::before {
  content: "";
  width: 2px;
  height: 100%;
  border-radius: 999px;
  background: #d5ddd7;
}

.schedule-line i {
  position: absolute;
  width: 8px;
  height: 8px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.schedule-row.active .schedule-line i {
  background: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}

.schedule-copy {
  min-width: 0;
}

.schedule-copy strong,
.schedule-copy small {
  display: block;
}

.schedule-copy strong {
  font-size: 0.78rem;
}

.schedule-copy strong em {
  margin-left: 5px;
  color: var(--green);
  font-size: 0.48rem;
  font-style: normal;
  text-transform: uppercase;
}

.schedule-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.62rem;
}

.schedule-row > .icon {
  width: 15px;
  height: 15px;
  color: #9da29f;
}

.schedule-empty {
  min-height: 95px;
  padding: 14px;
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.schedule-empty > .icon {
  width: 25px;
  height: 25px;
  color: var(--muted);
}

.schedule-empty strong {
  font-size: 0.75rem;
}

.schedule-empty p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.6rem;
}

.schedule-empty .button {
  min-height: 36px;
  padding-inline: 10px;
  font-size: 0.62rem;
}

.button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 850;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.button:active {
  transform: scale(0.98);
}

.button.primary {
  color: white;
  background: var(--green);
  box-shadow: 0 6px 15px rgb(36 75 60 / 20%);
}

.button.light {
  color: var(--green);
  background: #fff;
  box-shadow: 0 5px 14px rgb(17 40 32 / 17%);
}

.button.soft {
  color: var(--green);
  border-color: #d9e4db;
  background: var(--green-soft);
}

.button.outline {
  color: var(--green);
  border-color: #d7d2c6;
  background: var(--paper);
}

.button.danger {
  color: #943f33;
  background: var(--red-soft);
}

.button.wide {
  width: 100%;
}

.button.icon-only {
  width: 44px;
  padding: 0;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 12px 0 22px;
}

.metric-card {
  min-width: 0;
  padding: 14px 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(255 253 248 / 84%);
  box-shadow: var(--shadow-sm);
}

.metric-icon {
  width: 31px;
  height: 31px;
  margin-bottom: 10px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
}

.metric-icon.blue { color: var(--blue); background: var(--blue-soft); }
.metric-icon.amber { color: var(--amber); background: var(--amber-soft); }
.metric-icon .icon { width: 16px; height: 16px; }

.metric-value {
  display: block;
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.metric-label {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.path-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.path-card {
  position: relative;
  min-height: 152px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.path-card.quiz {
  background: #edf3f0;
  border-color: #d6e4dc;
}

.path-card .path-icon {
  width: 39px;
  height: 39px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
}

.path-card.quiz .path-icon {
  color: white;
  background: var(--green);
}

.path-card strong {
  display: block;
  margin-top: 14px;
  font-size: 0.92rem;
}

.path-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.38;
}

.path-card .corner {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #7f857f;
  background: rgb(255 255 255 / 70%);
}

.path-card .corner .icon { width: 14px; height: 14px; }

.list-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.list-row {
  width: 100%;
  min-height: 62px;
  padding: 10px 13px;
  border: 0;
  border-bottom: 1px solid #ede7db;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  background: transparent;
}

.list-row:last-child { border-bottom: 0; }

.list-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--blue-soft);
}

.list-icon.amber { color: var(--amber); background: var(--amber-soft); }
.list-icon.green { color: var(--green); background: var(--green-soft); }
.list-icon .icon { width: 17px; height: 17px; }

.list-copy {
  min-width: 0;
  flex: 1;
}

.list-copy strong {
  display: block;
  font-size: 0.8rem;
}

.list-copy small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-value {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 850;
}

.bottom-nav {
  position: fixed;
  z-index: 50;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding: 7px 7px var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  background:
    repeating-linear-gradient(1deg, rgb(105 65 25 / 4%) 0 1px, transparent 1px 7px),
    linear-gradient(140deg, #efd19f, #dfb679);
  border-top: 1px solid rgb(121 76 30 / 10%);
  box-shadow: 0 -8px 26px rgb(72 47 24 / 12%);
}

.nav-button {
  min-width: 0;
  height: 59px;
  padding: 4px 2px;
  border: 0;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #6a5438;
  background: transparent;
  font-size: 0.61rem;
  font-weight: 750;
}

.nav-button .icon {
  width: 21px;
  height: 21px;
  stroke-width: 1.8;
}

.nav-button.active {
  color: var(--green);
  background: rgb(255 255 255 / 24%);
}

.nav-button.qcm {
  width: 61px;
  height: 61px;
  margin: -19px auto 0;
  border: 4px solid #e7c28b;
  border-radius: 50%;
  color: white;
  background: var(--green);
  box-shadow: 0 6px 14px rgb(30 69 54 / 30%);
}

.nav-button.qcm span { font-size: 0.55rem; }
.nav-button.qcm .icon { width: 24px; height: 24px; }

.segmented {
  margin: -1px 0 16px;
  padding: 5px;
  border: 1px solid #e1d3bd;
  border-radius: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background:
    repeating-linear-gradient(0deg, rgb(100 63 25 / 3%) 0 1px, transparent 1px 6px),
    var(--oak-100);
}

.segment-button {
  min-height: 38px;
  padding: 0 6px;
  border: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #765a38;
  background: transparent;
  font-size: 0.7rem;
  font-weight: 800;
}

.segment-button .icon { width: 15px; height: 15px; }
.segment-button.active {
  color: white;
  background: var(--green);
  box-shadow: 0 3px 8px rgb(36 75 60 / 20%);
}

.classroom-wrap {
  min-height: 575px;
  margin-inline: -16px;
  padding: 4px 16px 24px;
  background:
    radial-gradient(circle at 0 10%, rgb(112 151 105 / 10%) 0 30px, transparent 31px),
    radial-gradient(circle at 100% 90%, rgb(112 151 105 / 9%) 0 38px, transparent 39px),
    linear-gradient(90deg, rgb(89 64 39 / 2%) 1px, transparent 1px),
    #f7f2e8;
  background-size: auto, auto, 8px 100%, auto;
}

.board {
  width: 70%;
  height: 44px;
  margin: 0 auto 24px;
  border: 5px solid #b89567;
  border-top-width: 2px;
  border-radius: 5px 5px 11px 11px;
  display: grid;
  place-items: center;
  color: rgb(255 255 255 / 75%);
  background:
    repeating-linear-gradient(-5deg, rgb(255 255 255 / 3%) 0 1px, transparent 1px 9px),
    #2f4b3d;
  box-shadow: 0 5px 8px rgb(69 52 31 / 14%);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.seat-plan {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 24px;
  max-width: 420px;
  margin: 0 auto;
}

.desk {
  min-height: 57px;
  border: 1px solid #dec49d;
  border-radius: 17px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  background:
    repeating-linear-gradient(2deg, rgb(143 91 36 / 3%) 0 1px, transparent 1px 7px),
    linear-gradient(140deg, #f5dfb9, #f1d4a6);
  box-shadow: 0 4px 9px rgb(96 65 35 / 12%);
}

.desk.single {
  width: 70%;
  justify-self: center;
  grid-template-columns: 1fr;
}

.desk-seat {
  position: relative;
  min-width: 0;
  min-height: 56px;
  padding: 6px 4px;
  border: 0;
  border-right: 1px solid rgb(150 98 45 / 15%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.desk-seat:last-child { border-right: 0; }
.desk-seat.selected {
  color: #244d78;
  background: #e2ecf8;
  box-shadow: inset 0 0 0 3px #7196c2;
}

.desk-seat.absent {
  color: #8e7e70;
  background: rgb(255 255 255 / 25%);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: #65a078;
  box-shadow: 0 0 0 2px rgb(255 255 255 / 35%);
}

.status-dot.amber { background: #dea321; }
.status-dot.blue { background: #4d80b5; }
.status-dot.violet { background: #8565ab; }
.status-dot.red { background: var(--red); }
.status-dot.gray { background: #a69d90; }

.selection-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: #4c7db3;
  font-size: 0.55rem;
  font-weight: 900;
}

.spatial-plan {
  margin-top: 12px;
}

.plan-toolbar {
  margin-bottom: 10px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.plan-selector {
  min-width: 0;
  flex: 1;
}

.plan-selector label {
  display: block;
  margin: 0 0 4px 2px;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 850;
  text-transform: uppercase;
}

.plan-selector select {
  width: 100%;
  min-height: 42px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: var(--paper);
  font-size: 0.7rem;
  font-weight: 780;
}

.plan-toolbar-actions {
  display: flex;
  gap: 6px;
}

.plan-toolbar-actions .button {
  min-height: 42px;
  padding-inline: 11px;
  border-radius: 13px;
  font-size: 0.65rem;
}

.plan-toolbar-actions .icon-only {
  width: 42px;
  padding: 0;
}

.plan-display-switches {
  margin: -2px 0 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.plan-switch {
  min-width: 0;
  min-height: 43px;
  padding: 7px 9px;
  border: 1px solid #d8d2c4;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  color: #6d675e;
  background: #f5eee2;
}

.plan-switch > span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.plan-switch .icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.plan-switch strong {
  overflow: hidden;
  font-size: 0.62rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.plan-switch > i {
  width: 31px;
  height: 18px;
  flex: 0 0 auto;
  padding: 2px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  background: #c9c5bd;
  transition: background 160ms ease;
}

.plan-switch > i > b {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: block;
  background: white;
  box-shadow: 0 1px 3px rgb(64 52 36 / 22%);
  transition: transform 160ms ease;
}

.plan-switch.active {
  border-color: #99b7a8;
  color: #285746;
  background: #e5eee8;
}

.plan-switch.active > i {
  background: var(--green);
}

.plan-switch.active > i > b {
  transform: translateX(13px);
}

.plan-attendance-bar {
  margin: -2px 0 10px;
  padding: 10px 11px;
  border: 1px solid #d8c2aa;
  border-radius: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  background: #f8ecdd;
}

.plan-attendance-bar strong,
.plan-attendance-bar span {
  display: block;
}

.plan-attendance-bar strong {
  font-size: 0.67rem;
}

.plan-attendance-bar span {
  margin-top: 2px;
  color: #76654e;
  font-size: 0.52rem;
  line-height: 1.25;
}

.plan-attendance-bar .button {
  min-height: 36px;
  padding-inline: 9px;
  font-size: 0.59rem;
}

.seat-marker-badge {
  position: absolute;
  z-index: 3;
  right: 3px;
  bottom: 3px;
  min-width: 23px;
  margin: 0;
  padding: 2px 4px;
  border-radius: 6px;
  color: white;
  text-align: center;
  background: #244d78;
  box-shadow: 0 2px 5px rgb(35 75 117 / 22%);
  font-size: 0.39rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  pointer-events: none;
}

.layout-editor-controls {
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid #d9d2c4;
  border-radius: 16px;
  background: #f3ead9;
  box-shadow: var(--shadow-sm);
}

.layout-editor-fields {
  display: grid;
  grid-template-columns: 1.15fr 0.8fr 0.8fr;
  gap: 7px;
}

.layout-editor-fields > .field-row {
  grid-column: 1 / -1;
}

.field-row.compact {
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 6px;
}

.size-apply,
.layout-item-size > button {
  min-height: 39px;
  padding: 0 9px;
  border: 0;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: white;
  background: var(--green);
  font-size: 0.53rem;
  font-weight: 850;
}

.size-apply .icon,
.layout-item-size > button .icon {
  width: 12px;
  height: 12px;
}

.layout-editor-controls .field input,
.layout-editor-controls .field select {
  min-height: 39px;
  padding-block: 7px;
  border-radius: 11px;
  font-size: 0.67rem;
}

.layout-add-tools {
  margin-top: 9px;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.layout-add-tools::-webkit-scrollbar {
  display: none;
}

.layout-add-tools button {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid #d7c9af;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #655238;
  background: rgb(255 255 255 / 72%);
  font-size: 0.56rem;
  font-weight: 850;
  white-space: nowrap;
}

.layout-add-tools button.active {
  color: white;
  border-color: var(--green);
  background: var(--green);
}

.layout-add-tools .icon {
  width: 12px;
  height: 12px;
}

.layout-editor-hint {
  margin-top: 9px;
  padding: 8px 9px;
  border-radius: 11px;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: #465d52;
  background: #e4eee7;
  font-size: 0.59rem;
  line-height: 1.4;
}

.layout-editor-hint .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.layout-item-size {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid #d7cdbb;
  border-radius: 11px;
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 82px 82px auto;
  align-items: end;
  gap: 7px;
  background: rgb(255 255 255 / 58%);
}

.layout-item-size strong {
  align-self: center;
  color: #63533e;
  font-size: 0.59rem;
}

.layout-item-size label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.5rem;
  font-weight: 800;
}

.layout-item-size input {
  width: 100%;
  min-height: 32px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  font-size: 0.62rem;
  font-weight: 800;
}

.layout-nudge {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(5, 34px) minmax(76px, 1fr);
  gap: 5px;
}

.layout-nudge button {
  min-height: 34px;
  border: 1px solid #d3c8b5;
  border-radius: 9px;
  color: var(--ink);
  background: white;
  font-size: 0.8rem;
  font-weight: 900;
}

.layout-nudge .remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #95493d;
  background: var(--red-soft);
  font-size: 0.57rem;
}

.layout-nudge .remove .icon {
  width: 12px;
  height: 12px;
}

.layout-nudge button:not(.remove) .icon {
  width: 14px;
  height: 14px;
}

.classroom-wrap.spatial {
  min-height: 0;
  margin-inline: -16px;
  padding: 5px 12px 22px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.layout-surface {
  position: relative;
  width: max(100%, calc(var(--layout-cols) * 18px + 12px));
  max-width: none;
  margin: 0 auto;
  padding: 54px 6px 6px;
}

.layout-board {
  position: absolute;
  z-index: 3;
  top: 4px;
  left: 18%;
  right: 18%;
  height: 37px;
  border: 4px solid #b89567;
  border-top-width: 2px;
  border-radius: 5px 5px 10px 10px;
  display: grid;
  place-items: center;
  color: rgb(255 255 255 / 75%);
  background:
    repeating-linear-gradient(-5deg, rgb(255 255 255 / 3%) 0 1px, transparent 1px 9px),
    #2f4b3d;
  box-shadow: 0 4px 7px rgb(69 52 31 / 13%);
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.layout-surface.board-bottom {
  padding: 6px 6px 54px;
}

.layout-surface.board-bottom .layout-board {
  top: auto;
  bottom: 4px;
  border-width: 2px 4px 4px;
  transform: rotate(180deg);
}

.layout-surface.board-left {
  padding: 6px 6px 6px 46px;
}

.layout-surface.board-right {
  padding: 6px 46px 6px 6px;
}

.layout-surface.board-left .layout-board,
.layout-surface.board-right .layout-board {
  top: 18%;
  bottom: 18%;
  left: 4px;
  right: auto;
  width: 31px;
  height: auto;
  writing-mode: vertical-rl;
}

.layout-surface.board-right .layout-board {
  left: auto;
  right: 4px;
  transform: rotate(180deg);
}

.room-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--layout-cols), minmax(0, 1fr));
  grid-template-rows: repeat(var(--layout-rows), 27px);
  gap: 3px;
  padding: 5px;
  border: 1px solid #dfd8cb;
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgb(112 102 87 / 5%) 1px, transparent 1px),
    linear-gradient(rgb(112 102 87 / 5%) 1px, transparent 1px),
    #faf7f0;
  background-size: calc(100% / var(--layout-cols)) calc(100% / var(--layout-rows));
  box-shadow: inset 0 0 24px rgb(91 68 42 / 4%);
}

.room-grid.editing {
  border-color: #9cb2a5;
  background-color: #f4f8f5;
}

.room-grid.shape-editing {
  cursor: cell;
}

.layout-grid-cell {
  z-index: 0;
  min-width: 0;
  border: 1px dashed rgb(76 111 94 / 15%);
  border-radius: 4px;
  background: transparent;
}

.layout-grid-cell:active {
  background: rgb(74 121 98 / 10%);
}

.layout-grid-cell.excluded,
.layout-void {
  z-index: 1;
  border: 1px solid rgb(129 117 101 / 12%);
  border-radius: 3px;
  background:
    repeating-linear-gradient(
      -45deg,
      rgb(104 90 72 / 7%) 0 3px,
      transparent 3px 7px
    ),
    #e9e4db;
}

.layout-void {
  pointer-events: none;
}

.layout-grid-cell.shape-editing {
  cursor: cell;
}

.layout-grid-cell.shape-editing:not(.excluded):hover {
  background: rgb(174 93 72 / 10%);
  box-shadow: inset 0 0 0 1px rgb(174 93 72 / 22%);
}

.layout-grid-cell.shape-editing.excluded:hover {
  background: #dfeae3;
  box-shadow: inset 0 0 0 1px rgb(53 102 78 / 25%);
}

.spatial-table {
  position: relative;
  z-index: 2;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  border: 1px solid #dec49d;
  border-radius: 13px;
  overflow: visible;
  background:
    repeating-linear-gradient(2deg, rgb(143 91 36 / 3%) 0 1px, transparent 1px 7px),
    linear-gradient(140deg, #f5dfb9, #f1d4a6);
  box-shadow: 0 3px 7px rgb(96 65 35 / 12%);
}

.spatial-table.editing {
  border-style: dashed;
}

.spatial-table.item-selected,
.layout-furniture.item-selected {
  outline: 3px solid #5184bb;
  outline-offset: 2px;
}

.spatial-table-seats {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.spatial-table:has(.layout-seat:only-child) .spatial-table-seats {
  grid-template-columns: 1fr;
}

.spatial-table.portrait .spatial-table-seats {
  grid-template-columns: 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.spatial-table.portrait .layout-seat {
  border-right: 0;
  border-bottom: 1px solid rgb(150 98 45 / 15%);
}

.spatial-table.portrait .layout-seat:last-child {
  border-bottom: 0;
}

.table-move-handle {
  position: absolute;
  z-index: 4;
  top: -8px;
  left: 50%;
  width: 30px;
  height: 17px;
  padding: 0;
  border: 1px solid #bfa77f;
  border-radius: 7px;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  color: #725a38;
  background: #fff7e8;
  cursor: grab;
  touch-action: none;
}

.table-move-handle .icon {
  width: 13px;
  height: 13px;
}

.layout-seat {
  position: relative;
  min-width: 0;
  padding: 4px 2px;
  border: 0;
  border-right: 1px solid rgb(150 98 45 / 15%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--ink);
  background: transparent;
  font-size: 0.58rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
}

.layout-seat:last-child {
  border-right: 0;
}

.layout-seat:has(.seat-marker-badge) {
  padding-bottom: 15px;
}

.layout-seat.selected {
  color: #244d78;
  background: #e2ecf8;
  box-shadow: inset 0 0 0 2px #7196c2;
}

.layout-seat.moving {
  color: #244d78;
  background: #dceafa;
  box-shadow: inset 0 0 0 2px #5184bb;
}

.layout-seat.absent {
  color: #8e7e70;
  background: rgb(255 255 255 / 30%);
}

.layout-seat.attendance-mode {
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgb(91 98 91 / 12%);
}

.layout-seat.attendance-absent {
  color: #99493d;
  background: #f8dfda;
  box-shadow: inset 0 0 0 2px #d9877b;
}

.attendance-seat-state {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border-radius: 5px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--green);
}

.attendance-absent .attendance-seat-state {
  background: var(--red);
}

.attendance-seat-state .icon {
  width: 10px;
  height: 10px;
}

.layout-seat.empty {
  color: #937b58;
  font-size: 0.49rem;
  font-weight: 750;
}

.layout-seat.empty.target {
  background: rgb(81 132 187 / 12%);
}

.layout-seat.empty .icon {
  width: 11px;
  height: 11px;
}

.layout-seat .status-dot {
  width: 7px;
  height: 7px;
}

.layout-furniture {
  position: relative;
  z-index: 2;
  min-width: 0;
  min-height: 0;
  padding: 5px;
  border: 1px solid #c9c5bc;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #686965;
  background: #e8e6e0;
  font-size: 0.47rem;
  font-weight: 850;
}

.layout-furniture.editing {
  cursor: grab;
  touch-action: none;
}

.spatial-table.dragging,
.layout-furniture.dragging {
  z-index: 12;
  cursor: grabbing;
  opacity: 0.88;
  filter: drop-shadow(0 9px 10px rgb(45 54 48 / 22%));
}

body.layout-dragging,
body.layout-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
}

.layout-furniture.teacherDesk {
  color: #3e594e;
  background: #dce8df;
  border-color: #b8cbbd;
}

.layout-furniture.door {
  color: #7b5b38;
  background: #f0dfc4;
  border-color: #dbc49f;
}

.layout-furniture.window {
  color: #456c88;
  background: #dfeaf1;
  border-color: #bfd2df;
}

.layout-furniture .icon {
  width: 14px;
  height: 14px;
}

.layout-furniture:disabled {
  opacity: 1;
}

.unassigned-students {
  margin-top: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
}

.unassigned-students > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.unassigned-students > div:first-child strong {
  font-size: 0.7rem;
}

.unassigned-students > div:first-child span {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--amber);
  font-size: 0.58rem;
  font-weight: 900;
}

.unassigned-students > div:nth-child(2) {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.unassigned-students button {
  min-width: 83px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: #f7f5ef;
  font-size: 0.56rem;
  font-weight: 800;
}

.unassigned-students button.selected {
  border-color: #5184bb;
  background: #e2ecf8;
}

.unassigned-students .avatar {
  width: 27px;
  height: 27px;
  font-size: 0.48rem;
}

.unassigned-students p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.6rem;
}

.selection-panel {
  position: fixed;
  z-index: 45;
  left: 0;
  right: 0;
  bottom: calc(var(--nav-h) + var(--safe-bottom) - 1px);
  padding: 10px 14px 14px;
  border-radius: 24px 24px 0 0;
  background:
    repeating-linear-gradient(1deg, rgb(105 65 25 / 3%) 0 1px, transparent 1px 7px),
    #f4deba;
  box-shadow: 0 -12px 34px rgb(59 43 28 / 18%);
  animation: sheet-up 200ms ease-out;
}

@keyframes sheet-up {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.selection-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}

.selection-count {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
}

.selection-head strong {
  font-size: 0.83rem;
}

.selection-head .text-button { margin-left: auto; }

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.quick-action {
  min-width: 0;
  min-height: 68px;
  padding: 7px 2px;
  border: 1px solid rgb(117 79 37 / 10%);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgb(255 253 248 / 78%);
  box-shadow: 0 2px 6px rgb(71 46 22 / 7%);
  font-size: 0.58rem;
  font-weight: 850;
}

.quick-action-icon {
  width: 31px;
  height: 31px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
}

.quick-action:nth-child(1) .quick-action-icon { color: var(--blue); background: var(--blue-soft); }
.quick-action:nth-child(2) .quick-action-icon { color: var(--amber); background: var(--amber-soft); }
.quick-action:nth-child(3) .quick-action-icon { color: var(--violet); background: var(--violet-soft); }
.quick-action:nth-child(4) .quick-action-icon { color: #735b46; background: #eee5d9; }
.quick-action .icon { width: 17px; height: 17px; }

.attendance-callout,
.card-management-callout {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 11px 0 13px;
  padding: 12px 13px;
  border: 1px solid #d6ddd6;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgb(255 255 255 / 72%), transparent),
    #edf3ed;
  box-shadow: var(--shadow-sm);
}

.attendance-callout > div,
.card-management-callout > div {
  min-width: 0;
  flex: 1;
}

.attendance-callout > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.attendance-callout > div > .icon {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  color: var(--green);
}

.attendance-callout small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.56rem;
}

.attendance-callout strong,
.card-management-callout strong {
  display: block;
  font-size: 0.75rem;
}

.attendance-callout p,
.card-management-callout p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.59rem;
  line-height: 1.35;
}

.attendance-callout .button,
.card-management-callout .button,
.compact-button {
  min-height: 38px;
  padding-inline: 11px;
  font-size: 0.64rem;
  white-space: nowrap;
}

.searchbar {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.searchbar .icon { color: #8a908c; width: 18px; height: 18px; }
.searchbar input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 0.78rem;
}

.searchbar input::placeholder { color: #9a9f9b; }

.filter-scroll {
  display: flex;
  gap: 7px;
  margin: 11px -16px 15px;
  padding: 0 16px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-scroll::-webkit-scrollbar { display: none; }

.filter-chip {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #6c716e;
  background: var(--paper);
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.filter-chip.active {
  border-color: var(--green);
  color: white;
  background: var(--green);
}

.student-list {
  display: grid;
  gap: 8px;
}

.student-row {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #345449;
  background: #dfe9dd;
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgb(61 87 76 / 8%);
}

.avatar.amber { color: #7d551c; background: #f5dfb5; }
.avatar.blue { color: #395e78; background: #dde9f1; }
.avatar.violet { color: #6a567e; background: #e9e1ef; }
.avatar.rose { color: #86584d; background: #f0ddd7; }

.student-main {
  min-width: 0;
  flex: 1;
}

.student-name {
  display: block;
  font-size: 0.82rem;
  font-weight: 850;
}

.student-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.64rem;
}

.student-meta .mini-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #b0b3af;
}

.mastery-pill {
  min-width: 47px;
  padding: 6px 7px;
  border-radius: 10px;
  text-align: center;
  color: var(--green);
  background: var(--green-soft);
  font-size: 0.68rem;
  font-weight: 900;
}

.mastery-pill.warn { color: #90631e; background: var(--amber-soft); }
.mastery-pill.low { color: #94483d; background: var(--red-soft); }

.stats-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-bottom: 16px;
}

.stat-box {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.stat-box strong {
  display: block;
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}

.stat-box span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.68rem;
}

.skill-list {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.skill-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 0.72rem;
  font-weight: 800;
}

.skill-row-head span:last-child { color: var(--muted); }

.progress {
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: #ece9e1;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.progress.amber > span { background: var(--amber); }
.progress.blue > span { background: var(--blue); }
.progress.red > span { background: var(--red); }

.quiz-hero {
  padding: 18px;
  border-radius: var(--radius-lg);
  color: white;
  background:
    linear-gradient(120deg, rgb(255 255 255 / 8%), transparent 60%),
    var(--green);
  box-shadow: var(--shadow-md);
}

.quiz-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quiz-status {
  padding: 5px 9px;
  border-radius: 999px;
  color: #d9ede3;
  background: rgb(255 255 255 / 11%);
  font-size: 0.62rem;
  font-weight: 850;
}

.quiz-hero h2 {
  margin: 16px 0 6px;
  font-size: 1.22rem;
  letter-spacing: -0.03em;
}

.quiz-hero p {
  margin: 0;
  color: rgb(255 255 255 / 68%);
  font-size: 0.74rem;
  line-height: 1.45;
}

.quiz-progress {
  display: flex;
  gap: 4px;
  margin: 17px 0;
}

.quiz-progress span {
  height: 5px;
  flex: 1;
  border-radius: 999px;
  background: rgb(255 255 255 / 15%);
}

.quiz-progress span.done { background: #ddbc77; }
.quiz-progress span.current { background: white; }

.quiz-actions {
  display: flex;
  gap: 8px;
}

.quiz-actions .button { flex: 1; }

.response-cards-callout {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  margin-top: 13px;
  padding: 13px;
  border: 1px solid #d6ddd6;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgb(255 255 255 / 72%), transparent),
    #edf3ed;
  box-shadow: var(--shadow-sm);
}

.response-cards-icon {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--green);
  box-shadow: 0 6px 15px rgb(36 75 60 / 18%);
}

.response-cards-icon .icon {
  width: 23px;
  height: 23px;
}

.response-cards-copy {
  min-width: 0;
}

.response-cards-copy .eyebrow {
  margin-bottom: 2px;
  font-size: 0.52rem;
}

.response-cards-copy h3 {
  margin: 0;
  font-size: 0.84rem;
}

.response-cards-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.35;
}

.response-cards-callout .button {
  min-height: 38px;
  padding-inline: 12px;
  font-size: 0.66rem;
}

.builder-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.builder-card h3 {
  margin: 0 0 4px;
  font-size: 0.9rem;
}

.builder-card > p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.4;
}

.criteria-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.criteria-field {
  min-width: 0;
}

.criteria-field.span-2 {
  grid-column: 1 / -1;
}

.criteria-field label {
  display: block;
  margin: 0 0 5px 2px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
}

.criteria-field select {
  width: 100%;
  min-height: 40px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  color: var(--ink);
  background: #faf8f2;
  font-size: 0.7rem;
  font-weight: 750;
}

.theme-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 15px 2px 8px;
  color: var(--ink);
  font-size: 0.65rem;
  font-weight: 850;
}

.theme-picker-head small {
  color: var(--muted);
  font-size: 0.59rem;
}

.theme-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.theme-option {
  min-height: 33px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #68706b;
  background: #faf8f2;
  font-size: 0.63rem;
  font-weight: 800;
}

.theme-option.selected {
  border-color: #9db5a5;
  color: var(--green);
  background: var(--green-soft);
}

.theme-option .icon,
.tag .icon {
  width: 13px;
  height: 13px;
}

.rotation-note {
  margin-top: 11px;
  padding: 9px 10px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #5e6e66;
  background: #edf2ee;
  font-size: 0.6rem;
  font-weight: 750;
  line-height: 1.35;
}

.rotation-note .icon {
  width: 14px;
  height: 14px;
}

.question-stage {
  min-height: calc(100svh - 188px);
  display: flex;
  flex-direction: column;
}

.question-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.question-number {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
}

.quiz-countdown {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  margin-top: 12px;
  padding: 10px 11px;
  border: 1px solid #b9d0c1;
  border-radius: 18px;
  color: var(--green);
  background: linear-gradient(135deg, #edf5ef, #f8fbf8);
  box-shadow: var(--shadow-sm);
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.quiz-countdown.paused {
  color: #78633f;
  border-color: #dcc89d;
  background: #faf3e4;
}

.quiz-countdown.expired {
  color: #9a4438;
  border-color: #deb0a8;
  background: #fbebe7;
}

.countdown-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: white;
  background: currentColor;
}

.countdown-icon .icon {
  color: white;
}

.countdown-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.countdown-copy strong {
  font-size: 1.7rem;
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.countdown-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 750;
}

.countdown-actions {
  display: flex;
  gap: 6px;
}

.countdown-actions .scan-control {
  width: 38px;
  height: 38px;
  color: currentColor;
  background: rgb(255 255 255 / 78%);
}

.question-card {
  margin: 14px 0 12px;
  padding: 20px 17px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.question-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.tag {
  padding: 5px 8px;
  border-radius: 999px;
  color: #6a716c;
  background: #efede7;
  font-size: 0.59rem;
  font-weight: 800;
}

.tag.green { color: var(--green); background: var(--green-soft); }
.tag.amber { color: #94621d; background: var(--amber-soft); }
.tag.blue { color: var(--blue); background: var(--blue-soft); }
.tag.draft { color: #826222; background: #f6e9c8; }

.question-card h2 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.38;
  letter-spacing: -0.025em;
}

.answer-grid {
  display: grid;
  gap: 8px;
}

.answer-option {
  min-height: 54px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--paper);
}

.answer-letter {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--green);
  background: var(--green-soft);
  font-size: 0.74rem;
  font-weight: 900;
}

.answer-option:nth-child(2) .answer-letter { color: var(--blue); background: var(--blue-soft); }
.answer-option:nth-child(3) .answer-letter { color: #9a6319; background: var(--amber-soft); }
.answer-option:nth-child(4) .answer-letter { color: var(--violet); background: var(--violet-soft); }
.answer-option.correct {
  border-color: #91b29d;
  background: #f1f7f2;
}

.answer-option span:last-child {
  font-size: 0.8rem;
  font-weight: 750;
}

.remote-session-card {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fbf8f1;
}

.remote-session-card.connected {
  border-color: #b9cec0;
  background: #f1f7f2;
}

.remote-session-heading {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.remote-session-heading > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.remote-session-heading strong {
  font-size: 0.73rem;
}

.remote-session-heading span {
  color: var(--muted);
  font-size: 0.59rem;
}

.remote-device-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
}

.remote-device-icon .icon {
  width: 19px;
  height: 19px;
}

.connection-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #b9bcb9;
  box-shadow: 0 0 0 4px rgb(185 188 185 / 18%);
}

.connection-dot.online {
  background: #4e966d;
  box-shadow: 0 0 0 4px rgb(78 150 109 / 17%);
}

.remote-session-card > .button {
  margin-top: 10px;
}

.session-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgb(36 75 60 / 10%);
  font-size: 0.65rem;
}

.session-code-row > span {
  color: var(--muted);
}

.session-code-row > strong {
  color: var(--green);
  font-size: 0.92rem;
  letter-spacing: 0.12em;
}

.session-code-row .text-button {
  margin-left: auto;
}

.session-url {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.55rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remote-close {
  display: block;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 0.58rem;
}

.remote-error {
  margin: 8px 2px 0;
  color: var(--red);
  font-size: 0.61rem;
}

.stage-bottom {
  margin-top: auto;
  padding-top: 16px;
}

.projection-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.64rem;
}

.projection-note .icon { width: 14px; height: 14px; }

.scan-page {
  min-height: calc(100svh - var(--nav-h) - var(--safe-bottom));
  padding: 0;
  color: white;
  background: #17231f;
}

.scan-header {
  position: absolute;
  z-index: 4;
  top: calc(12px + var(--safe-top));
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.scan-header .button {
  min-height: 40px;
  padding: 0 12px;
  color: white;
  border-color: rgb(255 255 255 / 18%);
  background: rgb(22 31 28 / 62%);
  backdrop-filter: blur(12px);
}

.remote-question-label {
  padding: 9px 12px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 12px;
  color: white;
  background: rgb(22 31 28 / 62%);
  backdrop-filter: blur(12px);
  font-size: 0.66rem;
  font-weight: 850;
}

.camera-view {
  position: relative;
  height: 60svh;
  min-height: 410px;
  overflow: hidden;
  background:
    radial-gradient(circle at 52% 45%, rgb(84 123 106 / 32%), transparent 35%),
    linear-gradient(145deg, #2a3933, #121b18);
}

.camera-view video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
}

.camera-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgb(255 255 255 / 7%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 7%) 1px, transparent 1px);
  background-size: 25% 25%;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

.scan-frame {
  position: absolute;
  inset: 18% 10% 15%;
  border: 1px solid rgb(255 255 255 / 26%);
  border-radius: 24px;
}

.scan-frame::before,
.scan-frame::after {
  content: "";
  position: absolute;
  width: 38px;
  height: 38px;
  border-color: #d9b96f;
  border-style: solid;
}

.scan-frame::before {
  top: -2px;
  left: -2px;
  border-width: 3px 0 0 3px;
  border-radius: 12px 0 0;
}

.scan-frame::after {
  right: -2px;
  bottom: -2px;
  border-width: 0 3px 3px 0;
  border-radius: 0 0 12px;
}

.scan-line {
  position: absolute;
  left: 11%;
  right: 11%;
  top: 40%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e5c986, transparent);
  box-shadow: 0 0 10px #e5c986;
  animation: scan-line 2.8s ease-in-out infinite;
}

@keyframes scan-line {
  0%, 100% { transform: translateY(-100px); opacity: 0; }
  15%, 85% { opacity: 1; }
  50% { transform: translateY(115px); }
}

.demo-label {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  padding: 6px 10px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 999px;
  color: rgb(255 255 255 / 70%);
  background: rgb(12 20 17 / 55%);
  backdrop-filter: blur(10px);
  font-size: 0.59rem;
  font-weight: 800;
  white-space: nowrap;
}

.remote-timer {
  position: absolute;
  z-index: 3;
  top: calc(68px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  min-width: 112px;
  padding: 7px 12px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: white;
  background: rgb(16 28 23 / 72%);
  backdrop-filter: blur(10px);
}

.remote-timer span {
  color: rgb(255 255 255 / 65%);
  font-size: 0.5rem;
  font-weight: 750;
}

.remote-timer strong {
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.remote-timer.expired {
  color: #ffd6cf;
  border-color: rgb(225 122 106 / 48%);
  background: rgb(91 32 25 / 78%);
}

.detection-chip {
  position: absolute;
  z-index: 2;
  padding: 4px 7px;
  border: 1px solid rgb(255 255 255 / 26%);
  border-radius: 8px;
  color: white;
  background: rgb(48 105 78 / 72%);
  backdrop-filter: blur(4px);
  font-size: 0.58rem;
  font-weight: 850;
  animation: pop 160ms ease-out;
}

.detection-chip.ambiguous { background: rgb(176 113 35 / 78%); }

@keyframes pop {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.scan-panel {
  position: relative;
  z-index: 3;
  min-height: 40svh;
  margin-top: -20px;
  padding: 17px 15px calc(20px + var(--safe-bottom));
  border-radius: 24px 24px 0 0;
  color: var(--ink);
  background: #f8f5ed;
}

.remote-question-mini {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.remote-question-mini span {
  color: var(--green);
  font-size: 0.56rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.remote-question-mini strong {
  font-size: 0.72rem;
  line-height: 1.35;
}

.remote-sync-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.55rem;
}

.remote-sync-note .connection-dot {
  width: 7px;
  height: 7px;
  box-shadow: none;
}

.scan-all-detected {
  color: var(--green);
  font-size: 0.66rem;
  font-weight: 850;
}

.remote-scanner-state {
  min-height: 100svh;
  padding: 28px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  color: var(--ink);
  background: var(--cream);
}

.remote-scanner-state .remote-device-icon {
  width: 62px;
  height: 62px;
  border-radius: 20px;
}

.remote-scanner-state h1 {
  margin: 18px 0 5px;
  font-size: 1.25rem;
}

.remote-scanner-state p {
  max-width: 280px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.remote-shell {
  padding-bottom: 0;
}

.projector-page {
  min-height: 100svh;
  padding: clamp(22px, 4vw, 52px);
  display: flex;
  flex-direction: column;
  color: #f9f5e9;
  background:
    radial-gradient(circle at 16% 12%, rgb(213 184 119 / 16%), transparent 28rem),
    linear-gradient(145deg, #263b32, #14231e 62%, #1d3028);
}

.projector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: clamp(18px, 3vw, 34px);
  border-bottom: 1px solid rgb(255 255 255 / 13%);
}

.projector-header > div {
  display: flex;
  flex-direction: column;
}

.projector-header span {
  color: rgb(255 255 255 / 60%);
  font-size: clamp(0.64rem, 1.3vw, 0.9rem);
  font-weight: 750;
}

.projector-header strong {
  margin-top: 3px;
  font-size: clamp(1rem, 2vw, 1.45rem);
}

.projector-question-index {
  padding: 9px 14px;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 999px;
  background: rgb(255 255 255 / 7%);
}

.projector-question {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(25px, 5vh, 64px) 0;
}

.projector-timer {
  align-self: flex-end;
  min-width: clamp(150px, 19vw, 250px);
  padding: clamp(12px, 1.8vw, 20px);
  border: 1px solid rgb(221 194 132 / 36%);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #f1d696;
  background: rgb(9 20 15 / 28%);
}

.projector-timer span {
  color: rgb(255 255 255 / 60%);
  font-size: clamp(0.62rem, 1.2vw, 0.9rem);
  font-weight: 750;
}

.projector-timer strong {
  margin-top: 3px;
  font-size: clamp(2.2rem, 6vw, 5rem);
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.projector-timer.expired {
  color: #ffc6bb;
  border-color: rgb(211 101 83 / 60%);
  background: rgb(104 35 25 / 32%);
}

.projector-kicker {
  color: #d9bd7e;
  font-size: clamp(0.68rem, 1.5vw, 1rem);
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.projector-question h1 {
  max-width: 1050px;
  margin: clamp(10px, 2vw, 20px) 0 clamp(22px, 4vw, 46px);
  font-size: clamp(1.8rem, 4vw, 4.3rem);
  line-height: 1.16;
  letter-spacing: -0.035em;
}

.projector-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(10px, 1.8vw, 20px);
}

.projector-answers > div {
  min-height: clamp(72px, 11vh, 124px);
  padding: clamp(12px, 2vw, 22px);
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 22px);
  background: rgb(255 255 255 / 7%);
}

.projector-answers span {
  width: clamp(42px, 5vw, 64px);
  height: clamp(42px, 5vw, 64px);
  border-radius: 16px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #1f392f;
  background: #e8ce92;
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 900;
}

.projector-answers strong {
  font-size: clamp(1rem, 2.2vw, 1.8rem);
  line-height: 1.25;
}

.projector-footer {
  padding-top: clamp(14px, 2.5vw, 25px);
  border-top: 1px solid rgb(255 255 255 / 13%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: rgb(255 255 255 / 60%);
  font-size: clamp(0.62rem, 1.2vw, 0.85rem);
}

.projector-footer > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.projector-footer strong {
  color: #e9f1eb;
}

.projector-results {
  flex: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.projector-results > strong {
  margin-top: 10px;
  color: #d9bd7e;
  font-size: clamp(4rem, 11vw, 9rem);
  line-height: 1;
  letter-spacing: -0.07em;
}

.projector-results h1 {
  margin: 9px 0 clamp(25px, 4vw, 48px);
  font-size: clamp(1.3rem, 3vw, 2.5rem);
}

.projector-bars {
  height: clamp(150px, 24vh, 260px);
  display: flex;
  align-items: flex-end;
  gap: clamp(24px, 6vw, 80px);
}

.projector-bar-wrap {
  min-width: clamp(44px, 6vw, 80px);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
}

.projector-bar-wrap span {
  font-weight: 850;
}

.projector-bar-wrap i {
  width: 100%;
  max-height: 75%;
  border-radius: 9px 9px 2px 2px;
  background: #668678;
}

.projector-bar-wrap i.correct {
  background: #d9bd7e;
}

.projector-bar-wrap b {
  font-size: clamp(1rem, 2vw, 1.5rem);
}

.projector-results p {
  margin-top: 30px;
  color: rgb(255 255 255 / 52%);
  font-size: clamp(0.62rem, 1.2vw, 0.85rem);
}

.pulse {
  animation: remote-pulse 1.5s ease-in-out infinite;
}

@keyframes remote-pulse {
  50% { transform: scale(1.06); opacity: 0.72; }
}

.scan-count-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.scan-count strong {
  font-size: 1.55rem;
  letter-spacing: -0.04em;
}

.scan-count span {
  color: var(--muted);
  font-size: 0.7rem;
}

.scan-controls {
  display: flex;
  gap: 7px;
}

.scan-control {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: white;
}

.scan-progress {
  height: 6px;
  margin: 12px 0 14px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5e2da;
}

.scan-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #72a283);
  transition: width 250ms ease;
}

.scan-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 13px;
}

.scan-stat {
  padding: 9px;
  border-radius: 12px;
  background: white;
  border: 1px solid var(--line);
}

.scan-stat strong {
  display: block;
  font-size: 0.85rem;
}

.scan-stat span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.58rem;
}

.scan-stat.warn strong { color: var(--amber); }

.missing-strip {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
}

.missing-label {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  flex: 0 0 auto;
}

.mini-avatar {
  width: 27px;
  height: 27px;
  border: 2px solid #f8f5ed;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #4e5a55;
  background: #dfe7df;
  font-size: 0.51rem;
  font-weight: 900;
}

.results-hero {
  padding: 19px;
  border-radius: var(--radius-lg);
  text-align: center;
  color: white;
  background:
    radial-gradient(circle at center top, rgb(255 255 255 / 15%), transparent 45%),
    var(--green);
  box-shadow: var(--shadow-md);
}

.score-ring {
  width: 100px;
  height: 100px;
  margin: 3px auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(#e5bd69 var(--score), rgb(255 255 255 / 15%) 0);
}

.score-ring-inner {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
}

.score-ring strong {
  display: block;
  font-size: 1.4rem;
  letter-spacing: -0.04em;
}

.score-ring span {
  display: block;
  color: rgb(255 255 255 / 65%);
  font-size: 0.56rem;
}

.results-hero h2 {
  margin: 0;
  font-size: 1.05rem;
}

.results-hero p {
  margin: 5px 0 0;
  color: rgb(255 255 255 / 68%);
  font-size: 0.7rem;
}

.distribution-card {
  margin-top: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.distribution {
  height: 150px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 12px;
  margin-top: 16px;
}

.bar-wrap {
  height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.bar {
  width: 100%;
  max-width: 45px;
  min-height: 5px;
  border-radius: 8px 8px 3px 3px;
  background: #cfdadd;
  transition: height 300ms ease;
}

.bar.correct { background: var(--green); }
.bar-count { font-size: 0.67rem; font-weight: 900; }
.bar-label {
  width: 27px;
  height: 27px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #efede7;
  font-size: 0.67rem;
  font-weight: 900;
}
.bar-label.correct { color: white; background: var(--green); }

.explanation-card {
  margin-top: 10px;
  padding: 14px;
  border-radius: var(--radius);
  color: #395e4b;
  background: var(--green-soft);
}

.explanation-card strong {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.76rem;
}

.explanation-card p {
  margin: 7px 0 0;
  font-size: 0.7rem;
  line-height: 1.45;
}

.question-list {
  display: grid;
  gap: 9px;
}

.question-list-card {
  width: 100%;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: left;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.question-list-top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
}

.question-list-top .tag:last-of-type { margin-right: auto; }
.question-list-top .icon { width: 15px; height: 15px; color: #969b97; }

.question-list-card h3 {
  margin: 0;
  font-size: 0.79rem;
  line-height: 1.4;
}

.question-list-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 700;
}

.difficulty {
  display: flex;
  gap: 2px;
}

.difficulty i {
  width: 4px;
  height: 12px;
  border-radius: 2px;
  background: #ddd9d0;
}

.difficulty i.on { background: var(--amber); }

.fab {
  position: fixed;
  z-index: 40;
  right: 16px;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 15px);
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  background: var(--green);
  box-shadow: 0 8px 22px rgb(36 75 60 / 28%);
  font-size: 0.72rem;
  font-weight: 900;
}

.empty-state {
  padding: 35px 20px;
  border: 1px dashed #d8d1c4;
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
}

.empty-state .icon {
  width: 30px;
  height: 30px;
  margin-bottom: 8px;
  color: #99a09b;
}

.empty-state strong {
  display: block;
  color: var(--ink);
  font-size: 0.82rem;
}

.empty-state p {
  margin: 5px 0 0;
  font-size: 0.7rem;
  line-height: 1.4;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  padding: max(16px, var(--safe-top)) 12px max(16px, var(--safe-bottom));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgb(21 29 26 / 55%);
  backdrop-filter: blur(4px);
  animation: fade-in 160ms ease-out;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-height: calc(100svh - 28px);
  border-radius: 25px 25px 20px 20px;
  overflow: hidden;
  background: var(--cream);
  box-shadow: var(--shadow-lg);
  animation: sheet-up 200ms ease-out;
}

.modal-handle {
  width: 38px;
  height: 4px;
  margin: 8px auto 4px;
  border-radius: 999px;
  background: #d2cabd;
}

.modal-head {
  min-height: 59px;
  padding: 8px 15px 11px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-head h2 {
  min-width: 0;
  flex: 1;
  margin: 0;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-close {
  width: 37px;
  height: 37px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #747c77;
  background: #e9e6df;
}

.modal-body {
  max-height: calc(100svh - 110px);
  padding: 15px;
  overflow-y: auto;
}

.modal.wide {
  max-width: 760px;
}

.marker-backdrop {
  padding: 16px;
  align-items: center;
}

.marker-modal {
  width: min(980px, calc(100vw - 32px));
  height: min(920px, calc(100svh - 32px));
  max-width: none;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
}

.marker-modal .modal-body {
  max-height: none;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.class-manager-modal .modal-head > div,
.schedule-manager-modal .modal-head > div {
  min-width: 0;
  flex: 1;
}

.class-manager-modal .modal-head .eyebrow,
.schedule-manager-modal .modal-head .eyebrow {
  margin-bottom: 1px;
  font-size: 0.54rem;
}

.manager-intro {
  padding: 13px;
  border: 1px solid #d8e2da;
  border-radius: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--green-soft);
}

.manager-intro p {
  flex: 1;
  margin: 0;
  color: #506059;
  font-size: 0.67rem;
  line-height: 1.45;
}

.manager-intro .button,
.schedule-manager-head .button {
  min-height: 39px;
  padding-inline: 12px;
  flex: 0 0 auto;
  font-size: 0.66rem;
}

.managed-class-list {
  margin-top: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  background: white;
}

.managed-class-row {
  min-height: 72px;
  border-bottom: 1px solid #ece7dd;
  display: flex;
  align-items: stretch;
}

.managed-class-row:last-child {
  border-bottom: 0;
}

.managed-class-row.active {
  background: #f1f6f2;
}

.managed-class-main {
  min-width: 0;
  flex: 1;
  padding: 10px 8px 10px 11px;
  border: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: transparent;
}

.managed-class-icon {
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
}

.managed-class-row.active .managed-class-icon {
  color: white;
  background: var(--green);
}

.managed-class-icon .icon {
  width: 18px;
  height: 18px;
}

.managed-class-main > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.managed-class-main strong,
.managed-class-main small {
  display: block;
}

.managed-class-main strong {
  font-size: 0.8rem;
}

.managed-class-main small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.59rem;
}

.managed-class-main em {
  padding: 5px 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--green);
  background: white;
  font-size: 0.5rem;
  font-style: normal;
  font-weight: 900;
}

.managed-class-main em .icon {
  width: 11px;
  height: 11px;
}

.managed-class-edit {
  width: 50px;
  border: 0;
  border-left: 1px solid #ece7dd;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: transparent;
}

.managed-class-edit .icon {
  width: 17px;
  height: 17px;
}

.student-membership-head {
  margin-top: 3px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.student-membership-head h3 {
  margin: 0;
  font-size: 0.84rem;
}

.student-membership-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.62rem;
}

.student-membership-head > span {
  color: var(--green);
  font-size: 0.6rem;
  font-weight: 850;
  white-space: nowrap;
}

.student-membership-grid {
  max-height: 330px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  overflow-y: auto;
  background: #ebe7de;
}

.student-membership-item {
  min-width: 0;
  min-height: 53px;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
}

.student-membership-item:has(input:checked) {
  border-color: #90af9d;
  background: #eff6f1;
}

.student-membership-item input {
  position: absolute;
  opacity: 0;
}

.student-membership-item .avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  font-size: 0.56rem;
}

.student-membership-item > span:nth-of-type(2) {
  min-width: 0;
  flex: 1;
}

.student-membership-item strong,
.student-membership-item small {
  display: block;
}

.student-membership-item strong {
  overflow: hidden;
  font-size: 0.65rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.student-membership-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.5rem;
}

.student-membership-item i {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border: 1px solid #d6d2c8;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: transparent;
  background: #f7f5ef;
}

.student-membership-item:has(input:checked) i {
  border-color: var(--green);
  color: white;
  background: var(--green);
}

.student-membership-item i .icon {
  width: 12px;
  height: 12px;
}

.class-membership-grid {
  max-height: 240px;
}

.add-student-from-class {
  margin: 2px 0 8px;
}

.student-class-memberships {
  margin-bottom: 15px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f5f0e7;
}

.student-class-memberships > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.68rem;
}

.student-class-memberships > div:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.student-class-memberships > div:last-child > span {
  padding: 5px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 0.55rem;
  font-weight: 800;
}

.student-class-memberships > div:last-child .icon {
  width: 12px;
  height: 12px;
}

.attendance-instruction {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 12px;
  padding: 10px 11px;
  border-radius: 13px;
  color: #3d5148;
  background: var(--green-soft);
  font-size: 0.65rem;
  line-height: 1.4;
}

.attendance-instruction .icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.attendance-grid {
  max-height: 55vh;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  overflow-y: auto;
  background: #ebe7de;
}

.attendance-student {
  min-width: 0;
  min-height: 57px;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
}

.attendance-student input {
  position: absolute;
  opacity: 0;
}

.attendance-student .avatar {
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  font-size: 0.56rem;
}

.attendance-student > span:nth-of-type(2) {
  min-width: 0;
  flex: 1;
}

.attendance-student strong,
.attendance-student small {
  display: block;
}

.attendance-student strong {
  overflow: hidden;
  font-size: 0.63rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.attendance-student small {
  margin-top: 2px;
  color: var(--green);
  font-size: 0.51rem;
  font-weight: 800;
}

.attendance-student i {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--green);
}

.attendance-student i .icon {
  width: 13px;
  height: 13px;
}

.attendance-student.absent {
  border-color: #d9a198;
  background: var(--red-soft);
}

.attendance-student.absent small {
  color: var(--red);
}

.attendance-student.absent i {
  background: var(--red);
}

.observation-presets {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.observation-presets legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 800;
}

.observation-presets > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.observation-presets label {
  position: relative;
}

.observation-presets input {
  position: absolute;
  opacity: 0;
}

.observation-presets span {
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: #5d625e;
  background: white;
  font-size: 0.58rem;
  font-weight: 780;
}

.observation-presets input:checked + span {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-soft);
}

.manager-days {
  margin-bottom: 14px;
}

.schedule-manager-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.schedule-manager-head h3 {
  margin: 0;
  font-size: 0.9rem;
}

.schedule-manager-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.62rem;
}

.managed-slot-list {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  background: white;
}

.managed-slot-row {
  width: 100%;
  min-height: 64px;
  padding: 9px 11px;
  border: 0;
  border-bottom: 1px solid #ece7dd;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  background: transparent;
}

.managed-slot-row:last-child {
  border-bottom: 0;
}

.managed-slot-copy {
  min-width: 0;
  flex: 1;
}

.managed-slot-copy strong,
.managed-slot-copy small {
  display: block;
}

.managed-slot-copy strong {
  font-size: 0.76rem;
}

.managed-slot-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.59rem;
}

.managed-slot-row > .icon {
  width: 16px;
  height: 16px;
  color: var(--blue);
}

.empty-state.compact {
  min-height: 135px;
  padding-block: 20px;
}

.delete-slot-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid #e8c7c0;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #95493d;
  background: var(--red-soft);
  font-size: 0.68rem;
  font-weight: 850;
}

.delete-slot-button .icon {
  width: 15px;
  height: 15px;
}

.marker-modal .modal-head > div {
  min-width: 0;
  flex: 1;
}

.marker-modal .modal-head .eyebrow {
  margin-bottom: 1px;
  font-size: 0.55rem;
}

.marker-explainer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #d7e2d9;
  border-radius: 14px;
  color: #3d5148;
  background: var(--green-soft);
}

.marker-explainer-icon {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--green);
}

.marker-explainer-icon .icon {
  width: 17px;
  height: 17px;
}

.marker-explainer p {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.5;
}

.marker-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 13px;
}

.marker-checkbox {
  grid-column: 1 / -1;
  min-height: 43px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #505853;
  background: white;
  font-size: 0.7rem;
  font-weight: 780;
}

.marker-checkbox input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.marker-checkbox > span {
  width: 22px;
  height: 22px;
  border: 1px solid #cfcbbf;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: transparent;
  background: #f7f5ef;
}

.marker-checkbox input:checked + span {
  border-color: var(--green);
  color: white;
  background: var(--green);
}

.marker-checkbox .icon {
  width: 14px;
  height: 14px;
}

.marker-summary {
  margin: 16px 1px 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 0.72rem;
}

.marker-summary small {
  color: var(--muted);
  font-size: 0.59rem;
}

.marker-summary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.marker-summary-actions .text-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.marker-summary-actions .icon {
  width: 13px;
  height: 13px;
}

.card-replacement-panel {
  margin-top: 13px;
  padding: 13px;
  border: 1px solid #dec999;
  border-radius: 15px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 55%), transparent),
    #f4ead6;
}

.card-replacement-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-replacement-head h3 {
  margin: 0;
  font-size: 0.84rem;
}

.card-replacement-head .eyebrow {
  margin-bottom: 2px;
  font-size: 0.52rem;
}

.modal-close.compact {
  width: 31px;
  height: 31px;
  border-radius: 10px;
  color: #786540;
  background: rgb(255 255 255 / 60%);
}

.card-replacement-panel > p {
  margin: 6px 0 0;
  color: #76684d;
  font-size: 0.63rem;
  line-height: 1.4;
}

.replacement-controls {
  margin: 11px 0 10px;
}

.global-marker-impact {
  max-height: 110px;
  margin: 0 0 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  overflow-y: auto;
}

.global-marker-impact span {
  padding: 5px 8px;
  border: 1px solid #dccda9;
  border-radius: 999px;
  color: #675a40;
  background: rgb(255 255 255 / 64%);
  font-size: 0.55rem;
  font-weight: 760;
}

.marker-management-head {
  margin: 14px 1px 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.marker-management-head h3 {
  margin: 0;
  font-size: 0.82rem;
}

.marker-management-head p {
  max-width: 250px;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1.35;
}

.marker-management-head .text-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6rem;
  white-space: nowrap;
}

.marker-management-head .icon {
  width: 13px;
  height: 13px;
}

.marker-assignment-table-wrap {
  max-height: min(45vh, 390px);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: auto;
  background: #ebe7de;
}

.marker-modal .marker-assignment-table-wrap {
  min-height: 140px;
  max-height: none;
  flex: 1;
}

.marker-assignment-table {
  min-width: max-content;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ink);
  font-size: 0.59rem;
}

.marker-assignment-table th,
.marker-assignment-table td {
  min-width: 118px;
  height: 37px;
  padding: 3px 5px;
  border-right: 1px solid #e6e1d7;
  border-bottom: 1px solid #e6e1d7;
  background: white;
}

.marker-assignment-table thead th {
  position: sticky;
  z-index: 2;
  top: 0;
  color: #52645a;
  text-align: left;
  background: #f3ead9;
  font-size: 0.56rem;
  font-weight: 900;
}

.marker-assignment-table .marker-export-column,
.marker-assignment-table td:first-child {
  position: sticky;
  z-index: 1;
  left: 0;
  min-width: 41px;
  width: 41px;
  padding-inline: 4px;
  text-align: center;
}

.marker-assignment-table thead .marker-export-column {
  z-index: 3;
}

.marker-assignment-table th[scope="row"] {
  position: sticky;
  z-index: 1;
  left: 41px;
  min-width: 52px;
  width: 52px;
  padding-inline: 7px;
  color: #345646;
  text-align: left;
  background: #faf8f2;
  font-size: 0.63rem;
}

.marker-assignment-table thead th:nth-child(2) {
  position: sticky;
  z-index: 3;
  left: 41px;
  min-width: 52px;
  background: #f3ead9;
}

.marker-assignment-table tr:last-child th,
.marker-assignment-table tr:last-child td {
  border-bottom: 0;
}

.marker-assignment-table th:last-child,
.marker-assignment-table td:last-child {
  border-right: 0;
}

.marker-assignment-table tr.marker-unprinted th,
.marker-assignment-table tr.marker-unprinted td {
  color: #85827a;
  background: #f0efeb;
}

.marker-assignment-table tr.marker-lost th,
.marker-assignment-table tr.marker-lost td {
  color: #8a807c;
  background: #efedeb;
}

.marker-assignment-table th[scope="row"] small,
.marker-assignment-table td small {
  display: block;
  margin-top: 1px;
  color: currentColor;
  opacity: 0.78;
  font-size: 0.42rem;
}

.marker-assignment-table td:nth-child(3),
.marker-assignment-table thead th:nth-child(3) {
  min-width: 91px;
  width: 91px;
}

.marker-state-select {
  width: 100%;
  height: 29px;
  padding: 0 18px 0 6px;
  border: 1px solid #dedad0;
  border-radius: 8px;
  color: #5f5b52;
  background: #fbfaf6;
  font-size: 0.53rem;
  font-weight: 760;
}

.marker-assignment-table tr.marker-printed .marker-state-select {
  border-color: #b7824e;
  color: #5e3b20;
  background: #ead0aa;
}

.marker-assignment-table tr.marker-unprinted .marker-state-select {
  border-color: #c8c2b6;
  color: #6f6b62;
  background: #e4e1da;
}

.marker-assignment-table tr.marker-lost .marker-state-select {
  border-color: #c4b6b2;
  color: #6f625f;
  background: #e4ddda;
}

.marker-assignment-select {
  width: 100%;
  min-width: 108px;
  height: 29px;
  padding: 0 21px 0 7px;
  border: 1px solid #dedad0;
  border-radius: 8px;
  color: var(--ink);
  background: #fbfaf6;
  font-size: 0.56rem;
  font-weight: 700;
}

.marker-export-check {
  position: relative;
  width: 23px;
  height: 23px;
  margin: auto;
  display: grid;
  place-items: center;
}

.marker-export-check input {
  position: absolute;
  opacity: 0;
}

.marker-export-check span {
  width: 20px;
  height: 20px;
  border: 1px solid #d2cdc1;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: transparent;
  background: white;
}

.marker-export-check input:checked + span {
  border-color: var(--green);
  color: white;
  background: var(--green);
}

.marker-export-check input:disabled + span {
  opacity: 0.45;
  background: #e9dfdd;
}

.marker-export-check .icon {
  width: 12px;
  height: 12px;
}

.marker-export-bar {
  margin-top: 10px;
  padding: 10px 11px;
  border: 1px solid #cbd8d0;
  border-radius: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  background: #edf3ed;
}

.marker-export-bar strong,
.marker-export-bar span {
  display: block;
}

.marker-export-bar strong {
  font-size: 0.66rem;
}

.marker-export-bar span {
  margin-top: 2px;
  color: #617169;
  font-size: 0.51rem;
  line-height: 1.3;
}

.marker-export-bar .button {
  min-height: 36px;
  padding-inline: 10px;
  font-size: 0.6rem;
}

.marker-export-bar .button:disabled {
  color: #8a8a84;
  border-color: #d5d3cd;
  background: #e7e6e2;
  box-shadow: none;
  opacity: 1;
  cursor: not-allowed;
}

.marker-export-bar .icon {
  width: 14px;
  height: 14px;
}

.marker-retired-note {
  margin: 8px 1px 0;
  color: #8b655e;
  font-size: 0.58rem;
}

.marker-preview {
  padding: 10px;
  border: 1px solid #d9d4c9;
  border-radius: 16px;
  background: #e9e6df;
}

.marker-print-title {
  display: none;
}

.marker-print-sheet {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.response-card {
  min-width: 0;
  padding: 8px;
  border: 1px dashed #bcb9b2;
  border-radius: 10px;
  color: #151817;
  background: white;
}

.response-card-head {
  min-height: 28px;
  padding-bottom: 5px;
  border-bottom: 1px solid #e7e5df;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}

.response-card-head span {
  color: #66706b;
  font-size: 0.4rem;
  font-weight: 900;
  letter-spacing: 0.09em;
}

.response-card-head strong {
  min-width: 0;
  overflow: hidden;
  font-size: 0.55rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.response-marker-stage {
  position: relative;
  width: min(100%, 160px);
  aspect-ratio: 1;
  margin: 5px auto 2px;
  display: grid;
  place-items: center;
}

.fiducial-marker {
  width: 77%;
  height: 77%;
  display: block;
}

.orientation-label {
  position: absolute;
  z-index: 1;
  width: 19px;
  height: 19px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  color: white;
  background: #151817;
  font-size: 0.64rem;
  font-weight: 950;
  line-height: 1;
}

.orientation-label.top {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.orientation-label.right {
  top: 50%;
  right: 0;
  transform: translateY(-50%) rotate(90deg);
}

.orientation-label.bottom {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) rotate(180deg);
}

.orientation-label.left {
  top: 50%;
  left: 0;
  transform: translateY(-50%) rotate(-90deg);
}

.response-card-foot {
  padding-top: 5px;
  border-top: 1px solid #e7e5df;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  font-size: 0.48rem;
}

.response-card-foot span {
  color: #6b706d;
}

.response-card-replace {
  padding: 3px 6px;
  border: 1px solid #d9d5cb;
  border-radius: 6px;
  color: var(--green);
  background: #f4f7f4;
  font-size: 0.43rem;
  font-weight: 850;
}

.marker-print-sheet.single {
  grid-template-columns: minmax(0, 1fr);
}

.marker-print-sheet.single .response-card {
  width: min(100%, 330px);
  justify-self: center;
}

.marker-limit-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 11px;
  padding: 10px 11px;
  border-radius: 13px;
  color: #675b49;
  background: #f3ead9;
  font-size: 0.63rem;
  line-height: 1.45;
}

.marker-limit-note .icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.marker-actions .button:last-child {
  flex: 1.65;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 15px;
}

.profile-identity .avatar {
  width: 56px;
  height: 56px;
  font-size: 0.88rem;
}

.profile-identity h3 {
  margin: 0;
  font-size: 1.08rem;
}

.profile-identity p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.profile-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 17px;
}

.profile-metric {
  padding: 10px 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  text-align: center;
  background: white;
}

.profile-metric strong {
  display: block;
  font-size: 0.88rem;
}

.profile-metric span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.52rem;
}

.timeline {
  position: relative;
  display: grid;
  gap: 0;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 17px;
  width: 1px;
  background: #ddd8cf;
}

.timeline-item {
  position: relative;
  min-height: 60px;
  padding: 8px 0 8px 47px;
}

.timeline-dot {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 7px;
  width: 21px;
  height: 21px;
  border: 4px solid var(--cream);
  border-radius: 50%;
  background: var(--green);
}

.timeline-dot.amber { background: var(--amber); }
.timeline-dot.blue { background: var(--blue); }
.timeline-dot.red { background: var(--red); }

.timeline-item strong {
  display: block;
  font-size: 0.74rem;
}

.timeline-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.35;
}

.timeline-date {
  display: block;
  margin-top: 4px;
  color: #9a9f9b;
  font-size: 0.56rem;
  font-weight: 750;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.field label {
  display: block;
  margin: 0 0 5px 2px;
  color: #68706b;
  font-size: 0.66rem;
  font-weight: 850;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  color: var(--ink);
  background: white;
  font-size: 0.77rem;
}

.field textarea {
  min-height: 78px;
  resize: vertical;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.answer-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.answer-radio {
  width: 22px;
  height: 22px;
  accent-color: var(--green);
}

.form-actions {
  position: sticky;
  bottom: -15px;
  display: flex;
  gap: 8px;
  margin: 8px -15px -15px;
  padding: 12px 15px calc(13px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: rgb(248 245 237 / 95%);
  backdrop-filter: blur(8px);
}

.form-actions .button { flex: 1; }

.toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 14px);
  width: max-content;
  max-width: calc(100% - 32px);
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 12px;
  color: white;
  background: #24312c;
  box-shadow: var(--shadow-md);
  font-size: 0.7rem;
  font-weight: 750;
  animation: toast-in 180ms ease-out;
}

@keyframes toast-in {
  from { transform: translate(-50%, 10px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.offline-banner {
  position: fixed;
  z-index: 80;
  top: calc(8px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 11px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: white;
  background: #785d39;
  box-shadow: var(--shadow-sm);
  font-size: 0.62rem;
  font-weight: 800;
}

.offline-banner .icon { width: 13px; height: 13px; }

.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;
}

@media (min-width: 680px) {
  body { padding: 22px 0; }

  #app {
    width: 440px;
    min-height: calc(100svh - 44px);
    margin: 0 auto;
    border: 1px solid rgb(67 50 30 / 14%);
    border-radius: 32px;
    box-shadow: 0 30px 90px rgb(57 45 32 / 22%);
  }

  .app-shell { min-height: calc(100svh - 44px); }

  #app:has(.question-stage) {
    width: min(920px, calc(100vw - 44px));
  }

  #app:has(.projector-page) {
    width: min(1280px, calc(100vw - 44px));
  }

  #app:has(.projector-page),
  #app:has(.projector-page) .app-shell {
    min-height: calc(100svh - 44px);
  }

  #app:has(.projector-page) .projector-page {
    min-height: calc(100svh - 44px);
  }

  #app:has(.question-stage) .question-stage {
    padding-inline: clamp(30px, 6vw, 76px);
  }

  #app:has(.question-stage) .question-card {
    padding: 26px 24px;
  }

  #app:has(.question-stage) .question-card h2 {
    font-size: clamp(1.4rem, 2.5vw, 2rem);
  }

  #app:has(.question-stage) .answer-grid {
    grid-template-columns: 1fr 1fr;
  }

  #app:has(.question-stage) .answer-option {
    min-height: 68px;
  }

  #app:has(.question-stage) .remote-session-card {
    max-width: 620px;
    width: 100%;
    margin-inline: auto;
  }

  .topbar {
    top: 0;
    padding-top: 15px;
    border-radius: 31px 31px 0 0;
  }

  .bottom-nav,
  .selection-panel {
    left: 50%;
    right: auto;
    width: 440px;
    transform: translateX(-50%);
  }

  .bottom-nav { bottom: 22px; border-radius: 0 0 31px 31px; }
  .selection-panel { bottom: calc(22px + var(--nav-h) - 1px); }
  .fab { right: calc(50% - 204px); bottom: calc(22px + var(--nav-h) + 15px); }

  .modal { max-width: 430px; }
  .toast { bottom: calc(22px + var(--nav-h) + 14px); }
  .scan-page { min-height: calc(100svh - 44px); }
  .question-stage { min-height: calc(100svh - 210px); }
}

@media (max-width: 360px) {
  .page { padding-inline: 12px; }
  .metrics-grid { gap: 6px; }
  .metric-card { padding-inline: 8px; }
  .seat-plan { gap: 19px 14px; }
  .classroom-wrap { margin-inline: -12px; padding-inline: 12px; }
  .quick-actions { gap: 4px; }
  .quick-action { font-size: 0.52rem; }
  .nav-button { font-size: 0.56rem; }
  .response-cards-callout {
    grid-template-columns: 42px minmax(0, 1fr);
  }
  .response-cards-callout .button {
    grid-column: 1 / -1;
    width: 100%;
  }
  .student-membership-grid {
    grid-template-columns: 1fr;
  }
  .attendance-grid {
    grid-template-columns: 1fr;
  }
  .schedule-empty {
    grid-template-columns: 32px minmax(0, 1fr);
  }
  .schedule-empty .button {
    grid-column: 1 / -1;
    width: 100%;
  }
  .layout-editor-fields {
    grid-template-columns: 1fr 1fr;
  }
  .layout-editor-fields > .field:first-child {
    grid-column: 1 / -1;
  }
  .layout-item-size {
    grid-template-columns: 1fr 1fr;
  }
  .layout-item-size strong {
    grid-column: 1 / -1;
  }
  .layout-item-size > button {
    grid-column: 1 / -1;
  }
  .field-row.compact {
    grid-template-columns: 1fr 1fr;
  }
  .field-row.compact .size-apply {
    grid-column: 1 / -1;
  }
  .room-grid {
    grid-template-rows: repeat(var(--layout-rows), 24px);
    gap: 2px;
    padding: 4px;
  }
  .layout-seat {
    font-size: 0.52rem;
  }
  .layout-surface {
    width: max(100%, calc(var(--layout-cols) * 16px + 10px));
  }
}

@page {
  size: A4 portrait;
  margin: 8mm;
}

@media print {
  body {
    padding: 0;
    color: #000;
    background: #fff;
  }

  #app {
    width: auto;
    min-height: 0;
    border: 0;
    box-shadow: none;
  }

  .app-shell {
    min-height: 0;
  }

  .app-shell > * {
    display: none !important;
  }

  .app-shell > .marker-backdrop {
    position: static;
    display: block !important;
    padding: 0;
    background: none;
    backdrop-filter: none;
  }

  .marker-modal {
    width: 100%;
    max-width: none;
    max-height: none;
    overflow: visible;
    border-radius: 0;
    background: white;
    box-shadow: none;
    animation: none;
  }

  .marker-modal > .modal-handle,
  .marker-modal > .modal-head,
  .marker-modal-body > :not(.marker-preview) {
    display: none !important;
  }

  .marker-modal-body {
    max-height: none;
    padding: 0;
    overflow: visible;
  }

  .marker-preview {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: white;
  }

  .marker-print-title {
    height: 10mm;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    color: #000;
    font-size: 9pt;
  }

  .marker-print-title span {
    font-size: 8pt;
  }

  .marker-print-sheet {
    grid-template-columns: repeat(2, 1fr);
    gap: 4mm;
  }

  .response-card {
    height: 128mm;
    padding: 5mm;
    border: 0.35mm dashed #777;
    border-radius: 2mm;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .response-card-head {
    min-height: 9mm;
    padding-bottom: 2mm;
  }

  .response-card-head span {
    font-size: 6pt;
  }

  .response-card-head strong {
    font-size: 9pt;
  }

  .response-marker-stage {
    width: 82mm;
    margin: 2mm auto 1mm;
  }

  .orientation-label {
    width: 9mm;
    height: 9mm;
    border-radius: 1.4mm;
    font-size: 15pt;
  }

  .response-card-foot {
    padding-top: 2mm;
    font-size: 7pt;
  }

  .response-card-replace {
    display: none !important;
  }

  .marker-print-sheet.single {
    grid-template-columns: 94mm;
    justify-content: center;
  }

  .marker-print-sheet.single .response-card {
    width: 94mm;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
