@font-face {
  font-family: "Pretendard";
  src: url("assets/brand/PretendardVariable.woff2") format("woff2-variations");
  font-style: normal;
  font-weight: 45 920;
  font-display: swap;
}

:root {
  color-scheme: light;
  --coral: #ff4547;
  --coral-strong: #db2d2f;
  --coral-soft: #ffe8e3;
  --coral-pale: #fff6f4;
  --ink: #2b2929;
  --ink-soft: #4a4848;
  --muted: #6b6b70;
  --line: #ececef;
  --line-strong: #dddddd;
  --surface: #ffffff;
  --surface-soft: #f5f5f7;
  --surface-warm: #fff6f4;
  --green: #207a45;
  --green-soft: #e8f6ec;
  --blue: #1a334e;
  --blue-soft: #edf3f8;
  --purple: #7c3aed;
  --purple-soft: #f5f3ff;
  --shadow-sm: 0 1px 2px rgba(28, 31, 35, 0.03), 0 5px 18px rgba(28, 31, 35, 0.035);
  --shadow-md: 0 16px 42px rgba(32, 35, 38, 0.09);
  --rail-width: 244px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --font-sans: Pretendard, Roboto, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Apple SD Gothic Neo", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  background: var(--surface-soft);
  scroll-behavior: auto;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface-soft);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
textarea,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:not(:disabled),
[role="button"] {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

svg {
  display: block;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  left: 16px;
  top: -60px;
  padding: 10px 16px;
  color: #fff;
  background: var(--ink);
  border-radius: 10px;
  text-decoration: none;
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 12px;
}

:focus-visible {
  outline: 3px solid rgba(255, 69, 71, 0.25);
  outline-offset: 3px;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.history-rail {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--rail-width);
  flex-direction: column;
  padding: 22px 16px 16px;
  background: #f5f5f7;
  border-right: 1px solid var(--line);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  width: auto;
  padding: 2px 6px 18px;
  background: transparent;
  border: 0;
  text-align: left;
}

.brand-logo {
  display: block;
  width: 174px;
  max-width: 100%;
  height: auto;
}

.brand-symbol {
  position: relative;
  display: grid;
  width: 31px;
  height: 31px;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  padding: 3px;
  transform: rotate(-2deg);
}

.brand-symbol span {
  display: block;
  background: var(--coral);
  border-radius: 4px;
}

.brand-symbol span:nth-child(2) {
  border-radius: 50% 4px 4px 4px;
}

.brand-symbol span:nth-child(3) {
  border-radius: 4px 4px 4px 50%;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-copy strong {
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.new-start-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 43px;
  padding: 9px 14px;
  color: var(--coral-strong);
  background: var(--surface);
  border: 1px solid rgba(244, 95, 87, 0.25);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font-weight: 750;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.new-start-button:hover {
  border-color: rgba(244, 95, 87, 0.55);
  box-shadow: 0 8px 20px rgba(244, 95, 87, 0.08);
  transform: translateY(-1px);
}

.new-start-button > span:first-child {
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

.rail-nav {
  display: grid;
  gap: 4px;
  margin-top: 15px;
}

.rail-nav button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 11px;
  font-weight: 650;
  text-align: left;
  transition: color 150ms ease, background 150ms ease;
}

.rail-nav button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

.rail-nav button.active {
  color: var(--coral-strong);
  background: var(--surface);
  box-shadow: inset 3px 0 0 var(--coral), var(--shadow-sm);
}

.rail-nav svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.rail-history {
  min-height: 0;
  flex: 1;
  margin-top: 27px;
  overflow: hidden;
}

.rail-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px 8px;
}

.rail-section-title h2 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rail-section-title span {
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
}

.rail-history-list {
  display: grid;
  max-height: 100%;
  gap: 3px;
  overflow: auto;
  scrollbar-width: thin;
}

.rail-project-button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 7px;
  background: transparent;
  border: 0;
  border-radius: 10px;
  text-align: left;
}

.rail-project-button:hover {
  background: rgba(255, 255, 255, 0.72);
}

.rail-project-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--coral-strong);
  background: var(--coral-soft);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 850;
}

.rail-project-copy {
  min-width: 0;
}

.rail-project-copy strong,
.rail-project-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-project-copy strong {
  font-size: 12px;
  font-weight: 700;
}

.rail-project-copy span {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
}

.rail-history-empty {
  padding: 12px 8px;
  color: var(--muted);
  font-size: 12px;
}

.rail-footer {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 13px 7px 2px;
  color: var(--muted);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 10px;
  font-weight: 650;
}

.version-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(51, 152, 113, 0.12);
}

.main-content {
  min-height: 100vh;
  margin-left: var(--rail-width);
  background: var(--surface);
}

.page-view {
  min-height: 100vh;
  animation: page-in 280ms cubic-bezier(0.22, 0.78, 0.25, 1);
}

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

.page-frame {
  width: min(1080px, calc(100% - 64px));
  margin: 0 auto;
  padding: 68px 0 72px;
}

.home-frame {
  padding-top: clamp(64px, 9vh, 108px);
}

.eyebrow,
.step-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 14px;
  color: var(--coral-strong);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow::before,
.step-kicker::before {
  width: 18px;
  height: 2px;
  content: "";
  background: var(--coral);
  border-radius: 2px;
}

.home-hero {
  position: relative;
  max-width: 760px;
}

.home-hero h1,
.page-heading h1,
.create-heading h1 {
  margin: 0;
  color: #202224;
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.12;
  word-break: keep-all;
}

.home-hero h1 .accent-word {
  position: relative;
  color: var(--coral);
  white-space: nowrap;
}

.home-hero h1 .accent-word::after {
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 7px;
  content: "";
  background: rgba(244, 95, 87, 0.13);
  border-radius: 999px;
  z-index: -1;
}

.home-hero > p,
.page-heading > p,
.create-heading > p {
  max-width: 620px;
  margin: 19px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.75;
  word-break: keep-all;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 50px;
}

.mode-card {
  position: relative;
  display: flex;
  min-height: 244px;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.mode-card::after {
  position: absolute;
  width: 160px;
  height: 160px;
  right: -54px;
  bottom: -64px;
  content: "";
  background: var(--card-glow, var(--coral-soft));
  border-radius: 50%;
  transition: transform 220ms ease;
}

.mode-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-border, rgba(244, 95, 87, 0.35));
  box-shadow: var(--shadow-md);
}

.mode-card:hover::after {
  transform: scale(1.14);
}

.mode-card.create-card {
  --card-glow: var(--blue-soft);
  --card-border: rgba(66, 111, 197, 0.3);
}

.mode-icon,
.type-icon,
.grade-icon {
  display: grid;
  place-items: center;
  color: var(--coral-strong);
  background: var(--coral-soft);
  border-radius: 15px;
}

.mode-icon {
  width: 50px;
  height: 50px;
}

.create-card .mode-icon {
  color: var(--blue);
  background: var(--blue-soft);
}

.mode-icon svg,
.type-icon svg,
.grade-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.mode-card h2 {
  margin: 21px 0 7px;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.mode-card p {
  max-width: 310px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
  word-break: keep-all;
}

.mode-card-footer {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding-top: 22px;
  color: var(--coral-strong);
  font-size: 13px;
  font-weight: 800;
}

.create-card .mode-card-footer {
  color: var(--blue);
}

.mode-card-footer span:last-child {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  background: currentColor;
  border-radius: 50%;
}

.mode-card-footer svg {
  width: 13px;
  fill: none;
  stroke: #fff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.section-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading-row h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.section-heading-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.home-recent {
  margin-top: 58px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.recent-project-card {
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  text-align: left;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.recent-project-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.recent-card-icon {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  color: var(--coral-strong);
  background: var(--coral-soft);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 850;
}

.recent-card-copy {
  min-width: 0;
}

.recent-card-copy strong,
.recent-card-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-card-copy strong {
  font-size: 13px;
}

.recent-card-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.recent-project-card > svg {
  width: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.recent-empty {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 15px;
}

.recent-empty-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 21px;
}

.recent-empty strong,
.recent-empty span {
  display: block;
}

.recent-empty strong {
  color: var(--ink);
  font-size: 13px;
}

.recent-empty span {
  margin-top: 2px;
  font-size: 12px;
}

.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 42px;
}

.back-button,
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 11px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

.back-button:hover,
.text-button:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.back-button svg,
.text-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.page-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.page-badge::before {
  width: 6px;
  height: 6px;
  content: "";
  background: currentColor;
  border-radius: 50%;
}

.page-heading h1,
.create-heading h1 {
  font-size: clamp(34px, 4vw, 50px);
}

.grade-grid,
.project-type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 42px;
}

.grade-card,
.type-card {
  position: relative;
  min-height: 190px;
  padding: 24px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.grade-card:hover,
.type-card:hover,
.type-card.selected {
  transform: translateY(-3px);
  border-color: rgba(244, 95, 87, 0.45);
  box-shadow: var(--shadow-md);
}

.type-card.selected {
  background: var(--coral-pale);
  box-shadow: 0 0 0 2px rgba(244, 95, 87, 0.12), var(--shadow-sm);
}

.grade-icon,
.type-icon {
  width: 44px;
  height: 44px;
}

.grade-card:nth-child(2) .grade-icon {
  color: var(--blue);
  background: var(--blue-soft);
}

.grade-card:nth-child(3) .grade-icon {
  color: var(--purple);
  background: var(--purple-soft);
}

.grade-card h2,
.type-card h2 {
  margin: 19px 0 5px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.grade-card p,
.type-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.grade-count,
.type-code {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 5px 9px;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.type-card.selected .type-code {
  color: var(--coral-strong);
  background: var(--coral-soft);
}

.curriculum-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.curriculum-header h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -0.04em;
}

.curriculum-header p {
  margin: 10px 0 0;
  color: var(--ink-soft);
}

.p2-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 410px;
  margin: 32px 0 0;
  padding: 15px 17px;
  color: #6b5845;
  background: #fff9ed;
  border: 1px solid #f2e2c1;
  border-radius: 14px;
  font-size: 12px;
}

.p2-notice strong,
.p2-notice span {
  display: block;
}

.p2-notice strong {
  margin-bottom: 2px;
  color: #574534;
  font-size: 13px;
}

.p2-notice-icon {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  place-items: center;
  color: #856b49;
  background: #ffefcb;
  border-radius: 9px;
  font-weight: 850;
}

.curriculum-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.lesson-slot {
  position: relative;
  min-height: 150px;
  padding: 19px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 17px;
}

.lesson-slot::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(135deg, transparent 60%, rgba(244, 95, 87, 0.028));
  border-radius: inherit;
  pointer-events: none;
}

.lesson-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lesson-number {
  color: var(--coral);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.lesson-type {
  padding: 4px 8px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.lesson-slot h2 {
  margin: 22px 0 6px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.lesson-slot p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.create-setup-frame {
  width: min(960px, calc(100% - 64px));
}

.selection-label {
  display: block;
  margin: 39px 0 13px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.project-type-grid {
  margin-top: 0;
}

.type-card {
  min-height: 175px;
}

.type-check {
  position: absolute;
  right: 17px;
  bottom: 17px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: #fff;
  background: var(--coral);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.75);
  transition: opacity 150ms ease, transform 150ms ease;
}

.type-card.selected .type-check {
  opacity: 1;
  transform: scale(1);
}

.type-check svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.idea-panel {
  margin-top: 28px;
  padding: 24px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.idea-panel label {
  display: block;
  margin-bottom: 9px;
  font-size: 14px;
  font-weight: 800;
}

.idea-panel label span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.idea-input-wrap {
  position: relative;
}

.idea-panel textarea,
.composer textarea {
  display: block;
  width: 100%;
  resize: none;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.idea-panel textarea {
  min-height: 118px;
  padding: 15px 16px 54px;
  border-radius: 15px;
  line-height: 1.65;
}

.idea-panel textarea:focus,
.composer textarea:focus {
  border-color: rgba(244, 95, 87, 0.65);
  box-shadow: 0 0 0 3px rgba(244, 95, 87, 0.09);
}

.idea-panel textarea::placeholder,
.composer textarea::placeholder {
  color: #a6aaae;
}

.idea-actions {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.idea-hint {
  color: var(--muted);
  font-size: 10px;
}

.primary-button,
.send-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 16px;
  color: #fff;
  background: var(--coral);
  border: 1px solid var(--coral);
  border-radius: 11px;
  box-shadow: 0 6px 16px rgba(244, 95, 87, 0.18);
  font-size: 12px;
  font-weight: 800;
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.primary-button:hover,
.send-button:hover {
  background: var(--coral-strong);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(244, 95, 87, 0.23);
}

.primary-button:disabled,
.send-button:disabled {
  color: #fff;
  background: #c9cbcd;
  border-color: #c9cbcd;
  box-shadow: none;
  transform: none;
}

.primary-button svg,
.send-button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.example-explorer {
  margin-top: 64px;
  padding-top: 54px;
  border-top: 1px solid var(--line);
}

.example-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.example-heading .step-kicker {
  margin-bottom: 8px;
}

.example-heading h2 {
  margin: 0;
  font-size: clamp(28px, 3.5vw, 40px);
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.example-heading p:not(.step-kicker) {
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.example-search {
  width: min(280px, 38%);
  flex: 0 0 auto;
}

.example-search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 15px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  font-size: 13px;
}

.example-search input:focus {
  background: var(--surface);
  border-color: rgba(244, 95, 87, 0.62);
  box-shadow: 0 0 0 3px rgba(244, 95, 87, 0.09);
}

.example-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 26px;
}

.example-categories button {
  min-height: 38px;
  padding: 7px 14px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 720;
}

.example-categories button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.example-categories button.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.example-result-count {
  margin: 20px 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.example-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.example-card {
  --example-accent: var(--blue);
  position: relative;
  display: flex;
  min-height: 226px;
  padding: 22px;
  flex-direction: column;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.example-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--example-accent);
  content: "";
}

.example-card.type-blockly {
  --example-accent: var(--green);
}

.example-card.type-hybrid {
  --example-accent: var(--purple);
}

.example-card:hover {
  border-color: color-mix(in srgb, var(--example-accent) 38%, var(--line));
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.example-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.example-card-meta span {
  padding: 5px 8px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}

.example-card-meta span:last-child {
  color: var(--example-accent);
  background: color-mix(in srgb, var(--example-accent) 9%, #fff);
}

.example-card > strong {
  display: block;
  margin-top: 20px;
  font-size: 18px;
  font-weight: 820;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.example-description {
  display: -webkit-box;
  margin-top: 8px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.example-start {
  display: flex;
  margin-top: auto;
  padding-top: 18px;
  align-items: center;
  justify-content: space-between;
  color: var(--example-accent);
  font-size: 11px;
  font-weight: 800;
}

.example-start svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.example-empty {
  display: grid;
  min-height: 180px;
  padding: 30px;
  grid-column: 1 / -1;
  place-items: center;
  align-content: center;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  text-align: center;
}

.example-empty strong,
.example-empty span {
  display: block;
}

.example-empty strong {
  color: var(--ink);
  font-size: 15px;
}

.example-empty span {
  margin-top: 4px;
  font-size: 12px;
}

.workspace-view {
  height: 100vh;
  height: 100dvh;
  min-height: 700px;
  padding: 0;
  background: var(--surface-soft);
  overflow: hidden;
}

.workspace-topbar {
  display: flex;
  height: 66px;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.workspace-title {
  min-width: 155px;
}

.workspace-title strong,
.workspace-title span {
  display: block;
}

.workspace-title strong {
  max-width: 240px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-title span {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
}

.phase-rail {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 auto;
}

.phase-step {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.phase-step:not(:last-child)::after {
  width: 42px;
  height: 1px;
  margin: 0 8px;
  content: "";
  background: var(--line-strong);
}

.phase-dot {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  margin-right: 6px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 9px;
}

.phase-step.active {
  color: var(--coral-strong);
}

.phase-step.active .phase-dot {
  color: #fff;
  background: var(--coral);
  border-color: var(--coral);
  box-shadow: 0 0 0 4px var(--coral-soft);
}

.phase-step.completed {
  color: var(--green);
}

.phase-step.completed .phase-dot {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.workspace-status {
  display: inline-flex;
  min-width: 115px;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.status-pulse {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
}

.workspace-status.streaming .status-pulse {
  background: var(--coral);
  animation: pulse 1.2s ease-in-out infinite;
}

.workspace-status.error .status-pulse {
  background: #cc3d3d;
}

@keyframes pulse {
  0%, 100% { opacity: 0.42; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

.workspace-grid {
  display: grid;
  height: calc(100vh - 66px);
  height: calc(100dvh - 66px);
  min-height: 634px;
  grid-template-columns: minmax(320px, 38%) minmax(0, 1fr);
  gap: 1px;
  background: var(--line);
}

.mobile-workspace-switch {
  display: none;
}

.conversation-panel,
.artifact-panel {
  min-width: 0;
  min-height: 0;
  background: var(--surface);
}

.conversation-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.panel-header {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
}

.panel-chip {
  padding: 4px 8px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}

.chat-scroll {
  overflow-y: auto;
  padding: 22px 20px 28px;
  scroll-behavior: smooth;
  scrollbar-color: #d5d7d9 transparent;
  scrollbar-width: thin;
}

.chat-message {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 21px;
}

.chat-message.user {
  grid-template-columns: minmax(0, 1fr) 30px;
}

.message-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--coral-strong);
  background: var(--coral-soft);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 900;
}

.chat-message.user .message-avatar {
  grid-column: 2;
  color: #fff;
  background: var(--ink);
}

.message-body {
  min-width: 0;
}

.chat-message.user .message-body {
  grid-row: 1;
  text-align: right;
}

.message-name {
  display: block;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.message-content {
  display: inline-block;
  max-width: 100%;
  padding: 11px 13px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 5px 14px 14px 14px;
  font-size: 13px;
  line-height: 1.68;
  overflow-wrap: anywhere;
  text-align: left;
  white-space: pre-wrap;
}

.chat-message.user .message-content {
  color: #fff;
  background: #303235;
  border-color: #303235;
  border-radius: 14px 5px 14px 14px;
}

.message-content.pending::after {
  display: inline-block;
  width: 5px;
  height: 13px;
  margin-left: 3px;
  vertical-align: -2px;
  content: "";
  background: var(--coral);
  border-radius: 2px;
  animation: cursor-blink 850ms steps(1) infinite;
}

@keyframes cursor-blink {
  50% { opacity: 0; }
}

.stream-status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -7px 0 18px 40px;
  color: var(--muted);
  font-size: 10px;
}

.stream-status-line::before {
  width: 10px;
  height: 10px;
  content: "";
  border: 2px solid #e2b2af;
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-banner {
  margin: 0 0 18px 40px;
  padding: 10px 12px;
  color: #9e3733;
  background: #fff1ef;
  border: 1px solid #f1cac6;
  border-radius: 10px;
  font-size: 11px;
}

.composer {
  padding: 14px 16px 15px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.composer-box {
  position: relative;
}

.composer textarea {
  min-height: 77px;
  max-height: 170px;
  padding: 11px 50px 28px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.55;
}

.composer-meta {
  position: absolute;
  right: 9px;
  bottom: 8px;
  left: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.composer-meta span {
  color: var(--muted);
  font-size: 8px;
}

.send-button {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 10px;
  pointer-events: auto;
}

.artifact-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.artifact-tabs {
  display: flex;
  min-height: 52px;
  align-items: end;
  gap: 20px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
}

.artifact-tab {
  position: relative;
  height: 52px;
  padding: 0 2px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 11px;
  font-weight: 800;
}

.artifact-tab:hover {
  color: var(--ink);
}

.artifact-tab.active {
  color: var(--ink);
}

.artifact-tab.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  content: "";
  background: var(--coral);
  border-radius: 2px 2px 0 0;
}

.artifact-body {
  min-height: 0;
  overflow: auto;
  padding: 24px;
  background: var(--surface-soft);
}

.empty-artifact {
  display: grid;
  min-height: 100%;
  place-content: center;
  padding: 40px;
  color: var(--muted);
  text-align: center;
}

.empty-artifact-visual {
  position: relative;
  width: 92px;
  height: 76px;
  margin: 0 auto 23px;
}

.empty-artifact-visual span {
  position: absolute;
  display: block;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
}

.empty-artifact-visual span:nth-child(1) {
  inset: 0 24px 12px 0;
}

.empty-artifact-visual span:nth-child(2) {
  inset: 15px 7px 0 17px;
}

.empty-artifact-visual span:nth-child(3) {
  width: 13px;
  height: 13px;
  right: 0;
  bottom: 8px;
  background: var(--coral);
  border: 0;
  border-radius: 50%;
}

.empty-artifact strong {
  color: var(--ink);
  font-size: 14px;
}

.empty-artifact p {
  max-width: 320px;
  margin: 7px auto 0;
  font-size: 11px;
  line-height: 1.65;
  word-break: keep-all;
}

.artifact-section {
  max-width: 900px;
  margin: 0 auto;
}

.artifact-section-header {
  margin-bottom: 20px;
}

.artifact-section-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.025em;
}

.artifact-section-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.design-hero-card,
.summary-card,
.blockly-card,
.progress-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.design-hero-card {
  padding: 23px;
  background: linear-gradient(135deg, var(--surface) 66%, var(--coral-pale));
}

.design-hero-card .mini-label {
  color: var(--coral-strong);
}

.mini-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.design-hero-card h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.design-hero-card p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.summary-card {
  padding: 18px;
}

.summary-card h3 {
  margin: 0 0 12px;
  font-size: 12px;
}

.summary-list,
.feature-list,
.task-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.summary-list li,
.feature-list li {
  position: relative;
  padding-left: 14px;
  color: var(--ink-soft);
  font-size: 11px;
}

.summary-list li::before,
.feature-list li::before {
  position: absolute;
  top: 7px;
  left: 0;
  width: 5px;
  height: 5px;
  content: "";
  background: var(--coral);
  border-radius: 50%;
}

.feature-list strong {
  display: block;
  color: var(--ink);
  font-size: 11px;
}

.feature-list span {
  display: block;
  margin-top: 1px;
}

.code-shell {
  min-height: 420px;
  overflow: hidden;
  background: #242629;
  border: 1px solid #303337;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.code-file-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 9px 10px 0;
  background: #2b2d30;
  scrollbar-width: thin;
}

.code-file-tab {
  min-width: max-content;
  padding: 8px 12px 9px;
  color: #9da2aa;
  background: transparent;
  border: 0;
  border-radius: 8px 8px 0 0;
  font-family: var(--font-mono);
  font-size: 10px;
}

.code-file-tab:hover {
  color: #fff;
}

.code-file-tab.active {
  color: #f7f7f7;
  background: #242629;
}

.code-view {
  min-height: 370px;
  margin: 0;
  padding: 20px;
  overflow: auto;
  color: #e4e6e9;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.72;
  tab-size: 2;
  white-space: pre;
}

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.result-switches {
  display: flex;
  gap: 5px;
}

.result-switch {
  padding: 6px 10px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 10px;
  font-weight: 750;
}

.result-switch.active {
  color: var(--coral-strong);
  background: var(--coral-soft);
  border-color: rgba(244, 95, 87, 0.22);
}

.artifact-meta {
  color: var(--muted);
  font-size: 10px;
}

.blockly-card {
  overflow: hidden;
}

.blockly-visual {
  position: relative;
  min-height: 290px;
  padding: 28px;
  overflow: hidden;
  background-color: #f7f8fa;
  background-image: radial-gradient(#d8dce0 0.8px, transparent 0.8px);
  background-size: 18px 18px;
}

.blockly-placeholder {
  display: flex;
  max-width: 560px;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0;
  margin: 32px auto 0;
}

.visual-block {
  position: relative;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 9px 18px;
  color: #fff;
  background: #5b80c9;
  border-radius: 8px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12), 0 3px 8px rgba(0, 0, 0, 0.08);
  font-size: 11px;
  font-weight: 750;
}

.visual-block:nth-child(2) { background: #b76cae; }
.visual-block:nth-child(3) { background: #5ba26e; }
.visual-block:nth-child(4) { background: #df8e4d; }

.visual-block:not(:last-child)::after {
  width: 14px;
  height: 3px;
  margin: 0 -18px 0 12px;
  content: "";
  background: rgba(255, 255, 255, 0.5);
}

.blockly-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
}

.blockly-info > div {
  min-width: 0;
  padding: 16px;
  background: var(--surface);
}

.blockly-info p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.xml-details {
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.xml-details summary {
  padding: 11px 14px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.xml-details pre {
  max-height: 260px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: #e4e6e9;
  background: #242629;
  border-radius: 0 0 11px 11px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.6;
  white-space: pre;
}

.progress-card {
  padding: 20px;
}

.task-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

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

.task-state {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 8px;
  font-size: 9px;
  font-weight: 850;
}

.task-state.done {
  color: #fff;
  background: var(--green);
}

.task-state.active {
  color: #fff;
  background: var(--coral);
}

.task-copy strong,
.task-copy span {
  display: block;
}

.task-copy strong {
  font-size: 11px;
}

.task-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.task-badge {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.steps-timeline {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.timeline-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 10px;
}

.timeline-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: var(--green);
  border-radius: 50%;
}

.timeline-row.running .timeline-dot {
  background: var(--coral);
  animation: pulse 1.2s ease infinite;
}

.noscript-message {
  position: fixed;
  z-index: 100;
  inset: auto 20px 20px calc(var(--rail-width) + 20px);
  padding: 14px 18px;
  color: #fff;
  background: #242628;
  border-radius: 12px;
  text-align: center;
}

@media (max-width: 1120px) {
  :root {
    --rail-width: 208px;
  }

  .page-frame {
    width: min(960px, calc(100% - 48px));
  }

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

  .workspace-grid {
    grid-template-columns: minmax(310px, 42%) minmax(0, 1fr);
  }

  .phase-step:not(:last-child)::after {
    width: 20px;
  }
}

@media (max-width: 860px) {
  :root {
    --rail-width: 76px;
  }

  .new-start-button {
    display: none;
  }

  .history-rail {
    padding: 19px 10px 13px;
  }

  .brand {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 2px 0 18px;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
    content: url("assets/brand/favicon.ico");
    object-fit: contain;
  }

  .brand-copy,
  .new-start-button span:last-child,
  .rail-history,
  .rail-footer {
    display: none;
  }

  .new-start-button {
    width: 44px;
    min-height: 42px;
    margin: 0 auto;
    padding: 0;
  }

  .rail-nav {
    gap: 7px;
  }

  .rail-nav button {
    justify-content: center;
    width: 56px;
    min-height: 56px;
    margin: 0 auto;
    padding: 7px 3px;
    flex-direction: column;
    gap: 4px;
  }

  .rail-nav-label {
    display: block;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.025em;
    white-space: nowrap;
  }

  .rail-nav button.active {
    box-shadow: inset 0 -3px 0 var(--coral), var(--shadow-sm);
  }

  .page-frame {
    width: min(720px, calc(100% - 40px));
  }

  .grade-grid,
  .project-type-grid,
  .curriculum-grid,
  .example-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-view {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .workspace-topbar {
    position: sticky;
    z-index: 10;
    top: 0;
  }

  .workspace-title {
    min-width: 120px;
  }

  .phase-rail {
    margin-left: auto;
  }

  .phase-step span:last-child,
  .workspace-status span:last-child {
    display: none;
  }

  .phase-step:not(:last-child)::after {
    width: 14px;
    margin: 0 5px;
  }

  .workspace-status {
    min-width: auto;
  }

  .workspace-grid {
    height: auto;
    min-height: calc(100vh - 66px);
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
    background: var(--surface-soft);
  }

  .conversation-panel,
  .artifact-panel {
    min-height: 620px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 17px;
  }

  .conversation-panel {
    height: min(720px, calc(100vh - 86px));
  }

  .artifact-panel {
    height: 720px;
  }
}

@media (max-width: 680px) {
  :root {
    --rail-width: 0px;
  }

  .history-rail {
    right: 0;
    bottom: auto;
    display: block;
    width: 100%;
    height: 64px;
    padding: 0 13px;
    background: rgba(255, 255, 255, 0.96);
    border-right: 0;
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }

  .rail-top {
    display: flex;
    height: 64px;
    align-items: center;
    gap: 7px;
  }

  .brand {
    width: auto;
    margin-right: auto;
    padding: 0;
  }

  .brand-logo {
    width: 142px;
    height: auto;
    content: url("assets/brand/logo.svg");
  }

  .brand-symbol {
    width: 29px;
    height: 29px;
  }

  .brand-copy {
    display: flex;
  }

  .brand-copy strong {
    font-size: 14px;
  }

  .brand-copy small {
    font-size: 8px;
  }

  .new-start-button {
    width: 35px;
    min-height: 35px;
    margin: 0;
  }

  .rail-nav {
    display: flex;
    gap: 3px;
    margin: 0;
  }

  .rail-nav button {
    width: 35px;
    min-height: 35px;
    margin: 0;
    padding: 8px;
  }

  .rail-nav svg {
    width: 17px;
    height: 17px;
  }

  .main-content {
    margin-left: 0;
    padding-top: 64px;
  }

  .page-view {
    min-height: calc(100vh - 64px);
  }

  .page-frame,
  .create-setup-frame {
    width: min(100% - 30px, 600px);
    padding: 42px 0 54px;
  }

  .home-frame {
    padding-top: 48px;
  }

  .home-hero h1,
  .page-heading h1,
  .create-heading h1 {
    font-size: 35px;
  }

  .home-hero > p,
  .page-heading > p,
  .create-heading > p {
    font-size: 15px;
  }

  .mode-grid,
  .grade-grid,
  .project-type-grid,
  .curriculum-grid,
  .example-grid,
  .recent-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .example-explorer {
    margin-top: 48px;
    padding-top: 40px;
  }

  .example-heading {
    display: block;
  }

  .example-search {
    width: 100%;
    margin-top: 18px;
  }

  .example-categories {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .example-categories button {
    flex: 0 0 auto;
  }

  .example-card {
    min-height: 210px;
  }

  .mode-card {
    min-height: 224px;
    padding: 24px;
  }

  .grade-card,
  .type-card {
    min-height: 150px;
  }

  .curriculum-header {
    display: block;
  }

  .curriculum-header .page-badge {
    margin-top: 14px;
  }

  .lesson-slot {
    min-height: 130px;
  }

  .idea-panel {
    padding: 16px;
  }

  .idea-panel textarea {
    min-height: 145px;
    padding-bottom: 60px;
  }

  .idea-hint {
    display: none;
  }

  .workspace-view {
    min-height: calc(100vh - 64px);
  }

  .workspace-topbar {
    top: 64px;
    height: 58px;
    padding: 0 13px;
  }

  .workspace-title {
    min-width: 0;
    margin-right: auto;
  }

  .workspace-title strong {
    max-width: 145px;
  }

  .workspace-title span,
  .workspace-status,
  .phase-step:not(.active) {
    display: none;
  }

  .phase-step.active .phase-dot {
    margin: 0 6px 0 0;
  }

  .phase-step.active span:last-child {
    display: inline;
  }

  .workspace-grid {
    min-height: calc(100vh - 122px);
    padding: 7px;
  }

  .conversation-panel {
    height: calc(100vh - 136px);
    min-height: 560px;
  }

  .artifact-panel {
    height: 650px;
    min-height: 560px;
  }

  .chat-scroll {
    padding: 18px 14px 22px;
  }

  .panel-header,
  .artifact-tabs {
    padding-right: 14px;
    padding-left: 14px;
  }

  .artifact-body {
    padding: 15px;
  }

  .empty-artifact {
    padding: 25px;
  }

  .blockly-info {
    grid-template-columns: 1fr;
  }

  .blockly-placeholder {
    display: grid;
    gap: 5px;
    margin-top: 5px;
  }

  .visual-block:not(:last-child)::after {
    display: none;
  }

  .noscript-message {
    inset: auto 12px 12px;
  }
}

/* Mobile product pass: one workspace pane at a time and phone-safe controls. */
.artifact-tab,
.example-categories button {
  min-height: 44px;
}

.composer textarea {
  padding-right: 62px;
}

@media (max-width: 860px) {
  .workspace-view {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .workspace-grid {
    height: calc(100vh - 66px);
    height: calc(100dvh - 66px);
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
  }

  .mobile-workspace-switch {
    display: grid;
    padding: 4px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    background: #ececef;
    border-radius: 13px;
  }

  .mobile-workspace-switch button {
    min-height: 44px;
    color: var(--ink-soft);
    background: transparent;
    border: 0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
  }

  .mobile-workspace-switch button.active {
    color: var(--coral-strong);
    background: #fff;
    box-shadow: var(--shadow-sm);
  }

  .conversation-panel,
  .artifact-panel {
    height: auto;
    min-height: 0;
  }

  .conversation-panel.mobile-panel-hidden,
  .artifact-panel.mobile-panel-hidden {
    display: none;
  }
}

@media (max-width: 680px) {
  .history-rail {
    height: calc(64px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
  }

  .new-start-button {
    display: none;
  }

  .brand-logo {
    width: 124px;
  }

  .rail-nav {
    gap: 2px;
  }

  .rail-nav button {
    width: 52px;
    min-height: 52px;
    padding: 5px 2px;
  }

  .rail-nav svg {
    width: 18px;
    height: 18px;
  }

  .rail-nav-label {
    font-size: 9px;
  }

  .main-content {
    padding-top: calc(64px + env(safe-area-inset-top));
  }

  .page-view {
    min-height: calc(100vh - 64px);
    min-height: calc(100dvh - 64px - env(safe-area-inset-top));
  }

  .example-search input,
  .idea-panel textarea,
  .composer textarea {
    font-size: 16px;
  }

  .workspace-view {
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px - env(safe-area-inset-top));
  }

  .workspace-topbar {
    position: relative;
    top: auto;
  }

  .workspace-grid {
    height: calc(100vh - 122px);
    height: calc(100dvh - 122px - env(safe-area-inset-top));
    min-height: 0;
  }

  .conversation-panel,
  .artifact-panel {
    height: auto;
    min-height: 0;
  }

  .composer {
    padding-bottom: max(15px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 390px) {
  .history-rail {
    padding-right: 9px;
    padding-left: 9px;
  }

  .brand-logo {
    width: 116px;
  }

  .workspace-topbar {
    gap: 10px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .workspace-title strong {
    max-width: 120px;
  }
}

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