:root {
  --paper: #f7f5f0;
  --paper-light: #fffefc;
  --ink: #312e29;
  --muted: #8d867b;
  --faint: #a8a094;
  --hairline: #ddd6ca;
  --accent: #b7462f;
  --accent-soft: rgba(183, 70, 47, 0.08);
  --highlight: #e8a33d;
  --highlight-deep: #d8912f;
  --grid-size: 227px;
  --panel-width: 252px;
  --ui-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  height: 100%;
  background: var(--paper);
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  width: 100%;
  height: 100%;
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}

button,
input {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button {
  touch-action: manipulation;
}

input {
  -webkit-user-select: text;
  user-select: text;
}

.page-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.86) 0, rgba(255, 255, 255, 0) 43%),
    radial-gradient(circle at 8% 98%, rgba(183, 70, 47, 0.055) 0, rgba(183, 70, 47, 0) 36%),
    radial-gradient(circle at 96% 4%, rgba(136, 108, 67, 0.055) 0, rgba(136, 108, 67, 0) 32%);
}

.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  height: 100svh;
  max-width: 1320px;
  margin: 0 auto;
  padding:
    max(14px, env(safe-area-inset-top, 0px))
    max(22px, env(safe-area-inset-right, 0px))
    max(14px, env(safe-area-inset-bottom, 0px))
    max(22px, env(safe-area-inset-left, 0px));
  gap: clamp(8px, 1.5vh, 14px);
}

@supports (height: 100dvh) {
  .app {
    height: 100dvh;
  }
}

/* ---------- top bar ---------- */

.topbar {
  display: grid;
  flex: none;
  grid-template-columns: auto minmax(170px, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 2vw, 22px);
  min-height: 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brand__mark {
  display: grid;
  width: 25px;
  height: 25px;
  flex: none;
  place-items: center;
  border: 1px solid rgba(183, 70, 47, 0.76);
  border-radius: 2px;
  color: var(--accent);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1;
  transform: rotate(-2deg);
}

.brand__name {
  color: #5b554b;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.2em;
  white-space: nowrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  justify-self: center;
  width: min(100%, 430px);
  height: 40px;
  padding: 0 13px;
  border: 1px solid rgba(218, 210, 197, 0.98);
  border-radius: 12px;
  background: rgba(255, 254, 252, 0.78);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.search-box:focus-within {
  border-color: rgba(183, 70, 47, 0.46);
}

.search-box__icon {
  width: 16px;
  height: 16px;
  flex: none;
  color: #9b9387;
}

#char-search {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  caret-color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
  font-family: var(--ui-font);
  font-size: 13px;
  line-height: 1.4;
}

#char-search::placeholder {
  color: #aaa296;
}

#char-search::-webkit-search-decoration,
#char-search::-webkit-search-cancel-button,
#char-search::-webkit-search-results-button,
#char-search::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.search-box__clear {
  display: grid;
  width: 28px;
  height: 28px;
  flex: none;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(49, 46, 41, 0.08);
  color: #6f675c;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    color 160ms ease;
}

.search-box__clear svg {
  width: 13px;
  height: 13px;
}

.search-box__clear:hover {
  background: rgba(49, 46, 41, 0.14);
  color: #4b463e;
}

.search-box__clear:active {
  background: rgba(49, 46, 41, 0.18);
}

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

.lesson-chip {
  padding: 6px 10px 5px;
  border: 1px solid rgba(221, 214, 202, 0.92);
  border-radius: 999px;
  background: rgba(255, 254, 252, 0.5);
  color: var(--muted);
  font-family: var(--ui-font);
  font-size: 10px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.panel-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: rgba(255, 254, 252, 0.72);
  color: #5e574c;
  cursor: pointer;
  font-family: var(--ui-font);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.panel-toggle__icon {
  width: 15px;
  height: 15px;
}

.panel-toggle:focus-visible,
.panel-close:focus-visible,
.char-button:focus-visible,
.search-box__clear:focus-visible,
.button:focus-visible {
  outline: 2px solid rgba(183, 70, 47, 0.72);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .panel-toggle:hover {
    border-color: #cdc4b6;
    background: var(--paper-light);
  }
}

/* ---------- workspace ---------- */

.workspace {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
}

.course-panel {
  display: flex;
  flex: none;
  flex-direction: column;
  width: var(--panel-width);
  min-height: 0;
  margin-right: clamp(14px, 2vw, 24px);
  padding: 18px 14px 12px;
  overflow: hidden;
  border: 1px solid rgba(221, 214, 202, 0.9);
  border-radius: 18px;
  background: rgba(255, 254, 252, 0.64);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 18px 40px -36px rgba(70, 58, 42, 0.5);
  transition:
    width 260ms var(--ease),
    margin-right 260ms var(--ease),
    padding 260ms var(--ease),
    border-width 260ms var(--ease),
    opacity 200ms ease;
}

.app.is-list-collapsed .course-panel {
  width: 0;
  margin-right: 0;
  padding-right: 0;
  padding-left: 0;
  border-width: 0;
  opacity: 0;
  pointer-events: none;
}

.course-panel__head {
  display: flex;
  flex: none;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.section-kicker {
  margin: 0 0 5px;
  color: #9b9387;
  font-family: var(--ui-font);
  font-size: 9px;
  letter-spacing: 0.2em;
  line-height: 1.4;
}

.course-title {
  margin: 0;
  color: #4b463e;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.25;
  white-space: nowrap;
}

.panel-close {
  display: grid;
  width: 30px;
  height: 30px;
  flex: none;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(221, 214, 202, 0.88);
  border-radius: 50%;
  background: rgba(255, 254, 252, 0.55);
  color: #8d867b;
  cursor: pointer;
}

.panel-close svg {
  width: 14px;
  height: 14px;
}

.course-summary {
  display: flex;
  flex: none;
  justify-content: space-between;
  margin: 9px 1px 8px;
  color: #a39b90;
  font-family: var(--ui-font);
  font-size: 9.5px;
  letter-spacing: 0.06em;
}

.lesson-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 2px 3px 10px 1px;
  scrollbar-width: thin;
  scrollbar-color: rgba(167, 156, 140, 0.4) transparent;
}

.lesson-list::-webkit-scrollbar {
  width: 4px;
}

.lesson-list::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(167, 156, 140, 0.4);
}

.course-tree {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.course-tree details {
  min-width: 0;
}

/* An author `display` rule on nested content can override the browser's
   default hiding of closed <details> content. Keep the accordion closed. */
.course-tree details:not([open]) > :not(summary) {
  display: none;
}

.course-tree summary {
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

.course-tree summary::-webkit-details-marker {
  display: none;
}

.course-tree summary::marker {
  content: "";
}

.course-tree summary::before {
  width: 0;
  height: 0;
  flex: none;
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
  border-left: 4.5px solid currentColor;
  content: "";
  transform-origin: 30% 50%;
  transition: transform 180ms var(--ease);
}

.course-tree details[open] > summary::before {
  transform: rotate(90deg);
}

.course-tree summary:focus-visible {
  outline: 2px solid rgba(183, 70, 47, 0.72);
  outline-offset: 2px;
}

.course-tree summary.is-search-hit .summary-label {
  color: var(--accent);
}

.course-tree summary.is-search-hit .summary-count {
  color: rgba(183, 70, 47, 0.62);
}

.char-button.is-search-hit {
  border-color: rgba(183, 70, 47, 0.54);
  background: rgba(183, 70, 47, 0.1);
  color: var(--accent);
}

.global-search {
  margin: 2px 0 12px;
  padding: 11px 10px;
  border: 1px solid rgba(183, 70, 47, 0.18);
  border-radius: 12px;
  background: rgba(183, 70, 47, 0.055);
}

.global-search-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.global-search-title {
  margin: 0;
  color: var(--accent);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.global-search-count {
  flex: none;
  color: rgba(183, 70, 47, 0.62);
  font-family: var(--ui-font);
  font-size: 8.5px;
  letter-spacing: 0.02em;
}

.global-search-note {
  margin: 3px 0 0;
  color: #9b9387;
  font-family: var(--ui-font);
  font-size: 8.5px;
  letter-spacing: 0.03em;
}

.global-search-grid {
  margin-top: 9px;
}

.summary-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-count {
  flex: none;
  color: #b0a79b;
  font-family: var(--ui-font);
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: 0;
}

.grade-group {
  margin: 1px 0;
}

.grade-group + .grade-group {
  margin-top: 4px;
  border-top: 1px solid rgba(224, 217, 205, 0.72);
  padding-top: 4px;
}

.grade-summary {
  padding: 7px 3px;
  color: #4b463e;
  font-family: var(--serif);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.4;
}

.unit-accordion {
  margin-left: 9px;
  padding-left: 5px;
  border-left: 1px solid rgba(224, 217, 205, 0.72);
}

.unit-summary {
  padding: 5px 3px;
  color: #7c7469;
  font-family: var(--ui-font);
  font-size: 10px;
  letter-spacing: 0.045em;
  line-height: 1.4;
}

.lesson-accordion {
  margin-left: 7px;
}

.lesson-summary {
  padding: 5px 2px;
  color: #91897e;
  font-family: var(--ui-font);
  font-size: 10px;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.lesson-accordion .char-grid {
  margin: 3px 0 9px 11px;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 6px;
}

.unit-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 1px 7px;
  color: #837b70;
  font-family: var(--ui-font);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  line-height: 1.4;
}

.unit-heading span:last-child {
  color: #b0a79b;
  font-size: 9px;
  letter-spacing: 0.02em;
}

.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 6px;
}

.char-button {
  display: grid;
  aspect-ratio: 1;
  min-width: 0;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(224, 217, 205, 0.88);
  border-radius: 10px;
  background: rgba(255, 254, 252, 0.7);
  color: #4b463e;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.char-button:active {
  transform: scale(0.96);
}

.char-button.is-active {
  border-color: rgba(183, 70, 47, 0.56);
  background: var(--accent-soft);
  color: var(--accent);
}

@media (hover: hover) and (pointer: fine) {
  .char-button:hover {
    border-color: rgba(183, 70, 47, 0.42);
    background: rgba(255, 254, 252, 0.98);
  }
}

.empty-state {
  margin: 16px 3px;
  color: #9c9489;
  font-family: var(--ui-font);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-align: center;
}

.course-panel__foot {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  padding-top: 9px;
  border-top: 1px solid rgba(224, 217, 205, 0.72);
  color: #9a9287;
  font-family: var(--ui-font);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.status-dot {
  width: 4px;
  height: 4px;
  flex: none;
  border-radius: 50%;
  background: #b9b0a3;
}

.panel-backdrop {
  position: absolute;
  inset: 0;
  z-index: 20;
  padding: 0;
  border: 0;
  background: rgba(49, 46, 41, 0.22);
  cursor: pointer;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

/* ---------- practice ---------- */

.practice-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: 4px 0;
  gap: clamp(8px, 1.4vh, 14px);
}

.practice-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 430px);
  gap: 12px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: #9b9387;
  font-family: var(--ui-font);
  font-size: 9px;
  letter-spacing: 0.25em;
  line-height: 1.4;
  white-space: nowrap;
}

.eyebrow span {
  width: 11px;
  height: 1px;
  background: rgba(155, 147, 135, 0.58);
}

.practice-note {
  color: #aaa197;
  font-family: var(--ui-font);
  font-size: 8.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.practice {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas:
    ". model"
    "controls write";
  align-items: center;
  justify-items: center;
  justify-content: center;
  column-gap: clamp(28px, 4.5vw, 52px);
  row-gap: clamp(9px, 1.4vh, 13px);
}

.practice-block--model {
  grid-area: model;
}

.practice-block--write {
  grid-area: write;
}

.practice-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.grid-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: max(var(--grid-size), 170px);
  margin-bottom: 7px;
  color: #8f887d;
  font-family: var(--ui-font);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  line-height: 1;
}

.grid-meta__title strong {
  color: #6f675c;
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.grid-meta > span:last-child {
  color: #a39b90;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

.pen-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pen-label i {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #b9b0a3;
}

.grid {
  position: relative;
  isolation: isolate;
  flex: none;
  width: var(--grid-size);
  height: var(--grid-size);
  overflow: hidden;
  border-radius: 2px;
  background: var(--paper-light);
  box-shadow:
    0 1px 0 rgba(70, 58, 42, 0.08),
    0 16px 34px -23px rgba(70, 58, 42, 0.52);
}

.write-hint {
  width: max(var(--grid-size), 170px);
  margin: 6px 0 0;
  color: #aaa197;
  font-family: var(--ui-font);
  font-size: 8.5px;
  letter-spacing: 0.04em;
  line-height: 1.5;
  text-align: center;
}

.grid-bg,
.model-glyph,
.guide-glyph {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

.grid-bg {
  z-index: 2;
}

.model-glyph {
  z-index: 1;
  opacity: 1;
  transform: translateZ(0);
  transition:
    opacity 180ms ease,
    transform 220ms var(--ease);
}

.model-glyph.is-switching {
  opacity: 0;
  transform: scale(0.97);
}

.guide-glyph {
  /* The comparison guide is the topmost layer. */
  z-index: 4;
  opacity: 0;
  transition: none;
  will-change: opacity;
}

.guide-glyph.is-visible {
  opacity: 0.5;
  transition: opacity 340ms var(--ease);
}

#ink-canvas {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

/* ---------- controls ---------- */

.controls {
  display: flex;
  grid-area: controls;
  flex: none;
  flex-direction: column;
  gap: 8px;
  width: 112px;
}

.utility-row {
  display: contents;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 12px;
  font-family: var(--ui-font);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 150ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    opacity 180ms ease;
}

.button:active:not(:disabled) {
  transform: scale(0.975);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.32;
  filter: saturate(0.55);
  box-shadow: none;
}

.button--quiet {
  border: 1px solid rgba(221, 214, 202, 0.96);
  background: rgba(255, 254, 252, 0.62);
  color: #5d574d;
}

.button--primary {
  min-height: 46px;
  border: 1px solid var(--highlight);
  background: var(--highlight);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28) inset,
    0 14px 24px -18px rgba(180, 116, 27, 0.62);
  color: #ffffff;
  font-size: 12px;
  letter-spacing: 0.14em;
}

.button__icon {
  width: 14px;
  height: 14px;
  flex: none;
}

@media (hover: hover) and (pointer: fine) {
  .button--quiet:hover:not(:disabled) {
    border-color: #cdc4b6;
    background: var(--paper-light);
  }

  .button--primary:hover {
    border-color: var(--highlight-deep);
    background: var(--highlight-deep);
  }
}

.a2hs-tip {
  position: fixed;
  z-index: 60;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(92vw, 430px);
  padding: 12px 12px 12px 16px;
  border: 1px solid rgba(221, 214, 202, 0.96);
  border-radius: 14px;
  background: rgba(255, 254, 252, 0.98);
  box-shadow: 0 16px 36px -20px rgba(49, 46, 41, 0.45);
  color: #5d574d;
  font-family: var(--ui-font);
  font-size: 12px;
  letter-spacing: 0.02em;
  line-height: 1.55;
  transform: translateX(-50%);
  animation: a2hs-in 320ms var(--ease) both;
}

.a2hs-tip__text {
  margin: 0;
}

.a2hs-tip__close {
  flex: none;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #35312b;
  border-radius: 999px;
  background: #35312b;
  color: #fbf8f1;
  font-family: var(--ui-font);
  font-size: 11px;
  letter-spacing: 0.06em;
  cursor: pointer;
}

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

.toast {
  position: fixed;
  z-index: 50;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  max-width: calc(100vw - 40px);
  padding: 9px 15px 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  background: rgba(49, 46, 41, 0.93);
  box-shadow: 0 10px 24px -14px rgba(30, 26, 20, 0.7);
  color: #fbf8f2;
  font-family: var(--ui-font);
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition:
    opacity 180ms ease,
    transform 220ms var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.icp-footer {
  flex: none;
  margin-top: auto;
  padding: 0 0 8px;
  color: #a39b90;
  font-family: var(--ui-font);
  font-size: 8.5px;
  letter-spacing: 0.03em;
  line-height: 1.5;
  text-align: center;
}

.icp-footer a {
  color: inherit;
  text-decoration: none;
}

.icp-footer a:hover,
.icp-footer a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.measure-inch {
  position: fixed;
  top: 0;
  left: -10000px;
  width: 1in;
  height: 1in;
  margin: 0;
  padding: 0;
  border: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .course-panel {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 30;
    width: min(84vw, 320px);
    margin-right: 0;
    padding: 18px 16px 12px;
    border-width: 1px;
    border-radius: 16px;
    background: #fbf9f4;
    box-shadow: 18px 0 48px -34px rgba(50, 40, 26, 0.55);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-105%);
    transition:
      transform 260ms var(--ease),
      opacity 200ms ease;
  }

  .app.is-list-open .course-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "brand actions"
      "search search";
    gap: 8px 12px;
  }

  .brand {
    grid-area: brand;
  }

  .search-box {
    grid-area: search;
    justify-self: stretch;
    width: 100%;
    max-width: none;
  }

  .topbar__actions {
    grid-area: actions;
    justify-self: end;
  }

  .lesson-chip {
    display: none;
  }

  .practice-topline {
    justify-content: center;
  }

  .practice-note {
    display: none;
  }
}

@media (max-width: 520px) {
  .brand__name {
    letter-spacing: 0.12em;
  }

  .panel-toggle span {
    display: none;
  }

  .panel-toggle {
    width: 38px;
    padding: 0;
    border-radius: 50%;
  }

  .controls {
    width: 86px;
    gap: 6px;
  }

  .controls .button {
    flex-direction: column;
    gap: 2px;
    min-height: 46px;
    padding: 0 4px;
    font-size: 10px;
    letter-spacing: 0;
  }

  .controls .button--primary {
    min-height: 46px;
    font-size: 10.5px;
    letter-spacing: 0.08em;
  }

  .controls .button__icon {
    width: 13px;
    height: 13px;
  }
}

@media (max-width: 360px) {
  .practice {
    column-gap: 18px;
  }

  .controls {
    width: 80px;
  }
}

@media (max-height: 760px) and (min-width: 761px) {
  .app {
    padding-top: max(9px, env(safe-area-inset-top, 0px));
    padding-bottom: max(9px, env(safe-area-inset-bottom, 0px));
    gap: 8px;
  }

  .practice-panel {
    gap: 8px;
  }

  .practice {
    row-gap: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .guide-glyph.is-visible,
  .model-glyph,
  .toast,
  .button,
  .course-panel,
  .char-button {
    transition-duration: 0.01ms;
  }
}
