:root {
  --bg: #07111f;
  --bg-deep: #03080f;
  --surface: rgba(11, 24, 43, 0.76);
  --surface-strong: rgba(14, 30, 54, 0.92);
  --surface-soft: rgba(8, 18, 33, 0.9);
  --surface-soft-2: rgba(62, 214, 255, 0.16);
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(62, 214, 255, 0.34);
  --ink: #eef6ff;
  --ink-strong: #ffffff;
  --muted: #9fb6ce;
  --muted-soft: rgba(159, 182, 206, 0.78);
  --accent: #7cf7d4;
  --accent-strong: #3ed6ff;
  --gold: #ffd166;
  --success: #7cf7d4;
  --success-soft: rgba(124, 247, 212, 0.12);
  --danger: #ff7b72;
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.38);
  --shadow-md: 0 18px 38px rgba(0, 0, 0, 0.28);
  --radius-lg: 32px;
  --radius-md: 24px;
  --radius-sm: 18px;
  --font-ui: "Sora", sans-serif;
  --font-display: "Space Grotesk", sans-serif;
}

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

html,
body {
  height: auto;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: none;
  color: var(--ink);
  font-family: var(--font-ui);
  background:
    radial-gradient(circle at 15% 20%, rgba(62, 214, 255, 0.24), transparent 22%),
    radial-gradient(circle at 85% 12%, rgba(124, 247, 212, 0.18), transparent 18%),
    radial-gradient(circle at 50% 100%, rgba(255, 209, 102, 0.12), transparent 25%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-deep) 100%);
}

body {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  position: relative;
}

html.is-drawing-stroke,
body.is-drawing-stroke {
  overflow: hidden;
  touch-action: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(124, 247, 212, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 247, 212, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black 44%, transparent 100%);
}

.hidden {
  display: none !important;
}

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

.page-glow {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.28;
  pointer-events: none;
  z-index: 0;
}

.page-glow-left {
  top: 8%;
  left: -90px;
  background: #00c2ff;
}

.page-glow-right {
  right: -120px;
  bottom: 10%;
  background: #85ffc7;
}

.app-shell,
.workspace {
  position: relative;
  width: 100%;
}

.app-shell {
  min-height: 100vh;
  height: auto;
  z-index: 1;
}

.header-shell {
  position: relative;
  z-index: 7;
  display: flex;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
}

.workspace {
  min-height: 100vh;
  height: 100vh;
}

.toolbar-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: min(100%, 1480px);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(22px);
}

.toolbar-shell::after {
  content: "";
  position: absolute;
  right: 28px;
  top: 18px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(62, 214, 255, 0.28) 0 24%, transparent 25%),
    radial-gradient(circle at 50% 50%, rgba(124, 247, 212, 0.12) 0 52%, transparent 53%);
  opacity: 0.8;
  pointer-events: none;
}

.hero-spotlight {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(62, 214, 255, 0.07), transparent 42%),
    var(--surface-strong);
  position: relative;
  overflow: hidden;
}

.hero-spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 84% 18%, rgba(62, 214, 255, 0.18), transparent 22%),
    radial-gradient(circle at 70% 100%, rgba(124, 247, 212, 0.14), transparent 28%);
}

.hero-spotlight::after {
  content: "";
  position: absolute;
  right: 34px;
  top: 22px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(62, 214, 255, 0.34) 0 24%, transparent 25%),
    radial-gradient(circle at 50% 50%, rgba(124, 247, 212, 0.1) 0 56%, transparent 57%);
  opacity: 0.86;
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

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

.classroom-join-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1.2fr);
  gap: 18px;
  align-items: end;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(124, 247, 212, 0.1), rgba(62, 214, 255, 0.08)),
    rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.classroom-join-card.is-joined {
  border-color: rgba(124, 247, 212, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 28px rgba(124, 247, 212, 0.1);
}

.classroom-join-copy h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  color: var(--ink-strong);
}

.classroom-join-copy p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.classroom-join-card.is-joined .classroom-join-copy p:last-child {
  color: var(--accent);
}

.classroom-join-fields {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(170px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.classroom-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.classroom-field span {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.classroom-field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0 14px;
  background: rgba(3, 8, 15, 0.5);
  color: var(--ink-strong);
  font: inherit;
  font-weight: 700;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.classroom-field input::placeholder {
  color: rgba(159, 182, 206, 0.52);
}

.classroom-field input:focus {
  border-color: var(--line-strong);
  background: rgba(3, 8, 15, 0.7);
  box-shadow: 0 0 0 4px rgba(62, 214, 255, 0.1);
}

.classroom-join-button {
  min-height: 48px;
  white-space: nowrap;
}

.hero-eyebrow {
  margin-bottom: 10px;
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 0.94;
  color: var(--ink-strong);
  white-space: nowrap;
  overflow-wrap: normal;
}

.hero-intro {
  margin: 16px 0 0;
  max-width: 44ch;
  color: var(--muted);
  line-height: 1.75;
}

.toolbar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.toolbar-row--main {
  justify-content: space-between;
  flex-wrap: wrap;
}

.toolbar-note {
  margin: -2px 4px 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.toolbar-center,
.toolbar-right {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.question-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(124, 247, 212, 0.08);
  border: 1px solid rgba(124, 247, 212, 0.18);
}

.question-switcher a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.question-switcher a:hover,
.question-switcher a:focus-visible,
.question-switcher a[aria-current="page"] {
  background: rgba(62, 214, 255, 0.16);
  box-shadow: 0 10px 24px rgba(62, 214, 255, 0.12);
  transform: translateY(-1px);
}

.tool-button--new-question {
  border-color: rgba(127, 255, 212, 0.34);
  background:
    linear-gradient(135deg, rgba(127, 255, 212, 0.16), rgba(62, 214, 255, 0.1)),
    rgba(255, 255, 255, 0.06);
  color: var(--ink-strong);
  white-space: nowrap;
  box-shadow: 0 14px 28px rgba(62, 214, 255, 0.1);
}

.tool-button,
.drawer-button,
.mode-button,
.size-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  font: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease,
    color 180ms ease,
    opacity 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.tool-button:hover,
.tool-button:focus-visible,
.drawer-button:hover,
.drawer-button:focus-visible,
.mode-button:hover,
.mode-button:focus-visible,
.size-button:hover,
.size-button:focus-visible,
.icon-button:hover,
.icon-button:focus-visible {
  transform: translateY(-1px);
}

.tool-button:disabled,
.toolbar-select:disabled,
.drawer-button:disabled {
  cursor: default;
  opacity: 0.46;
}

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

.tool-button--ghost,
.drawer-button,
.mode-button,
.size-button,
.icon-button {
  background: rgba(255, 255, 255, 0.07);
}

.tool-button--secondary,
.mode-button.is-active,
.tool-button.is-active {
  background: rgba(255, 209, 102, 0.16);
  border-color: rgba(255, 209, 102, 0.45);
  color: var(--ink);
}

.tool-button--primary {
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: #02131e;
  box-shadow: 0 16px 30px rgba(255, 209, 102, 0.18);
}

.tool-button--faint {
  opacity: 0.38;
}

.tool-button--faint.is-armed {
  opacity: 0.68;
}

.tool-button--faint.is-ready {
  opacity: 1;
  border-color: rgba(255, 123, 114, 0.36);
}

.tool-icon,
.button-icon {
  display: block;
  width: 18px;
  height: 18px;
}

.tool-icon {
  filter: brightness(0) saturate(100%) invert(97%) sepia(7%) saturate(1082%) hue-rotate(178deg) brightness(105%) contrast(101%);
}

.button-icon {
  filter: brightness(0) saturate(100%) invert(9%) sepia(29%) saturate(829%) hue-rotate(165deg) brightness(92%) contrast(95%);
}

.toolbar-select {
  min-height: 44px;
  min-width: 152px;
  padding: 0 42px 0 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(4, 12, 23, 0.82), rgba(4, 12, 23, 0.74))
    padding-box;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(159, 182, 206, 0.86) 50%),
    linear-gradient(135deg, rgba(159, 182, 206, 0.86) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 19px,
    calc(100% - 14px) 19px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.question-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(62, 214, 255, 0.06), transparent 35%),
    var(--surface-strong);
  overflow: hidden;
  position: relative;
}

.question-strip::after {
  content: "";
  position: absolute;
  inset: auto -10% -60% auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 247, 212, 0.28), transparent 70%);
  pointer-events: none;
}

.question-strip .question-copy {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.question-strip .pill--topic {
  align-self: start;
}

.question-strip h1,
.unsupported-state h2,
.feedback-header h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  color: var(--ink-strong);
  line-height: 1.06;
}

.question-strip[data-scale="sm"] h1 {
  font-size: 1.05rem;
}

.question-strip[data-scale="md"] h1 {
  font-size: 1.22rem;
}

.question-strip[data-scale="lg"] h1 {
  font-size: 1.42rem;
}

.question-strip[data-scale="sm"] .question-prompt {
  font-size: 0.84rem;
}

.question-strip[data-scale="md"] .question-prompt {
  font-size: 0.94rem;
}

.question-strip[data-scale="lg"] .question-prompt {
  font-size: 1.02rem;
}

.pill,
.pill--topic {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(124, 247, 212, 0.18);
  background: rgba(124, 247, 212, 0.08);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.pill--topic,
.eyebrow,
.popover-title,
.detail-card h3 {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.eyebrow,
.popover-title,
.detail-card h3 {
  font-size: 0.72rem;
  font-weight: 700;
}

.eyebrow,
.popover-title {
  margin: 0;
}

.question-prompt,
.drawer-markdown,
.detail-card p,
.unsupported-state p {
  color: var(--muted);
  line-height: 1.68;
}

.question-prompt p,
.drawer-markdown p {
  margin: 0 0 0.6rem;
}

.question-prompt p:last-child,
.drawer-markdown p:last-child {
  margin-bottom: 0;
}

.question-prompt code,
.drawer-markdown code {
  padding: 0.12rem 0.38rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  font-family: "SF Mono", "Menlo", monospace;
  font-size: 0.94em;
  color: var(--ink);
}

.question-prompt ul,
.drawer-markdown ul,
.drawer-markdown ol {
  margin: 0.3rem 0 0.7rem 1.1rem;
  padding: 0;
}

.math-block,
.question-prompt .katex-display,
.drawer-markdown .katex-display,
.detail-card .katex-display {
  margin: 0.48rem 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.08rem 0;
  text-align: left;
}

.math-block > span {
  display: block;
}

.question-prompt .katex,
.drawer-markdown .katex,
.detail-card .katex {
  font-size: 1em;
  color: var(--ink);
}

.question-prompt .katex-display > .katex {
  display: block;
  text-align: left;
}

.question-strip[data-scale="sm"] .question-prompt .katex-display > .katex {
  font-size: 1.16em;
}

.question-strip[data-scale="md"] .question-prompt .katex-display > .katex {
  font-size: 1.24em;
}

.question-strip[data-scale="lg"] .question-prompt .katex-display > .katex {
  font-size: 1.32em;
}

.tool-popover,
.unsupported-state,
.feedback-modal {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(22px);
}

.tool-popover {
  position: absolute;
  z-index: 8;
  min-width: 240px;
  padding: 16px;
  border-radius: 22px;
}

.swatch-row,
.mode-row,
.size-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.size-row {
  margin-top: 14px;
}

.size-row.is-hidden {
  display: none;
}

.swatch-button,
.mode-button,
.size-button {
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.swatch-button {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.mode-button {
  min-height: 36px;
  padding: 0 14px;
}

.size-button {
  width: 36px;
  height: 36px;
  padding: 0;
}

.swatch-button.is-active,
.size-button.is-active {
  outline: 2px solid rgba(62, 214, 255, 0.8);
  outline-offset: 3px;
}

.size-dot {
  border-radius: 999px;
  background: var(--ink);
}

.paper-scroller {
  position: absolute;
  inset: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding:
    0
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
}

.paper-surface {
  position: relative;
  margin: 0 auto;
  border: 1px solid rgba(124, 247, 212, 0.16);
  border-radius: 24px;
  background:
    linear-gradient(rgba(124, 247, 212, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 247, 212, 0.07) 1px, transparent 1px),
    linear-gradient(180deg, rgba(2, 12, 21, 0.96), rgba(6, 18, 31, 0.96));
  background-size: 24px 24px, 24px 24px, 100% 100%;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 30px 70px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.paper-surface::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(62, 214, 255, 0.08), transparent 34%),
    radial-gradient(circle at bottom right, rgba(124, 247, 212, 0.08), transparent 28%);
}

#drawSurface {
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  touch-action: none;
}

.feedback-scrim {
  position: absolute;
  inset: 0;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  background: rgba(3, 8, 15, 0.42);
}

.feedback-modal {
  position: absolute;
  z-index: 6;
  right: max(12px, env(safe-area-inset-right));
  width: min(360px, calc(100vw - 24px));
  max-height: min(60vh, 580px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

#typeScaleButton {
  min-width: 54px;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.feedback-modal.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.feedback-modal.status-correct {
  border-color: rgba(124, 247, 212, 0.36);
}

.feedback-modal.status-correct .eyebrow,
.feedback-modal.status-correct #drawerTitle,
.feedback-modal.status-correct #drawerStatus {
  color: var(--success);
}

.feedback-modal.status-correct #drawerStatus,
.feedback-modal.status-correct .detail-card,
.feedback-modal.status-correct .drawer-button {
  background: rgba(124, 247, 212, 0.12);
}

.feedback-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.feedback-header h2 {
  margin-top: 8px;
  font-size: 1.4rem;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
}

.feedback-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  overflow: auto;
}

.feedback-meta {
  display: flex;
  align-items: center;
}

.detail-card {
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.detail-card h3 {
  margin: 0 0 8px;
}

.detail-card p {
  margin: 0;
}

.detailed-feedback summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  cursor: pointer;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-weight: 700;
  list-style: none;
}

.detailed-feedback summary::-webkit-details-marker {
  display: none;
}

.detailed-feedback summary::after {
  content: "+";
  color: var(--accent);
}

.detailed-feedback[open] summary::after {
  content: "-";
}

.detailed-feedback.is-expanded {
  padding-top: 16px;
}

.detailed-feedback.is-expanded summary {
  display: none;
}

.detailed-feedback-content {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.68;
}

.detailed-feedback-content p {
  margin: 0 0 0.65rem;
}

.detailed-feedback-content ul,
.detailed-feedback-content ol {
  margin: 0.3rem 0 0.7rem 1.1rem;
  padding: 0;
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 18px 18px;
}

.drawer-button {
  min-height: 40px;
  padding: 0 16px;
}

.unsupported-state {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 8;
  width: min(520px, calc(100vw - 28px));
  padding: 28px;
  border-radius: 28px;
  transform: translate(-50%, -50%);
}

.unsupported-state h2 {
  font-size: 1.9rem;
}

.unsupported-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.unsupported-links a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 980px) {
  .hero-spotlight {
    grid-template-columns: 1fr;
  }

  .classroom-join-card,
  .classroom-join-fields {
    grid-template-columns: 1fr;
  }

  .toolbar-row--main {
    flex-wrap: wrap;
    justify-content: center;
  }

  .toolbar-center,
  .toolbar-right {
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .header-shell {
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
  }

  .toolbar-shell {
    padding: 16px 14px;
    gap: 14px;
    border-radius: 24px;
  }

  .hero-spotlight {
    padding: 18px;
    gap: 14px;
  }

  .hero-title {
    font-size: clamp(2rem, 10vw, 3.4rem);
  }

  .toolbar-row,
  .toolbar-center,
  .toolbar-right {
    gap: 10px;
  }

  .question-switcher,
  .tool-button--new-question,
  .model-picker,
  .toolbar-select {
    width: 100%;
  }

  .question-switcher {
    justify-content: space-between;
  }

  .question-switcher a {
    flex: 1 1 0;
  }

  .tool-button--new-question {
    justify-content: center;
  }

  .toolbar-center,
  .toolbar-right {
    width: 100%;
    flex-wrap: wrap;
  }

  .tool-button,
  .toolbar-select,
  .drawer-button {
    min-height: 42px;
  }

  .tool-button--secondary,
  .tool-button--primary,
  .tool-button--faint {
    flex: 1 1 0;
  }

  .question-strip {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px;
  }

  .feedback-modal {
    right: 8px;
    left: 8px;
    width: auto;
    max-height: 50vh;
  }
}

@media (max-width: 560px) {
  .toolbar-shell {
    padding: 14px 12px;
  }

  .hero-spotlight {
    padding: 16px;
  }

  .question-strip,
  .unsupported-state,
  .feedback-header,
  .feedback-body,
  .feedback-actions {
    padding-left: 16px;
    padding-right: 16px;
  }

  .tool-popover {
    min-width: min(260px, calc(100vw - 32px));
  }
}
