:root {
  --green: #3FA4B3;
  --green-dark: #2d8593;
  --green-soft: #ddf8cf;
  --blue: #1cb0f6;
  --blue-dark: #1286c4;
  --blue-soft: #e5f7ff;
  --yellow: #ffc800;
  --orange: #ff9600;
  --red: #ff4b4b;
  --purple: #b65cff;
  --purple-dark: #9546df;
  --ink: #27313f;
  --muted: #738091;
  --line: #e6edf4;
  --surface: #ffffff;
  --shadow: 0 18px 48px rgba(29, 55, 78, 0.12);
  --button-shadow: inset 0 -6px rgba(0, 0, 0, 0.16);
  --dash-cream: var(--ry-cream, #fff8f4);
  --shell-max: 1440px;
  --shell-gutter: clamp(16px, 3.2vw, 36px);
  --shell-top: 0px;
  --dock-space: 84px;
  --stage-radius: clamp(24px, 4vw, 36px);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 0%, rgba(88, 204, 2, 0.14), transparent 26rem),
    radial-gradient(circle at 88% 8%, rgba(28, 176, 246, 0.15), transparent 28rem),
    #f7fbff;
  font-family: Nunito, system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--ink);
  border: 2px solid #dce8f2;
  border-radius: 15px;
  background: #fff;
  font-weight: 800;
  outline: 0;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(28, 176, 246, 0.13);
}

label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--shell-top) var(--shell-gutter) calc(var(--dock-space) + env(safe-area-inset-bottom));
  overflow-x: clip;
}

.dashboard-stage {
  flex: 0 1 var(--shell-max);
  width: min(100%, var(--shell-max));
  max-width: calc(100vw - (var(--shell-gutter) * 2));
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(226, 235, 244, 0.9);
  border-radius: var(--stage-radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.status-bar,
.top-brand,
.stat,
.hero-actions,
.step-chooser-row,
.bottom-dock,
.bottom-nav,
.bottom-nav a,
.panel-head,
.pill,
.input-row,
.person-card,
.lesson-chip,
.assignment-card-head,
.progress-card-head,
.status-line,
.add-lesson-actions,
.custom-lesson-card-head,
.custom-lesson-actions {
  display: flex;
  align-items: center;
}

.status-bar {
  position: sticky;
  z-index: 20;
  top: 0;
  justify-content: flex-start;
  gap: 12px;
  min-height: 68px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

.top-brand {
  flex: 0 0 auto;
  gap: 7px;
  min-height: 40px;
  margin-right: auto;
  color: var(--blue-dark);
  font-family: Nunito, Inter, sans-serif;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.top-brand img {
  display: block;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  object-fit: contain;
}

.stat {
  position: relative;
  gap: 7px;
  min-height: 40px;
  padding: 0 2px;
  font-weight: 900;
}

.stat::before {
  content: "";
  display: block;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border-radius: 9px;
  box-shadow: inset 0 -3px rgba(0, 0, 0, 0.13);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
}

.class-stat::before {
  background-color: var(--orange);
  background-image: url("../assets/stat-icons/mail.svg");
}

.plan-stat::before {
  background-color: var(--purple);
  background-image: url("../assets/stat-icons/book.svg");
}

.progress-stat::before {
  background-color: var(--green);
  background-image: url("../assets/stat-icons/chart.svg");
}

.stat small {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.class-hero {
  display: grid;
  gap: 10px;
  padding: 20px 18px;
}

.class-hero p,
.class-hero h1,
.panel-head p,
.panel-head h2,
.plan-builder h3,
.pending-box h3,
.custom-lesson-box h3,
.progress-card h3,
.progress-card p,
.add-lesson-lead,
.mode-hint,
.add-lesson-status,
.custom-lesson-box p,
.custom-lesson-card h3,
.custom-lesson-card p {
  margin: 0;
}

.class-hero p,
.panel-head p {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.class-hero h1 {
  max-width: 22ch;
  font-family: Nunito, Inter, sans-serif;
  font-size: clamp(1.45rem, 2.4vw, 2.1rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero-actions,
.step-chooser-row {
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions a,
.invite-form button,
.section-tabs button,
.step-btn {
  min-height: 44px;
  padding: 11px 14px 14px;
  color: #fff;
  border: 0;
  border-radius: 14px;
  background: var(--green);
  box-shadow: var(--button-shadow);
  font-weight: 900;
  text-decoration: none;
}

.hero-actions a:nth-child(2) {
  background: var(--blue);
}

.hero-actions a:nth-child(3) {
  background: var(--purple);
}

.hero-actions a:nth-child(4) {
  background: var(--orange);
}

.hero-actions a:nth-child(5) {
  background: var(--yellow);
  color: var(--ink);
}

.prototype-note {
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 16px;
  background: color-mix(in srgb, #fff 55%, #ffd4d6);
  color: #9a2430;
  font-size: 0.86rem;
  line-height: 1.35;
}

.prototype-note strong {
  flex: 0 0 auto;
  font-weight: 900;
}

.step-chooser {
  display: grid;
  gap: 10px;
  margin: 0;
}

.step-chooser-label,
.step-chooser-row,
.step-btn {
  display: flex;
}

.step-chooser-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.step-chooser-row {
  align-items: stretch;
}

.step-btn {
  flex: 1 1 132px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-height: 68px;
  padding: 10px 14px 14px;
  color: var(--ink);
  border-radius: 16px;
  background: color-mix(in srgb, #fff 70%, #ffd4d6);
  font-family: Nunito, Inter, sans-serif;
  text-align: left;
}

.step-btn small {
  color: var(--muted);
  font-family: Inter, sans-serif;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.step-btn span {
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

.step-btn.active {
  color: #fff;
}

.step-btn.active small {
  color: rgba(255, 255, 255, 0.82);
}

.step-btn[data-step="invite"].active {
  background: var(--green);
}

.step-btn[data-step="plan"].active {
  background: var(--blue);
}

.step-btn[data-step="homework"].active {
  background: var(--purple);
}

.step-btn[data-step="progress"].active {
  background: var(--orange);
}

.step-btn[data-step="add-lesson"].active {
  color: var(--ink);
  background: var(--yellow);
}

.step-btn[data-step="add-lesson"].active small {
  color: rgba(39, 49, 63, 0.7);
}

.step-btn.active {
  box-shadow: inset 0 -3px rgba(0, 0, 0, 0.18);
  transform: translateY(2px);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  padding: 0;
}

.dashboard-grid:not(:has(.panel.is-open)) {
  display: none;
}

.panel[hidden],
.add-lesson-section[hidden] {
  display: none;
}

.panel,
.add-lesson-section {
  scroll-margin-top: 84px;
}

.add-lesson-section {
  padding: 0 0 calc(var(--dock-space) + 8px);
}

.add-lesson-actions,
.custom-lesson-box {
  scroll-margin-bottom: calc(var(--dock-space) + 24px);
}

.add-lesson-panel {
  grid-column: 1 / -1;
}

.panel {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.progress-panel {
  grid-column: 1 / -1;
}

.assignment-panel {
  grid-column: 1 / -1;
}

.panel-head {
  justify-content: space-between;
  gap: 14px;
}

.panel-head h2 {
  margin-top: 2px;
  font-family: Nunito, Inter, sans-serif;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.pill {
  justify-content: center;
  min-height: 32px;
  padding: 6px 10px;
  color: #9a2430;
  border-radius: 999px;
  background: #ffd4d6;
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.invite-form,
.people-tools,
.plan-name,
.assignment-form,
.add-lesson-form,
.field-group,
.progress-filter {
  display: grid;
  gap: 8px;
}

.field-group[hidden] {
  display: none;
}

.input-row {
  gap: 8px;
}

.invite-form button {
  flex: 0 0 auto;
  background: var(--coral);
}

.people-list,
.progress-list {
  display: grid;
  gap: 10px;
}

.person-card {
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px;
  color: var(--ink);
  border: 0;
  border-radius: 16px;
  background: color-mix(in srgb, #fff 70%, #ffd4d6);
  text-align: left;
}

.person-card:hover,
.person-card:focus-visible,
.person-card.selected {
  border-color: transparent;
  background: #ffd4d6;
  outline: 0;
}

.person-card strong,
.lesson-chip strong {
  display: block;
  font-weight: 900;
}

.person-card span,
.lesson-chip span,
.plan-builder p,
.progress-card p,
.status-line {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.person-card em {
  display: grid;
  place-items: center;
  min-width: 36px;
  height: 28px;
  color: #fff;
  border-radius: 10px;
  background: var(--purple);
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 900;
}

.pending-box {
  display: grid;
  gap: 10px;
  padding: 4px 0 0;
  border-radius: 0;
  background: transparent;
}

.pending-box h3,
.plan-builder h3 {
  font-size: 0.95rem;
  font-weight: 900;
}

.pending-box ul,
.plan-builder ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pending-box li,
.plan-builder li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: color-mix(in srgb, #fff 82%, #ffd4d6);
  font-size: 0.82rem;
  font-weight: 900;
}

.pending-box li span {
  color: var(--orange);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.section-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.section-tabs button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 9px 12px 12px;
  background: #d1dbe5;
  font-size: 0.78rem;
}

.section-tabs button.active {
  background: var(--purple);
}

.lesson-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.lesson-chip {
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 84px;
  padding: 12px;
  color: var(--ink);
  border: 0;
  border-radius: 18px;
  background: #fff;
  text-align: left;
}

.lesson-chip::before {
  content: attr(data-unit);
  display: grid;
  place-items: center;
  width: 44px;
  height: 40px;
  flex: 0 0 44px;
  color: #fff;
  border-radius: 50%;
  background: var(--green);
  box-shadow: inset 0 -5px rgba(0, 0, 0, 0.16);
  font-size: 0.72rem;
  font-weight: 900;
}

.lesson-chip[data-section="2"]::before {
  background: var(--blue);
}

.lesson-chip[data-section="3"]::before {
  background: var(--purple);
}

.lesson-chip[data-section="4"]::before {
  background: var(--orange);
}

.lesson-chip[data-section="5"]::before {
  background: var(--blue);
}

.lesson-chip[data-section="6"]::before {
  background: var(--pink);
}

.lesson-chip[data-section="7"]::before {
  background: var(--purple);
}

.lesson-chip[data-section="8"]::before {
  background: #4c97e8;
}

.lesson-chip:hover,
.lesson-chip:focus-visible,
.lesson-chip.selected {
  border-color: transparent;
  background: var(--coral-soft, #ffd4d6);
  outline: 0;
}

.plan-builder {
  display: grid;
  gap: 12px;
  padding: 14px 0 0;
  border: 0;
  border-top: 1px dashed color-mix(in srgb, var(--coral) 35%, #fff);
  border-radius: 0;
  background: transparent;
}

.plan-builder li button {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  color: #fff;
  border: 0;
  border-radius: 10px;
  background: var(--red);
  font-weight: 900;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(150px, 0.7fr);
  gap: 10px;
}

.assignment-form {
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.assignment-form button {
  justify-self: start;
  min-height: 44px;
  padding: 11px 16px 14px;
  color: #fff;
  border: 0;
  border-radius: 14px;
  background: var(--coral);
  box-shadow: var(--button-shadow);
  font-weight: 900;
}

.assignment-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.assignment-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 0;
  border-radius: 16px;
  background: color-mix(in srgb, #fff 80%, #ffd4d6);
  box-shadow: none;
}

.assignment-card-head {
  justify-content: space-between;
  gap: 12px;
}

.assignment-card h3,
.assignment-card p {
  margin: 0;
}

.assignment-card h3 {
  font-size: 1rem;
  font-weight: 900;
}

.assignment-card p,
.assignment-card small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.assignment-card small {
  display: block;
}

.unit-badge {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 40px;
  color: #fff;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: inset 0 -5px rgba(0, 0, 0, 0.16);
  font-size: 0.72rem;
  font-weight: 900;
}

.assignment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.assignment-meta span {
  padding: 5px 8px;
  color: var(--blue-dark);
  border-radius: 999px;
  background: var(--blue-soft);
  font-size: 0.68rem;
  font-weight: 900;
}

.progress-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.progress-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 0;
  border-radius: 16px;
  background: color-mix(in srgb, #fff 78%, #ffd4d6);
}

.progress-card-head {
  justify-content: space-between;
  gap: 12px;
}

.progress-card h3 {
  font-size: 1rem;
  font-weight: 900;
}

.progress-badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 40px;
  flex: 0 0 44px;
  color: #fff;
  border-radius: 15px;
  background: var(--blue);
  box-shadow: inset 0 -5px rgba(0, 0, 0, 0.14);
  font-size: 0.72rem;
  font-weight: 900;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #d9e4ee;
}

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

.status-line {
  justify-content: space-between;
  gap: 10px;
}

.status-line strong {
  color: var(--ink);
}

.add-lesson-lead,
.mode-hint,
.custom-lesson-box p {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.4;
}

.add-lesson-form {
  gap: 14px;
  padding: 0;
  border: 0;
  background: transparent;
}

.mode-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mode-pill {
  min-height: 40px;
  padding: 8px 14px 11px;
  color: var(--ink);
  border: 0;
  border-radius: 999px;
  background: #d1dbe5;
  box-shadow: var(--button-shadow);
  font-weight: 900;
}

.mode-pill[data-lesson-mode="create"].active {
  color: #fff;
  background: var(--green);
}

.mode-pill[data-lesson-mode="replace"].active {
  color: #fff;
  background: var(--orange);
}

.mode-pill[data-lesson-mode="build-on"].active {
  color: #fff;
  background: var(--purple);
}

.mode-hint {
  font-size: 0.82rem;
}

.add-lesson-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}

.add-lesson-form:has(#sourceLessonField:not([hidden])) .add-lesson-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
}

.add-lesson-actions {
  flex-wrap: wrap;
  gap: 10px;
}

.add-lesson-form button[type="submit"],
.add-lesson-form #resetLessonForm {
  min-height: 44px;
  padding: 11px 16px 14px;
  color: #fff;
  border: 0;
  border-radius: 14px;
  box-shadow: var(--button-shadow);
  font-weight: 900;
}

.add-lesson-form button[type="submit"] {
  background: var(--coral);
}

.add-lesson-form #resetLessonForm {
  background: #d1dbe5;
  color: var(--ink);
}

.add-lesson-status {
  min-height: 1.2em;
  color: var(--green-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

.add-lesson-status.is-error {
  color: var(--red);
}

.custom-lesson-box {
  display: grid;
  gap: 12px;
  padding: 8px 0 0;
  border-radius: 0;
  background: transparent;
}

.custom-lesson-box h3 {
  font-size: 0.95rem;
  font-weight: 900;
}

.custom-lesson-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.custom-lesson-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 0;
  border-radius: 16px;
  background: color-mix(in srgb, #fff 80%, #ffd4d6);
  box-shadow: none;
}

.custom-lesson-card-head {
  justify-content: space-between;
  gap: 12px;
}

.custom-lesson-card h3 {
  font-size: 1rem;
  font-weight: 900;
}

.custom-lesson-card p,
.custom-lesson-card small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.4;
}

.custom-lesson-card p {
  white-space: pre-wrap;
}

.custom-lesson-card small {
  display: block;
}

.custom-lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.custom-lesson-meta span {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
}

.custom-lesson-meta .mode-create {
  color: var(--green-dark);
  background: var(--green-soft);
}

.custom-lesson-meta .mode-replace {
  color: #9a4d00;
  background: #fff3d6;
}

.custom-lesson-meta .mode-build-on {
  color: var(--purple-dark);
  background: #f3e8ff;
}

.custom-lesson-meta .mode-unit {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.custom-lesson-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.custom-lesson-actions button {
  min-height: 36px;
  padding: 7px 12px 9px;
  color: #fff;
  border: 0;
  border-radius: 12px;
  box-shadow: var(--button-shadow);
  font-size: 0.78rem;
  font-weight: 900;
}

.custom-lesson-actions .edit-draft {
  background: var(--blue);
}

.custom-lesson-actions .add-to-plan {
  background: var(--green);
}

.custom-lesson-actions .remove-draft {
  background: var(--red);
}

.lesson-chip[data-origin="create"],
.lesson-chip[data-origin="build-on"],
.lesson-chip[data-origin="replace"] {
  position: relative;
}

.lesson-chip[data-origin="replace"] {
  border-color: #ffd79a;
  background: #fff8eb;
}

.lesson-chip[data-origin="create"]::after,
.lesson-chip[data-origin="build-on"]::after,
.lesson-chip[data-origin="replace"]::after {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.lesson-chip[data-origin="create"]::after {
  content: "NEW";
  color: var(--green-dark);
  background: var(--green-soft);
}

.lesson-chip[data-origin="build-on"]::after {
  content: "EDIT";
  color: var(--purple-dark);
  background: #f3e8ff;
}

.lesson-chip[data-origin="replace"]::after {
  content: "SWAP";
  color: #9a4d00;
  background: #fff3d6;
}

.bottom-dock {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 18px;
  gap: 10px;
  width: min(820px, calc(100vw - (var(--shell-gutter) * 2)));
  max-width: calc(100vw - (var(--shell-gutter) * 2));
  padding: 10px 14px;
  border: 1px solid rgba(226, 235, 244, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(29, 55, 78, 0.16);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.bottom-nav {
  justify-content: space-around;
  flex: 1 1 100%;
  min-height: 58px;
}

.bottom-nav a {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 86px;
  color: #9aa5b1;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 900;
}

.bottom-nav span {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 30px;
  padding: 0 7px;
  color: #fff;
  border-radius: 11px;
  background: #d1dbe5;
  box-shadow: inset 0 -4px rgba(0, 0, 0, 0.11);
  font-size: 0.54rem;
}

.bottom-nav a.active,
.bottom-nav a:hover {
  color: var(--blue);
}

.bottom-nav a.active span,
.bottom-nav a:hover span {
  background: var(--blue);
}

.work-empty {
  display: none;
}

.dash-work:not(:has(.is-open)) .work-empty {
  display: grid;
  gap: 8px;
  min-height: 240px;
  padding: 24px 8px;
  align-content: center;
}

.work-empty .ry-label,
.work-empty p {
  margin: 0;
}

.work-empty strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.work-empty span {
  max-width: 38ch;
  color: var(--muted);
  font-weight: 700;
}

@media (min-width: 1100px) {
  .class-hero {
    padding: 16px 16px 14px;
  }

  .class-hero h1 {
    font-size: clamp(1.25rem, 1.7vw, 1.65rem);
  }

  .prototype-note {
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  .step-chooser-row {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
  }

  .step-btn {
    flex: 0 0 auto;
    width: 100%;
    min-height: 48px;
    padding: 8px 12px 11px;
  }

  .people-list,
  .progress-list,
  .assignment-list,
  .custom-lesson-list,
  .lesson-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .progress-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  .app-shell {
    --shell-gutter: 0px;
    --shell-top: 0px;
    --dock-space: clamp(126px, 18vh, 154px);
    padding: 0 0 calc(var(--dock-space) + env(safe-area-inset-bottom));
  }

  .dashboard-stage {
    max-width: 100vw;
    width: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .dashboard-grid,
  .progress-list,
  .assignment-list,
  .custom-lesson-list {
    grid-template-columns: 1fr;
  }

  .bottom-dock {
    left: 0;
    bottom: 0;
    max-width: 100vw;
    width: 100%;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
    transform: none;
  }
}

@media (max-width: 560px) {
  .status-bar {
    gap: 6px;
    padding-inline: 10px;
  }

  .top-brand {
    flex: 0 0 auto;
  }

  .top-brand span {
    display: none;
  }

  .stat {
    gap: 4px;
    padding: 0;
  }

  .stat::before {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
    background-size: 12px 12px;
  }

  .class-hero,
  .dashboard-grid,
  .add-lesson-section,
  .dash-board {
    padding-inline: 12px;
  }

  .step-chooser {
    margin-inline: 0;
  }

  .add-lesson-grid {
    grid-template-columns: 1fr;
  }

  .prototype-note {
    display: grid;
    margin-inline: 12px;
  }

  .panel {
    padding: 14px;
  }

  .input-row {
    display: grid;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .invite-form button {
    width: 100%;
  }

  .lesson-picker {
    grid-template-columns: 1fr;
  }

  .bottom-nav a {
    min-width: 62px;
    font-size: 0.62rem;
  }

  .bottom-nav span {
    min-width: 30px;
    padding-inline: 6px;
    font-size: 0.46rem;
  }
}

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

/* Cream workbench on the shared circuit field — 16:9, not a phone column. */
body.room-class .dash-board--class {
  gap: 20px;
  padding: 4px 12px 12px;
}

body.room-class .class-hero,
body.room-class .prototype-note,
body.room-class .step-chooser,
body.room-class .dash-work,
body.room-class .dash-rail {
  color: var(--ink);
  background: var(--dash-cream);
  box-shadow: none;
}

body.room-class .dash-rail,
body.room-class .dash-work {
  border-radius: 28px;
  box-shadow: 0 10px 28px rgba(22, 48, 56, 0.08);
}

body.room-class .dash-rail {
  display: grid;
  gap: 16px;
  padding: 22px 20px;
}

body.room-class .dash-work {
  padding: 22px 24px;
  background: var(--dash-cream);
}

body.room-class .class-hero {
  padding: 4px 0 0;
  border-radius: 0;
  background: transparent;
}

body.room-class .class-hero p,
body.room-class .class-hero h1 {
  color: var(--ink);
  text-shadow: none;
}

body.room-class .class-hero p {
  color: var(--muted);
}

body.room-class .class-hero h1 {
  max-width: 18ch;
  font-size: clamp(1.45rem, 2vw, 1.9rem);
}

body.room-class .prototype-note {
  background: color-mix(in srgb, var(--dash-cream) 70%, #ffd4d6);
}

body.room-class .step-btn {
  background: #fff;
}

body.room-class .invite-form button,
body.room-class .assignment-form button,
body.room-class .add-lesson-form button[type="submit"] {
  color: #fff;
  background: #fc5b62;
  box-shadow: 0 3px 0 #c4333b;
}

@media (min-width: 1100px) {
  body.room-class .dash-board--class {
    grid-template-columns: minmax(280px, 0.32fr) minmax(0, 1fr);
    min-height: calc(100dvh - 72px - var(--dock-space));
  }

  body.room-class .dash-work {
    min-height: calc(100dvh - 120px - var(--dock-space));
  }
}
