:root {
  --ink: #111111;
  --muted: #5f5f5f;
  --line: #dedede;
  --soft: #f7f7f5;
  --paper: #ffffff;
  --red: #c8102e;
  --red-dark: #8f0d20;
  --ok: #176b3a;
  --ease-ui: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-soft: 0 14px 34px rgba(17, 17, 17, 0.07);
  --shadow-lift: 0 22px 52px rgba(17, 17, 17, 0.11);
  --red-ring: 0 0 0 3px rgba(200, 16, 46, 0.12);
  --red-glow: 0 18px 40px rgba(200, 16, 46, 0.13);
  --font-sans: "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.auth-pending {
  min-height: 100vh;
  background: #ffffff;
}

body.auth-pending .auth-screen,
body.auth-pending .app-shell {
  display: none;
}

html.auth-optimistic body.auth-pending .app-shell {
  display: block;
}

html.auth-optimistic body.auth-pending .auth-screen {
  display: none;
}

.auth-screen {
  min-height: 100vh;
  background:
    linear-gradient(90deg, var(--red) 0 72px, transparent 72px),
    #111111;
  color: #ffffff;
  display: none;
  place-items: center;
  padding: 32px 20px 32px 96px;
}

.auth-screen.ready {
  display: grid;
}

.auth-screen.hidden {
  display: none;
}

.auth-shell {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 0.75fr);
  border: 1px solid #333333;
  background: #ffffff;
  color: var(--ink);
}

.auth-brand {
  min-height: 520px;
  padding: 48px;
  background: #111111;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.auth-brand .eyebrow {
  color: #ffced4;
}

.auth-brand h1 {
  margin-bottom: 18px;
  font-size: clamp(42px, 6vw, 76px);
}

.auth-brand p:last-child {
  margin-bottom: 0;
  color: #d8d8d8;
  font-size: 15px;
  line-height: 1.9;
}

.auth-card {
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-language-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 26px;
  padding: 4px;
  border: 1px solid var(--line);
  background: #f8f8f8;
}

.auth-language-switch button {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: #555555;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  transition: transform 180ms ease-out, background 180ms ease-out, color 180ms ease-out, box-shadow 180ms ease-out;
}

.auth-language-switch button:hover {
  transform: translateY(-1px);
  color: var(--ink);
}

.auth-language-switch button.active {
  background: var(--ink);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(17, 17, 17, 0.12);
}

.auth-card label {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-card span {
  color: #333333;
  font-size: 12px;
  font-weight: 900;
}

.auth-card input {
  height: 44px;
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

.auth-card input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.13);
}

.auth-submit,
.auth-create,
.google-button {
  width: 100%;
}

.auth-create {
  margin-top: 10px;
}

.auth-divider {
  position: relative;
  margin: 22px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.auth-divider::before {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--line);
  content: "";
}

.auth-divider span {
  position: relative;
  padding: 0 10px;
  background: #ffffff;
}

.google-button {
  min-height: 44px;
  border: 1px solid var(--ink);
  background: #ffffff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 800;
}

.google-button span {
  width: 22px;
  height: 22px;
  border: 1px solid var(--red);
  color: var(--red);
  display: inline-grid;
  place-items: center;
  font-family: Arial, sans-serif;
  font-size: 13px;
}

.auth-message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--red);
  font-size: 12.5px;
  line-height: 1.6;
}

.app-shell {
  display: none;
}

.app-shell.visible {
  display: block;
  position: relative;
  min-height: 100vh;
  overflow-x: clip;
  background: #ffffff;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.result-page {
  min-height: 100vh;
  padding: clamp(32px, 7vw, 88px);
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(200, 16, 46, 0.08) 0, rgba(200, 16, 46, 0) 24%),
    #ffffff;
}

.result-card {
  width: min(760px, 100%);
  padding: clamp(32px, 6vw, 64px);
  border: 1px solid var(--ink);
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(17, 17, 17, 0.08);
}

.result-card h1 {
  margin: 12px 0 18px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.08;
}

.result-card p:not(.eyebrow) {
  max-width: 620px;
  color: #333333;
  font-size: 16px;
  font-weight: 700;
  line-height: 2;
}

.result-card.success {
  border-left: 7px solid var(--red);
}

.result-card.cancel {
  border-left: 7px solid #777777;
}

.result-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button,
input {
  font: inherit;
}

.site-header {
  border-bottom: 1px solid #d8d8d8;
  background:
    linear-gradient(90deg, var(--red) 0 56px, transparent 56px),
    linear-gradient(180deg, #ffffff 0%, #fbfbfa 100%);
}

.header-inner,
main,
.site-footer {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.header-inner {
  position: relative;
  padding: 28px 0 24px 76px;
}

.study-log-panel {
  position: absolute;
  top: 54px;
  right: 0;
  z-index: 2;
  width: 276px;
  border: 1px solid var(--ink);
  padding: 10px;
  display: grid;
  gap: 8px;
  align-content: start;
  background: linear-gradient(180deg, #ffffff 0%, #fffafa 100%);
  box-shadow: 0 14px 34px rgba(17, 17, 17, 0.08);
  transition: border-color 220ms var(--ease-ui), box-shadow 220ms var(--ease-ui), transform 220ms var(--ease-ui);
  will-change: transform;
}

.lesson-current {
  display: inline-block;
  margin: 0 0 8px;
  border-left: 3px solid var(--red);
  padding: 5px 0 5px 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.type-logo {
  min-height: 18px;
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.type-logo::after {
  display: inline-block;
  width: 7px;
  height: 1.15em;
  margin-left: 4px;
  background: var(--red);
  vertical-align: -0.18em;
  content: "";
  animation: caretBlink 900ms steps(1) infinite;
}

.type-logo.done::after {
  opacity: 0;
  animation: none;
}

.trace-room-logo {
  width: fit-content;
  max-width: min(100%, 430px);
  margin: 0 0 14px;
  border: 1px solid var(--ink);
  padding: 8px 12px 8px 8px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background:
    linear-gradient(90deg, rgba(200, 16, 46, 0.08) 0 42px, transparent 42px),
    #ffffff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 16px 34px rgba(17, 17, 17, 0.06);
  transition:
    transform 220ms var(--ease-ui),
    border-color 220ms var(--ease-ui),
    box-shadow 220ms var(--ease-ui),
    background 220ms var(--ease-ui);
  will-change: transform;
}

.trace-room-logo:hover {
  border-color: var(--red);
  background:
    linear-gradient(90deg, rgba(200, 16, 46, 0.12) 0 42px, transparent 42px),
    #fffdfd;
  box-shadow: 0 24px 46px rgba(200, 16, 46, 0.13), 0 10px 28px rgba(17, 17, 17, 0.08);
  transform: translateY(-2px);
}

.trace-room-logo:focus-visible {
  outline: 3px solid rgba(200, 16, 46, 0.22);
  outline-offset: 4px;
}

.trace-room-mark {
  position: relative;
  width: 46px;
  height: 46px;
  border: 1px solid var(--red);
  display: inline-grid;
  place-items: center;
  background: #ffffff;
  color: var(--red);
  flex: 0 0 auto;
  overflow: hidden;
}

.trace-room-mark::before,
.trace-room-mark::after {
  position: absolute;
  content: "";
  background: var(--red);
}

.trace-room-mark::before {
  top: 8px;
  right: 7px;
  width: 14px;
  height: 1px;
}

.trace-room-mark::after {
  right: 7px;
  bottom: 8px;
  width: 1px;
  height: 14px;
}

.trace-room-mark-core {
  position: relative;
  z-index: 1;
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
}

.trace-room-word {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.trace-room-word strong {
  color: var(--ink);
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: clamp(18px, 2.1vw, 26px);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
}

.trace-room-word small {
  color: #666666;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}

.user-summary {
  width: min(340px, 100%);
  margin: 10px 0 12px;
  border: 1px solid var(--ink);
  background: #ffffff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  transition: border-color 220ms var(--ease-ui), box-shadow 220ms var(--ease-ui), transform 220ms var(--ease-ui), background 220ms var(--ease-ui);
  will-change: transform;
}

.user-summary-head {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 30px;
  border: 1px solid var(--red);
  color: var(--red);
  display: inline-grid;
  place-items: center;
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.user-label {
  margin: 0 0 3px;
  color: var(--red);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.user-name {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-edit-button {
  margin-left: auto;
  border: 1px solid var(--line);
  padding: 5px 8px;
  background: #ffffff;
  color: var(--red);
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
  transition: border-color 170ms var(--ease-ui), box-shadow 170ms var(--ease-ui), transform 170ms var(--ease-ui), background 170ms var(--ease-ui);
}

.user-edit-button:hover {
  border-color: var(--red);
  background: #fffafa;
  box-shadow: 0 8px 18px rgba(200, 16, 46, 0.08);
  transform: translateY(-1px);
}

.user-metrics {
  display: grid;
  grid-template-columns: repeat(2, 78px);
}

.user-metrics div {
  padding: 10px 8px;
  display: grid;
  align-content: center;
  gap: 2px;
  text-align: center;
}

.user-metrics div + div {
  border-left: 1px solid var(--line);
}

.user-metrics span {
  color: var(--red);
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 18px;
  font-weight: 900;
}

.user-metrics small {
  color: #343434;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.25;
}

.user-profile-editor {
  display: none;
  grid-column: 1 / -1;
  border-top: 1px solid var(--ink);
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fffafa 100%);
}

.user-summary.editing .user-profile-editor {
  display: grid;
  gap: 12px;
}

.user-summary.profile-guided {
  position: relative;
  border-color: var(--red);
  box-shadow: 0 18px 38px rgba(17, 17, 17, 0.12);
  animation: profileGuideIn 420ms ease both;
}

.user-summary.profile-guided::after {
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(200, 16, 46, 0.34);
  content: "";
  pointer-events: none;
  animation: profileGuidePulse 1.8s ease-in-out infinite;
}

.profile-tracea-nudge {
  display: none;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid rgba(200, 16, 46, 0.32);
  border-left: 3px solid var(--red);
  padding: 12px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(17, 17, 17, 0.08);
}

.user-summary.profile-guided .profile-tracea-nudge {
  display: grid;
  animation: traceaNudgeIn 360ms ease both;
}

.profile-tracea-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--red);
  color: var(--red);
  background: #fff7f8;
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 14px;
  font-weight: 900;
}

.profile-tracea-label {
  margin: 0 0 4px;
  color: var(--red);
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 900;
}

.profile-tracea-text {
  min-height: 42px;
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.7;
}

.profile-tracea-text.is-typing::after {
  display: inline-block;
  width: 7px;
  height: 1.1em;
  margin-left: 3px;
  background: var(--red);
  vertical-align: -0.16em;
  content: "";
  animation: caretBlink 900ms steps(1) infinite;
}

.profile-nudge-skip {
  margin-top: 8px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.profile-nudge-skip:hover {
  color: var(--red);
}

.user-profile-editor label {
  display: grid;
  gap: 6px;
}

.user-profile-editor label span {
  color: var(--red);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.user-profile-editor input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 0 10px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  outline: none;
}

.user-profile-editor input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}

.avatar-choice-group {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.avatar-choice {
  min-height: 34px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 900;
}

.avatar-choice:hover,
.avatar-choice.active {
  border-color: var(--red);
  color: var(--red);
  box-shadow: inset 0 -3px 0 rgba(200, 16, 46, 0.16);
}

.avatar-icon {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.avatar-icon-dot {
  fill: currentColor;
  stroke: none;
}

.avatar-choice .avatar-icon {
  margin: 0 auto;
  width: 20px;
  height: 20px;
}

.user-avatar .avatar-icon,
.trace-user-avatar .avatar-icon,
.chat-avatar .avatar-icon {
  width: 24px;
  height: 24px;
}

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

.profile-message {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.5;
}

.profile-message.ok {
  color: var(--ok);
}

.profile-message.no {
  color: var(--red);
}

@keyframes caretBlink {
  0%,
  48% {
    opacity: 1;
  }

  49%,
  100% {
    opacity: 0;
  }
}

@keyframes profileGuideIn {
  from {
    opacity: 0.8;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes profileGuidePulse {
  0%,
  100% {
    opacity: 0.2;
    transform: scale(1);
  }

  50% {
    opacity: 0.8;
    transform: scale(1.015);
  }
}

@keyframes traceaNudgeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 24px;
  font-size: clamp(38px, 5.2vw, 76px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.lead {
  max-width: 900px;
  margin-bottom: 30px;
  color: #333333;
  font-size: clamp(16px, 1.55vw, 22px);
  font-weight: 600;
  line-height: 2;
  letter-spacing: 0.01em;
}

.lead span {
  color: var(--red);
  font-weight: 800;
}

.header-actions {
  width: fit-content;
  max-width: calc(100% - 300px);
  border: 1px solid var(--ink);
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: #ffffff;
}

.primary-link,
.secondary-link,
.action-button {
  min-height: 34px;
  border: 1px solid var(--ink);
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: #ffffff;
  text-decoration: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  background-size: 180% 100%;
  transition:
    transform 170ms var(--ease-ui),
    background 190ms var(--ease-ui),
    color 170ms var(--ease-ui),
    border-color 170ms var(--ease-ui),
    box-shadow 190ms var(--ease-ui);
  will-change: transform;
}

.header-actions .primary-link,
.header-actions .secondary-link {
  border: 0;
  border-right: 1px solid var(--line);
  min-height: 38px;
  padding: 8px 14px;
}

.header-actions .primary-link:last-child,
.header-actions .secondary-link:last-child {
  border-right: 0;
}

.header-actions .billing-link {
  position: relative;
  letter-spacing: 0.01em;
}

.header-actions .billing-link::after {
  position: absolute;
  right: 8px;
  bottom: 5px;
  left: 8px;
  height: 1px;
  background: currentColor;
  content: "";
  opacity: 0;
  transform: scaleX(0.5);
  transform-origin: center;
  transition: opacity 180ms var(--ease-ui), transform 180ms var(--ease-ui);
}

.header-actions .billing-link:hover::after,
.header-actions .billing-link.loading::after {
  opacity: 0.42;
  transform: scaleX(1);
}

.header-actions .billing-link:disabled {
  cursor: wait;
  opacity: 0.76;
}

.billing-feedback {
  width: fit-content;
  max-width: min(calc(100% - 312px), 720px);
  margin: 10px 300px 0 auto;
  padding: 7px 11px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #666666;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.6;
  box-shadow: 0 12px 28px rgba(17, 17, 17, 0.06);
  position: relative;
  z-index: 3;
}

.billing-feedback.active {
  border-color: rgba(200, 16, 46, 0.35);
  color: var(--red);
}

.billing-feedback.no {
  border-color: rgba(200, 16, 46, 0.45);
  background: #fff7f8;
  color: var(--red);
}

.primary-link,
.action-button.primary {
  border-color: var(--red);
  background: var(--red);
  color: #ffffff;
}

.primary-link:hover,
.secondary-link:hover,
.action-button:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px) scale(1.01);
}

.secondary-link:hover,
.action-button.secondary:hover {
  border-color: var(--red);
  color: var(--red);
  background: #fffafa;
}

.primary-link:hover,
.action-button.primary:hover {
  background: linear-gradient(105deg, var(--red-dark) 0%, var(--red) 52%, #df2443 100%);
  box-shadow: var(--red-glow);
}

.primary-link:active,
.secondary-link:active,
.action-button:active,
.chat-send-button:active:not(:disabled),
.trace-room-switch:active {
  transform: translateY(0) scale(0.985);
}

.primary-link:focus-visible,
.secondary-link:focus-visible,
.action-button:focus-visible,
.chat-send-button:focus-visible,
.trace-room-switch:focus-visible,
.signout-button:focus-visible,
.user-edit-button:focus-visible {
  outline: none;
  box-shadow: var(--red-ring), var(--shadow-soft);
}

.lesson-toggle {
  appearance: none;
  color: var(--red);
}

.lesson-panel {
  display: none;
  width: min(560px, 50vw);
  max-height: min(680px, calc(100vh - 190px));
  overflow: auto;
  margin-top: 12px;
  border: 1px solid var(--ink);
  background: #ffffff;
  box-shadow: 0 20px 46px rgba(17, 17, 17, 0.08);
}

.lesson-panel.visible {
  display: inline-grid;
  grid-template-columns: 1fr;
  vertical-align: top;
}

.study-log-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.study-log-head .eyebrow {
  margin-bottom: 2px;
  font-size: 10px;
}

.study-log-head h2 {
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
}

.study-log-head span {
  color: var(--muted);
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.study-log-metrics {
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #ffffff;
}

.study-log-metrics div {
  padding: 7px 5px;
  text-align: center;
}

.study-log-metrics div + div {
  border-left: 1px solid var(--line);
}

.study-log-metrics span {
  display: block;
  color: var(--red);
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.study-log-metrics small {
  color: #333333;
  font-size: 10px;
  font-weight: 900;
}

.study-log-section {
  border-top: 1px solid rgba(200, 16, 46, 0.18);
  padding-top: 7px;
}

.study-log-section h3 {
  margin: 0 0 5px;
  color: var(--red);
  font-size: 10px;
  font-weight: 900;
}

.study-log-section ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.study-log-section li {
  min-width: 0;
  border: 1px solid var(--line);
  padding: 6px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  background: #ffffff;
}

.study-log-section li.empty {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.study-log-section li span {
  color: var(--red);
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 900;
}

.study-log-section li b {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-log-section li small {
  border: 1px solid rgba(200, 16, 46, 0.2);
  padding: 2px 5px;
  color: var(--red);
  background: #fffafa;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.lesson-panel-head {
  border-right: 0;
  border-bottom: 1px solid var(--ink);
  padding: 14px 16px;
}

.lesson-panel-head .eyebrow {
  margin-bottom: 8px;
}

.lesson-panel-head h2 {
  margin-bottom: 5px;
  font-size: 20px;
  line-height: 1.3;
}

.lesson-panel-head p:last-child {
  margin-bottom: 0;
  color: #303030;
  font-size: 12px;
  line-height: 1.65;
}

.lesson-groups {
  display: grid;
  align-content: start;
}

.lesson-group + .lesson-group {
  border-top: 1px solid var(--ink);
}

.lesson-group-toggle {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 9px 12px;
  background: #ffffff;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  text-align: left;
}

.lesson-group-toggle::after {
  content: "+";
  color: var(--red);
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 13px;
  font-weight: 900;
}

.lesson-group.open .lesson-group-toggle::after {
  content: "-";
}

.lesson-group-toggle small {
  color: var(--red);
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 10px;
  white-space: nowrap;
}

.lesson-links {
  display: none;
  grid-template-columns: 1fr;
}

.lesson-group.open .lesson-links {
  display: grid;
}

.lesson-links a {
  min-height: 42px;
  border-right: 0;
  border-bottom: 1px solid var(--line);
  padding: 9px 12px;
  color: var(--ink);
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  transition: background 160ms ease, color 160ms ease;
}

.lesson-links a:last-child {
  border-bottom: 0;
}

.lesson-links a:hover,
.lesson-links a.active {
  background: #fff8f8;
  color: var(--red);
}

.lesson-links a.disabled {
  color: #777777;
  cursor: default;
  background: #fbfbfa;
}

.lesson-links a.disabled:hover {
  color: #777777;
  transform: none;
}

.lesson-links a.premium-locked-link {
  color: #7a7474;
  background: linear-gradient(90deg, #fffafa 0%, #ffffff 78%);
}

.lesson-links a.premium-locked-link:hover {
  border-color: rgba(200, 16, 46, 0.32);
  color: var(--red);
}

.lesson-links a.premium-locked-link b::after {
  content: "LOCK";
  margin-left: 8px;
  border: 1px solid rgba(200, 16, 46, 0.45);
  padding: 1px 5px;
  color: var(--red);
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.lesson-links a.premium-unlocked-link b::after {
  content: "OPEN";
  margin-left: 8px;
  border: 1px solid rgba(30, 126, 71, 0.35);
  padding: 1px 5px;
  color: var(--ok);
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.premium-group-locked > .lesson-group-toggle span::after {
  content: "鍵";
  margin-left: 10px;
  border: 1px solid rgba(200, 16, 46, 0.42);
  padding: 2px 7px;
  color: var(--red);
  font-size: 10px;
  font-weight: 900;
}

.lesson-links span {
  color: var(--red);
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 11px;
}

.lesson-links b {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-check {
  width: fit-content;
  border: 1px solid var(--line);
  padding: 2px 6px;
  color: #3a3a3a;
  background: #ffffff;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.lesson-links a.lesson-complete .lesson-check {
  border-color: var(--ok);
  color: var(--ok);
}

.syntax-section,
.basics-section,
.arrays-section,
.array-questions-section,
.conditionals-section,
.conditional-questions-section,
.booleans-section,
.boolean-questions-section,
.questions-section {
  padding: 44px 0;
}

.section-heading {
  margin-bottom: 22px;
  border-left: 4px solid var(--red);
  padding-left: 16px;
}

.section-heading h2 {
  margin-bottom: 8px;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.18;
}

.section-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.trace-room-heading {
  margin-bottom: 20px;
  border-left-width: 4px;
  padding: 6px 0 6px 16px;
}

.trace-room-title-mark {
  margin-bottom: 10px;
  color: var(--red);
  font-size: 17px;
  letter-spacing: 0.08em;
}

.basics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}

.basics-grid article {
  min-height: 330px;
  padding: 22px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: #ffffff;
}

.basics-grid h3 {
  margin-bottom: 12px;
  color: var(--red);
  font-size: 28px;
}

.basics-grid p {
  min-height: 126px;
  color: #303030;
  font-size: 14px;
  line-height: 1.75;
}

.term {
  color: var(--red);
  font-weight: 800;
}

.basics-grid code {
  display: inline-block;
  margin-top: 6px;
  border-bottom: 2px solid var(--red);
  padding-bottom: 3px;
  font-family: Menlo, Consolas, monospace;
  font-size: 13px;
}

.basics-grid ul {
  margin: 16px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.basics-grid li {
  position: relative;
  margin: 0 0 8px;
  padding-left: 16px;
  color: #272727;
  font-size: 12.5px;
  line-height: 1.55;
}

.basics-grid li::before {
  position: absolute;
  top: 0.68em;
  left: 0;
  width: 6px;
  height: 6px;
  background: var(--red);
  content: "";
}

.basics-grid b {
  font-weight: 900;
}

.source-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.source-note a {
  color: var(--red-dark);
  font-weight: 800;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.trace-room-board {
  display: grid;
  grid-template-columns: minmax(260px, 0.56fr) minmax(0, 1.44fr);
  border: 1px solid var(--ink);
  background: #ffffff;
}

.trace-room-copy {
  border-right: 1px solid var(--ink);
  padding: 28px;
  background: #111111;
  color: #ffffff;
}

.trace-room-copy h3 {
  margin-bottom: 14px;
  font-size: 25px;
  line-height: 1.45;
}

.trace-room-copy p {
  color: #e8e8e8;
  font-size: 14px;
  line-height: 1.9;
}

.trace-room-list {
  display: grid;
  gap: 0;
}

.trace-user-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(210px, 0.9fr) minmax(0, 2fr);
  gap: 16px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  transition:
    background 220ms var(--ease-ui),
    box-shadow 220ms var(--ease-ui),
    transform 220ms var(--ease-ui),
    border-color 220ms var(--ease-ui);
  will-change: transform;
}

.trace-user-card::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  background: var(--red);
  content: "";
  opacity: 0;
  transform: scaleY(0.3);
  transform-origin: center;
  transition: opacity 220ms var(--ease-ui), transform 220ms var(--ease-ui);
}

.trace-user-card:last-child,
.trace-room-empty:last-child {
  border-bottom: 0;
}

.trace-user-card.mentor {
  border-left: 3px solid var(--red);
  background: linear-gradient(90deg, #fff6f7 0%, #ffffff 42%);
}

.trace-user-card.mentor::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 10% 20%, rgba(200, 16, 46, 0.11), transparent 32%);
  content: "";
  opacity: 0;
  transition: opacity 240ms var(--ease-ui);
}

.trace-user-top {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.trace-user-avatar {
  width: 38px;
  height: 38px;
  border: 1px solid var(--red);
  display: grid;
  place-items: center;
  color: var(--red);
  background: #ffffff;
  font-size: 15px;
  font-weight: 900;
}

.trace-user-name-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.trace-user-name-line h3 {
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trace-user-identity p {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trace-user-badge {
  border: 1px solid var(--red);
  padding: 3px 6px;
  color: var(--red);
  background: #ffffff;
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 9px;
  font-weight: 900;
}

.trace-online-dot {
  width: 9px;
  height: 9px;
  border: 1px solid #777777;
  border-radius: 50%;
  background: #ffffff;
  transition: box-shadow 220ms var(--ease-ui), transform 220ms var(--ease-ui), border-color 220ms var(--ease-ui);
}

.trace-online-dot.online {
  border-color: var(--ok);
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(0, 126, 58, 0.12);
}

.trace-user-details {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  border: 1px solid var(--line);
  min-width: 0;
}

.trace-user-details div {
  min-width: 0;
  padding: 8px 10px;
}

.trace-user-details div + div {
  border-left: 1px solid var(--line);
}

.trace-user-details dt {
  margin-bottom: 3px;
  color: var(--red);
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.25;
}

.trace-user-details dd {
  margin: 0;
  overflow: hidden;
  color: #242424;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trace-room-empty {
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding: 18px 24px 24px 90px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.trace-room-chat {
  margin-top: 26px;
  border: 1px solid var(--ink);
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 15, 15, 0.06);
  transition: border-color 220ms var(--ease-ui), box-shadow 220ms var(--ease-ui), transform 220ms var(--ease-ui);
}

.chat-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  border-bottom: 1px solid var(--ink);
  padding: 24px 28px;
  background: linear-gradient(90deg, #ffffff 0%, #fff7f8 100%);
}

.chat-heading h3 {
  margin: 4px 0 6px;
  font-size: 31px;
  line-height: 1.15;
}

.chat-heading p:last-child {
  margin: 0;
  color: #444444;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.7;
}

.chat-live-badge {
  border: 1px solid var(--red);
  padding: 7px 10px;
  color: var(--red);
  background: #ffffff;
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 900;
}

.chat-message-list {
  display: grid;
  gap: 14px;
  max-height: 460px;
  overflow-y: auto;
  padding: 22px 28px;
  background: #fffdfd;
  scroll-behavior: smooth;
}

.chat-empty {
  margin: 0;
  border: 1px dashed rgba(200, 16, 46, 0.35);
  padding: 18px;
  color: #5a5a5a;
  background: #ffffff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.8;
}

.chat-message {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  animation: chatMessageIn 240ms ease both;
  transition: transform 200ms var(--ease-ui);
  will-change: transform;
}

.chat-message.deletable {
  grid-template-columns: 38px minmax(0, 1fr) 22px;
}

.chat-message.mentor .chat-message-body {
  border-color: rgba(200, 16, 46, 0.34);
  background: linear-gradient(90deg, #fff5f6 0%, #ffffff 55%);
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border: 1px solid var(--red);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--red);
  background: #ffffff;
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 13px;
  font-weight: 900;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-message-body {
  border: 1px solid var(--line);
  padding: 13px 15px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(18, 18, 18, 0.07);
  transition: border-color 200ms var(--ease-ui), box-shadow 200ms var(--ease-ui), background 200ms var(--ease-ui), transform 200ms var(--ease-ui);
}

.chat-message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 7px;
}

.chat-message-meta strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.chat-mentor-badge {
  border: 1px solid var(--red);
  padding: 2px 6px;
  color: var(--red);
  background: #ffffff;
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 9px;
  font-weight: 900;
}

.chat-delete-button {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(31, 31, 31, 0.12);
  border-radius: 50%;
  padding: 0;
  display: grid;
  place-items: center;
  color: #777777;
  background: #ffffff;
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(17, 17, 17, 0.06);
  align-self: end;
  justify-self: start;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.chat-delete-button:hover:not(:disabled),
.chat-delete-button:focus-visible:not(:disabled) {
  border-color: rgba(200, 16, 46, 0.32);
  color: var(--red);
  background: #fff2f4;
  transform: translateY(-1px);
}

.chat-delete-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.chat-message-text {
  margin: 0;
  color: #222222;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.chat-message-time {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 10px;
  font-weight: 900;
}

.chat-input-form {
  border-top: 1px solid var(--ink);
  padding: 20px 28px 24px;
  background: #ffffff;
}

.chat-input-label {
  display: block;
  margin-bottom: 8px;
  color: var(--red);
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.chat-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
}

.chat-input-row textarea {
  min-height: 56px;
  max-height: 142px;
  resize: vertical;
  border: 1px solid var(--line);
  border-bottom: 2px solid var(--red);
  border-radius: 0;
  padding: 13px 14px;
  color: var(--ink);
  background: #fffafa;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.65;
  outline: none;
  transition: border-color 180ms var(--ease-ui), box-shadow 180ms var(--ease-ui), background 180ms var(--ease-ui);
}

.chat-input-row textarea:hover {
  border-color: #d5b2b8;
  background: #ffffff;
}

.chat-input-row textarea:focus {
  border-color: var(--red);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.12);
}

.chat-send-button {
  min-width: 92px;
  border: 1px solid var(--red);
  padding: 0 22px;
  color: #ffffff;
  background: var(--red);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 170ms var(--ease-ui), box-shadow 190ms var(--ease-ui), background 190ms var(--ease-ui);
  will-change: transform;
}

.chat-send-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--red-glow);
  background: linear-gradient(105deg, var(--red-dark) 0%, var(--red) 55%, #df2443 100%);
}

.chat-send-button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}

.chat-send-button:disabled {
  opacity: 0.54;
  cursor: wait;
}

.chat-form-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 22px;
  margin-top: 8px;
}

.chat-feedback,
.chat-count {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.6;
}

.chat-feedback.no {
  color: var(--red);
}

@keyframes chatMessageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.trace-room-switcher {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(116px, 1fr));
  gap: 4px;
  width: min(420px, 100%);
  margin: -4px 0 24px;
  border: 1px solid rgba(17, 17, 17, 0.14);
  border-radius: 999px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 44px rgba(17, 17, 17, 0.07);
  backdrop-filter: blur(14px);
}

.trace-room-switch {
  position: relative;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  color: var(--ink);
  background: transparent;
  text-decoration: none;
  text-align: center;
  box-shadow: none;
  transition: color 180ms var(--ease-ui), transform 180ms var(--ease-ui), box-shadow 180ms var(--ease-ui), background 180ms var(--ease-ui);
  will-change: transform;
}

.trace-room-switch:hover {
  background: rgba(200, 16, 46, 0.06);
  color: var(--red);
  transform: translateY(-1px);
}

.trace-room-switch.active {
  background: #111111;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(17, 17, 17, 0.15);
}

.trace-room-switch span,
.trace-room-switch small {
  display: block;
}

.trace-room-switch span {
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.02em;
}

.trace-room-switch small {
  margin-top: 2px;
  color: currentColor;
  font-size: 9px;
  font-weight: 850;
  opacity: 0.55;
}

.trace-room-chat {
  overflow: hidden;
  border: 1px solid #1f1f1f;
  border-radius: 8px;
  background: #f7f7f8;
  box-shadow: 0 24px 60px rgba(12, 12, 12, 0.1);
}

.chat-heading {
  align-items: center;
  border-bottom: 1px solid rgba(31, 31, 31, 0.08);
  padding: 18px 22px;
  background: #ffffff;
}

.chat-heading h3 {
  margin: 2px 0 3px;
  font-size: 24px;
  letter-spacing: 0;
}

.chat-heading p:last-child {
  color: #555555;
  font-size: 13px;
}

.chat-presence {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  border: 1px solid rgba(200, 16, 46, 0.18);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--red);
  background: #fff7f8;
  font-size: 11px;
  font-weight: 950;
}

.chat-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(200, 16, 46, 0.1);
}

.chat-message-list {
  align-content: end;
  gap: 10px;
  min-height: 440px;
  max-height: 560px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 247, 248, 0.98)),
    repeating-linear-gradient(0deg, rgba(200, 16, 46, 0.035) 0 1px, transparent 1px 28px);
}

.chat-empty {
  border: 1px solid rgba(31, 31, 31, 0.08);
  border-radius: 8px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 32px rgba(12, 12, 12, 0.06);
}

.chat-message {
  grid-template-columns: 36px minmax(220px, min(620px, calc(100% - 48px)));
  max-width: min(760px, 100%);
  align-items: end;
}

.chat-message.deletable {
  grid-template-columns: 36px minmax(220px, min(620px, calc(100% - 78px))) 22px;
}

.chat-message-body {
  min-width: 0;
  max-width: min(620px, 100%);
  border: 1px solid rgba(31, 31, 31, 0.08);
  border-radius: 8px 8px 8px 2px;
  padding: 11px 13px 9px;
  background: #ffffff;
  box-shadow: 0 14px 32px rgba(12, 12, 12, 0.08);
}

.chat-message.mentor .chat-message-body {
  border-color: rgba(200, 16, 46, 0.18);
  background: #fff7f8;
}

.chat-avatar {
  border-radius: 8px;
  width: 36px;
  height: 36px;
  border-color: rgba(200, 16, 46, 0.55);
  box-shadow: 0 8px 18px rgba(200, 16, 46, 0.08);
}

.chat-message-meta {
  margin-bottom: 3px;
}

.chat-message-meta strong {
  font-size: 12px;
}

.chat-message-text {
  font-size: 14px;
  line-height: 1.65;
  word-break: normal;
  overflow-wrap: anywhere;
}

.chat-message-time {
  margin-top: 5px;
  text-align: right;
}

.chat-typing {
  min-height: 23px;
  margin: 0;
  padding: 0 22px 12px;
  color: var(--red);
  background: #f7f7f8;
  font-size: 12px;
  font-weight: 900;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.chat-typing.visible {
  opacity: 1;
  transform: translateY(0);
}

.chat-typing.visible::after {
  content: "...";
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: typingDots 1.1s ease-in-out infinite;
}

.chat-input-form {
  border-top: 1px solid rgba(31, 31, 31, 0.08);
  padding: 14px 16px 16px;
  background: #ffffff;
}

.chat-input-row {
  grid-template-columns: minmax(0, 1fr) 84px;
  gap: 10px;
  align-items: end;
  border: 1px solid rgba(31, 31, 31, 0.09);
  border-radius: 8px;
  padding: 8px;
  background: #f7f7f8;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.chat-input-row:focus-within {
  border-color: rgba(200, 16, 46, 0.42);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.08);
}

.chat-input-row textarea {
  min-height: 44px;
  max-height: 112px;
  border: 0;
  border-radius: 6px;
  padding: 10px 10px;
  background: transparent;
}

.chat-input-row textarea:hover,
.chat-input-row textarea:focus {
  border: 0;
  box-shadow: none;
  background: transparent;
}

.chat-send-button {
  min-width: 0;
  min-height: 42px;
  border-radius: 7px;
  padding: 0 14px;
}

.chat-form-footer {
  padding: 0 4px;
}

@keyframes typingDots {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.syntax-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
  border: 1px solid var(--ink);
  background: #ffffff;
}

.class-roadmap {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
  border: 1px solid var(--ink);
  background: #ffffff;
}

.class-roadmap div {
  min-height: 118px;
  padding: 18px;
  border-right: 1px solid var(--line);
  display: grid;
  align-content: start;
  gap: 8px;
}

.class-roadmap div:last-child {
  border-right: 0;
}

.class-roadmap span {
  color: var(--red);
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 12px;
  font-weight: 900;
}

.class-roadmap b {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

.class-roadmap p {
  margin: 0;
  color: #3a3a3a;
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1.7;
}

.array-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1.28fr);
  border: 1px solid var(--ink);
  background: #ffffff;
}

.syntax-code,
.array-code {
  border-right: 1px solid var(--ink);
  background: #111111;
  color: #ffffff;
}

.syntax-code pre,
.array-code pre {
  margin: 0;
  padding: 28px;
  overflow-x: auto;
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.8;
}

.syntax-code code,
.array-code code {
  color: inherit;
}

.unlock-challenge {
  display: flex;
  flex-direction: column;
}

.unlock-input {
  width: min(100%, 34ch);
  height: 34px;
  border: 0;
  border-bottom: 2px solid var(--red);
  border-radius: 0;
  padding: 2px 6px;
  background: #1d1d1d;
  color: #ffffff;
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 14px;
  outline: none;
}

.unlock-input:focus {
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.28);
}

.unlock-actions {
  border-top: 1px solid #242424;
  padding: 18px 28px 24px;
}

.unlock-feedback {
  min-height: 24px;
  margin: 10px 0 0;
  color: #d8d8d8;
  font-size: 12.5px;
  line-height: 1.6;
}

.unlock-feedback.ok {
  color: #ffffff;
}

.unlock-feedback.no {
  color: #ffb4bf;
}

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

.array-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.syntax-cards article,
.array-cards article {
  min-height: 210px;
  padding: 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.topic-card {
  position: relative;
  padding-bottom: 48px;
  cursor: pointer;
  transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.topic-card::after {
  content: "詳しく見る";
  position: absolute;
  right: 18px;
  bottom: 16px;
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.topic-card:hover,
.topic-card:focus-visible,
.topic-card.active {
  background: #fff8f9;
  box-shadow: inset 0 0 0 2px var(--red);
  outline: none;
}

.topic-card:hover::after,
.topic-card:focus-visible::after,
.topic-card.active::after {
  opacity: 1;
  transform: translateY(0);
}

.syntax-cards article:nth-child(2n) {
  border-right: 0;
}

.syntax-cards article:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.syntax-cards article:nth-child(n + 7) {
  border-bottom: 0;
}

.array-cards article:nth-child(3n) {
  border-right: 0;
}

.array-cards article:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.syntax-label {
  display: inline-block;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--red);
  color: var(--red);
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 12px;
  font-weight: 900;
}

.syntax-cards h3,
.array-cards h3 {
  margin-bottom: 10px;
  font-size: 18px;
  line-height: 1.45;
}

.syntax-cards p,
.array-cards p {
  margin-bottom: 0;
  color: #303030;
  font-size: 13.5px;
  line-height: 1.85;
}

.topic-deep-dive,
.array-deep-dive {
  margin-top: 24px;
  border: 1px solid var(--ink);
  padding: clamp(22px, 3vw, 34px);
  background: #ffffff;
}

.topic-deep-dive h3,
.array-deep-dive h3 {
  width: min(100%, 820px);
  margin-bottom: 20px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.45;
}

.deep-body {
  display: grid;
  gap: 14px;
  width: min(100%, 920px);
}

.deep-body p {
  margin: 0;
  color: #282828;
  font-size: clamp(14px, 1.45vw, 16px);
  font-weight: 650;
  line-height: 2.05;
  max-width: 72em;
}

.deep-checks {
  margin-top: 24px;
  border-left: 4px solid var(--red);
  padding: 18px 20px;
  background: #fbfbfa;
}

.deep-checks h4 {
  margin-bottom: 10px;
  color: var(--red);
  font-size: 13px;
  letter-spacing: 0;
}

.deep-checks ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  max-width: 760px;
}

.deep-checks li {
  color: #262626;
  font-size: 13.5px;
  font-weight: 750;
  line-height: 1.75;
}

.topic-deep-dive pre,
.array-deep-dive pre {
  margin: 22px 0 0;
  overflow-x: auto;
  border: 1px solid #1b1b1b;
  padding: 18px;
  background: #111111;
  color: #ffffff;
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.8;
}

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

.locked-panel {
  display: none;
  border: 1px solid var(--ink);
  padding: 20px;
  background: #ffffff;
}

.locked-panel h3 {
  margin-bottom: 6px;
  color: var(--red);
  font-size: 20px;
}

.locked-panel p {
  margin-bottom: 0;
  color: #303030;
  line-height: 1.8;
}

.questions-section.locked .locked-panel {
  display: block;
}

.questions-section.locked .difficulty-panel,
.questions-section.locked .question-list {
  display: none;
}

.difficulty-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 22px;
  border: 1px solid var(--ink);
  padding: 16px 18px;
  background: #ffffff;
}

.difficulty-panel h3 {
  margin-bottom: 4px;
  font-size: 18px;
}

.difficulty-panel p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.difficulty-tabs {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  min-width: 196px;
  border: 1px solid var(--ink);
}

.difficulty-tab {
  min-height: 40px;
  border: 0;
  border-right: 1px solid var(--ink);
  padding: 8px 18px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.difficulty-tab:last-child {
  border-right: 0;
}

.difficulty-tab.active {
  background: var(--red);
  color: #ffffff;
}

.question-card {
  position: relative;
  border: 1px solid var(--ink);
  background: #ffffff;
  transition: border-color 220ms var(--ease-ui), box-shadow 220ms var(--ease-ui), transform 220ms var(--ease-ui), background 220ms var(--ease-ui);
  will-change: transform;
}

.question-top {
  display: grid;
  grid-template-columns: 100px 1fr;
  border-bottom: 1px solid var(--ink);
}

.question-number {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--ink);
  color: var(--red);
  font-size: 26px;
  font-weight: 900;
}

.question-copy {
  padding: 22px 24px;
}

.question-title-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.question-copy h3 {
  margin-bottom: 8px;
  font-size: 24px;
}

.progress-mark {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  padding: 4px 8px;
  color: #555555;
  background: #ffffff;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.question-card.completed .progress-mark {
  border-color: var(--ok);
  color: var(--ok);
}

.question-copy p {
  margin-bottom: 0;
  color: #303030;
  line-height: 1.8;
}

.exam-prompt {
  margin: 14px 0 0;
  border-left: 4px solid var(--red);
  background: #fffafa;
  padding: 14px 16px 16px;
}

.exam-prompt-label {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.exam-prompt-main {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.75;
}

.exam-prompt-condition {
  border-top: 1px solid rgba(17, 17, 17, 0.08);
  padding-top: 10px;
}

.exam-prompt-condition p {
  font-size: 15px;
  font-weight: 700;
}

.tracea-prompt p {
  margin-bottom: 0;
  color: #303030;
  line-height: 1.85;
}

.basic-syntax-question .question-title-line {
  align-items: center;
}

.basic-syntax-question .question-copy h3 {
  margin-bottom: 0;
}

.question-focus {
  border-left: 4px solid var(--red);
  background: #fffafa;
  padding: 14px 16px;
}

.question-focus-label {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.question-focus .tracea-prompt p {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.75;
}

.basic-syntax-question .prerequisite-panel {
  margin: 0;
}

.prerequisite-panel {
  margin: 16px 0;
  border: 1px solid rgba(17, 17, 17, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #fffafa 100%);
  padding: 14px;
}

.prerequisite-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.prerequisite-head h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 900;
}

.prerequisite-head p {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.7;
}

.prerequisite-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prerequisite-tag {
  position: relative;
  min-height: 34px;
  border: 1px solid var(--line);
  padding: 7px 10px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 900;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.prerequisite-tag:hover,
.prerequisite-tag:focus-visible,
.prerequisite-tag.active {
  border-color: var(--red);
  box-shadow: 0 8px 22px rgba(17, 17, 17, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.prerequisite-label {
  color: var(--ink);
}

.prerequisite-status {
  border-left: 1px solid var(--line);
  padding-left: 8px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.prerequisite-tag.understood .prerequisite-status {
  color: var(--ok);
}

.prerequisite-tag.review .prerequisite-status,
.prerequisite-tag.caution .prerequisite-status {
  color: var(--red);
}

.prerequisite-description {
  position: absolute;
  z-index: 5;
  top: calc(100% + 8px);
  left: 0;
  width: min(320px, calc(100vw - 44px));
  border: 1px solid var(--red);
  padding: 12px;
  background: #ffffff;
  color: #262626;
  box-shadow: 0 14px 32px rgba(17, 17, 17, 0.14);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.7;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.prerequisite-tag:hover .prerequisite-description,
.prerequisite-tag:focus-visible .prerequisite-description,
.prerequisite-tag.active .prerequisite-description {
  opacity: 1;
  transform: translateY(0);
}

.prerequisite-note {
  margin: 14px 0 0;
  border-left: 3px solid var(--red);
  padding: 10px 12px;
  background: #ffffff;
  color: #2d2d2d;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.75;
}

.prerequisite-note::before {
  content: "Tracea";
  margin-right: 10px;
  color: var(--red);
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 900;
}

.pitfall-box {
  margin-top: 10px;
  border-top: 1px solid rgba(17, 17, 17, 0.1);
  padding-top: 10px;
}

.pitfall-box summary {
  color: var(--red-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.pitfall-box ul {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 18px;
}

.pitfall-box li {
  color: #303030;
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1.65;
}

.question-body {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 0;
}

.code-panel {
  border-right: 1px solid var(--ink);
  background: var(--soft);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  font-size: 12px;
  font-weight: 800;
}

.concept {
  color: var(--red);
}

.code-box {
  margin: 0;
  padding: 18px 18px 20px;
  overflow-x: hidden;
  background: var(--soft);
  color: var(--ink);
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.86;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.code-input {
  width: calc(var(--chars, 8) * 1ch + 18px);
  min-width: 56px;
  height: 30px;
  border: 0;
  border-bottom: 2px solid var(--red);
  border-radius: 0;
  padding: 2px 6px;
  background: #ffffff;
  color: var(--red-dark);
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 14px;
  font-weight: 800;
  outline: none;
}

.code-input:focus {
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.14);
}

.side-panel {
  padding: 18px;
}

.output-box,
.explain-box,
.tracea-panel,
.answer-box {
  border: 1px solid var(--line);
  padding: 14px;
  background: #ffffff;
}

.output-box h4,
.explain-box h4,
.tracea-panel h4,
.answer-box h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.output-box pre {
  margin: 0;
  color: var(--red-dark);
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.explain-box {
  margin-top: 12px;
  color: #303030;
  font-size: 14px;
  line-height: 1.8;
}

.tracea-panel {
  margin-top: 12px;
  border-color: rgba(200, 16, 46, 0.26);
  background: linear-gradient(180deg, #ffffff 0%, #fffafa 100%);
  transition: border-color 220ms var(--ease-ui), box-shadow 220ms var(--ease-ui), transform 220ms var(--ease-ui), background 220ms var(--ease-ui);
}

.tracea-panel h4 {
  color: var(--red);
  font-family: Menlo, Consolas, "Courier New", monospace;
  letter-spacing: 0;
}

.tracea-status {
  min-height: 22px;
  margin: 0 0 10px;
  color: #333333;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.7;
}

.tracea-status.thinking::after {
  content: "";
  display: inline-block;
  min-width: 18px;
  animation: traceaDots 1100ms steps(3, end) infinite;
}

.tracea-status.is-typing::after,
.tracea-notes p.is-typing::after {
  display: inline-block;
  width: 7px;
  height: 1.1em;
  margin-left: 3px;
  background: var(--red);
  vertical-align: -0.16em;
  content: "";
  animation: caretBlink 900ms steps(1) infinite;
}

.tracea-ask {
  border-color: var(--red);
  color: var(--red);
}

.action-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.tracea-mark {
  position: relative;
  border-radius: 6px;
  isolation: isolate;
  transition: background 180ms ease, box-shadow 180ms ease, outline-color 180ms ease, color 180ms ease;
}

.tracea-mark.is-visible {
  animation: traceaAppear 220ms ease both;
}

.tracea-mark.is-visible.tracea-highlight {
  background: rgba(200, 16, 46, 0.1);
  box-shadow: inset 0 -8px 0 rgba(200, 16, 46, 0.16);
}

.tracea-mark.is-visible.tracea-underline {
  box-shadow: inset 0 -2px 0 var(--red);
}

.tracea-mark.is-visible.tracea-wavy {
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--red);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

.tracea-mark.is-visible.tracea-circle {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.tracea-pin {
  display: none;
  min-width: 18px;
  height: 18px;
  margin-left: 4px;
  border: 1px solid var(--red);
  background: #ffffff;
  color: var(--red);
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 10px;
  font-weight: 900;
  line-height: 16px;
  text-align: center;
  vertical-align: text-top;
}

.tracea-mark.is-visible .tracea-pin {
  display: inline-block;
  animation: traceaBubble 240ms ease both;
}

.tracea-notes {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tracea-notes:empty {
  display: none;
}

.tracea-notes li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: start;
  border-top: 1px solid rgba(200, 16, 46, 0.16);
  padding-top: 8px;
  animation: traceaBubble 220ms ease both;
}

.tracea-notes span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--red);
  color: var(--red);
  background: #ffffff;
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 900;
}

.tracea-notes p {
  min-height: 1.65em;
  margin: 0;
  color: #262626;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.65;
}

@keyframes traceaAppear {
  from {
    opacity: 0.35;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes traceaDots {
  0% {
    content: "";
  }
  33% {
    content: ".";
  }
  66% {
    content: "..";
  }
  100% {
    content: "...";
  }
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.action-button {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 13px;
}

.feedback {
  min-height: 24px;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 800;
}

.feedback.ok {
  color: var(--ok);
}

.feedback.no {
  color: var(--red);
}

.answer-box {
  display: none;
  margin-top: 12px;
}

.answer-box.visible {
  display: block;
}

.answer-box pre {
  margin: 0;
  overflow-x: auto;
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre;
}

.site-footer {
  border-top: 1px solid var(--ink);
  padding: 26px 0 36px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.signout-button {
  border: 1px solid var(--ink);
  padding: 8px 14px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transition: border-color 170ms var(--ease-ui), box-shadow 170ms var(--ease-ui), transform 170ms var(--ease-ui), color 170ms var(--ease-ui), background 170ms var(--ease-ui);
}

.signout-button:hover {
  border-color: var(--red);
  color: var(--red);
  background: #fffafa;
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.practice-hero {
  padding-bottom: 28px;
}

.practice-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: #ffffff;
}

.practice-points article {
  padding: 28px;
  min-height: 210px;
  border-right: 1px solid var(--line);
}

.practice-points article:last-child {
  border-right: 0;
}

.practice-points h3 {
  margin: 18px 0 12px;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.35;
}

.practice-points p {
  margin: 0;
  color: #333333;
  line-height: 1.9;
  font-weight: 700;
}

.practice-editor-section {
  width: min(1440px, calc(100% - 64px));
  margin: 0 auto 72px;
  border: 1px solid var(--ink);
  background:
    linear-gradient(90deg, rgba(200, 16, 46, 0.06), transparent 34%),
    #ffffff;
  box-shadow: 0 26px 70px rgba(17, 17, 17, 0.09);
}

.practice-editor-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding: 34px 40px 24px;
  border-bottom: 1px solid var(--line);
}

.practice-editor-head h2 {
  margin: 8px 0 0;
  font-size: clamp(30px, 4vw, 56px);
  line-height: 1.1;
}

.free-badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(200, 16, 46, 0.34);
  color: var(--red);
  background: rgba(200, 16, 46, 0.055);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.practice-editor-shell {
  display: grid;
  grid-template-columns: minmax(250px, 0.34fr) minmax(0, 1fr);
}

.practice-tracea-guide {
  padding: 34px 30px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.tracea-mini-avatar {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid var(--red);
  color: var(--red);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-weight: 900;
  font-size: 22px;
  margin-bottom: 22px;
  box-shadow: 0 14px 28px rgba(200, 16, 46, 0.12);
}

.practice-tracea-guide h3 {
  margin: 12px 0;
  font-size: 27px;
  line-height: 1.35;
}

.practice-tracea-guide p {
  min-height: 88px;
  margin: 0;
  color: #333333;
  font-weight: 800;
  line-height: 1.8;
}

.practice-tracea-guide p[data-state="success"] {
  color: var(--ok);
}

.practice-tracea-guide p[data-state="error"] {
  color: var(--red);
}

.practice-tracea-guide ul {
  margin: 24px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid rgba(200, 16, 46, 0.18);
  list-style: none;
  display: grid;
  gap: 12px;
  color: #333333;
  font-weight: 800;
  line-height: 1.6;
}

.practice-tracea-guide li::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 10px;
  border-radius: 999px;
  background: var(--red);
  vertical-align: 2px;
}

.practice-tracea-guide span,
.practice-tracea-guide kbd {
  font-family: "SFMono-Regular", Consolas, monospace;
  color: var(--red);
}

.practice-workbench {
  min-width: 0;
  padding: 28px;
}

.practice-window-bar {
  height: 48px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  border: 1px solid #262626;
  border-bottom: 0;
  background: #1f2228;
  color: #f7f7f7;
  font-family: "SFMono-Regular", Consolas, monospace;
}

.practice-window-bar small {
  color: #9ba3b4;
  font-weight: 800;
}

.window-dots {
  display: inline-flex;
  gap: 7px;
}

.window-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #c8cdd8;
}

.window-dots span:first-child {
  background: #ff5f57;
}

.window-dots span:nth-child(2) {
  background: #febc2e;
}

.window-dots span:nth-child(3) {
  background: #28c840;
}

.code-editor {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  height: 420px;
  border: 1px solid #262626;
  background: #111318;
  overflow: hidden;
  transition: box-shadow 220ms var(--ease-ui), border-color 220ms var(--ease-ui), transform 220ms var(--ease-ui);
}

.code-editor:focus-within {
  border-color: rgba(255, 255, 255, 0.46);
  box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.18), 0 24px 52px rgba(17, 17, 17, 0.18);
}

.practice-line-numbers {
  grid-column: 1;
  margin: 0;
  padding: 22px 12px 22px 0;
  overflow: hidden;
  background: #0c0e13;
  color: #596171;
  text-align: right;
  font: 15px/1.7 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  user-select: none;
}

.practice-highlight-frame,
.practice-code-input {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  height: 100%;
}

.practice-highlight-frame {
  overflow: auto;
  pointer-events: none;
}

.practice-highlight {
  margin: 0;
  min-width: max-content;
  padding: 22px 18px;
  color: #e8edf7;
  font: 15px/1.7 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  white-space: pre;
}

.practice-code-input {
  position: relative;
  z-index: 2;
  resize: none;
  border: 0;
  outline: 0;
  padding: 22px 18px;
  background: transparent;
  color: transparent;
  caret-color: #ffffff;
  -webkit-text-fill-color: transparent;
  font: 15px/1.7 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  white-space: pre;
  overflow: auto;
  tab-size: 4;
}

.practice-code-input::selection {
  background: rgba(200, 16, 46, 0.36);
  -webkit-text-fill-color: transparent;
}

.tok-keyword {
  color: #ff6b86;
  font-weight: 800;
}

.tok-string {
  color: #f6c177;
}

.tok-number {
  color: #9cdcfe;
}

.tok-comment {
  color: #6a9955;
  font-style: italic;
}

.practice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 0;
}

.run-button {
  min-width: 140px;
}

.console-output {
  border: 1px solid #262626;
  background: #0c0e13;
  color: #f3f3f3;
}

.console-title {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid #262626;
  font-weight: 900;
}

.console-title small {
  color: #aeb5c3;
  font-family: "SFMono-Regular", Consolas, monospace;
}

.console-output pre {
  margin: 0;
  min-height: 98px;
  padding: 18px;
  color: #d6ffe2;
  font: 15px/1.7 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
}

.practice-tutorial-open {
  overflow: hidden;
}

.practice-tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 20% 12%, rgba(200, 16, 46, 0.12), transparent 28%),
    rgba(255, 255, 255, 0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease-ui);
  backdrop-filter: blur(18px);
}

.practice-tutorial-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.practice-tutorial-frame {
  width: min(1500px, 100%);
  max-height: min(920px, calc(100vh - 44px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--ink);
  background: #ffffff;
  box-shadow: 0 34px 90px rgba(17, 17, 17, 0.18);
  transform: translateY(14px) scale(0.985);
  transition: transform 240ms var(--ease-ui);
  overflow: hidden;
}

.practice-tutorial-overlay.visible .practice-tutorial-frame {
  transform: translateY(0) scale(1);
}

.practice-tutorial-frame .practice-editor-shell {
  min-height: 0;
  overflow: hidden;
}

.practice-tutorial-frame .practice-tracea-guide,
.practice-tutorial-frame .practice-workbench {
  min-height: 0;
  overflow: auto;
}

.practice-tutorial-frame .code-editor {
  height: min(500px, 48vh);
}

.tutorial-close-button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  transition: border-color 180ms var(--ease-ui), color 180ms var(--ease-ui), transform 180ms var(--ease-ui), box-shadow 180ms var(--ease-ui);
}

.tutorial-close-button:hover {
  border-color: var(--red);
  color: var(--red);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.tutorial-complete-button {
  display: none;
}

.tutorial-success .tutorial-complete-button {
  display: inline-flex;
}

/* Compact density: closer to a 75% browser zoom feel without forcing browser zoom. */
.header-inner,
main,
.site-footer {
  width: min(1360px, calc(100% - 36px));
}

.header-inner {
  padding: 20px 0 18px 66px;
}

.site-header {
  background:
    linear-gradient(90deg, var(--red) 0 48px, transparent 48px),
    linear-gradient(180deg, #ffffff 0%, #fbfbfa 100%);
}

.lesson-current {
  margin-bottom: 6px;
  padding: 4px 0 4px 9px;
  font-size: 11px;
}

.eyebrow {
  margin-bottom: 12px;
  font-size: 12px;
}

.trace-room-logo {
  margin-bottom: 10px;
  padding: 6px 10px 6px 6px;
  gap: 9px;
}

.trace-room-mark {
  width: 38px;
  height: 38px;
}

.trace-room-word strong {
  font-size: clamp(16px, 1.55vw, 22px);
}

.user-summary {
  width: min(318px, 100%);
  margin: 8px 0 10px;
}

.user-summary-head {
  padding: 9px 11px;
}

.user-avatar {
  width: 32px;
  height: 28px;
}

.user-metrics {
  grid-template-columns: repeat(2, 72px);
}

.user-metrics div {
  padding: 8px 6px;
}

.user-metrics span {
  font-size: 16px;
}

.study-log-panel {
  top: 42px;
  width: 252px;
  padding: 8px;
  gap: 6px;
}

.study-log-head h2 {
  font-size: 13px;
}

.study-log-metrics div {
  padding: 6px 4px;
}

.study-log-metrics span {
  font-size: 18px;
}

.study-log-section li {
  padding: 5px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
}

.header-actions {
  max-width: calc(100% - 276px);
}

.header-actions .primary-link,
.header-actions .secondary-link,
.primary-link,
.secondary-link,
.action-button {
  min-height: 32px;
  padding: 6px 11px;
  font-size: 12px;
}

.billing-feedback {
  max-width: min(calc(100% - 276px), 640px);
  margin: 8px 276px 0 auto;
  padding: 6px 10px;
}

.lesson-panel {
  width: min(520px, 45vw);
  max-height: min(620px, calc(100vh - 150px));
  margin-top: 10px;
}

.lesson-panel-head {
  padding: 12px 14px;
}

.lesson-panel-head h2 {
  font-size: 18px;
}

.lesson-group-toggle {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 12px;
}

.lesson-links a {
  min-height: 36px;
  padding: 7px 10px;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  font-size: 12px;
}

.lesson-links b {
  font-size: 12px;
}

.syntax-section,
.questions-section,
.array-section,
.trace-room-section {
  padding: 32px 0;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading h2 {
  font-size: clamp(28px, 3.3vw, 52px);
}

.section-heading p {
  max-width: 900px;
  font-size: 15px;
  line-height: 1.8;
}

.syntax-code pre,
.array-code pre {
  padding: 20px;
  font-size: 13px;
  line-height: 1.7;
}

.syntax-cards article,
.array-cards article,
.topic-card {
  min-height: 112px;
  padding: 18px;
}

.syntax-cards h3,
.array-cards h3,
.topic-card h3 {
  font-size: clamp(18px, 1.9vw, 28px);
  line-height: 1.35;
}

.question-list {
  gap: 22px;
}

.question-top {
  grid-template-columns: 76px 1fr;
}

.question-number {
  font-size: 22px;
}

.question-copy {
  padding: 16px 18px;
}

.question-copy h3 {
  margin-bottom: 6px;
  font-size: 20px;
}

.exam-prompt {
  margin-top: 10px;
  padding: 11px 13px 13px;
}

.exam-prompt-main {
  font-size: 15px;
  line-height: 1.65;
}

.exam-prompt-condition p,
.tracea-prompt p {
  font-size: 14px;
  line-height: 1.7;
}

.prerequisite-panel {
  margin: 12px 0;
  padding: 11px;
}

.prerequisite-tag {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 11px;
}

.panel-title {
  min-height: 38px;
  padding: 0 13px;
}

.code-box {
  padding: 14px 15px 16px;
  font-size: 13px;
  line-height: 1.7;
}

.code-input {
  height: 27px;
  font-size: 13px;
}

.side-panel {
  padding: 14px;
}

.output-box,
.explain-box,
.tracea-panel,
.answer-box {
  padding: 11px;
}

.explain-box,
.tracea-panel,
.answer-box {
  margin-top: 9px;
}

.button-row {
  gap: 8px;
  margin: 11px 0;
}

.trace-room-copy {
  padding: 22px;
}

.trace-user-card {
  padding: 9px 13px;
  gap: 10px;
}

.trace-user-top {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
}

.trace-user-avatar {
  width: 42px;
  height: 42px;
}

.trace-user-name-line h3 {
  font-size: 21px;
}

.trace-user-details div {
  padding: 8px 10px;
}

.trace-room-switcher {
  margin-bottom: 14px;
}

.trace-room-switch {
  padding: 10px 13px;
}

.chat-heading {
  padding: 14px 18px;
}

.chat-message-list {
  min-height: 360px;
  max-height: 500px;
  padding: 16px;
}

.chat-message-body {
  padding: 9px 11px 8px;
}

.chat-input-form {
  padding: 12px 14px 14px;
}

.practice-editor-section {
  width: min(1360px, calc(100% - 36px));
}

.practice-points article,
.practice-workbench,
.practice-tracea-guide {
  padding: 22px;
}

.practice-editor-head {
  padding: 26px 30px 20px;
}

.code-editor {
  height: 380px;
}

@media (hover: hover) and (pointer: fine) {
  .question-card:hover,
  .topic-card:hover,
  .user-summary:hover,
  .study-log-panel:hover,
  .trace-room-chat:hover {
    border-color: rgba(200, 16, 46, 0.72);
    background: #ffffff;
    box-shadow: var(--shadow-lift);
    transform: translateY(-3px);
  }

  .question-card:hover .question-copy h3,
  .topic-card:hover h3,
  .trace-user-card:hover .trace-user-name-line h3,
  .chat-message:hover .chat-message-meta strong {
    color: var(--red-dark);
  }

  .question-card:hover .question-number {
    text-shadow: 0 10px 28px rgba(200, 16, 46, 0.18);
  }

  .trace-user-card:hover {
    background: linear-gradient(90deg, #fff8f9 0%, #ffffff 56%);
    box-shadow: var(--shadow-soft);
    transform: translateY(-2px);
  }

  .trace-user-card:hover::before {
    opacity: 1;
    transform: scaleY(1);
  }

  .trace-user-card.mentor:hover {
    box-shadow: var(--red-glow);
  }

  .trace-user-card.mentor:hover::after {
    opacity: 1;
  }

  .trace-user-card:hover .trace-online-dot.online {
    box-shadow: 0 0 0 6px rgba(23, 107, 58, 0.14), 0 0 18px rgba(23, 107, 58, 0.24);
    transform: scale(1.12);
  }

  .chat-message:hover {
    transform: translateY(-2px);
  }

  .chat-message:hover .chat-message-body {
    border-color: rgba(200, 16, 46, 0.28);
    background: #ffffff;
    box-shadow: var(--shadow-lift);
  }

  .chat-message.mentor:hover .chat-message-body,
  .tracea-panel:hover,
  .tracea-prompt:hover,
  .prerequisite-note:hover {
    border-color: rgba(200, 16, 46, 0.42);
    box-shadow: var(--red-glow);
  }

  .code-input:hover,
  .unlock-input:hover,
  .user-profile-editor input:hover,
  .auth-card input:hover {
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    min-height: 280px;
  }

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

  .lesson-panel {
    width: 100%;
    max-height: none;
  }

  .header-actions {
    max-width: 100%;
  }

  .trace-room-logo {
    max-width: 100%;
  }

  .trace-room-word strong {
    font-size: 18px;
  }

  .study-log-panel {
    position: static;
    width: min(340px, 100%);
    margin: 0 0 12px;
    box-shadow: none;
  }

  .billing-feedback {
    max-width: 100%;
    margin: 10px 0 0;
  }

  .lesson-panel-head {
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

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

  .lesson-links a:nth-child(4n) {
    border-right: 0;
  }

  .lesson-links a:nth-child(3n) {
    border-right: 0;
  }

  .lesson-links a:nth-child(2n) {
    border-right: 0;
  }

  .lesson-links a:nth-last-child(-n + 4) {
    border-bottom: 1px solid var(--line);
  }

  .lesson-links a:nth-last-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }

  .lesson-links a:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .lesson-links a:last-child {
    border-bottom: 0;
  }

  .syntax-layout,
  .array-layout,
  .trace-room-board {
    grid-template-columns: 1fr;
  }

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

  .class-roadmap div:nth-child(2n) {
    border-right: 0;
  }

  .class-roadmap div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .syntax-code,
  .array-code,
  .trace-room-copy {
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

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

  .array-cards article:nth-child(3n) {
    border-right: 1px solid var(--line);
  }

  .array-cards article:nth-child(2n) {
    border-right: 0;
  }

  .array-cards article:nth-last-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }

  .array-cards article:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

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

  .practice-points,
  .practice-editor-shell {
    grid-template-columns: 1fr;
  }

  .practice-points article,
  .practice-points article:last-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .practice-points article:last-child {
    border-bottom: 0;
  }

  .practice-tracea-guide {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .question-body,
  .question-top {
    grid-template-columns: 1fr;
  }

  .difficulty-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .question-number,
  .code-panel {
    border-right: 0;
  }

  .question-number {
    min-height: 56px;
    border-bottom: 1px solid var(--ink);
  }
}

@media (max-width: 620px) {
  .auth-screen {
    padding: 20px 12px 20px 56px;
    background:
      linear-gradient(90deg, var(--red) 0 44px, transparent 44px),
      #111111;
  }

  .auth-brand,
  .auth-card {
    padding: 28px 22px;
  }

  .auth-brand {
    min-height: 240px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-inner,
  main,
  .site-footer {
    width: min(100% - 24px, 1120px);
  }

  .header-inner {
    padding: 34px 0 28px 58px;
  }

  .site-header {
    background:
      linear-gradient(90deg, var(--red) 0 44px, transparent 44px),
      linear-gradient(180deg, #ffffff 0%, #fbfbfa 100%);
  }

  .eyebrow {
    margin-bottom: 14px;
    font-size: 11px;
  }

  .user-summary {
    grid-template-columns: 1fr;
  }

  .user-summary-head {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .avatar-choice-group {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  h1 {
    margin-bottom: 18px;
    font-size: 38px;
    line-height: 1.18;
  }

  .lead {
    margin-bottom: 24px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.9;
  }

  .exam-prompt {
    padding: 12px;
  }

  .exam-prompt-main {
    font-size: 15px;
  }

  .exam-prompt-condition p {
    font-size: 14px;
  }

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

  .syntax-cards,
  .array-cards {
    grid-template-columns: 1fr;
  }

  .syntax-cards article,
  .syntax-cards article:nth-child(2n),
  .syntax-cards article:nth-child(n + 7),
  .syntax-cards article:nth-last-child(-n + 2),
  .array-cards article,
  .array-cards article:nth-child(2n),
  .array-cards article:nth-child(3n),
  .array-cards article:nth-last-child(-n + 2),
  .array-cards article:nth-last-child(-n + 3) {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .syntax-cards article:last-child,
  .array-cards article:last-child {
    border-bottom: 0;
  }

  .class-roadmap {
    grid-template-columns: 1fr;
  }

  .class-roadmap div,
  .class-roadmap div:nth-child(2n),
  .class-roadmap div:nth-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .class-roadmap div:last-child {
    border-bottom: 0;
  }

  .practice-points,
  .practice-editor-shell {
    grid-template-columns: 1fr;
  }

  .practice-points article,
  .practice-points article:last-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .practice-points article:last-child {
    border-bottom: 0;
  }

  .practice-tracea-guide {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .syntax-code pre,
  .array-code pre {
    padding: 20px 16px;
    font-size: 12.5px;
  }

  .unlock-actions {
    padding: 16px;
  }

  .unlock-input {
    font-size: 12.5px;
  }

  .trace-room-copy,
  .trace-user-card {
    padding: 12px 14px;
  }

  .trace-user-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .trace-user-top {
    grid-template-columns: 36px 1fr auto;
  }

  .trace-user-avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

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

  .trace-user-details div + div {
    border-left: 1px solid var(--line);
  }

  .trace-user-details div:nth-child(2n + 1) {
    border-left: 0;
  }

  .trace-user-details div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .trace-room-empty {
    padding: 16px;
  }

  .trace-room-chat {
    margin-top: 18px;
  }

  .chat-heading {
    display: grid;
    padding: 18px 16px;
  }

  .chat-heading h3 {
    font-size: 24px;
  }

  .chat-live-badge {
    width: max-content;
  }

  .chat-message-list {
    max-height: 380px;
    padding: 16px;
  }

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

  .chat-message.deletable {
    grid-template-columns: 34px minmax(0, 1fr) 22px;
  }

  .chat-input-form {
    padding: 16px;
  }

  .chat-input-row {
    grid-template-columns: 1fr;
  }

  .chat-send-button {
    min-height: 48px;
  }

  .question-copy,
  .side-panel {
    padding: 16px;
  }

  .prerequisite-panel {
    padding: 12px;
  }

  .question-focus {
    padding: 12px;
  }

  .question-focus .tracea-prompt p {
    font-size: 16px;
  }

  .prerequisite-head {
    display: grid;
    gap: 6px;
  }

  .prerequisite-head p {
    max-width: none;
  }

  .prerequisite-tags {
    display: grid;
    grid-template-columns: 1fr;
  }

  .prerequisite-tag {
    justify-content: space-between;
    width: 100%;
  }

  .prerequisite-description {
    right: 0;
    left: auto;
    width: min(100%, calc(100vw - 48px));
  }

  .difficulty-tabs {
    width: 100%;
  }

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

  .lesson-links a,
  .lesson-links a:nth-child(2n),
  .lesson-links a:nth-child(3n),
  .lesson-links a:nth-child(4n),
  .lesson-links a:nth-last-child(-n + 2),
  .lesson-links a:nth-last-child(-n + 3),
  .lesson-links a:nth-last-child(-n + 4) {
    min-height: 68px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .lesson-links a:last-child {
    border-bottom: 0;
  }

  .code-box {
    padding: 14px 12px 16px;
    font-size: 12.5px;
  }

  .code-input {
    font-size: 12.5px;
  }

  .tracea-mark.is-visible.tracea-circle {
    outline-offset: 1px;
  }

  .practice-editor-section {
    width: calc(100% - 28px);
    margin-bottom: 44px;
  }

  .practice-editor-head,
  .practice-workbench,
  .practice-tracea-guide {
    padding: 18px 16px;
  }

  .practice-editor-head {
    display: grid;
  }

  .practice-window-bar {
    grid-template-columns: auto 1fr;
  }

  .practice-window-bar small {
    display: none;
  }

  .code-editor {
    grid-template-columns: 42px minmax(0, 1fr);
    height: 360px;
  }

  .practice-line-numbers,
  .practice-highlight,
  .practice-code-input,
  .console-output pre {
    font-size: 12.5px;
  }

  .practice-line-numbers {
    padding-right: 9px;
  }

  .practice-highlight,
  .practice-code-input {
    padding: 18px 12px;
  }

  .practice-tutorial-overlay {
    padding: 10px;
    align-items: stretch;
  }

  .practice-tutorial-frame {
    max-height: calc(100vh - 20px);
  }

  .practice-tutorial-frame .code-editor {
    height: 340px;
  }
}
