/* 墨练 UI 规范 V1.0 — 设计令牌（逻辑像素） */
:root {
  /* 颜色 */
  --paper: #FAF7F2;
  --card: #FFFFFF;
  --fill: #F3EFE9;
  --ink: #382C30;
  --muted: #706764;
  --muted-2: #817773;
  --border: #E5DFD8;
  --line: #382C30; /* 兼容旧用法：深色描边/文字 */
  --pop: #FF7657;
  --pop-deep: #B94329;
  --pop-soft: #FFF0E9;
  --seal: var(--pop);
  --ok: #28754D;
  --ok-soft: #E9F6ED;
  --warn: #8A5A16;
  --warn-soft: #FFF4D8;
  --err: #B93838;
  --err-soft: #FDECEC;
  --sky-top: #FAF7F2;
  --sky-bottom: #F3EFE9;

  /* 字号 */
  --fs-page: 28px;
  --fs-section: 20px;
  --fs-dialog: 22px;
  --fs-stat: 32px;
  --fs-body: 18px;
  --fs-btn: 18px;
  --fs-label: 16px;
  --fs-meta: 14px;
  --fs-tag: 12px;
  --fs-dock: 14px;
  --lh-page: 38px;
  --lh-section: 28px;
  --lh-dialog: 30px;
  --lh-stat: 40px;
  --lh-body: 28px;
  --lh-btn: 24px;
  --lh-label: 24px;
  --lh-meta: 22px;
  --lh-tag: 18px;
  --lh-dock: 20px;

  /* 间距（4 的倍数） */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --pad-x: 20px;
  --pad-top: 24px;
  --gap-block: 24px;
  --pad-card: 20px;
  --content-max: 1200px;
  --auth-max: 440px;

  /* 圆角 / 阴影 / 控件 */
  --radius-page: 28px;
  --radius-card: 20px;
  --radius-input: 14px;
  --radius-btn: 16px;
  --radius-dialog: 24px;
  --radius-icon: 14px;
  --shadow: 0 4px 16px rgba(56, 44, 48, 0.06);
  --shadow-soft: 0 8px 24px rgba(56, 44, 48, 0.08);
  --btn-h: 56px;
  --btn-h-play: 60px;
  --btn-h-sec: 48px;
  --btn-h-sm: 40px;
  --input-h: 56px;
  --dock-h: 72px;
  --icon-btn: 48px;
  --icon-size: 28px;
  --font: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-num: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", ui-monospace, monospace;

  /* 练习 / 结算专项 */
  --fs-eq: 48px;
  --fs-eq-lg: 64px;
  --fs-eq-long: 36px;
  --fs-eq-long-lg: 48px;
  --fs-key: 28px;
  --fs-key-lg: 32px;
  --fs-score: 64px;
  --fs-name: 24px;
  --lh-name: 32px;
  --ink-rgb: 56, 44, 48;

  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: var(--lh-body);
}

@media (min-width: 1024px) {
  :root {
    --pad-x: 32px;
    --pad-top: 32px;
    --gap-block: 32px;
    --pad-card: 24px;
    --dock-h: 80px;
  }
}
@media (max-width: 599px) {
  :root {
    --fs-page: 24px;
    --lh-page: 32px;
    --fs-section: 18px;
    --lh-section: 26px;
    --pad-x: 16px;
    --pad-top: 20px;
  }
}

* { box-sizing: border-box; scrollbar-width: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--paper); }
button, input { font: inherit; color: inherit; }
b, strong { font-weight: 700; }
button {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
  transition: transform 120ms ease, box-shadow 120ms ease, background 160ms ease, color 160ms ease;
}
button:disabled { cursor: default; opacity: .5; }
button:focus-visible { outline: 3px solid var(--pop); outline-offset: 3px; }

.num,
[data-clock],
[data-extra],
.auth-box input,
.keys button {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.desk {
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 118, 87, .06), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(40, 117, 77, .05), transparent 24%),
    linear-gradient(180deg, #FFFCF8 0%, var(--paper) 48%, var(--sky-bottom) 100%);
  background-attachment: fixed;
}

.home, .play, .result, .page {
  width: min(var(--content-max), calc(100% - (var(--pad-x) * 2)));
  margin: 0 auto;
  padding: var(--pad-top) 0 calc(var(--dock-h) + 24px);
}

.home {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  padding: 28px 0;
  text-align: left;
}
.board {
  background: rgba(255, 253, 248, .94);
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: 18px 16px 10px;
  box-shadow: var(--shadow-soft);
}
.home .mast {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 4px 14px;
  align-items: center;
}
.home .mast .actions { grid-column: 1 / -1; }
.home .buddy { margin: 0; }
.home h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: var(--fs-page);
  line-height: var(--lh-page);
  font-weight: 700;
  letter-spacing: 0;
  text-align: left;
}
.home h1 span { letter-spacing: .18em; }
.home h1 i {
  display: inline-flex;
  align-items: center;
  height: 26px;
  margin-top: 4px;
  padding: 0 8px 0 10px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--ink);
  font-style: normal;
  font-size: var(--fs-meta);
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1;
}
.home .lead { margin-top: 4px; text-align: left; }
.home .actions { display: flex; gap: 8px; align-items: stretch; margin-top: 14px; }
.home .go, .home .ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--btn-h);
  min-height: var(--btn-h);
  margin: 0;
  padding: 0 16px;
  font-size: var(--fs-section);
  font-weight: 600;
}
.home .go { flex: 1 1 auto; min-width: 0; background: var(--pop-deep); color: #fff; border-color: var(--pop-deep); }
.home .ghost { flex: none; font-weight: 600; color: var(--ink); background: var(--card); border: 1.5px solid var(--border); }
.home .go:active, .home .ghost:active { transform: translateY(1px); }
.home .ghost em {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--ink);
  font-style: normal;
  font-size: var(--fs-meta);
  font-weight: 700;
}
.home .grade-block h2 {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 16px 2px 10px;
  font-size: var(--fs-meta);
  letter-spacing: .2em;
  color: var(--muted);
  font-weight: 700;
}
.home .grade-block h2::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--pop);
}
.home .grade-block h2::after { content: none; }
.home .grades { grid-template-columns: repeat(3, 1fr); gap: 8px 10px; margin: 0; }
.home .grades button {
  position: relative;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 2px 0 0;
  background: transparent;
  box-shadow: none;
  place-items: center;
  align-content: start;
  gap: 4px;
  transform: none;
}
.home .grades button::after { content: none; }
.home .grades .medal {
  position: relative;
  width: 76px;
  height: 96px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding-bottom: 16px;
  border: 0;
  background: transparent;
  box-shadow: none;
  filter: none;
}
.home .grades .plate {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 5px 0 rgba(var(--ink-rgb), .16));
}
.home .grades .medal em,
.home .grades .medal b { position: relative; z-index: 1; color: var(--ink); }
.home .grades .medal em {
  font-style: normal;
  font-size: var(--fs-tag);
  line-height: 1;
  letter-spacing: .12em;
  font-weight: 700;
}
.home .grades .medal b { font-size: var(--fs-page); line-height: .9; font-weight: 700; }
.home .grades .medal { position: relative; }
.home .grades small {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: 0;
  font-weight: 600;
  opacity: 1;
  color: var(--ink);
}
.home .grades .rank { display: flex; gap: 4px; height: 10px; }
.home .grades .rank i {
  width: 10px;
  height: 10px;
  background: linear-gradient(#fff6e4, #e4d0bc);
  clip-path: polygon(50% 0, 62% 35%, 100% 38%, 70% 62%, 80% 100%, 50% 78%, 20% 100%, 30% 62%, 0 38%, 38% 35%);
}
.home .grades .rank[data-rank="1"] i:nth-child(1),
.home .grades .rank[data-rank="2"] i:nth-child(-n+2),
.home .grades .rank[data-rank="3"] i { background: linear-gradient(#fff1b0, #ffb703 68%, #e09020); }
.home .grades button:active { transform: none; }
.home .grades button:active .medal { transform: translateY(4px); }
.home .grades button:active .plate { filter: drop-shadow(0 1px 0 rgba(var(--ink-rgb), .16)); }
.home nav {
  margin-top: 6px;
  padding: 0;
  gap: 8px;
  background: transparent;
}
.home nav button {
  border: 0;
  box-shadow: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  gap: 6px;
}
.mark { width: 18px; height: 18px; display: block; flex: none; }
.home nav .mark { width: 30px; height: 30px; }
.play header .mark { width: 20px; height: 20px; }
.seg button, .settings .set button, .tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.home .go, .home .ghost { gap: 6px; }
.home nav b {
  width: 58px;
  height: 58px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: var(--fs-page);
  line-height: 1;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .7), 4px 5px 0 rgba(var(--ink-rgb), .12);
}
.home nav button:nth-child(1) b { background: #b7e4ff; border-radius: 16px 6px 14px 8px; transform: rotate(-6deg); }
.home nav button:nth-child(2) b { background: #ffd0e0; border-radius: 6px 16px 8px 14px; transform: rotate(5deg); }
.home nav button:nth-child(3) b { background: var(--warn-soft); border-radius: 10px 10px 4px 18px; transform: rotate(-3deg); }
.home nav button:nth-child(4) b { background: #e4d4ff; border-radius: 4px 14px 16px 6px; transform: rotate(4deg); }
.home nav button:active { background: transparent; transform: none; box-shadow: none; }
.home nav button:active b { transform: translateY(4px) rotate(0deg); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .7); }
.home .quests {
  margin-top: 8px;
  padding: 0 4px 6px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.home .quests h2 {
  margin: 10px 0 0;
  font-size: var(--fs-section);
  font-weight: 600;
  line-height: var(--lh-section);
  letter-spacing: 0;
  color: var(--ink);
}
.home .calendar {
  margin: 14px 0 6px;
  padding: 4px 10px 12px;
  background: var(--pop-soft);
  border-radius: 24px;
}
.home .calendar h2 { margin: 10px 6px 0; font-size: var(--fs-meta); letter-spacing: .14em; font-weight: 700; }
.home .calendar .cal-nav {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  margin-top: 4px;
}
.home .calendar .cal-nav strong {
  text-align: center;
  font-size: var(--fs-dialog);
  line-height: var(--lh-dialog);
  font-weight: 600;
  letter-spacing: 0;
}
.home .calendar .cal-nav button {
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--warn-soft);
  color: var(--ink);
}
.home .calendar .cal-nav button svg { width: 18px; height: 18px; display: block; margin: 0 auto; }
.home .calendar .cal-nav button:disabled { background: var(--warn-soft); }
.home .calendar p {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: 700;
}
.home .calendar .cal-week,
.home .calendar .cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  justify-items: center;
}
.home .calendar .cal-week { margin-top: 6px; }
.home .calendar .cal-week span {
  font-size: var(--fs-meta);
  font-weight: 500;
  line-height: var(--lh-meta);
  color: var(--muted-2);
}
.home .calendar .cal-days .pad,
.home .calendar .cal-days .day {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  margin: 2px 0;
  border-radius: 50%;
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.home .calendar .cal-days .day { color: rgba(var(--ink-rgb), .55); }
.home .calendar .cal-days .later { color: rgba(var(--ink-rgb), .28); }
.home .calendar .cal-days .played {
  background: #ffb703;
  color: var(--ink);
  box-shadow: inset 0 -2px 0 #e09020;
}
.home .calendar .cal-days .today { box-shadow: 0 0 0 2px #e8a31a; }
.home .calendar .cal-days .played.today { box-shadow: inset 0 -2px 0 #e09020, 0 0 0 2px var(--warn); }

.buddy {
  width: 96px;
  height: 108px;
  margin: 0 auto 8px;
}
.buddy .mascot { width: 100%; height: 100%; display: block; object-fit: contain; }
.buddy.play-buddy {
  width: 92px;
  height: 104px;
  margin: 0 0 2px;
  animation: none;
}
.buddy.play-buddy.is-fast,
.buddy.play-buddy.is-cheer { animation: mascot-pop .45s ease; }
.buddy.play-buddy.is-miss { animation: mascot-shake .42s linear; }

h1 {
  font-weight: 700;
  letter-spacing: 0;
  font-size: var(--fs-page);
  line-height: var(--lh-page);
  margin: 4px 0 8px;
}
h2 {
  font-weight: 600;
  letter-spacing: 0;
  font-size: var(--fs-section);
  line-height: var(--lh-section);
}
.lead, .sub { color: var(--muted); margin: 0; }
.lead { font-size: var(--fs-label); }

.go, .ghost, .card .row button, .seg button, .page button[data-act="sound"], .page button[data-act="motion"], .page button[data-act="reset"], .result button {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-btn);
  background: #fff;
  box-shadow: none;
  height: var(--btn-h-sec);
  min-height: var(--btn-h-sec);
  padding: 0 20px;
  font-size: var(--fs-btn);
  font-weight: 600;
  line-height: var(--lh-btn);
}
.go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  height: var(--btn-h);
  min-height: var(--btn-h);
  padding: 0 24px;
  background: var(--pop-deep);
  color: #fff;
  border-color: var(--pop-deep);
  box-shadow: var(--shadow);
  letter-spacing: 0;
  font-weight: 600;
}
.ghost {
  padding: 0 20px;
  background: var(--card);
  color: var(--ink);
  border-color: var(--border);
}
.go:active, .ghost:active, .grades button:active, nav button:active, .keys button:active, .seg button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(var(--ink-rgb), .08);
}
.go:disabled, .ghost:disabled { opacity: .5; transform: none; }
.sub { margin-top: 12px; }

.grades {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 22px 0 16px;
}
.grades button {
  display: grid;
  justify-items: center;
  gap: 0;
  padding: 10px 6px 8px;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  color: var(--line);
}
.grades b { font-size: var(--fs-page); line-height: 1.1; }
.grades small { font-size: var(--fs-tag); letter-spacing: .08em; }
.g1 { background: var(--warn-soft); }
.g2 { background: #ffd0e0; }
.g3 { background: var(--ok-soft); }
.g4 { background: #c9ecff; }
.g5 { background: #e4d4ff; }
.g6 { background: #ffd8bf; }

nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
nav button {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 4px 10px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 4px 0 rgba(var(--ink-rgb), .1);
  font-size: var(--fs-meta);
  font-weight: 700;
}
nav b { font-size: var(--fs-dialog); line-height: 1.2; font-weight: 400; }

.quests {
  text-align: left;
  margin-top: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 14px 16px 6px;
  box-shadow: 0 6px 0 rgba(var(--ink-rgb), .1);
}
.quests h2, .page h2 {
  font-weight: 600;
  letter-spacing: 0;
  font-size: var(--fs-section);
  line-height: var(--lh-section);
  margin: 8px 0;
}
.quests ul, .achieve, .skills { list-style: none; padding: 0; margin: 0; }
.quests li {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: var(--lh-body);
  align-items: center;
  border-top: 2px dashed rgba(var(--ink-rgb), .18);
  padding: 10px 0;
}
.quests em {
  flex: none;
  background: #fff4d2;
  border-radius: 999px;
  padding: 2px 8px;
  font-style: normal;
  font-size: var(--fs-meta);
}
.quests .done { color: var(--muted); }
.quests .done span { text-decoration: line-through; }

.play {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 12px 0 10px;
}
.play header, .page header { display: flex; align-items: center; gap: 10px; }
.play header .hud-title, .page header h1 { flex: 1; letter-spacing: .04em; font-size: var(--fs-body); margin: 0; font-weight: 700; }
.play header button, .page header button {
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow);
  font-weight: 700;
  font-size: var(--fs-label);
  display: grid;
  place-items: center;
  padding: 0;
}
.play header button img,
.page header button img {
  width: 22px;
  height: 22px;
  display: block;
  pointer-events: none;
}
.play header button:active, .page header button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(var(--ink-rgb), .16);
}
.page header h1 { font-size: var(--fs-page); line-height: 1; letter-spacing: .06em; }
.page header button {
  width: 36px;
  height: 36px;
  box-shadow: 0 3px 0 rgba(var(--ink-rgb), .16);
}
.page header button img { width: 16px; height: 16px; }
.page header button:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(var(--ink-rgb), .16); }
.page header {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  margin-bottom: 28px;
}
.page header h1 { grid-column: 2; text-align: left; justify-self: start; }
.page header .back { grid-column: 1; }
.page header .set { grid-column: 3; background: #fff; color: var(--ink); }
.page header .set svg { width: 18px; height: 18px; }
.page header button, .play header .back { background: #ffb4a8; }
.play header .sound { margin-left: auto; background: var(--warn-soft); }
.play header .full { background: #b7e4ff; }
.play header .hud-title {
  flex: 0 1 auto;
  display: grid;
  justify-items: start;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 3px 14px 5px;
  box-shadow: 0 4px 0 rgba(var(--ink-rgb), .1);
  line-height: 1.15;
}
.play header .hud-title small {
  font-size: var(--fs-tag);
  letter-spacing: .14em;
  color: var(--muted);
  font-weight: 700;
}
.play header .hud-title b { font-size: var(--fs-body); letter-spacing: .04em; }
.play .meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.play .meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px 3px 8px;
  font-size: var(--fs-meta);
  font-weight: 700;
  box-shadow: 0 3px 0 rgba(var(--ink-rgb), .1);
}
.play .meta span::before { font-size: var(--fs-meta); line-height: 1; }
.play .meta .time::before { content: "⏱"; }
.play .meta .ok { background: var(--ok-soft); }
.play .meta .ok::before { content: "★"; }
.play .meta .miss { background: #ffd6e0; }
.play .meta .miss::before { content: "×"; }
.play .meta .combo { background: var(--warn-soft); }
.play .meta .combo::before { content: "✦"; }
.play .meta .heat { background: #ffd8bf; }
.play .meta .heat::before { content: "▲"; }
.play .meta .extra { background: #e4d4ff; }

.sheet {
  position: relative;
  margin: 10px 0;
  min-height: 180px;
  padding: 16px 16px 12px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background-color: var(--card);
  box-shadow: 0 8px 0 rgba(var(--ink-rgb), .1);
  display: grid;
  align-content: safe center;
  justify-items: center;
  gap: 8px;
}
.play .sheet {
  flex: 1;
  min-height: 0;
  margin: 6px 0;
  overflow: auto;
  scrollbar-width: none;
  padding: 8px 12px 4px;
  gap: 4px;
}
.play .sheet::-webkit-scrollbar { display: none; }
.stage { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.problem { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.kicker, .place { margin: 0; letter-spacing: .06em; color: var(--muted); font-size: var(--fs-meta); font-weight: 700; }
.hint {
  position: relative;
  align-self: center;
  width: fit-content;
  max-width: 100%;
  margin: 2px 0 10px;
  padding: 8px 16px;
  color: #c45c44;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 0 0 3px #ffe1d8;
  text-align: center;
  line-height: 1.5;
  font-size: var(--fs-label);
  letter-spacing: 0;
  font-weight: 700;
}
.play .sheet .hint { margin: 8px 0 0; }
.hint::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  width: 12px;
  height: 12px;
  background: #fff;
  box-shadow: -3px -3px 0 #ffe1d8;
  transform: translateX(-50%) rotate(45deg);
}
.expr {
  font-size: var(--fs-eq-long);
  font-weight: 700;
  letter-spacing: .02em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  column-gap: 8px;
  row-gap: 12px;
  width: 100%;
  max-width: 100%;
}
.expr .prompt {
  min-width: min(100%, max-content);
  max-width: 100%;
  text-align: center;
  line-height: 1.35;
}
.expr .answers {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
}
.expr.hot .prompt { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--seal); }
.cell {
  min-width: 34px;
  height: 42px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  line-height: 1;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-bottom-width: 4px;
  border-bottom-color: var(--ink);
  font-size: var(--fs-page);
  font-weight: 700;
}
.cell.on {
  border-color: var(--seal);
  background: #fff6f1;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--seal) 28%, transparent);
}
.cell.ok {
  border-color: #7dce7a;
  background: var(--ok-soft);
  color: var(--ink);
}
.cell.bad { color: var(--seal); background: var(--pop-soft); animation: shake .28s linear; }
.vert { display: grid; gap: 2px; justify-items: end; align-content: center; }
.vrow { display: grid; grid-template-columns: 1.6rem repeat(var(--cols), 2.15rem); align-items: center; line-height: 1; }
.vrow i { line-height: 1; height: auto; font-weight: 700; }
.vrow i, .vrow .cell { text-align: center; font-style: normal; font-size: var(--fs-page); }
.vrow .hot { color: var(--seal); }
.op { font-weight: 700; }
.rule { height: 3px; border-radius: 3px; background: var(--ink); margin: 2px 0 2px 1.6rem; }
.stamp {
  position: absolute;
  right: 18px;
  bottom: 16px;
  width: 64px;
  height: 64px;
  margin: 0;
  display: grid;
  place-items: center;
  border: 4px solid var(--seal);
  color: var(--seal);
  border-radius: 50%;
  background: rgba(255, 255, 255, .8);
  font-size: var(--fs-page);
  font-weight: 700;
  letter-spacing: 0;
  transform: rotate(-8deg);
  animation: pop .35s cubic-bezier(.2, 1.5, .4, 1);
}
.explain {
  margin: 0;
  padding: 8px 8px 8px 1.4em;
  text-align: left;
  width: min(100%, 380px);
  background: #fff8e8;
  border-radius: 14px;
}
.tools { display: flex; align-items: center; gap: 12px; margin: 26px 0 8px; }
.tools .bar { flex: 1; min-width: 0; }
.tools button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff4d2;
  padding: 4px 12px;
  font-weight: 700;
}
.tools i { display: block; }
.bar { height: 8px; background: #fff; border: 1px solid var(--border); border-radius: 999px; display: block; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--pop); transform-origin: left center; border-radius: 999px; }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; flex: none; }
.keys button {
  height: clamp(46px, 6.6dvh, 58px);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: var(--fs-key);
  font-weight: 700;
  background: #fff;
  box-shadow: 0 4px 0 #f0c9a0;
}
.keys button[data-act="back"] { background: var(--pop-soft); box-shadow: 0 4px 0 var(--pop-soft); font-size: var(--fs-section); }
.keys i { display: none; }

.result {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 0 40px;
}
.scoreboard {
  background: rgba(255, 253, 248, .94);
  border: 1px solid var(--border);
  border-radius: 36px;
  padding: 28px 22px 22px;
  box-shadow: var(--shadow-soft);
}
.celebrate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px 16px;
  margin-bottom: 22px;
}
.result .buddy { width: 108px; height: 120px; margin: 0; flex: none; }
.score-copy { min-width: 0; text-align: left; }
.result h1 {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 0;
  font-size: var(--fs-score);
  letter-spacing: 0;
  line-height: .85;
}
.result h1 i {
  display: inline-flex;
  align-items: center;
  height: 28px;
  margin-bottom: 8px;
  padding: 0 8px 0 10px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--ink);
  font-style: normal;
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1;
}
.result .lead { margin: 10px 0 0; }
.stats {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 18px;
  padding: 0;
}
.stats li {
  border: 0;
  border-radius: 22px;
  padding: 14px 16px 16px;
  background: var(--pop-soft);
  text-align: left;
}
.stats em {
  display: block;
  font-style: normal;
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: 700;
  letter-spacing: .08em;
}
.stats b {
  display: block;
  margin-top: 6px;
  font-size: var(--fs-stat);
  line-height: var(--lh-stat);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stats li:nth-child(1) { background: var(--ok-soft); }
.stats li:nth-child(2) { background: var(--err-soft); }
.stats li:nth-child(3) { background: var(--warn-soft); }
.stats li:nth-child(4) { background: var(--pop-soft); }
.result .acts { display: grid; gap: 10px; }
.result .acts .pair { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 10px; }
.result .acts button {
  width: 100%;
  height: var(--btn-h-sec);
  min-height: var(--btn-h-sec);
  margin: 0;
  margin-top: 0;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-btn);
  font-weight: 600;
  line-height: var(--lh-btn);
  box-shadow: none;
}
.result .acts .go {
  height: var(--btn-h);
  min-height: var(--btn-h);
  background: var(--pop-deep);
  color: #fff;
  border-color: var(--pop-deep);
  box-shadow: var(--shadow);
}

.page { padding-top: 16px; }
.page .lead { margin: 8px 0 14px; }
.split {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.catalog .board {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  gap: 18px 22px;
  align-items: start;
  padding: 18px;
}
.catalog .cats {
  padding: 4px 2px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.pane-head {
  display: grid;
  gap: 4px;
  margin: 4px 6px 14px;
}
.pane-head h2 {
  margin: 0;
  font-size: var(--fs-dialog);
  letter-spacing: .06em;
  justify-content: flex-start;
  gap: 10px;
}
.pane-head p { margin: 0; color: var(--muted); font-size: var(--fs-meta); }
.brush {
  display: block;
  width: 92px;
  height: 10px;
  margin: 2px 0 4px;
  background: var(--ink);
  opacity: .55;
  border-radius: 70% 30% 60% 40% / 80% 20% 80% 20%;
  transform: rotate(-2.5deg);
  transform-origin: left center;
}
.pane-head h2 button {
  margin-left: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  padding: 4px 12px;
  font-size: var(--fs-meta);
  font-weight: 700;
  box-shadow: 0 3px 0 rgba(var(--ink-rgb), .08);
}
.cats {
  display: grid;
  gap: 8px;
  position: sticky;
  top: 12px;
}
.cats button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  border: 1.5px solid transparent;
  border-radius: 16px;
  background: transparent;
  font-weight: 700;
  box-shadow: none;
}
.cats .pip {
  position: relative;
  width: 28px;
  height: 34px;
  display: grid;
  place-items: center;
}
.cats .pip svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cats .pip b { position: relative; font-size: var(--fs-tag); line-height: 1; }
.cats .pip.tone-ink,
.cats .pip.tone-paper,
.cats .pip.tone-color,
.cats .pip.tone-day,
.cats .pip.tone-work,
.cats .pip.tone-try {
  width: 26px;
  height: 26px;
  border: 0;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .8);
}
.cats .pip.tone-ink { border-radius: 8px; background: var(--card); }
.cats .pip.tone-paper {
  border-radius: 5px 8px 6px 7px;
  background: radial-gradient(circle at 16% 14%, #ffb060, var(--pop-soft) 58%);
  box-shadow: 0 3px 0 #f0b48a;
}
.cats .pip.tone-paper::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, transparent 48%, #ff9a4a 50%);
  border-radius: 0 7px 0 2px;
}
.cats .pip.tone-color { border-radius: 50%; background: var(--pop); }
.cats .pip.tone-day,
.cats .pip.tone-work,
.cats .pip.tone-try {
  width: 28px;
  height: 28px;
  background: none;
  box-shadow: none;
  border-radius: 0;
}
.cats button b { font-size: var(--fs-label); }
.cats button small {
  color: var(--muted);
  font-size: var(--fs-tag);
  font-weight: 700;
}
.cats button.on {
  border-color: transparent;
  background: #fff;
  box-shadow: none;
}
.cats button.paper.on { background: #ffd7b8; }
.cats button.color.on { background: var(--pop-soft); }
.cats button.day.on { background: var(--warn-soft); }
.cats button.work.on { background: var(--ok-soft); }
.cats button.try.on { background: #e4d4ff; }
.cats button.g1.on { background: var(--warn-soft); }
.cats button.g2.on { background: var(--err-soft); }
.cats button.g3.on { background: var(--ok-soft); }
.cats button.g4.on { background: #e7f6ff; }
.cats button.g5.on { background: #f4e9ff; }
.cats button.g6.on { background: var(--pop-soft); }
.cats button.on small { color: var(--ink); }
.cats button:active { transform: translateY(1px); box-shadow: none; }
.cats button.on:active { box-shadow: none; }
.pane { min-width: 0; }
.pane h2 { margin-top: 0; }
.skills { display: grid; gap: 10px; align-items: stretch; }
.skilltree { position: relative; overflow: visible; padding: 6px 2px 18px; }
.skilltree svg { position: absolute; left: 0; top: 0; pointer-events: none; }
.skilltree .grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
  grid-auto-rows: minmax(108px, auto);
  gap: 46px 16px;
  width: 100%;
  min-width: 0;
  justify-items: center;
}
.node {
  width: min(168px, 100%);
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  display: grid;
  justify-items: center;
  gap: 3px;
  color: var(--ink);
}
.node:disabled { opacity: 1; cursor: default; }
.node .gem {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #f7f4ee;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .75), 0 4px 0 rgba(var(--ink-rgb), .1);
}
.node.ready .gem { background: var(--ok-soft); box-shadow: 0 0 0 5px #e7f8ec, 0 4px 0 rgba(var(--ink-rgb), .1); }
.node.ok .gem { background: var(--warn-soft); }
.node.ok .gem::after { content: "★"; font-size: var(--fs-dialog); color: var(--warn); line-height: 1; }
.node.later .gem { background: #e7f3fb; }
.node.wait .gem { background: var(--fill); border-style: dashed; }
.node b { font-size: var(--fs-meta); line-height: 1.3; text-align: center; font-weight: 700; }
.node em, .node small { font-style: normal; font-size: var(--fs-tag); color: var(--muted); text-align: center; line-height: 1.35; }
.node.ready em { color: var(--ok); font-weight: 700; }
.node.ok em { color: var(--warn); font-weight: 700; }
.pane .swatches { grid-template-columns: repeat(3, 1fr); }
.skills button {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  text-align: left;
  padding: 14px 14px 12px 18px;
  border: 1px solid var(--border);
  border-radius: 6px 20px 16px 20px;
  background: #fff;
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.skills button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  border-style: solid;
  border-width: 16px 16px 0 0;
  border-color: var(--border) transparent transparent transparent;
}
.skills button.ready::before { border-color: var(--ok-soft) transparent transparent transparent; }
.skills button.ok::before { border-color: var(--warn-soft) transparent transparent transparent; }
.skills button.later::before { border-color: #d9ecf8 transparent transparent transparent; }
.skills button:disabled { opacity: 1; cursor: default; }
.skills strong {
  grid-column: 1;
  grid-row: 1;
  font-weight: 600;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  min-width: 0;
  color: var(--ink);
}
.skills .tag {
  grid-column: 2;
  grid-row: 1;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: 600;
  line-height: var(--lh-meta);
  letter-spacing: 0;
  white-space: nowrap;
}
.skills button.ready .tag { background: var(--ok-soft); color: var(--ok); }
.skills button.ok .tag { background: var(--warn-soft); color: var(--warn); }
.skills button.later .tag { background: #d9ecf8; color: #315066; }
.skills small { grid-column: 1 / -1; }
.skills strong { font-weight: 700; }
.skills em, .skills small, .swatch em, .achieve small {
  color: var(--muted);
  font-style: normal;
  font-size: var(--fs-meta);
  font-weight: 500;
  line-height: var(--lh-meta);
}
.page h2 { display: flex; align-items: center; justify-content: space-between; }
.page h2 button { padding: 4px 12px; font-size: var(--fs-meta); }

.swatches { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.swatch {
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--card);
  padding: var(--pad-card) var(--space-3);
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 4px;
  box-shadow: var(--shadow);
}
.swatch strong {
  grid-column: 1;
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: var(--lh-body);
}
.swatch em { grid-column: 1; }
.swatch.on { box-shadow: 0 0 0 3px var(--pop), 4px 5px 0 rgba(var(--ink-rgb), .08); }
.swatch.lock {
  background: var(--fill);
  border-style: dashed;
  border-color: #c9bfb4;
  box-shadow: none;
  opacity: 1;
  cursor: not-allowed;
}
.swatch.lock strong,
.swatch.lock em { color: var(--muted); }
.swatch.lock .chip::after {
  content: "锁";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: var(--fs-tag);
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}
.chip {
  position: relative;
  width: 100%;
  height: 84px;
  border: 1px solid var(--border);
  border-radius: 16px 16px 12px 18px;
  overflow: hidden;
}
.chip .stroke {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 24px;
  height: 7px;
  border-radius: 999px;
  background: var(--ink);
}
.chip .dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--seal);
  background: color-mix(in srgb, var(--seal) 35%, #fff);
}
.settings .board {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 8px 28px;
  padding: 16px;
  align-items: stretch;
}
.painting {
  margin: 0;
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 72% 16%, rgba(var(--ink-rgb), .05), transparent 32%),
    linear-gradient(180deg, #f7f1e6 0%, #efe4d2 100%);
}
.painting svg { width: 100%; height: 100%; display: block; }
.settings .sets { display: grid; align-content: center; padding: 8px 12px 8px 0; }
.settings .set {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 2px;
  border-bottom: 2px solid rgba(var(--ink-rgb), .08);
}
.settings .set h2 {
  margin: 0;
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: var(--lh-body);
}
.settings .lead {
  margin: 14px 2px 4px;
  font-size: var(--fs-meta);
  color: var(--muted);
  font-weight: 500;
  line-height: var(--lh-meta);
}
.settings .set button { padding: 8px 16px; min-height: var(--btn-h-sec); }

.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { padding: 8px 14px; font-weight: 700; }
.seg button.on { background: var(--warn-soft); }
.achieve {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.achieve > li.trophy {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 14px 16px;
  border: 0;
  border-radius: 24px;
  background: #fff6d8;
}
.achieve > li.tone-work { background: var(--ok-soft); }
.achieve > li.tone-try { background: #f4eeff; }
.achieve .medal { width: 112px; display: grid; justify-items: center; }
.achieve .medal img { width: 104px; height: auto; display: block; }
.achieve .face { position: relative; width: 96px; }
.achieve .face svg { display: block; width: 100%; height: auto; }
.achieve .face b {
  position: absolute;
  left: 0;
  right: 0;
  top: 54%;
  transform: translateY(-50%);
  margin: 0;
  text-align: center;
  font-size: var(--fs-stat);
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}
.achieve .face b.mid { font-size: var(--fs-name); }
.achieve .face b.long { font-size: var(--fs-body); }
.mark-copy { min-width: 0; }
.mark-copy header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mark-copy strong { font-size: var(--fs-body); }
.mark-copy em { font-style: normal; font-weight: 700; color: var(--muted); font-size: var(--fs-meta); }
.mark-copy ol { display: flex; flex-wrap: wrap; gap: 10px 8px; align-items: end; list-style: none; padding: 10px 0 0; margin: 0; }
.mark-copy ol li {
  position: relative;
  width: 36px;
  height: 42px;
  min-width: 0;
  padding: 0;
  border-radius: 0;
  display: block;
  flex: 0 0 auto;
  background: none;
  box-shadow: none;
}
.mark-copy ol li.long { width: 46px; }
.mark-copy ol li.huge { width: 58px; }
.mark-copy ol li .face { position: absolute; inset: 0; width: auto; }
.mark-copy ol li .face svg { width: 100%; height: 100%; }
.mark-copy ol li b {
  position: absolute;
  left: 0;
  right: 0;
  top: 56%;
  transform: translateY(-50%);
  text-align: center;
  font-size: var(--fs-meta);
  font-weight: 700;
  line-height: 1;
  color: rgba(var(--ink-rgb), .38);
}
.mark-copy ol li.long b,
.mark-copy ol li.huge b { font-size: var(--fs-tag); }
.tone-day .mark-copy ol li.on b { color: var(--ink); }
.tone-work .mark-copy ol li.on b { color: #fff; }
.tone-try .mark-copy ol li.on b { color: #fff; }
.tone-day .mark-copy ol li.next b { color: var(--warn); }
.tone-work .mark-copy ol li.next b { color: var(--ok); }
.tone-try .mark-copy ol li.next b { color: #7a4ec4; }
.mark-copy p { margin: 8px 0 0; color: var(--muted); font-size: var(--fs-meta); font-weight: 700; }

.veil {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(var(--ink-rgb), .28);
  display: grid;
  place-items: center;
  padding: 24px;
}
.card {
  width: min(420px, 100%);
  background: var(--card);
  padding: var(--pad-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-dialog);
  box-shadow: var(--shadow-soft);
}
.card h2 {
  font-weight: 600;
  letter-spacing: 0;
  font-size: var(--fs-dialog);
  line-height: var(--lh-dialog);
  margin: 0 0 8px;
}
.card .row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: flex-end;
  align-items: center;
  margin-top: var(--space-5);
}
.card .row button,
.card .row .go,
.card .row .ghost {
  height: var(--btn-h-sec);
  min-height: var(--btn-h-sec);
  margin: 0;
  margin-top: 0;
  padding: 0 20px;
  border-radius: var(--radius-btn);
  background: #fff;
  color: var(--ink);
  font-size: var(--fs-btn);
  font-weight: 600;
  line-height: var(--lh-btn);
  box-shadow: none;
}
.card .row .go {
  background: var(--pop-deep);
  color: #fff;
  border-color: var(--pop-deep);
}

.paper-plain .sheet, .chip.paper-plain { background-color: var(--card); background-image: radial-gradient(circle at 20% 10%, rgba(255, 210, 160, .45), transparent 42%); }
.paper-grid .sheet, .chip.paper-grid {
  background-color: var(--card);
  background-image: linear-gradient(rgba(90, 160, 220, .18) 1px, transparent 1px), linear-gradient(90deg, rgba(90, 160, 220, .18) 1px, transparent 1px);
  background-size: 22px 22px;
}
.paper-sea .sheet, .chip.paper-sea {
  background-color: #f3fbff;
  background-image: repeating-linear-gradient(180deg, transparent 0 14px, rgba(80, 170, 210, .28) 15px 17px);
}
.paper-lamp .sheet, .chip.paper-lamp { background-color: #fff6e8; background-image: radial-gradient(circle at 50% 0%, rgba(255, 170, 70, .35), transparent 58%); }
.paper-fold .sheet, .chip.paper-fold {
  background-color: var(--pop-soft);
  background-image: repeating-linear-gradient(135deg, transparent 0 16px, rgba(255, 140, 160, .2) 17px 19px);
}
.paper-star .sheet, .chip.paper-star {
  background-color: var(--card);
  background-image: radial-gradient(circle, #ffb703 1.1px, transparent 1.4px);
  background-size: 22px 22px;
}
.chip.paper-plain { background-image: radial-gradient(circle at 18% 16%, rgba(255, 176, 96, .95), transparent 48%); }
.chip.paper-grid {
  background-size: 8px 8px;
  background-image: linear-gradient(rgba(47, 142, 196, .62) 1px, transparent 1px), linear-gradient(90deg, rgba(47, 142, 196, .62) 1px, transparent 1px);
}
.chip.paper-sea { background-image: repeating-linear-gradient(180deg, transparent 0 5px, rgba(47, 158, 204, .72) 6px 7px); }
.chip.paper-lamp { background-image: radial-gradient(circle at 50% 0%, rgba(255, 140, 30, .95), transparent 72%); }
.chip.paper-fold { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255, 110, 140, .62) 7px 8px); }
.chip.paper-star {
  background-size: 12px 12px;
  background-image: radial-gradient(circle, #ffb703 1.7px, transparent 2px);
}
.chip:has(.dot) { background-color: var(--card); background-image: none; }
.chip.color-iris:has(.dot) { border-color: #7ec8ff; box-shadow: inset 0 0 0 3px #ffd0e0; }

.color-ink { --ink: #382C30; --seal: #FF7657; }
.color-blue { --ink: #1b4f73; --seal: #2f8ec4; }
.color-pine { --ink: #245c3a; --seal: #3eaf62; }
.color-frost { --ink: #315066; --seal: #6aa0bd; }
.color-warm { --ink: #7a3e16; --seal: #f08a2a; }
.color-violet { --ink: #5a3d78; --seal: #9b6adf; }
.color-gold { --ink: #7a5410; --seal: #e2a51a; }
.color-iris { --ink: #382C30; --seal: #FF7657; }
.color-iris .sheet { box-shadow: 0 0 0 3px #fff, 0 0 0 6px #7ec8ff, 8px 8px 0 #ffd0e0; }

@keyframes float {
  50% { transform: translateY(-6px); }
}
@keyframes mascot-pop {
  40% { transform: translateY(-8px) scale(1.06); }
}
@keyframes mascot-shake {
  20% { transform: translateX(-5px) rotate(-6deg); }
  40% { transform: translateX(5px) rotate(6deg); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
@keyframes pop {
  from { transform: scale(.4) rotate(-18deg); }
  to { transform: scale(1) rotate(-8deg); }
}
@keyframes shake {
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

@media (max-height: 760px) and (max-width: 959px) {
  .play { padding: 6px 0; }
  .play header button { width: 42px; height: 42px; }
  .play .sheet { margin: 4px 0; padding: 2px 10px 2px; gap: 0; scrollbar-width: none; }
  .keys { gap: 6px; }
  .keys button { height: 42px; font-size: var(--fs-key); }
  .cell { height: 36px; font-size: var(--fs-name); }
  .vrow i, .vrow .cell { font-size: var(--fs-name); }
  .hint { margin-top: 4px; padding: 6px 12px; font-size: var(--fs-meta); }
}

@media (max-height: 640px) and (max-width: 959px) {
  .keys { gap: 4px; }
  .keys button { height: 36px; }
  .hint { padding: 6px 12px; line-height: 1.35; }
}

@media (min-width: 960px) {
  .home { min-height: 100dvh; height: auto; justify-content: stretch; }
  .home .board {
    flex: 1 0 auto;
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    grid-template-areas:
      "mast mast"
      "today pick";
    column-gap: 40px;
    row-gap: 22px;
    align-items: start;
    align-content: start;
    padding: 26px 36px 28px;
  }
  .home .mast {
    grid-area: mast;
    grid-template-columns: 112px minmax(0, 1fr) 232px;
    gap: 6px 22px;
    padding-bottom: 18px;
    border-bottom: 2px dashed rgba(var(--ink-rgb), .16);
  }
  .home .mast .buddy { width: 112px; height: 124px; }
  .home .mast .actions {
    grid-column: auto;
    flex-direction: column;
    margin: 0;
  }
  .home .mast .go,
  .home .mast .ghost { width: 100%; }
  .home .today { grid-area: today; min-width: 0; }
  .home .pick {
    grid-area: pick;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  .home .grade-block {
    flex: none;
    display: flex;
    flex-direction: column;
    min-height: auto;
    background: transparent;
    padding: 0;
  }
  .home .grades { flex: none; align-content: start; }
  .home .actions { margin-top: 0; }
  .home .grade-block h2,
  .home .quests h2,
  .home .calendar h2 {
    margin: 0 0 8px;
    font-size: var(--fs-meta);
    letter-spacing: .18em;
    color: var(--muted);
  }
  .home nav {
    margin: 0;
    padding: 0;
    gap: 10px;
    background: transparent;
  }
  .home .quests {
    margin: 0;
    padding: 0 2px;
    background: transparent;
    border-radius: 0;
  }
  .home .calendar {
    margin: 18px 0 0;
    padding: 8px 12px 14px;
    background: var(--pop-soft);
    border-radius: 28px;
    display: block;
  }
  .home .calendar .cal-nav,
  .home .calendar .cal-week,
  .home .calendar .cal-days,
  .home .calendar p { width: 100%; }
  .home .grades { grid-template-columns: repeat(3, 1fr); gap: 16px 8px; }
  .home .grades .medal { width: 84px; height: 104px; }
  .home .grades .medal b { font-size: var(--fs-stat); }
  .swatches { grid-template-columns: repeat(4, 1fr); }
  .skills { grid-template-columns: 1fr 1fr; }
  .scoreboard {
    max-width: none;
    display: grid;
    grid-template-columns: minmax(280px, .82fr) minmax(0, 1.18fr);
    grid-template-areas:
      "celebrate stats"
      "celebrate acts";
    gap: 16px 36px;
    align-items: center;
    padding: 36px 40px 32px;
  }
  .celebrate { grid-area: celebrate; flex-direction: column; gap: 4px; margin: 0; }
  .score-copy { text-align: center; }
  .result h1 { justify-content: center; font-size: var(--fs-score); }
  .result .buddy { width: 148px; height: 164px; }
  .stats { grid-area: stats; margin: 0; align-self: end; }
  .result .acts { grid-area: acts; align-self: start; }
  .play .meta { justify-content: center; margin: 12px 0 4px; }
  .stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
    align-items: center;
  }
  .problem { justify-content: safe center; }
  .play .sheet {
    flex: 0 1 auto;
    width: 100%;
    min-height: 340px;
    margin: 0;
    padding: 36px 28px 28px;
  }
  .stage .keys {
    align-self: center;
    width: 100%;
    padding: 14px;
    gap: 10px;
    background: rgba(255, 253, 248, .94);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: 0 8px 0 rgba(var(--ink-rgb), .08);
  }
  .stage .keys button {
    height: 56px;
    font-size: var(--fs-name);
    border-radius: 14px;
  }
  .expr { font-size: var(--fs-eq-long-lg); }
  .cell { min-width: 44px; height: 54px; font-size: var(--fs-eq-long); }
  .vrow i, .vrow .cell { font-size: var(--fs-eq-long); }
}

@media (max-width: 760px) {
  .catalog .board { grid-template-columns: 1fr; }
  .settings .board { grid-template-columns: 1fr; }
  .settings .painting { height: 200px; }
  .settings .sets { padding: 4px 8px 8px; }
  .cats {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    position: static;
  }
  .cats button { width: auto; white-space: nowrap; }
  .pane .skills,
  .pane .swatches { grid-template-columns: 1fr 1fr; }
  .achieve > li.trophy { grid-template-columns: 1fr; justify-items: center; }
  .achieve .medal { width: auto; }
  .mark-copy { width: 100%; }
  .mark-copy ol { justify-content: center; }
}

@media (max-width: 460px) {
  .home .mast { grid-template-columns: 1fr; justify-items: center; }
  .home .mast .buddy { margin: 0 auto; }
  .home .mast .actions { width: 100%; }
  .home h1, .home .lead { text-align: center; }
  .home h1 { justify-content: center; }
  .home .actions { flex-direction: column; }
  .home .go, .home .ghost { width: 100%; flex: none; height: var(--btn-h); min-height: var(--btn-h); }
  .scoreboard { padding: 22px 16px 16px; }
  .result .buddy { width: 92px; height: 102px; }
  .result h1 { font-size: var(--fs-score); }
  .stats b { font-size: var(--fs-name); }
}

html:has(.studio),
body:has(.studio) { height: 100%; overflow: hidden; }
.desk:has(.studio) {
  height: 100dvh; min-height: 0; max-height: 100dvh; overflow: hidden;
  display: flex; flex-direction: column;
}
.home.studio {
  display: flex; flex-direction: column;
  flex: 1 1 auto; height: auto; min-height: 0; max-height: 100%;
  overflow: hidden; justify-content: stretch; padding: 10px 0;
}
.studio .update {
  flex: none; height: 36px; display: flex; align-items: center; gap: 10px;
  padding: 0 8px 0 14px; border-radius: 14px; background: #fff;
  box-shadow: var(--shadow);
}
.studio .update b { flex: none; font-size: var(--fs-meta); white-space: nowrap; }
.studio .update p {
  margin: 0; min-width: 0; flex: 1; color: var(--muted); font-size: var(--fs-meta); font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.studio .update button {
  flex: none; height: 28px; padding: 0 12px; border-radius: 999px;
  background: #fff; color: var(--pop); box-shadow: inset 0 0 0 2px var(--pop-soft);
  font-size: var(--fs-meta); font-weight: 700;
}
.studio .update .update-get { background: var(--pop); color: #fff; box-shadow: none; }
.studio .board:has(.update) { gap: 4px; }
.studio .board:has(.update) .week { padding-top: 6px; padding-bottom: 6px; }
.studio .board {
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  flex: 1 1 auto; min-height: 0; min-width: 0; padding: 18px 18px 14px; overflow: hidden;
  border: none; box-shadow: none;
}
.studio .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.studio .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.studio .who .face {
  width: 84px; height: 94px; flex: none; overflow: visible; background: none;
}
.studio .who .mascot {
  width: 84px; height: 94px; display: block; object-fit: contain;
}
.studio .who .brand { height: 72px; width: auto; display: block; flex: none; }
@keyframes mascot-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(-2.5deg); }
}
@keyframes mascot-shadow {
  0%, 100% { transform: scaleX(1); opacity: .55; }
  50% { transform: scaleX(.78); opacity: .28; }
}
@keyframes mascot-sway {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(7deg); }
}
@keyframes mascot-blink {
  0%, 40%, 46%, 88%, 94%, 100% { transform: scaleY(1); }
  43%, 91% { transform: scaleY(.12); }
}
.studio .who h1 {
  margin: 0;
  font-size: var(--fs-page);
  line-height: var(--lh-page);
  font-weight: 700;
  letter-spacing: 0;
  gap: 8px;
  justify-content: flex-start;
  flex-wrap: nowrap;
}
.studio .who h1 span { letter-spacing: .04em; white-space: nowrap; }
.studio .top-tools { display: flex; align-items: center; gap: 10px; flex: none; margin-left: auto; }
.studio .pill, .studio .streak {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px;
  border-radius: 999px; background: #fff; border: 2px solid rgba(var(--ink-rgb), .12);
  font-size: var(--fs-meta); font-weight: 700; white-space: nowrap;
}
.studio .pill svg { width: 16px; height: 16px; }
.studio .streak svg { width: 16px; height: 16px; }
.studio .streak b {
  color: var(--pop-deep);
  font-size: var(--fs-stat);
  line-height: var(--lh-stat);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.studio .grade-pick { position: relative; }
.studio .grade-menu {
  position: absolute; z-index: 5; top: 42px; right: 0; width: 132px;
  display: grid; gap: 2px; padding: 6px; border-radius: 16px; background: #fff;
  box-shadow: var(--shadow-soft);
}
.studio .grade-menu button { height: 36px; border-radius: 10px; font-weight: 700; }
.studio .grade-menu button.on, .studio .grade-menu button:hover { background: #fff1d6; }
.studio .layout {
  display: flex; flex-direction: column; gap: 14px; width: 100%;
  flex: 1 1 auto; min-height: 0; min-width: 0; overflow: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(var(--ink-rgb), .35) transparent;
}
.studio .layout::-webkit-scrollbar { width: 10px; height: 10px; }
.studio .layout::-webkit-scrollbar-thumb {
  background: rgba(var(--ink-rgb), .28); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box;
}
.studio .layout::-webkit-scrollbar-track { background: transparent; }
.studio .main-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.studio .challenge, .studio .goals, .studio .stage-card, .studio .week {
  background: var(--pop-soft); border-radius: 26px;
}
.studio .challenge {
  display: grid; grid-template-columns: minmax(0, 1fr) 148px; gap: 8px;
  padding: 10px 8px 10px 16px; align-items: center;
}
.studio .challenge h2 { margin: 0; font-size: var(--fs-name); letter-spacing: 0; line-height: 1.15; }
.studio .focus {
  display: inline-flex; margin: 4px 0 6px; padding: 3px 10px; border-radius: 999px;
  background: #fff3d6; color: var(--muted); font-size: var(--fs-meta); font-weight: 700;
}
.studio .challenge-go {
  width: min(100%, 280px);
  height: var(--btn-h);
  min-height: var(--btn-h);
  border-radius: var(--radius-btn);
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.15;
  font-size: var(--fs-btn);
  font-weight: 600;
}
.studio .challenge-go small { font-size: var(--fs-tag); font-weight: 700; opacity: .85; }
.studio .pair { display: flex; gap: 10px; margin-top: 16px; }
.studio .pair button {
  flex: 1; height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 2px solid rgba(var(--ink-rgb), .16); border-radius: 999px; background: #fff;
  font-weight: 700; font-size: var(--fs-label);
}
.studio .pair svg { width: 18px; height: 18px; }
.studio .pair em {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--pop);
  color: #fff; font-style: normal; font-size: var(--fs-tag); display: inline-grid; place-items: center;
}
.studio .sketch { width: 148px; height: auto; }
.studio .goals, .studio .stage-card { padding: 8px 16px 8px; }
.studio .goals h2, .studio .stage-card h2, .studio .week h2 {
  display: flex; align-items: center; gap: 6px; margin: 0 0 6px;
  font-size: var(--fs-label); letter-spacing: 0;
}
.studio .goals h2 svg, .studio .stage-card h2 svg, .studio .week h2 svg { width: 18px; height: 18px; }
.studio .goals ul { list-style: none; margin: 0; padding: 0; }
.studio .goals li {
  display: grid; grid-template-columns: 22px 9em minmax(0, 1fr) 3.6em; gap: 10px;
  align-items: center; padding: 6px 0;
}
.studio .goals li > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio .goals li i {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid #f0d5c4; background: #fff;
  display: grid; place-items: center; font-style: normal; font-size: var(--fs-tag); color: #fff;
}
.studio .goals li.done i { background: var(--pop); border-color: var(--pop); }
.studio .goals li b { height: 10px; border-radius: 999px; background: var(--border); overflow: hidden; }
.studio .goals li em { display: block; height: 100%; border-radius: inherit; background: var(--pop); }
.studio .goals li small {
  width: 100%; min-width: 0; height: 26px; padding: 0 4px; border-radius: 999px; background: #fff;
  display: grid; place-items: center; font-size: var(--fs-meta); font-weight: 700; color: #8a7568;
}
.studio .goals p {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 6px 0 2px; color: var(--warn); font-size: var(--fs-meta); font-weight: 700;
}
.studio .goals p svg { width: 16px; height: 16px; flex: none; }
.studio .stage-card { display: flex; flex-direction: column; align-items: center; text-align: center; }
.studio .stage-card h2 { align-self: flex-start; }
.studio .stage-card img { width: 120px; height: auto; max-height: 120px; object-fit: contain; margin: 2px 0; flex: 0 1 auto; min-height: 0; }
.studio .stage-card strong { font-size: var(--fs-section); }
.studio .stage-card p { margin: 2px 0 6px; color: var(--muted); font-size: var(--fs-meta); font-weight: 700; }
.studio .meter { width: min(100%, 240px); height: 10px; border-radius: 999px; background: #f3e2cf; overflow: hidden; }
.studio .meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ffb703, var(--pop)); }
.studio .stage-card > em { margin-top: 6px; font-style: normal; font-weight: 700; color: var(--warn); font-size: var(--fs-meta); }
.studio .stage-card > button {
  width: min(100%, 240px); height: 40px; margin-top: 8px; border-radius: 999px;
  border: 2px solid rgba(var(--ink-rgb), .16); background: #fff; font-weight: 700;
}
.studio .week {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 10px 8px 10px 16px;
}
.studio .week h2 { margin: 0; flex: none; }
.studio .week h2 svg { width: 22px; height: 22px; }
.studio .week .days { display: flex; gap: 16px; flex: 1; justify-content: center; }
.studio .week .pip { display: grid; justify-items: center; gap: 4px; min-width: 32px; }
.studio .week .pip b {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); background: #fff;
  display: grid; place-items: center;
}
.studio .week .pip b svg { width: 16px; height: 16px; }
.studio .week .pip.did b { background: var(--pop); border-color: var(--pop); }
.studio .week .pip.now:not(.did) b { border-color: var(--pop); background: #fff; }
.studio .week .pip small { font-size: var(--fs-tag); color: var(--muted-2); font-weight: 700; }
.studio .week > button {
  flex: none; display: inline-flex; align-items: center; gap: 2px;
  height: 32px; margin-left: 4px; padding: 0 12px 0 16px;
  border: 0; border-left: 1px solid var(--border); background: transparent;
  color: var(--muted); font-weight: 700; font-size: var(--fs-meta);
}
.studio .week > button svg { width: 16px; height: 16px; }
.studio .week .calendar { width: 100%; margin: 0; }
.studio .dock,
.pal .dock {
  position: sticky; bottom: 0; flex: none; width: 100%;
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 4px; margin-top: auto;
  height: calc(var(--dock-h) + env(safe-area-inset-bottom, 0px));
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  border: 0; border-radius: var(--radius-card) var(--radius-card) 0 0;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}
.pal .dock { position: relative; bottom: auto; border-radius: var(--radius-card); height: var(--dock-h); padding-bottom: 8px; }
.studio .dock > button,
.studio .dock > button:active,
.pal .dock > button,
.pal .dock > button:active {
  height: 100%; min-height: 56px; border-radius: var(--radius-btn);
  display: grid; justify-items: center; align-content: center;
  gap: 4px; font-size: var(--fs-dock); line-height: var(--lh-dock);
  font-weight: 600; color: var(--muted); background: transparent;
  border: 0; box-shadow: none; transform: none;
  transition: color 180ms ease, background 180ms ease;
}
.studio .dock > button svg,
.pal .dock > button svg,
.studio .dock > button img,
.pal .dock > button img {
  width: var(--icon-size); height: var(--icon-size);
  object-fit: contain; display: block;
}
.studio .dock > button.on,
.pal .dock > button.on { background: transparent; color: var(--pop-deep); }
.studio .dock > button.on img,
.pal .dock > button.on img {
  width: var(--icon-size); height: var(--icon-size);
  padding: 6px 18px; box-sizing: content-box;
  background: var(--pop-soft); border-radius: 999px;
}
.studio .dock .mine {
  position: absolute; right: 12px; bottom: 72px; display: grid; gap: 4px; width: 120px;
  padding: 8px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-soft);
}
.studio .dock .mine button { height: 36px; border-radius: 10px; font-weight: 700; background: var(--pop-soft); }

.grow .board { gap: 12px; }
.grow .grow-bar { display: flex; align-items: center; gap: 12px; flex: none; }
.grow .grow-title { min-width: 0; }
.grow .grow-title h1 {
  display: flex; align-items: center; gap: 6px; margin: 0;
  font-size: var(--fs-page); letter-spacing: 0; line-height: 1.1;
}
.grow .grow-title h1 svg { width: 26px; height: 26px; }
.grow .grow-title p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-meta); font-weight: 700; }
.grow .grow-bar .pill { margin-left: auto; }
.grow .grow-grid {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr) 280px;
  gap: 12px;
}
.grow .grow-grades, .grow .grow-map, .grow .grow-detail {
  min-height: 0; overflow: auto;
  background: var(--card); border-radius: 22px; padding: 14px;
  box-shadow: var(--shadow-soft);
}
.grow .grow-grades { display: flex; flex-direction: column; gap: 8px; }
.grow .grow-grades h2, .grow .grow-map h2, .grow .grow-detail h2, .grow .grow-detail h3 {
  margin: 0; letter-spacing: 0; font-size: var(--fs-label);
}
.grow .grade-list { display: grid; gap: 6px; }
.grow .grade {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 12px;
  border-radius: var(--radius-btn);
  background: transparent;
  text-align: left;
  border: 1.5px solid transparent;
  color: var(--ink);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.grow .grade.on {
  background: var(--pop-soft);
  border-color: color-mix(in srgb, var(--pop) 45%, #fff);
  box-shadow: inset 3px 0 0 var(--pop-deep);
  color: var(--pop-deep);
}
.grow .grade.on b { color: var(--pop-deep); font-weight: 700; }
.grow .grade.on small { color: var(--pop-deep); opacity: .78; }
.grow .grade.on i {
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px color-mix(in srgb, var(--pop) 55%, #fff);
}
.grow .grade i {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-style: normal;
  font-weight: 700;
  font-size: var(--fs-meta);
}
.grow .grade b {
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: var(--lh-body);
}
.grow .grade small {
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: 500;
  line-height: var(--lh-meta);
  font-variant-numeric: tabular-nums;
}
.grow .cheer { margin-top: auto; display: flex; align-items: flex-end; gap: 4px; padding-top: 8px; }
.grow .cheer .buddy { width: 72px; height: 80px; margin: 0; flex: none; }
.grow .cheer p {
  margin: 0 0 16px; padding: 8px 10px; border-radius: 14px;
  background: var(--pop-soft); color: var(--muted); font-size: var(--fs-meta); font-weight: 700; line-height: 1.35;
}
.grow .grow-map header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.grow .legend { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: var(--fs-tag); font-weight: 700; }
.grow .legend span { width: 1px; height: 12px; background: var(--border); margin: 0 4px; }
.grow .legend i { font-style: normal; }
.grow .leg-ok { color: #e0a31a; }
.grow .leg-ready { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }
.grow .leg-lock svg { width: 14px; height: 14px; display: block; }
.grow .skilltree { padding: 4px 4px 0; }
.grow .skilltree .grid { grid-auto-rows: auto; gap: 18px 20px; justify-items: center; }
.grow .node {
  width: 132px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  gap: 8px;
}
.grow .node.current {
  gap: 18px;
  padding-bottom: 2px;
}
.grow .node .gem {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 86px; height: 86px;
  border: 0; border-radius: 22px;
  background: var(--fill);
  box-shadow: var(--shadow);
}
.grow .node.ok .gem {
  background: linear-gradient(180deg, #ffe9a8, #ffd56a);
  box-shadow: 0 0 0 3px var(--warn), 0 8px 16px rgba(var(--ink-rgb), .05);
}
.grow .node.ok .gem::after {
  content: "✓";
  position: absolute; top: -6px; right: -6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ok); color: #fff;
  font-size: var(--fs-meta); line-height: 22px; text-align: center;
  box-shadow: 0 0 0 3px var(--card);
}
.grow .node.ready .gem {
  background: #fff;
  box-shadow: 0 0 0 3px var(--ok), 0 8px 16px rgba(var(--ink-rgb), .05);
}
.grow .node.ready .gem::after {
  content: "";
  position: absolute; top: -5px; right: -5px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--card);
}
.grow .node.current .gem { box-shadow: 0 0 0 3px var(--pop), 0 8px 16px rgba(var(--ink-rgb), .05); }
.grow .node.current .gem::after { content: none; }
.grow .node > b {
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: var(--lh-body);
  text-align: center;
}
.grow .node.current > b {
  margin-top: 2px;
}
.grow .node em { color: var(--muted-2); font-size: var(--fs-tag); }
.grow .node .stars { color: var(--warn); font-size: var(--fs-meta); letter-spacing: 1px; line-height: 1; }
.grow .node .now {
  position: absolute;
  left: 50%;
  bottom: -11px;
  z-index: 1;
  transform: translateX(-50%);
  font-style: normal;
  font-size: var(--fs-tag);
  font-weight: 600;
  line-height: var(--lh-tag);
  white-space: nowrap;
  color: #fff;
  background: var(--pop);
  border-radius: 999px;
  padding: 3px 10px;
}
.grow .node .lock {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  width: 16px; height: 16px; color: #c9bbb2;
}
.grow .face {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px; height: 52px;
}
.grow .node.wait .face, .grow .node.later .face { opacity: .42; filter: grayscale(.35); }
.grow .face-ten { gap: 4px; }
.grow .face-ten b {
  font-size: var(--fs-page); line-height: 1; color: #e39b12; font-style: italic; font-weight: 700;
}
.grow .face-ten i {
  width: 10px; height: 10px; border-radius: 50%; background: #ff9a3d;
  box-shadow: inset 0 -2px 0 rgba(180, 80, 0, .18);
}
.grow .face-ten { grid-template-columns: repeat(3, 10px); justify-content: center; align-content: center; }
.grow .face-ten b { grid-column: 1 / -1; text-align: center; }
.grow .face-add, .grow .face-sub { width: 62px; height: 48px; }
.grow .face-add .plus, .grow .face-sub .minus {
  position: absolute; left: 0; top: 6px;
  width: 34px; height: 34px; border-radius: 10px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12), 0 4px 0 rgba(var(--ink-rgb), .08);
}
.grow .face-add .plus { background: var(--ok); }
.grow .face-sub .minus { background: var(--pop); }
.grow .face-add .plus::before, .grow .face-add .plus::after,
.grow .face-sub .minus::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  background: #fff; border-radius: 2px; transform: translate(-50%, -50%);
}
.grow .face-add .plus::before { width: 16px; height: 4px; }
.grow .face-add .plus::after { width: 4px; height: 16px; }
.grow .face-sub .minus::before { width: 16px; height: 4px; }
.grow .face-add .cube, .grow .face-sub .cube {
  position: absolute; width: 22px; height: 22px; border-radius: 6px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12), 0 3px 0 rgba(var(--ink-rgb), .08);
}
.grow .face-add .cube.a, .grow .face-sub .cube.a { right: 8px; top: 0; background: #7eb6f6; }
.grow .face-add .cube.b, .grow .face-sub .cube.b { right: 0; bottom: 2px; background: var(--pop); }
.grow .face-sub .cube.b { background: #ffd56a; }
.grow .face-take, .grow .face-frame {
  width: 58px; height: 28px;
  grid-template-columns: repeat(5, 10px); gap: 3px; align-content: center; justify-content: center;
}
.grow .face-take i, .grow .face-frame i {
  width: 10px; height: 10px; border-radius: 50%;
  background: #fff; box-shadow: inset 0 0 0 1.5px #f0ddd2;
}
.grow .face-take i.on { background: var(--pop); box-shadow: inset 0 -2px 0 rgba(180, 60, 40, .18); }
.grow .face-frame i.r { background: var(--pop); box-shadow: inset 0 -2px 0 rgba(180, 60, 40, .18); }
.grow .face-frame i.b { background: #7eb6f6; box-shadow: inset 0 -2px 0 rgba(40, 90, 160, .18); }
.grow .face-frame { grid-template-columns: repeat(5, 10px); height: 40px; gap: 3px 3px; }
.grow .face-eq {
  gap: 0; color: #d7b089; font-weight: 700; line-height: 1.05;
}
.grow .face-eq b { font-size: var(--fs-body); font-style: italic; }
.grow .face-eq em { font-style: normal; font-size: var(--fs-meta); color: #e0b88f; }
.grow .node.ok .face-eq, .grow .node.ready .face-eq { color: #e39b12; }
.grow .node.ok .face-eq em, .grow .node.ready .face-eq em { color: var(--warn); }
.grow .face-shapes {
  grid-template-columns: repeat(3, 16px); gap: 4px; width: 58px; height: 28px;
}
.grow .face-shapes i { width: 14px; height: 14px; }
.grow .face-shapes .c {
  border-radius: 50%; background: var(--pop);
  box-shadow: inset 0 -2px 0 rgba(180, 60, 40, .18);
}
.grow .face-shapes .t {
  width: 0; height: 0; background: transparent;
  border-left: 8px solid transparent; border-right: 8px solid transparent;
  border-bottom: 14px solid #7eb6f6;
  filter: drop-shadow(0 2px 0 rgba(var(--ink-rgb), .08));
}
.grow .face-shapes .q {
  border-radius: 3px; background: #ffd56a;
  box-shadow: inset 0 -2px 0 rgba(180, 120, 0, .18);
}
.grow .face-mul {
  grid-template-columns: repeat(2, 20px); gap: 5px; width: 46px; height: 46px;
}
.grow .face-mul i {
  width: 20px; height: 20px; border-radius: 6px; background: var(--ok);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12), 0 3px 0 rgba(var(--ink-rgb), .08);
}
.grow .face-mul i.b { background: #7eb6f6; }
.grow .face-mul i.c { background: var(--pop); }
.grow .face-mul i.d { background: #ffd56a; }
.grow .face-div { width: 58px; height: 40px; }
.grow .face-div .pie {
  position: absolute; left: 4px; top: 6px;
  width: 28px; height: 28px; border-radius: 50%;
  background: conic-gradient(var(--pop) 0 50%, var(--pop-soft) 0);
  box-shadow: 0 3px 0 rgba(var(--ink-rgb), .08);
}
.grow .face-div .pie.cut {
  left: auto; right: 4px; top: 10px;
  width: 22px; height: 22px;
  background: conic-gradient(#7eb6f6 0 50%, #d6ebff 0);
}
.grow .face-div b {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: var(--fs-label); color: #e39b12; font-weight: 700;
  text-shadow: 0 1px 0 #fff;
}
.grow .face-frac { gap: 2px; width: 28px; }
.grow .face-frac b { font-size: var(--fs-label); line-height: 1; color: #e39b12; font-weight: 700; }
.grow .face-frac i { width: 22px; height: 3px; border-radius: 2px; background: var(--warn); }
.grow .face-dec {
  grid-auto-flow: column; gap: 3px; align-items: end; width: 58px; height: 36px;
}
.grow .face-dec b, .grow .face-dec em {
  font-size: var(--fs-dialog); line-height: 1; color: #e39b12; font-weight: 700; font-style: italic;
}
.grow .face-dec i {
  width: 10px; height: 10px; border-radius: 50%; background: var(--pop);
  box-shadow: inset 0 -2px 0 rgba(180, 60, 40, .18); margin-bottom: 4px;
}
.grow .face-dec i.b { background: #7eb6f6; }
.grow .face-dec i.c { background: #ffd56a; }
.grow .face-tool { width: 48px; height: 40px; }
.grow .face-tool .star {
  position: absolute; left: 4px; top: 6px;
  width: 26px; height: 26px;
  background: #ffd56a;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  filter: drop-shadow(0 2px 0 rgba(var(--ink-rgb), .1));
}
.grow .face-tool .bolt {
  position: absolute; right: 2px; bottom: 4px;
  width: 18px; height: 24px; background: #7eb6f6;
  clip-path: polygon(35% 0, 100% 0, 55% 42%, 85% 42%, 0 100%, 40% 52%, 10% 52%);
  filter: drop-shadow(0 2px 0 rgba(var(--ink-rgb), .1));
}
.grow .grow-detail { display: flex; flex-direction: column; gap: 8px; }
.grow .eyebrow { margin: 0; color: var(--ok); font-size: var(--fs-meta); font-weight: 700; }
.grow .grow-detail h2 { font-size: var(--fs-page); }
.grow .blurb { margin: 0; color: var(--muted); font-size: var(--fs-meta); font-weight: 700; }
.grow .demo {
  border-radius: 16px; background: #fff; padding: 12px;
  box-shadow: inset 0 0 0 2px var(--fill);
}
.grow .eq { margin: 0; text-align: center; font-size: var(--fs-page); font-weight: 700; }
.grow .beads { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 8px 0 0; flex-wrap: wrap; }
.grow .beads b { font-size: var(--fs-body); }
.grow .dots { display: inline-flex; gap: 3px; }
.grow .dots i { width: 12px; height: 12px; border-radius: 50%; }
.grow .hint-line {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 10px;
  border-radius: 12px; background: #fff8e8; color: #8a7048; font-size: var(--fs-meta); font-weight: 700;
}
.grow .hint-line svg { width: 22px; height: 22px; flex: none; }
.grow .start, .grow .explain-go {
  height: 46px; border-radius: 999px; font-size: var(--fs-label); font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.grow .start { background: linear-gradient(180deg, var(--pop), var(--pop-deep)); color: #fff; box-shadow: 0 6px 14px rgba(185, 67, 41, .28); }
.grow .explain-go { background: #fff; color: var(--pop); box-shadow: inset 0 0 0 2px var(--pop-soft); }
.grow .start svg, .grow .explain-go svg { width: 18px; height: 18px; }
.grow .light { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 0; color: var(--muted); font-size: var(--fs-tag); font-weight: 700; }
.grow .light svg { width: 14px; height: 14px; }

@media (max-width: 960px) {
  .grow .grow-grid { grid-template-columns: 1fr; }
  .grow .board { overflow: auto; }
}

@media (max-width: 720px) {
  .studio .challenge { grid-template-columns: 1fr; }
  .studio .sketch { display: none; }
  .studio .goals li { grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; }
  .studio .goals li b { display: none; }
  .studio .topbar { flex-wrap: wrap; row-gap: 10px; }
  .studio .who { min-width: max-content; }
  .studio .who h1 { font-size: var(--fs-name); }
  .studio .who .brand { height: 56px; }
}

@media (min-width: 960px) {
  .studio .board { display: flex; padding: 12px 24px 8px; }
  .studio .layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, .72fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas: "main stage" "week week";
    gap: 8px 16px;
    align-items: stretch;
    overflow: hidden;
  }
  .studio .layout:has(.calendar) { overflow: auto; }
  .studio .main-col { grid-area: main; min-height: 0; }
  .studio .stage-card { grid-area: stage; height: 100%; min-height: 0; justify-content: flex-start; overflow: hidden; }
  .studio .stage-card img { width: auto; max-width: 148px; max-height: 100%; margin-top: auto; margin-bottom: auto; }
  .studio .week { grid-area: week; }
}

.desk:has(.play.drill) {
  background: var(--paper);
}
.play.drill {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 0 14px;
  overflow: auto;
}
.play.drill header { gap: 16px; }
.play.drill header .back {
  width: auto;
  height: var(--icon-btn);
  padding: 0 18px 0 12px;
  border: 0;
  border-radius: var(--radius-btn);
  background: var(--pop-deep);
  color: #fff;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--fs-label);
  font-weight: 600;
}
.play.drill header .back svg { width: 22px; height: 22px; }
.play.drill header .hud-title {
  flex: 0 1 auto;
  border: 0;
  background: none;
  box-shadow: none;
  padding: 0;
  gap: 2px;
  line-height: 1.15;
}
.play.drill header .hud-title b {
  font-size: var(--fs-label);
  font-weight: 600;
  line-height: var(--lh-label);
  letter-spacing: 0;
  color: var(--ink);
}
.play.drill header .hud-title small {
  font-size: var(--fs-meta);
  letter-spacing: 0;
  color: var(--muted-2);
  font-weight: 500;
  line-height: var(--lh-meta);
}
.play.drill header .sound,
.play.drill header .full {
  width: var(--icon-btn);
  height: var(--icon-btn);
  border: 0;
  border-radius: 50%;
  background: var(--card);
  color: var(--muted-2);
  box-shadow: var(--shadow);
}
.play.drill header .sound .mark,
.play.drill header .full .mark { width: 22px; height: 22px; }
.play.drill .progress {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 36px;
}
.play.drill .progress .step {
  flex: none;
  font-size: var(--fs-label);
  font-weight: 600;
  line-height: var(--lh-label);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.play.drill .progress .meter {
  flex: 1;
  height: 12px;
  border-radius: 999px;
  background: #f0e4d8;
  overflow: hidden;
}
.play.drill .progress .meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pop), var(--pop));
}
.play.drill .progress .ok,
.play.drill .progress .time {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  font-size: var(--fs-meta);
  font-weight: 700;
  color: var(--muted);
  box-shadow: 0 4px 12px rgba(var(--ink-rgb), .05);
}
.play.drill .progress .ok { color: #3e9a62; background: var(--ok-soft); }
.play.drill .progress svg { width: 16px; height: 16px; }
.play.drill .stage {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .78fr);
  gap: 16px;
  align-items: stretch;
}
.play.drill .sheet,
.play.drill .pad {
  margin: 0;
  min-height: 0;
  border: 0;
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
  overflow: auto;
}
.play.drill .pad { background: #fffdf9; }
.desk.color-iris .play.drill .sheet {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px #7ec8ff, 8px 8px 0 #ffd0e0;
}
.play.drill .sheet {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 18px 22px 16px;
}
.play.drill .sheet-top {
  position: relative;
  z-index: 2;
  flex: none;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.play.drill .seen-tag {
  flex: none;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--pop-soft);
  color: var(--pop-deep);
  font-size: var(--fs-meta);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}
.play.drill .tag,
.play.drill .tip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: var(--fs-meta);
  font-weight: 700;
}
.play.drill .tag { background: var(--ok-soft); color: #3e9a62; }
.play.drill .tip {
  display: block;
  height: auto;
  min-height: 32px;
  min-width: 0;
  max-width: min(420px, 68%);
  padding: 7px 14px;
  line-height: 1.4;
  white-space: normal;
  text-align: left;
  background: var(--pop-soft);
  color: #e08a3c;
}
.play.drill .tip svg { display: inline-block; vertical-align: -3px; margin-right: 6px; }
.play.drill .tag svg,
.play.drill .tip svg { width: 16px; height: 16px; flex: none; }
.play.drill .cluster {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  gap: 8px;
  min-height: 0;
}
.play.drill .cluster:has(.vert) { padding-top: 28px; }
.play.drill .expr {
  margin: 0;
  font-size: var(--fs-eq);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.play.drill .expr.is-long { font-size: var(--fs-eq-long); }
.play.drill .cell {
  min-width: 84px;
  height: 96px;
  border-radius: var(--radius-card);
  border: 1.5px solid color-mix(in srgb, var(--pop) 42%, #fff);
  background: #fff;
  font-size: var(--fs-eq);
  box-shadow: none;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.play.drill .cell.on {
  border-color: var(--seal);
  background: #fff;
  box-shadow: none;
}
.play.drill .cell.on:empty::after {
  content: "";
  width: 3px;
  height: 42%;
  border-radius: 2px;
  background: var(--seal);
}
.play.drill .cell.ok { border-color: #7dce7a; background: var(--ok-soft); }
.play.drill .cell.bad { border-color: var(--seal); color: var(--seal); }
.play.drill .cell.on { position: relative; }
.play.drill .cell.on:empty::after {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.play.drill .vert {
  --vcell: 96px;
  --vgap: 12px;
  gap: 8px;
  justify-items: center;
}
.play.drill .vrow {
  grid-template-columns: 48px repeat(var(--cols), var(--vcell));
  column-gap: var(--vgap);
  justify-content: center;
}
.play.drill .vrow i {
  font-size: var(--fs-eq);
  font-weight: 700;
}
.play.drill .vrow .op {
  justify-self: center;
  font-size: var(--fs-eq-long);
  line-height: 1;
}
.play.drill .vrow .cell {
  min-width: 0;
  width: var(--vcell);
  height: var(--vcell);
}
.play.drill .vert .rule {
  justify-self: end;
  width: calc(var(--cols) * var(--vcell) + (var(--cols) - 1) * var(--vgap));
  height: 4px;
  margin: 4px 0;
  border-radius: 4px;
  background: var(--ink);
}
.play.drill .place {
  margin: 4px 0 8px;
  color: var(--muted-2);
  font-size: var(--fs-meta);
  letter-spacing: 0;
}
.play.drill .coach {
  margin-top: 10px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
}
.play.drill .pal {
  position: relative;
  width: 168px;
  height: 178px;
  flex: none;
}
.play.drill .pal .grass {
  position: absolute;
  left: -8px;
  right: -8px;
  bottom: 2px;
  width: calc(100% + 16px);
  height: 36px;
}
.play.drill .pal .play-buddy {
  position: relative;
  width: 150px;
  height: 168px;
  margin: 0 auto;
}
.play.drill .say {
  position: relative;
  margin: 0 0 42px;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--pop-soft);
  color: var(--muted);
  font-size: var(--fs-label);
  font-weight: 700;
  line-height: 1.4;
}
.play.drill .say::before {
  content: "";
  position: absolute;
  left: -5px;
  bottom: 16px;
  width: 12px;
  height: 12px;
  background: var(--pop-soft);
  transform: rotate(45deg);
}
.play.drill .scratch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  color: var(--muted-2);
  font-size: var(--fs-meta);
  font-weight: 700;
}
.play.drill .scratch svg { width: 16px; height: 16px; }
.play.drill .tools { margin: 10px 0 0; align-self: flex-start; }
.play.drill .pad {
  display: flex;
  flex-direction: column;
  padding: 18px 18px 14px;
  overflow: hidden;
}
.play.drill .pad h2 {
  margin: 0 0 14px;
  text-align: center;
  font-size: var(--fs-body);
  letter-spacing: 0;
}
.play.drill .keys {
  flex: 1;
  align-self: stretch;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  align-content: stretch;
  grid-template-rows: repeat(4, minmax(60px, 1fr));
  gap: 10px;
}
.play.drill .keys button {
  height: auto;
  min-height: 60px;
  border: 0;
  border-radius: var(--radius-btn);
  background: #fff;
  box-shadow: var(--shadow);
  font-size: var(--fs-key);
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.play.drill .keys .clear {
  background: color-mix(in srgb, var(--seal) 16%, #fff);
  color: var(--seal);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--seal) 26%, #fff);
  font-size: var(--fs-label);
}
.play.drill .keys .del {
  background: var(--pop-soft);
  color: var(--muted-2);
  border: 2px solid #f0d8c8;
  box-shadow: 0 5px 0 var(--border);
}
.play.drill .keys .del svg { width: 22px; height: 22px; }
.play.drill .foot {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted-2);
  font-size: var(--fs-meta);
  font-weight: 700;
}
.play.drill .sheet { position: relative; }
.play.drill .tip.wait { visibility: hidden; }
.play.drill .toast {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 128px;
  right: 22px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
  white-space: nowrap;
}
.play.drill .win-title {
  display: flex; align-items: center; gap: 8px; margin: 0;
  color: var(--ok); font-size: var(--fs-name); font-weight: 700; letter-spacing: 0;
}
.play.drill .tick {
  width: 32px; height: 32px; border-radius: 50%; background: var(--ok); color: #fff;
  display: grid; place-items: center; flex: none;
}
.play.drill .tick svg { width: 20px; height: 20px; }
.play.drill .win-sub { margin: 0; color: #8fa37a; font-size: var(--fs-label); font-weight: 700; }
.play.drill .sheet.is-right .cell.ok {
  position: relative; overflow: visible;
  border-color: #5dce86; background: var(--ok-soft); color: var(--ok);
}
.play.drill .sheet.is-right .cell.ok::after {
  content: "✓";
  position: absolute; top: -10px; right: -10px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ok); color: #fff; font-size: var(--fs-meta); line-height: 22px; text-align: center;
}
.play.drill .sheet.is-right .vert .cell.ok::after {
  top: auto;
  bottom: -8px;
}
.play.drill .sheet.is-right + .pad { opacity: .45; }
.play.drill .foot svg { width: 16px; height: 16px; color: var(--warn); }
@media (max-width: 599px) {
  .play.drill { height: auto; min-height: 100dvh; }
  .play.drill .stage { grid-template-columns: 1fr; }
  .play.drill .expr { margin-top: 8px; font-size: var(--fs-eq); }
  .play.drill .expr.is-long { font-size: var(--fs-eq-long); }
  .play.drill .cell { min-width: 72px; height: 80px; font-size: var(--fs-eq); }
  .play.drill .vert { --vcell: 72px; --vgap: 8px; }
  .play.drill .vrow { grid-template-columns: 36px repeat(var(--cols), var(--vcell)); }
  .play.drill .vrow i { font-size: var(--fs-eq-long-lg); }
  .play.drill .vrow .op { font-size: var(--fs-stat); }
  .play.drill .keys { grid-template-rows: repeat(4, minmax(60px, 1fr)); gap: 8px; }
  .play.drill .keys button { min-height: 60px; font-size: var(--fs-key); }
  .play.drill .win-title { font-size: var(--fs-name); }
  .play.drill .pal { width: 120px; height: 132px; }
  .play.drill .pal .play-buddy { width: 108px; height: 120px; }
  .play.drill header { flex-wrap: wrap; }
  .play.drill .progress { flex-wrap: wrap; }
  .play.drill .progress .meter { min-width: 120px; }
}
@media (min-width: 600px) {
  .play.drill .expr { font-size: var(--fs-eq-lg); }
  .play.drill .expr.is-long { font-size: var(--fs-eq-long-lg); }
  .play.drill .cell { font-size: var(--fs-eq-lg); min-width: 96px; height: 104px; }
  .play.drill .keys button { font-size: var(--fs-key-lg); min-height: 64px; }
  .play.drill .win-title { font-size: var(--fs-page); }
}

.desk:has(.result.done)::after {
  content: "";
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 150px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(80% 140% at 0% 120%, #b6e38a 46%, transparent 47%),
    radial-gradient(70% 160% at 18% 140%, #8ed56a 48%, transparent 49%),
    radial-gradient(90% 150% at 100% 130%, #6fbf55 50%, transparent 51%),
    radial-gradient(60% 120% at 78% 150%, #9adf78 42%, transparent 43%);
}
.result.done {
  position: relative;
  z-index: 1;
  justify-content: safe center;
  gap: 10px;
  padding: 8px 0 12px;
}
.result.done button {
  border: 0;
  box-shadow: none;
  margin: 0;
  letter-spacing: 0;
}
.result.done button:disabled { opacity: 1; color: var(--muted-2); }
.result.done h1,
.result.done h2 {
  display: block;
  margin: 0;
  letter-spacing: 0;
  line-height: 1.2;
  font-weight: 700;
}
.done-bar {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto minmax(200px, 1fr);
  align-items: center;
  gap: 12px;
}
.done-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.done-brand .book { width: 40px; height: 40px; flex: none; display: block; object-fit: contain; }
.done-brand h1 { font-size: var(--fs-dialog); }
.done-brand p { margin: 1px 0 0; color: var(--muted); font-size: var(--fs-meta); font-weight: 700; }
.banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  font-size: var(--fs-dialog);
  font-weight: 700;
  white-space: nowrap;
}
.banner .star { width: 20px; height: 20px; flex: none; }
.banner b { font-weight: 700; }
.banner em { color: var(--pop-deep); font-style: normal; }
.banner .bits { position: absolute; inset: -14px -36px; pointer-events: none; }
.banner .bits::before,
.banner .bits::after {
  content: "";
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 2px;
}
.banner .bits::before {
  top: 0; right: 10px;
  background: #ff8a6a;
  transform: rotate(16deg);
  box-shadow: -40px 26px 0 #7dce6a, 16px 30px 0 #ffd56a;
}
.banner .bits::after {
  left: 8px; bottom: 0;
  background: #7ec8ff;
  transform: rotate(-18deg);
}
.done-main {
  display: grid;
  grid-template-columns: minmax(260px, .78fr) minmax(0, 1.22fr);
  gap: 16px 18px;
  align-items: stretch;
}
.score-card {
  background: var(--card);
  border-radius: 22px;
  padding: 4px 14px 12px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}
.score-card .hero {
  position: relative;
  width: 168px;
  height: 128px;
  margin: 0 auto;
}
.score-card .hero .star { position: absolute; }
.score-card .hero .star:nth-child(1) { top: 16px; left: 10px; width: 18px; }
.score-card .hero .star:nth-child(2) { top: 6px; right: 42px; width: 28px; }
.score-card .hero .star:nth-child(3) { top: 52px; right: 4px; width: 16px; }
.score-card .hero .star:nth-child(4) { bottom: 42px; left: 2px; width: 22px; }
.score-card .hero .star:nth-child(5) { bottom: 22px; right: 22px; width: 14px; }
.score-card .buddy {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 108px;
  height: 120px;
  margin: 0;
  transform: translateX(-50%);
  animation: none;
  filter: drop-shadow(0 12px 0 #f6e6cf);
}
.points {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  margin: 0;
}
.points b {
  font-size: var(--fs-score);
  line-height: .82;
  letter-spacing: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.points i {
  margin-bottom: 8px;
  font-style: normal;
  font-size: var(--fs-section);
  font-weight: 600;
  line-height: var(--lh-section);
}
.done-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-weight: 700;
  font-size: var(--fs-meta);
}
.done-pill svg { width: 16px; height: 16px; }
.caption { margin: 6px 0 0; color: var(--muted); font-size: var(--fs-meta); font-weight: 700; }
.done-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.meters {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.meters li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 16px;
}
.meters li > i {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; flex: none; background: #fff;
}
.meters svg { width: 18px; height: 18px; }
.meters em {
  display: block;
  font-style: normal;
  color: var(--muted);
  font-size: var(--fs-label);
  font-weight: 600;
  line-height: var(--lh-label);
}
.meters b {
  display: block;
  margin-top: 1px;
  font-size: var(--fs-page);
  line-height: var(--lh-page);
  letter-spacing: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.m-green { background: var(--ok-soft); color: var(--ok); }
.m-peach { background: #fff1e8; color: #e07a4a; }
.m-pink { background: #ffe8ee; color: #e06a7c; }
.m-gold { background: #fff6d4; color: #e0a31a; }
.meters li > span { color: var(--ink); }
.report {
  flex: 1;
  background: var(--card);
  border-radius: 18px;
  padding: 10px 14px 8px;
  box-shadow: var(--shadow-soft);
}
.report h2 { display: flex; align-items: center; gap: 8px; font-size: var(--fs-label); }
.report .bulb { width: 26px; height: 26px; display: grid; place-items: center; }
.report .bulb svg { width: 26px; height: 26px; }
.report ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.report li { display: flex; align-items: center; gap: 8px; font-size: var(--fs-meta); font-weight: 700; color: #4a3a34; }
.report li svg { width: 18px; height: 18px; padding: 2px; color: var(--ok); background: var(--ok-soft); border-radius: 50%; }
.medal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 2px solid #f6eee6;
}
.ribbon { width: 58px; height: 58px; flex: none; }
.ribbon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.medal-copy { min-width: 0; }
.medal-copy b {
  display: block;
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: var(--lh-body);
}
.medal-copy p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: var(--lh-label);
}
.runway { display: block; width: 120px; flex: none; margin-left: auto; height: 8px; border-radius: 999px; background: #e7eef2; overflow: hidden; }
.runway i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8ec8f5, #3a96dc); }
.medal-note { margin: 0; color: var(--muted); font-size: var(--fs-meta); font-weight: 700; white-space: nowrap; }
.done-foot {
  display: grid;
  grid-template-columns: minmax(260px, .78fr) minmax(0, 1.22fr);
  grid-template-areas: "encore extra" "encore again";
  column-gap: 14px;
  row-gap: 8px;
  align-items: stretch;
}
.done-foot:has(.encore) {
  padding: 10px 12px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}
.done-foot .encore { grid-area: encore; }
.done-foot .extra-go { grid-area: extra; }
.done-foot .again-row { grid-area: again; }
.done-foot:not(:has(.encore)) {
  grid-template-columns: 1fr;
  grid-template-areas: "again";
  padding: 10px 12px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}
.done-foot:not(:has(.encore)) .again-row { justify-content: flex-end; }
.encore {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  padding: 4px 8px 4px 12px;
  background: none;
}
.encore .bolt {
  width: 46px; height: 46px;
  display: grid; place-items: center; flex: none;
}
.encore .bolt svg { width: 46px; height: 46px; }
.encore h2 { display: flex; align-items: center; gap: 8px; font-size: var(--fs-label); }
.encore h2 em {
  font-style: normal;
  font-size: var(--fs-tag);
  font-weight: 700;
  color: #e07088;
  background: #ffe4ec;
  border-radius: 999px;
  padding: 2px 8px;
}
.encore p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-meta); font-weight: 700; }
.result.done .extra-go {
  height: 48px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--pop), var(--pop-deep));
  color: #fff;
  font-size: var(--fs-body);
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(185, 67, 41, .28);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.result.done .extra-go:disabled {
  opacity: 1;
  background: var(--fill);
  color: var(--muted-2);
  box-shadow: none;
}
.result.done .again-row { display: flex; gap: 10px; }
.result.done .again-row button {
  flex: 1;
  height: 38px;
  font-size: var(--fs-meta);
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--ink);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.again-row button svg { width: 18px; height: 18px; }
.count-pip {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #efe6df;
  color: #8a756c;
  font-size: var(--fs-meta);
  line-height: 22px;
}
@media (max-width: 860px) {
  .done-bar { grid-template-columns: 1fr auto; }
  .banner { grid-column: 1 / -1; justify-self: start; font-size: var(--fs-dialog); }
  .done-main, .done-foot { grid-template-columns: 1fr; }
  .done-foot { grid-template-areas: "encore" "extra" "again"; }
  .done-foot:not(:has(.encore)) { grid-template-areas: "again"; }
  .points b { font-size: var(--fs-score); }
  .again-row { flex-wrap: wrap; }
  .medal-row { flex-wrap: wrap; }
  .runway { margin-left: 62px; width: min(180px, 100%); }
  .medal-note { white-space: normal; }
}

.deeds .board { gap: 6px; }
.deeds .deeds-bar { display: flex; align-items: center; gap: 4px; flex: none; padding: 2px 8px 0; }
.deeds .deeds-bar h1 {
  margin: 0; flex: 0 1 auto; min-width: 0;
  font-size: var(--fs-page); letter-spacing: 0; line-height: var(--lh-page); font-weight: 700;
  white-space: nowrap;
}
.deeds .sum { margin: 0 0 0 auto; color: var(--muted-2); font-size: var(--fs-meta); font-weight: 700; white-space: nowrap; }
.deeds .sum b { color: var(--muted); font-size: var(--fs-meta); }
.deeds .deeds-tabs {
  display: flex; gap: 40px; flex: none; padding: 8px 8px 0; overflow: auto;
  border-bottom: 1px solid var(--border);
}
.deeds .deeds-tabs button {
  position: relative; display: inline-flex; align-items: center; flex: none; height: 40px; padding: 0 0 8px;
  background: none; border: 0; box-shadow: none; border-radius: 0; color: var(--muted-2); font-size: var(--fs-label); font-weight: 700; white-space: nowrap;
}
.deeds .deeds-tabs button.on { color: var(--ink); }
.deeds .deeds-tabs button.on::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  border-radius: 999px; background: var(--pop);
}
.deeds-body {
  flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column;
  padding: 14px 4px 0;
}
.deeds .kicker { margin: 0 4px 12px; color: var(--muted-2); font-size: var(--fs-meta); font-weight: 700; }
.crest-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.crest {
  display: flex; flex-direction: column; align-items: center; width: 100%; min-width: 0;
  padding: 16px 14px 14px; border-radius: 18px; border: 1.5px solid var(--border); background: var(--card);
  box-shadow: none; text-align: center;
}
.crest.on { border-color: var(--pop-soft); box-shadow: 0 0 0 2px var(--pop-soft); }
.crest img { width: min(148px, 78%); height: auto; object-fit: contain; }
.crest.is-lock img { filter: grayscale(1); opacity: .9; }
.crest strong {
  margin-top: 6px;
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: var(--lh-body);
}
.crest .sub {
  margin: 2px 0 12px;
  color: var(--muted);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: var(--lh-label);
}
.crest .track { display: block; width: 100%; height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.crest .track b { display: block; height: 100%; border-radius: inherit; background: var(--pop); }
.crest.is-done .track b { background: linear-gradient(90deg, #ffb020, #ffe14a); }
.crest .frac {
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: 500;
  line-height: var(--lh-meta);
  font-variant-numeric: tabular-nums;
}
.crest .frac b { font-size: var(--fs-body); color: var(--pop-deep); font-weight: 600; }
.crest.is-done .frac b { color: var(--warn); }
.crest .pill {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 12px;
  border-radius: 999px; font-style: normal;
  font-size: var(--fs-meta); font-weight: 600; line-height: var(--lh-meta);
}
.crest .pill svg { width: 16px; height: 16px; flex: none; }
.crest.is-done .pill { background: var(--ok-soft); color: var(--ok); }
.crest.is-going .pill { background: var(--pop-soft); color: var(--pop); }
.crest.is-lock .pill { background: #f3f1ee; color: var(--muted-2); }
.crest small { display: block; margin-top: 6px; color: var(--muted-2); font-size: var(--fs-tag); font-weight: 700; }
.crest .tiers { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; list-style: none; margin: 12px 0 0; padding: 0; }
.crest .tiers li {
  min-width: 42px; height: 28px; padding: 0 8px; border-radius: 999px; background: #f6f1eb;
  color: var(--muted-2); font-size: var(--fs-tag); font-weight: 700; display: grid; place-items: center;
}
.crest .tiers li.on { background: var(--warn-soft); color: var(--ink); }
.crest .tiers li.next { background: #fff; color: var(--pop); box-shadow: inset 0 0 0 1.5px var(--pop-soft); }
.deeds-hint {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: auto 0 4px; padding: 18px 0 6px; color: var(--muted); font-size: var(--fs-meta); font-weight: 700;
}
.deeds-hint::before, .deeds-hint::after { content: ""; width: 72px; height: 1px; background: var(--border); }
@media (max-width: 720px) {
  .home.studio.deeds { width: min(1080px, calc(100% - 12px)); }
  .deeds .board { padding: 12px 10px 8px; }
  .crest-grid { grid-template-columns: 1fr; }
}

.inkroom button:disabled { opacity: 1; }
.ink-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ink-top h1 { margin: 0; font-size: var(--fs-page); font-weight: 700; letter-spacing: 0; line-height: 1.1; }
.ink-top p { margin: 4px 0 0; color: var(--muted); font-size: var(--fs-meta); font-weight: 700; }
.ink-tools { display: flex; align-items: center; gap: 10px; flex: none; }
.ink-shuffle {
  height: 40px; border-radius: 999px; background: #fff;
  box-shadow: var(--shadow);
  color: var(--ink);
  display: inline-flex; align-items: center; gap: 6px; padding: 0 16px;
  font-size: var(--fs-label); font-weight: 700;
}
.ink-shuffle svg { width: 18px; height: 18px; }
.ink-body {
  flex: 1 1 auto; min-height: 0; overflow: hidden; display: grid;
  grid-template-columns: minmax(280px, .86fr) minmax(0, 1.22fr); gap: 16px;
}
.ink-preview, .ink-pick {
  min-height: 0; height: 100%; overflow: hidden; background: var(--card); border-radius: 22px;
  box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column;
}
.ink-preview h2, .ink-pick .ink-tabs { margin: 0; }
.ink-preview h2 { padding: 18px 18px 0; font-size: var(--fs-body); font-weight: 700; letter-spacing: 0; }
.ink-stage {
  position: relative; flex: 1 1 auto; min-height: 240px; margin: 14px 16px 0; padding: 64px 16px 48px;
  border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background-color: var(--card);
}
.ink-stage .tag {
  position: absolute; top: 16px; left: 16px; padding: 4px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .78); color: #a8988c; font-size: var(--fs-meta); font-weight: 700;
}
.ink-stage .eq {
  margin: 0; display: flex; align-items: center; gap: 14px;
  font-size: var(--fs-eq-long-lg); font-weight: 700; letter-spacing: 0; line-height: 1;
}
.ink-stage .eq b { font-weight: 700; }
.ink-stage .eq i {
  width: 68px; height: 68px; border-radius: 14px; border: 1.5px solid var(--seal);
  background: rgba(255, 255, 255, .45);
}
.ink-stage .ask { margin: 22px 0 12px; color: #b7ada4; font-size: var(--fs-meta); font-weight: 700; }
.ink-choices { display: flex; gap: 10px; }
.ink-choices span {
  width: 54px; height: 46px; border-radius: 12px; background: #fff;
  box-shadow: 0 6px 14px rgba(var(--ink-rgb), .06);
  display: grid; place-items: center; font-size: var(--fs-section); font-weight: 700;
}
.ink-badge {
  position: absolute; right: 12px; bottom: 12px; padding: 3px 10px; border-radius: 999px;
  background: #ece7e1; color: var(--muted); font-size: var(--fs-tag); font-style: normal; font-weight: 700;
}
.ink-mix {
  display: flex; align-items: center; gap: 8px; margin: 14px 0 0; padding: 14px 18px;
  border-top: 1px solid rgba(var(--ink-rgb), .08); color: var(--muted); font-size: var(--fs-meta); font-weight: 700;
}
.ink-mix b { color: var(--ink); font-size: var(--fs-label); }
.ink-mix i { width: 14px; height: 14px; border-radius: 50%; background: var(--seal); }
.ink-tabs {
  flex: none; display: flex; align-items: flex-end; gap: 28px; padding: 8px 18px 0;
  border-bottom: 1px solid rgba(var(--ink-rgb), .08);
}
.ink-tabs button {
  position: relative; display: inline-flex; align-items: baseline; gap: 6px;
  height: 46px; padding: 0 2px; color: #b7ada4; font-size: var(--fs-body); font-weight: 700;
}
.ink-tabs button small { font-size: var(--fs-meta); font-weight: 700; color: #c4b8ae; }
.ink-tabs button.on { color: var(--ink); }
.ink-tabs button.on::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  border-radius: 3px; background: var(--pop);
}
.ink-cards {
  flex: 1 1 auto; min-height: 0; overflow: auto; display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 12px;
  align-content: start; padding: 16px 14px 12px;
}
.ink-item {
  display: grid; justify-items: start; gap: 6px; min-width: 0; padding: 8px; border-radius: 16px;
  border: 2px solid transparent; background: transparent; text-align: left;
}
.ink-item.on { border-color: var(--pop); background: #fff; }
.ink-sample {
  position: relative; width: 100%; height: 78px; border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(var(--ink-rgb), .06); background-color: var(--card);
}
.ink-check {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--pop); display: grid; place-items: center; box-shadow: 0 4px 8px rgba(255, 118, 87, .28);
}
.ink-check svg { width: 14px; height: 14px; }
.ink-item strong { font-size: var(--fs-label); font-weight: 700; }
.ink-item em {
  display: flex; align-items: flex-start; gap: 4px; max-width: 100%; min-height: 18px;
  color: var(--muted-2); font-style: normal; font-size: var(--fs-tag); font-weight: 700; line-height: 1.35;
}
.ink-item em svg { width: 14px; height: 14px; flex: none; }
.ink-item.on em { color: var(--pop); }
.ink-item.lock .ink-sample { filter: grayscale(.15) saturate(.8); }
.ink-item.lock strong, .ink-item.lock em { color: var(--muted-2); }
.ink-hint {
  flex: none; display: flex; align-items: center; gap: 6px; margin: 0; padding: 8px 18px 16px;
  color: var(--muted); font-size: var(--fs-meta); font-weight: 700;
}
.ink-hint svg { width: 16px; height: 16px; flex: none; }
.ink-foot { display: flex; align-items: center; gap: 16px; min-height: 44px; }
.ink-foot > span:first-child { margin-right: auto; color: var(--muted-2); font-size: var(--fs-meta); font-weight: 700; }
.ink-saved { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--fs-meta); font-weight: 700; }
.ink-saved svg { width: 18px; height: 18px; }
.inkroom .dock { flex: none; }
.ink-stage.paper-plain, .ink-sample.paper-plain {
  background-color: var(--paper);
  background-image: radial-gradient(circle at 18% 8%, rgba(255, 196, 140, .45), transparent 46%);
}
.ink-stage.paper-grid, .ink-sample.paper-grid {
  background-color: #f7fbff;
  background-image: linear-gradient(rgba(90, 160, 220, .28) 1px, transparent 1px), linear-gradient(90deg, rgba(90, 160, 220, .28) 1px, transparent 1px);
  background-size: 18px 18px;
}
.ink-sample.paper-grid { background-size: 10px 10px; }
.ink-stage.paper-sea, .ink-sample.paper-sea {
  background-color: #f3fbff;
  background-image: repeating-linear-gradient(180deg, transparent 0 12px, rgba(80, 170, 210, .45) 13px 15px);
}
.ink-sample.paper-sea { background-image: repeating-linear-gradient(180deg, transparent 0 6px, rgba(80, 170, 210, .55) 7px 8px); }
.ink-stage.paper-lamp, .ink-sample.paper-lamp {
  background-color: #fff6e4;
  background-image: radial-gradient(circle at 50% 0%, rgba(255, 176, 70, .55), transparent 68%);
}
.ink-stage.paper-fold, .ink-sample.paper-fold {
  background-color: #fff7f4;
  background-image: repeating-linear-gradient(135deg, transparent 0 14px, rgba(255, 150, 170, .38) 15px 17px);
}
.ink-sample.paper-fold { background-image: repeating-linear-gradient(135deg, transparent 0 7px, rgba(255, 140, 160, .5) 8px 9px); }
.ink-stage.paper-star, .ink-sample.paper-star {
  background-color: var(--card);
  background-image: radial-gradient(circle, #f0c14a 1.2px, transparent 1.5px);
  background-size: 18px 18px;
}
.ink-sample.paper-star { background-size: 11px 11px; }
.ink-sample.tone-ink { background: linear-gradient(160deg, #ffe8df, #ffc7b4); }
.ink-sample.tone-blue { background: linear-gradient(160deg, #e7f6ff, #9fd4f4); }
.ink-sample.tone-pine { background: linear-gradient(160deg, var(--ok-soft), #8ed9a8); }
.ink-sample.tone-frost { background: linear-gradient(160deg, #f4fbff, #b7d4e4); }
.ink-sample.tone-warm { background: linear-gradient(160deg, #fff3df, #f3c27a); }
.ink-sample.tone-violet { background: linear-gradient(160deg, #f6efff, #c9b0ef); }
.ink-sample.tone-gold { background: linear-gradient(160deg, #fff6d4, #f0c85a); }
.ink-sample.tone-iris { background: linear-gradient(135deg, #ffd0e0, #fff 42%, #b7e4ff); }
@media (max-width: 860px) {
  .ink-body { grid-template-columns: 1fr; overflow: auto; }
  .ink-stage { min-height: 220px; }
  .ink-stage .eq { font-size: var(--fs-eq-long); margin-top: 16px; }
  .ink-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

html:has(.prefs),
body:has(.prefs),
html:has(.tip),
body:has(.tip) { height: 100%; overflow: hidden; }
.desk:has(.prefs),
.desk:has(.tip) {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--fill);
}
.prefs {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0 10px;
}
.tip {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: 12px 0 24px;
}
.tip-top {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
}
.tip-title { min-width: 0; text-align: left; }
.tip-title h1 {
  margin: 0;
  font-size: var(--fs-page);
  font-weight: 700;
  line-height: var(--lh-page);
}
.tip-title p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: 500;
  line-height: var(--lh-meta);
}
.tip-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto;
  gap: var(--space-5);
  align-items: center;
  padding: var(--pad-card);
  border-radius: var(--radius-card);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.tip-lead {
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: var(--lh-body);
}
.tip-points {
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-2);
}
.tip-points li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: var(--lh-label);
}
.tip-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pop);
}
.tip-art {
  width: 148px;
  height: 148px;
  flex: none;
}
.tip-art svg { width: 100%; height: 100%; display: block; }
.tip-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}
.tip-board-single {
  grid-template-columns: minmax(0, 360px);
  justify-content: center;
}
.tip-qr {
  margin: 0;
  padding: var(--pad-card);
  border-radius: var(--radius-card);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  text-align: center;
}
.tip-qr-frame {
  width: min(280px, 100%);
  position: relative;
}
.tip-qr-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-input);
  background: var(--fill);
  object-fit: contain;
}
.tip-qr-frame img.is-hide { display: none; }
.tip-qr-miss {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-input);
  background: var(--fill);
  display: grid;
  place-content: center;
  gap: 6px;
  border: 1.5px dashed var(--border);
  color: var(--muted);
  padding: var(--space-4);
  box-sizing: border-box;
}
.tip-qr-miss[hidden] { display: none !important; }
.tip-qr-miss b {
  color: var(--ink);
  font-size: var(--fs-body);
  font-weight: 600;
}
.tip-qr-miss span {
  font-size: var(--fs-meta);
  font-weight: 500;
  line-height: var(--lh-meta);
}
.tip-qr figcaption {
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: var(--lh-body);
  color: var(--ink);
}
.tip-qr-wechat figcaption { color: #1faa3c; }
.tip-qr-alipay figcaption { color: #1677ff; }
.tip-note {
  margin: 0;
  text-align: center;
  color: var(--muted-2);
  font-size: var(--fs-meta);
  font-weight: 500;
  line-height: var(--lh-meta);
}
@media (max-width: 720px) {
  .tip-hero { grid-template-columns: 1fr; }
  .tip-art { width: 120px; height: 120px; margin: 0 auto; }
  .tip-board { grid-template-columns: 1fr; }
}

.prefs-top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.prefs-back {
  justify-self: start;
  height: 46px;
  padding: 0 18px 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--pop);
  color: #fff;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--fs-label);
  font-weight: 700;
}
.prefs-back svg { width: 22px; height: 22px; }
.prefs-title { text-align: left; min-width: 0; }
.prefs-title h1 { margin: 0; font-size: var(--fs-page); font-weight: 700; letter-spacing: 0; line-height: 1.1; }
.prefs-title p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-meta); font-weight: 700; }
.prefs-body { display: grid; gap: 10px; min-height: 0; overflow: auto; }
.prefs-check {
  height: 36px; padding: 0 14px; border-radius: 999px;
  background: #fff; color: var(--pop); box-shadow: inset 0 0 0 2px var(--pop-soft);
  font-size: var(--fs-meta); font-weight: 700;
}
.prefs-card {
  background: var(--card);
  border-radius: 20px;
  padding: 10px 14px 8px;
  box-shadow: var(--shadow-soft);
}
.prefs-card h2 { margin: 0 4px 8px; font-size: var(--fs-label); font-weight: 700; letter-spacing: 0; }
.prefs-line {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: #fff;
  border-radius: 14px;
  padding: 8px 14px;
  box-shadow: 0 0 0 1px rgba(var(--ink-rgb), .05);
}
.prefs-ico {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--pop-soft);
  color: var(--pop);
  display: grid;
  place-items: center;
}
.prefs-ico svg { width: 22px; height: 22px; }
.prefs-line strong { display: block; font-size: var(--fs-label); font-weight: 700; }
.prefs-line p { margin: 1px 0 0; color: var(--muted-2); font-size: var(--fs-tag); font-weight: 700; }
.prefs-seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #f4efe8;
}
.prefs-seg button {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 2px solid transparent;
  background: transparent;
  color: var(--muted-2);
  font-size: var(--fs-label);
  font-weight: 700;
}
.prefs-seg button.on {
  background: #fff;
  color: var(--pop);
  border-color: var(--pop);
}
.prefs-stack {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(var(--ink-rgb), .05);
}
.prefs-stack .prefs-line { background: transparent; box-shadow: none; border-radius: 0; }
.prefs-stack .prefs-line + .prefs-line { border-top: 1px solid rgba(var(--ink-rgb), .08); }
.prefs-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  color: var(--muted-2);
  font-size: var(--fs-label);
  font-weight: 700;
}
.prefs-switch i {
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: #e4ddd6;
  position: relative;
  display: block;
}
.prefs-switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(var(--ink-rgb), .16);
}
.prefs-switch.on { color: var(--ink); }
.prefs-switch.on i { background: var(--pop); }
.prefs-switch.on i::after { left: 25px; }
.prefs-wipe {
  height: 36px;
  padding: 0 18px;
  border-radius: 999px;
  border: 2px solid var(--pop);
  background: #fff;
  color: var(--pop);
  font-size: var(--fs-label);
  font-weight: 700;
}
.prefs-warn { margin: 6px 6px 0; color: var(--muted-2); font-size: var(--fs-tag); font-weight: 700; }
.prefs-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 28px;
  flex: none;
  color: var(--muted-2);
  font-size: var(--fs-meta);
  font-weight: 700;
}
.prefs-saved {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: var(--fs-meta);
}
.prefs-saved svg { width: 18px; height: 18px; }
@media (max-width: 720px) {
  .prefs { width: min(920px, calc(100% - 16px)); gap: 8px; padding: 8px 0; }
  .prefs-title h1 { font-size: var(--fs-name); }
  .prefs-line p { display: none; }
}

html:has(.diary),
body:has(.diary) { height: 100%; overflow: hidden; }
.desk:has(.diary) {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--fill);
}
.diary {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 0 14px;
  color: var(--ink);
}
.diary-top { display: flex; align-items: center; gap: 14px; flex: none; }
.diary-title { min-width: 0; }
.diary-top h1 { margin: 0; font-size: var(--fs-page); font-weight: 700; letter-spacing: 0; line-height: 1.1; }
.diary-top p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-meta); font-weight: 700; }
.diary-back, .diary-now {
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-label);
  font-weight: 700;
}
.diary-back {
  height: 46px;
  padding: 0 18px 0 12px;
  background: var(--pop);
  color: #fff;
  box-shadow: none;
  gap: 2px;
  font-size: var(--fs-label);
  font-weight: 700;
}
.diary-now { margin-left: auto; gap: 6px; padding: 0 16px 0 14px; }
.diary-back svg, .diary-now svg { width: 18px; height: 18px; }
.diary-back svg { width: 22px; height: 22px; }
.diary-main {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .72fr);
  gap: 14px;
}
.diary-board, .diary-side, .diary-foot {
  background: var(--pop-soft);
  border-radius: 26px;
  box-shadow: 0 10px 28px rgba(var(--ink-rgb), .04);
}
.diary-board {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 18px 12px;
}
.diary-monthbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  flex: none;
}
.diary-switch { grid-column: 2; display: flex; align-items: center; gap: 6px; }
.diary-switch strong { min-width: 9em; text-align: center; font-size: var(--fs-page); font-weight: 700; letter-spacing: 0; }
.diary-switch button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--muted);
  display: grid;
  place-items: center;
}
.diary-switch button svg { width: 20px; height: 20px; }
.diary-pill {
  grid-column: 3;
  justify-self: end;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: 700;
  white-space: nowrap;
}
.diary-pill b { color: var(--pop); font-size: var(--fs-label); }
.diary-week, .diary-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.diary-week { flex: none; margin: 12px 0 8px; }
.diary-week span { text-align: center; color: var(--muted); font-size: var(--fs-meta); font-weight: 700; }
.diary-days { flex: 1 1 auto; min-height: 0; grid-auto-rows: minmax(0, 1fr); }
.diary-cell {
  min-height: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  line-height: 1;
  padding: 2px;
}
.diary-cell b { font-size: var(--fs-body); font-weight: 700; }
.diary-cell svg { width: 14px; height: 14px; margin-top: 2px; }
.diary-cell small { margin-top: 1px; font-size: var(--fs-tag); font-weight: 700; }
.diary-cell.played { background: #d9f6e4; }
.diary-cell.played svg { color: #2fbe6a; }
.diary-cell.today { background: var(--pop); color: #fff; }
.diary-cell.today svg, .diary-cell.today small { color: #fff; }
.diary-cell.later { color: var(--border); }
.diary-cell.pick:not(.today) { box-shadow: inset 0 0 0 2px var(--pop); }
.diary-legend {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: 700;
}
.diary-legend i { width: 12px; height: 12px; border-radius: 50%; margin-left: 8px; }
.diary-legend i:first-child { margin-left: 0; }
.diary-legend i.did { background: #b7ebc6; }
.diary-legend i.now { background: #fff; box-shadow: inset 0 0 0 2px var(--pop); }
.diary-side {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 16px 16px;
}
.diary-side header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.diary-side h2 { margin: 0; font-size: var(--fs-page); font-weight: 700; letter-spacing: 0; }
.diary-side h2 span { color: var(--muted-2); font-size: var(--fs-body); font-weight: 700; }
.diary-side header em {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: #1fa85a;
  font-style: normal;
  font-size: var(--fs-meta);
  font-weight: 700;
  white-space: nowrap;
}
.diary-side header em svg { width: 14px; height: 14px; }
.diary-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--fill);
  color: var(--muted);
  font-weight: 700;
}
.diary-banner.done { background: var(--pop-soft); color: var(--ink); }
.diary-banner i {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e4ddd6;
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
}
.diary-banner.done i { background: var(--pop); }
.diary-banner svg { width: 14px; height: 14px; }
.diary-side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.diary-side li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  font-weight: 700;
}
.diary-side li > i { color: var(--muted); display: grid; }
.diary-side li svg { width: 20px; height: 20px; }
.diary-side li b { color: var(--pop); font-size: var(--fs-dialog); letter-spacing: 0; }
.diary-side li b small { margin-left: 2px; font-size: var(--fs-meta); font-weight: 700; }
.diary-side h3 { margin: 2px 0 0; font-size: var(--fs-body); font-weight: 700; }
.diary-logs { display: grid; gap: 8px; min-height: 0; overflow: auto; }
.diary-log {
  width: 100%;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 16px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(var(--ink-rgb), .05);
  text-align: left;
}
.diary-log > i {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--pop-soft);
  color: var(--pop);
  display: grid;
  place-items: center;
}
.diary-log > i svg, .diary-log > svg { width: 18px; height: 18px; }
.diary-log > svg { color: #c4b8ae; }
.diary-log strong { display: block; font-size: var(--fs-label); }
.diary-log small { display: block; margin-top: 2px; color: var(--muted-2); font-size: var(--fs-tag); font-weight: 700; }
.diary-again {
  margin-top: auto;
  height: 52px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--pop), var(--pop-deep));
  color: #fff;
  font-size: var(--fs-body);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 16px rgba(185, 67, 41, .28);
}
.diary-again svg { width: 20px; height: 20px; }
.diary-foot {
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 14px 8px;
}
.diary-foot span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
}
.diary-foot span + span { box-shadow: inset 1px 0 0 #f0e4d8; }
.diary-foot svg { width: 22px; height: 22px; color: #6d5c64; }
.diary-foot span:last-child svg { color: var(--pop); }
.diary-foot b { color: var(--pop); font-size: var(--fs-dialog); }
@media (max-width: 860px) {
  .diary { width: min(1120px, calc(100% - 16px)); gap: 8px; padding: 10px 0; }
  .diary-top p { display: none; }
  .diary-top h1 { font-size: var(--fs-name); }
  .diary-main { grid-template-columns: 1fr; overflow: auto; }
  .diary-days { grid-auto-rows: 52px; }
}

html:has(.lesson),
body:has(.lesson) { height: 100%; overflow: hidden; }
.desk:has(.lesson) {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--fill);
}
.lesson {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0 10px;
  color: var(--ink);
}
.lesson-top {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
}
.lesson-hear {
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  font-weight: 700;
}
.lesson-back {
  justify-self: start;
  height: 46px;
  padding: 0 18px 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--pop);
  color: #fff;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--fs-label);
  font-weight: 700;
}
.lesson-back svg { width: 22px; height: 22px; }
.lesson-hear svg { width: 20px; height: 20px; }
.lesson-title { text-align: left; min-width: 0; }
.lesson-title h1 {
  margin: 0;
  font-size: var(--fs-dialog);
  font-weight: 600;
  letter-spacing: 0;
  line-height: var(--lh-dialog);
}
.lesson-title p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: 500;
  line-height: var(--lh-meta);
}
.lesson-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.lesson-hear { gap: 4px; padding: 0 14px; background: #e7f4ff; color: #2f86c4; }
.lesson-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, .78fr) minmax(0, 1.25fr);
  gap: 14px;
}
.lesson-q, .lesson-do {
  min-height: 0;
  border-radius: 28px;
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
}
.lesson-q { background: #fff; }
.lesson-do { background: var(--pop-soft); overflow: auto; }
.lesson-badge {
  align-self: flex-start;
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  background: #fff1dc;
  color: #e09a3a;
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-meta);
  font-weight: 700;
}
.lesson-eq {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px 0 6px;
  font-size: var(--fs-eq-long-lg);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.lesson-eq.plain { font-size: var(--fs-eq-long); flex-wrap: wrap; }
.lesson-eq.plain em { margin: 0 6px; font-style: normal; }
.lesson-eq .prompt { font-size: var(--fs-eq-long); }
.lesson-eq i {
  width: 74px;
  height: 80px;
  border: 1.5px solid var(--pop);
  border-radius: 18px;
  background: #fff;
}
.bond { display: flex; flex-direction: column; align-items: center; margin-top: 6px; }
.bond > small, .bond span small { color: var(--muted); font-size: var(--fs-meta); font-weight: 700; }
.bond > b, .bond span b {
  min-width: 72px;
  height: 58px;
  padding: 0 12px;
  border-radius: 16px;
  background: #e7f5ff;
  box-shadow: inset 0 0 0 2px #8fd0f5;
  display: grid;
  place-items: center;
  font-size: var(--fs-stat);
}
.bond svg { width: 180px; height: 28px; }
.bond > div { display: flex; gap: 36px; }
.bond span { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lesson-note { margin: 12px 0 0; text-align: center; font-weight: 700; }
.lesson-tip {
  margin: auto 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 18px;
  background: var(--pop-soft);
  font-weight: 700;
}
.lesson-face { width: 46px; height: 52px; flex: none; }
.lesson-face .mascot { width: 46px; height: 52px; display: block; object-fit: contain; }
.lesson-do header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lesson-do h2 { display: flex; align-items: center; gap: 6px; margin: 0; font-size: var(--fs-body); }
.lesson-do h2 svg { width: 22px; height: 22px; }
.lesson-do header span { color: var(--muted-2); font-size: var(--fs-meta); font-weight: 700; }
.lesson-do header span b { color: var(--ink); }
.lesson-steps { display: flex; align-items: center; gap: 8px; margin: 12px 0 8px; }
.lesson-steps button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-2);
  font-size: var(--fs-label);
  font-weight: 700;
}
.lesson-steps button i {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #efe8e2;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: var(--fs-meta);
}
.lesson-steps button.on { color: var(--ink); }
.lesson-steps button.on i { background: var(--pop); color: #fff; }
.lesson-steps > span { width: 28px; height: 2px; border-radius: 999px; background: #eadfd6; }
.lesson-do h3 { margin: 4px 0 0; font-size: var(--fs-dialog); font-weight: 700; letter-spacing: 0; line-height: 1.3; }
.lesson-sub { margin: 4px 0 0; color: var(--muted); font-size: var(--fs-meta); font-weight: 700; }
.lesson-sub em { font-style: normal; font-weight: 700; }
.lesson-sub em.red { color: #ff6a4a; }
.lesson-sub em.blue { color: #3a9ad4; }
.lesson-stage { flex: none; min-height: 0; display: flex; justify-content: center; margin: 14px 0 8px; width: 100%; }
.lesson-scene { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.lesson-row { display: flex; align-items: center; justify-content: center; gap: 14px; }
.ten { display: flex; align-items: center; justify-content: center; gap: 14px; }
.ten-cap { display: flex; flex-direction: column; align-items: center; color: #5aaed6; font-size: var(--fs-meta); font-weight: 700; }
.ten-cap span {
  width: 78%;
  height: 10px;
  border: 2px solid #8fd0f2;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}
.ten-grid {
  display: grid;
  grid-template-columns: repeat(5, 48px);
  gap: 12px;
  margin-top: 8px;
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--border);
}
.ten-grid b, .split-dots b, .groups b {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  animation: lesson-pop .35s ease both;
}
.ten-grid b.red, .split-dots b.red, .groups b.red, .ones .stick.red { background: var(--pop); }
.ten-grid b.blue, .split-dots b.blue, .groups b.blue, .ones .stick.blue { background: #4aa3e8; }
.ten-grid b.gone, .split-dots b.gone, .groups b.gone, .stick.gone, .bundle.gone { background: var(--border); }
.ten-grid i, .dot-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--border);
}
.ten-grid i.slot { box-shadow: inset 0 0 0 2px var(--pop-soft); background: #fff6f2; }
.dot-btn { border: 0; padding: 0; background: #4aa3e8; box-shadow: none; cursor: pointer; }
.mini-go, .hand-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: 700;
  text-align: center;
}
.mini-go {
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--pop);
}
.carry { display: flex; align-items: center; justify-content: center; gap: 18px; }
.places { display: flex; gap: 28px; justify-content: center; }
.places > div { min-width: 120px; padding: 12px; border-radius: 16px; background: #fff; text-align: center; }
.places > div.on { box-shadow: inset 0 0 0 2px var(--pop-soft); }
.places small { display: block; margin-bottom: 8px; color: var(--pop); font-weight: 700; }
.bundles, .ones { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 54px; }
.bundle {
  width: 26px;
  height: 54px;
  border-radius: 8px;
  background: repeating-linear-gradient(90deg, var(--pop) 0 3px, #fff 3px 6px);
  box-shadow: inset 0 0 0 2px var(--pop-deep);
}
.bundle.blue { background: repeating-linear-gradient(90deg, #4aa3e8 0 3px, #fff 3px 6px); box-shadow: inset 0 0 0 2px #2f86c4; }
.bundle.gone { background: var(--border); box-shadow: inset 0 0 0 2px #b7aea6; }
.stick { width: 8px; height: 46px; border-radius: 4px; background: var(--pop); }
.ones .none, .bundles .none { color: var(--muted-2); font-style: normal; font-weight: 700; }
.groups { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 460px; }
.groups > div { display: flex; flex-wrap: wrap; gap: 4px; max-width: 140px; padding: 8px; border-radius: 14px; background: #fff; }
.groups.mini b, .groups.mini .split-dots b { width: 14px; height: 14px; }
.part-bar { display: flex; height: 42px; overflow: hidden; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 2px var(--border); }
.part-bar i { width: 36px; height: 100%; background: transparent; border-radius: 0; box-shadow: none; display: block; }
.part-bar i.on { background: var(--pop); }
.part-bar i.blue { background: #4aa3e8; }
.split b.join { align-self: center; font-size: var(--fs-page); color: var(--pop); }
.lesson-card { padding: 16px 18px; border-radius: 18px; background: #fff; }
.lesson-card .write-eq { flex-wrap: wrap; justify-content: center; font-size: var(--fs-stat); }
.chain { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; font-size: var(--fs-page); font-weight: 700; }
.chain em { font-style: normal; padding: 4px 10px; border-radius: 12px; background: var(--pop-soft); color: var(--pop); }
.chain span { color: var(--muted-2); }
.scale { display: grid; justify-items: center; gap: 8px; }
.scale .pan { display: flex; gap: 8px; }
.scale .pan b { min-width: 64px; height: 48px; padding: 0 10px; border-radius: 12px; background: #fff; display: grid; place-items: center; }
.scale > i { width: 180px; height: 8px; border-radius: 99px; background: #e7d3c4; }
.ten-grid b.fly { animation: lesson-fly .7s ease both; }
@keyframes lesson-fly {
  from { transform: translate(64px, 16px); opacity: .2; }
  to { transform: none; opacity: 1; }
}
.ten-tags { display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.ten-tags span {
  height: 32px;
  padding: 0 10px 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--fs-meta);
  font-weight: 700;
}
.ten-tags svg { width: 16px; height: 16px; }
.ten-tags .is-red { background: var(--pop-soft); color: var(--pop-deep); }
.ten-tags .is-blue { background: #e7f4ff; color: #2f86c4; }
.split { display: flex; justify-content: center; gap: 28px; }
.split > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 180px;
  padding: 16px;
  border-radius: 18px;
  background: #fff;
}
.split-dots { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 190px; }
.split small { color: var(--muted); font-weight: 700; }
.write-eq {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: var(--fs-eq);
  font-weight: 700;
}
.write-eq i {
  min-width: 72px;
  height: 78px;
  padding: 0 8px;
  border-radius: 16px;
  border: 1.5px solid var(--pop);
  display: grid;
  place-items: center;
  font-style: normal;
  color: var(--pop);
}
.lesson-line {
  margin: 0;
  padding: 18px 20px;
  border-radius: var(--radius-card);
  background: #fff;
  font-size: var(--fs-section);
  font-weight: 600;
  line-height: var(--lh-section);
  text-align: center;
}
.lesson-vert {
  display: grid;
  justify-content: center;
  gap: 6px;
  margin: 18px 0 4px;
  font-size: var(--fs-eq-long);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.lesson-vert > div {
  display: grid;
  grid-template-columns: 32px repeat(var(--cols), 46px);
  gap: 6px;
  align-items: center;
}
.lesson-vert > div i, .lesson-vert > div b {
  height: 48px;
  display: grid;
  place-items: center;
  font-style: normal;
}
.lesson-vert i.num { color: var(--ink); }
.lesson-vert i.wrote { border-radius: 12px; background: var(--pop-soft); color: var(--pop); }
.lesson-vert i.blank { border-radius: 12px; box-shadow: inset 0 0 0 3px var(--pop-soft); background: #fff; }
.lesson-vert i.on { box-shadow: inset 0 0 0 3px var(--pop); }
.lesson-vert .rule { height: 3px; margin-left: 38px; border-radius: 999px; background: var(--ink); }
.work {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 220px;
  padding: 22px 40px 18px;
  border-radius: 24px;
  background: #fff;
  font-size: var(--fs-eq);
  font-weight: 700;
  line-height: 1.15;
  box-shadow: 0 8px 20px rgba(var(--ink-rgb), .05);
}
.work small { justify-self: center; margin-bottom: 6px; color: var(--pop); font-size: var(--fs-label); font-weight: 700; }
.work small.tag { margin: 8px 0 0; color: var(--muted); font-size: var(--fs-meta); }
.work em { margin-right: 10px; font-style: normal; }
.work span { width: 100%; height: 3px; margin: 4px 0; border-radius: 999px; background: var(--ink); }
.work .got { color: var(--pop); }
.lesson-lines {
  list-style: none;
  width: min(100%, 440px);
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.lesson-lines li {
  padding: 12px 16px;
  border-radius: 14px;
  background: #fff;
  color: var(--muted-2);
  font-weight: 700;
}
.lesson-lines li.did { color: var(--muted); }
.lesson-lines li.on { color: var(--ink); font-size: var(--fs-body); box-shadow: inset 0 0 0 2px var(--pop-soft); }
.lesson-nudge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 16px;
  background: #fff;
  font-weight: 700;
}
.lesson-nudge span { font-size: var(--fs-dialog); }
.lesson-acts {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: auto;
  padding-top: var(--space-3);
  flex-wrap: wrap;
}
.lesson-acts-end {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-left: auto;
}
.lesson-replay,
.lesson-exit,
.lesson-done,
.lesson-try,
.lesson-swap,
.lesson-next {
  height: var(--btn-h-sec);
  min-height: var(--btn-h-sec);
  border-radius: var(--radius-btn);
  font-size: var(--fs-btn);
  font-weight: 600;
  line-height: var(--lh-btn);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 20px;
  box-shadow: none;
}
.lesson-replay {
  background: #fff;
  color: var(--muted);
  border: 1.5px solid var(--border);
}
.lesson-replay svg { width: 18px; height: 18px; }
.lesson-exit,
.lesson-try {
  background: #fff;
  color: var(--pop-deep);
  border: 1.5px solid var(--pop-soft);
}
.lesson-swap {
  background: #fff;
  color: #2f86c4;
  border: 1.5px solid #b7ddf5;
}
.lesson-done,
.lesson-next {
  background: var(--pop-deep);
  color: #fff;
  border: 1.5px solid var(--pop-deep);
  box-shadow: var(--shadow);
}
.lesson-next svg { width: 18px; height: 18px; }
@media (max-width: 720px) {
  .lesson-acts {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }
  .lesson-acts-end {
    margin-left: 0;
    width: 100%;
  }
  .lesson-replay,
  .lesson-done,
  .lesson-next {
    width: 100%;
  }
  .lesson-exit,
  .lesson-swap,
  .lesson-try {
    flex: 1 1 calc(50% - 6px);
  }
}
.lesson-foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--muted-2);
  font-size: var(--fs-meta);
  font-weight: 700;
}
.lesson-foot i { flex: 1; height: 1px; background: #e4d9cf; }
@keyframes lesson-pop {
  from { transform: scale(.35); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@media (max-width: 860px) {
  .lesson-body { grid-template-columns: 1fr; overflow: auto; }
  .lesson-eq { font-size: var(--fs-eq-long-lg); }
  .lesson-title h1 { font-size: var(--fs-dialog); }
}

.still *, .still { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

.studio .who button.face { padding: 0; border: 0; background: none; cursor: pointer; }
html:has(.pal),
body:has(.pal) { height: 100%; overflow: hidden; }
.desk:has(.pal) {
  height: 100dvh; max-height: 100dvh; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
}
.pal {
  width: min(var(--content-max), calc(100% - (var(--pad-x) * 2)));
  margin: 0 auto; flex: 1 1 auto; height: auto; min-height: 0; max-height: 100%;
  display: flex; flex-direction: column; gap: var(--space-4);
  overflow: hidden; justify-content: stretch;
  padding: var(--pad-top) 0 calc(var(--dock-h) + 8px); color: var(--ink);
}
main.pal {
  margin-top: 10px; margin-bottom: 10px; max-height: calc(100% - 20px);
  padding: var(--pad-card);
  border-radius: var(--radius-page);
  background: var(--card);
  box-shadow: var(--shadow);
}
@media (min-width: 960px) {
  main.pal { padding-left: 24px; padding-right: 24px; }
}
.pal-top {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex: none; min-height: 58px;
}
.pal-title { text-align: left; }
.pal-top h1 {
  margin: 0;
  font-size: var(--fs-page);
  font-weight: 700;
  letter-spacing: 0;
  line-height: var(--lh-page);
}
.pal-top p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: 500;
  line-height: var(--lh-meta);
}
.pal-back {
  justify-self: start;
  height: var(--icon-btn); padding: 0 18px 0 12px; border-radius: var(--radius-btn);
  background: var(--pop-deep); color: #fff;
  display: inline-flex; align-items: center; gap: 2px;
  font-size: var(--fs-label); font-weight: 600;
}
.pal-back svg { width: 22px; height: 22px; }
.pal-log {
  position: static; flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 16px 0 14px; border-radius: 999px; background: #fff;
  color: var(--ink); font-size: var(--fs-label); font-weight: 700;
  box-shadow: var(--shadow);
}
.pal-log svg { width: 18px; height: 18px; }
.pal-grid {
  flex: 1 1 auto; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(300px, .78fr);
  gap: 16px;
}
.pal-card, .pal-route, .pal-today, .pal-records {
  background: var(--card); border-radius: 28px;
  box-shadow: var(--shadow-soft);
}
.pal-card { min-height: 0; display: flex; flex-direction: column; padding: 18px 22px 16px; }
.pal-head { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pal-id { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.pal-id .tag {
  height: 28px; padding: 0 12px; border-radius: 999px;
  background: var(--ok-soft); color: var(--ok);
  font-style: normal; font-size: var(--fs-meta); font-weight: 600;
  line-height: var(--lh-meta);
  display: inline-flex; align-items: center;
}
.pal-head h2, .pal-name {
  margin: 0; display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-name); font-weight: 700; letter-spacing: 0; line-height: 32px;
}
.pal-head h2 button, .pal-name { color: inherit; }
.pal-head h2 button { width: 28px; height: 28px; color: var(--muted-2); }
.pal-head h2 svg { width: 18px; height: 18px; }
.pal-name {
  width: min(220px, 46%); height: 44px; padding: 0 10px;
  border-radius: 12px; background: var(--pop-soft); font-size: var(--fs-page);
}
.pal-switch {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 6px;
  height: 36px; padding: 0 4px; color: var(--muted); font-size: var(--fs-label); font-weight: 700;
}
.pal-switch svg { width: 18px; height: 18px; }
.pal-looks {
  position: absolute; z-index: 2; top: calc(100% + 6px); right: 0; display: grid; gap: 4px;
  padding: 8px; border-radius: 16px; background: #fff;
  box-shadow: var(--shadow-soft);
}
.pal-looks button { height: 36px; padding: 0 12px; border-radius: 10px; font-weight: 700; text-align: left; }
.pal-looks button.on, .pal-looks button:hover { background: var(--pop-soft); }
.pal-hero {
  position: relative; flex: 1 1 auto; min-height: 0;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 8px 176px 4px 0;
}
.pal-figure { position: relative; height: 100%; width: fit-content; max-width: 100%; }
.pal-art { display: block; object-fit: contain; }
.pal-hero .pal-art {
  height: 100%; width: auto; max-width: min(360px, 100%);
  filter: drop-shadow(0 16px 12px rgba(170, 120, 80, .16));
}
.pal-hero .say {
  position: absolute; left: calc(100% + 4px); top: 38%; z-index: 1;
  padding: 10px 14px; border-radius: 16px; background: #fff; white-space: nowrap;
  box-shadow: 0 8px 18px rgba(var(--ink-rgb), .08);
  color: var(--ink); font-size: var(--fs-meta); font-weight: 700; line-height: 1.35;
}
.pal-figure.is-bud .say { top: 44%; }
.pal-figure.is-young .say { top: 26%; }
.pal-figure.is-grow .say { top: 24%; }
.pal-figure.is-guard .say { top: 28%; }
.pal-figure[data-act] { cursor: pointer; }
.pal-figure.is-tap .pal-art { animation: pal-tap .45s ease; }
.pal-figure.is-hop .pal-art { animation: pal-hop .7s ease; }
@keyframes pal-tap {
  0%, 100% { transform: translateY(0) rotate(0); }
  35% { transform: translateY(-8px) rotate(-4deg); }
  70% { transform: translateY(-2px) rotate(3deg); }
}
@keyframes pal-hop {
  0%, 100% { transform: translateY(0); }
  35% { transform: translateY(-28px); }
  55% { transform: translateY(-4px); }
  75% { transform: translateY(-16px); }
}
.pal-hero .say::before {
  content: ""; position: absolute; left: -6px; bottom: 14px;
  border: 7px solid transparent; border-right-color: #fff; border-left: 0;
}
.pal-xp { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: end; }
.pal-xp b { font-size: var(--fs-body); font-weight: 600; }
.pal-xp strong {
  font-size: var(--fs-page);
  letter-spacing: 0;
  font-weight: 700;
  line-height: 36px;
  font-variant-numeric: tabular-nums;
}
.pal-xp i {
  grid-column: 1 / -1; display: block; height: 16px; border-radius: 999px;
  background: var(--fill); overflow: hidden;
}
.pal-xp i em { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pop), var(--pop)); }
.pal-xp p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: var(--lh-label);
}
.pal-acts { display: flex; gap: 12px; margin-top: 14px; }
.pal-go, .pal-route-go {
  height: var(--btn-h);
  min-height: var(--btn-h);
  border-radius: var(--radius-btn);
  font-size: var(--fs-btn);
  font-weight: 600;
  line-height: var(--lh-btn);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.pal-go {
  flex: 1.45;
  background: var(--pop-deep);
  color: #fff;
  box-shadow: var(--shadow);
}
.pal-go svg { width: 22px; height: 22px; }
.pal-route-go {
  flex: .85;
  height: var(--btn-h-sec);
  min-height: var(--btn-h-sec);
  background: #fff;
  color: var(--ink);
  box-shadow: none;
  border: 1.5px solid var(--border);
}
.pal aside { min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.pal-route, .pal-today { padding: 16px 16px 12px; }
.pal-route { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.pal-route h2, .pal-today h2, .pal-records h2 {
  margin: 0 0 10px;
  font-size: var(--fs-section);
  line-height: var(--lh-section);
  letter-spacing: 0;
  font-weight: 600;
}
.pal-route ol {
  list-style: none; margin: 0; padding: 2px 0 0 18px; position: relative;
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
}
.pal-route ol::before {
  content: ""; position: absolute; left: 4px; top: 36px; bottom: 36px;
  border-left: 2px dashed var(--border);
}
.pal-route li {
  position: relative; flex: none;
  display: grid; grid-template-columns: 52px minmax(0, 1fr) 84px;
  gap: 10px; align-items: center;
  padding: 6px 8px; border-radius: 16px;
}
.pal-route li::before {
  content: ""; position: absolute; left: -18px; top: 50%; width: 10px; height: 10px;
  transform: translateY(-50%); border-radius: 50%; background: var(--border);
  box-shadow: 0 0 0 3px var(--card);
}
.pal-route li.open::before { background: var(--ok); }
.pal-route li.on::before { background: var(--pop); }
.pal-route li.on { background: var(--pop-soft); }
.pal-route .meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pal-route .meta b {
  font-size: var(--fs-section);
  font-weight: 600;
  line-height: var(--lh-section);
}
.pal-route .meta small {
  color: var(--muted);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: var(--lh-label);
}
.pal-route .mini {
  width: 52px; height: 52px; border-radius: 14px; background: #fff6f1;
  display: grid; place-items: center;
}
.pal-route li.on .mini { background: #fff; }
.pal-route .mini .pal-art { width: 48px; height: 48px; object-fit: contain; }
.pal-route .ok, .pal-route .lock, .pal-route .now { justify-self: end; }
.pal-route .ok, .pal-route .lock {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
}
.pal-route .ok { background: var(--ok); color: #fff; }
.pal-route .ok svg, .pal-route .lock svg { width: 16px; height: 16px; }
.pal-route .lock { color: var(--muted-2); }
.pal-route .now {
  height: 28px; padding: 0 10px; border-radius: 999px; background: var(--pop); color: #fff;
  font-style: normal; font-size: var(--fs-meta); font-weight: 700; white-space: nowrap;
  display: inline-flex; align-items: center;
}
.pal-today ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pal-today li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-weight: 700; }
.pal-today li i {
  width: 36px; height: 36px; border-radius: 50%; background: var(--fill); color: var(--muted);
  display: grid; place-items: center;
}
.pal-today li i svg { width: 18px; height: 18px; }
.pal-today li.done i.tick { background: var(--ok-soft); color: var(--ok); }
.pal-today li b { color: var(--pop); font-size: var(--fs-body); font-weight: 700; }
.pal-today p { margin: 10px 0 4px; color: var(--muted-2); font-size: var(--fs-meta); font-weight: 700; }
.pal-foot {
  flex: none; display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 0; color: var(--muted-2); font-size: var(--fs-meta); font-weight: 700;
}
.pal-foot svg { width: 16px; height: 16px; }
.pal-records { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 18px 20px; }
.pal-records ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pal-records li strong,
.pal-records li > b:first-of-type {
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: var(--lh-body);
}
.pal-records li {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: 14px; background: var(--pop-soft);
}
.pal-records b {
  color: var(--pop-deep);
  font-size: var(--fs-body);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pal-records small {
  color: var(--muted-2);
  font-size: var(--fs-meta);
  font-weight: 500;
  line-height: var(--lh-meta);
}
.pal-records p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: 500;
  line-height: var(--lh-meta);
}
@media (max-width: 860px) {
  html:has(.pal),
  body:has(.pal) { height: auto; overflow: auto; }
  .desk:has(.pal) { height: auto; max-height: none; overflow: auto; }
  main.pal { overflow: visible; }
  .pal-grid { grid-template-columns: 1fr; overflow: visible; }
  .pal aside, .pal-route { flex: none; min-height: auto; overflow: visible; }
  .pal-head h2 { font-size: var(--fs-page); }
  .pal-top h1 { font-size: var(--fs-name); }
  .pal-log { height: 40px; padding: 0 12px; font-size: var(--fs-meta); }
  .pal-hero { padding-right: 148px; }
  .pal-hero .say { white-space: normal; max-width: 136px; }
}

html:has(.route),
body:has(.route) { height: 100%; overflow: hidden; }
.desk:has(.route) {
  height: 100dvh; max-height: 100dvh; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
}
.route {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto; flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px 0 12px; color: var(--ink);
}
.route-top {
  display: flex; align-items: center; gap: 14px;
  flex: none; min-height: 58px;
}
.route-title { text-align: left; min-width: 0; }
.route-top h1 { margin: 0; font-size: var(--fs-page); font-weight: 700; letter-spacing: 0; line-height: 1.1; }
.route-title p { margin: 4px 0 0; color: var(--muted); font-size: var(--fs-meta); font-weight: 700; }
.route-sum { margin: 0 0 0 auto; color: var(--muted); font-size: var(--fs-meta); font-weight: 700; }
.route-sum b { margin-left: 6px; color: var(--ink); font-size: var(--fs-page); font-weight: 700; }
.route-row {
  flex: 1 1 auto; min-height: 0;
  display: flex; align-items: stretch; gap: 8px;
}
.route-card {
  flex: 1 1 0; min-width: 0; min-height: 0;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: var(--pad-card); border-radius: var(--radius-dialog); background: var(--card);
  box-shadow: var(--shadow-soft);
}
.route-card.is-now { box-shadow: inset 0 0 0 2px var(--pop), 0 10px 28px rgba(255, 118, 87, .08); }
.route-card small { color: var(--muted-2); font-size: var(--fs-label); font-weight: 700; }
.route-card h2 {
  margin: 4px 0 0;
  font-size: var(--fs-section);
  font-weight: 600;
  letter-spacing: 0;
  line-height: var(--lh-section);
}
.route-card > p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: var(--lh-label);
}
.route-fig {
  flex: 1 1 auto; min-height: 0; width: 100%;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 8px 0 0;
}
.route-fig .pal-art {
  width: auto; height: min(220px, 100%); max-width: 100%;
  object-fit: contain; object-position: center bottom;
}
.route-card em {
  margin-top: 8px; height: 32px; padding: 0 14px; border-radius: 999px;
  font-style: normal; font-size: var(--fs-meta); font-weight: 700;
  display: inline-flex; align-items: center; gap: 4px;
}
.route-card em svg { width: 14px; height: 14px; }
.route-card em.now { background: var(--pop); color: #fff; }
.route-card em.open { background: var(--ok-soft); color: var(--ok); }
.route-card em.shut { background: var(--fill); color: var(--muted-2); }
.route-card .need {
  margin: 10px 0 0; width: 100%; height: 44px;
  display: grid; place-items: center;
  color: var(--muted-2); font-size: var(--fs-meta); font-weight: 700;
}
.route-card button {
  margin-top: 10px; width: 100%; height: 44px; border-radius: 999px;
  background: #fff; color: var(--ink); font-size: var(--fs-label); font-weight: 700;
  box-shadow: inset 0 0 0 1.5px var(--border);
}
.route-card .using,
.route-card .using:disabled {
  opacity: 1; cursor: default; background: var(--fill); color: var(--muted-2); box-shadow: none;
}
.route-next { flex: none; align-self: center; display: grid; place-items: center; color: var(--border); }
.route-next svg { width: 18px; height: 18px; }
.route-now {
  flex: none; background: var(--card); border-radius: 24px;
  padding: 16px 18px 14px; box-shadow: var(--shadow-soft);
}
.route-now-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.route-now-top b { font-size: var(--fs-body); font-weight: 700; }
.route-now-top span { color: var(--muted); font-size: var(--fs-meta); font-weight: 700; }
.route-now-top strong { color: var(--ink); font-size: var(--fs-dialog); font-weight: 700; }
.route-now-bar { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.route-now-bar i {
  flex: 1 1 auto; display: block; height: 14px; border-radius: 999px;
  background: var(--fill); overflow: hidden;
}
.route-now-bar em { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pop), var(--pop)); }
.route-go {
  flex: none;
  height: var(--btn-h);
  min-height: var(--btn-h);
  padding: 0 22px;
  border-radius: var(--radius-btn);
  background: var(--pop-deep);
  color: #fff;
  font-size: var(--fs-btn);
  font-weight: 600;
  line-height: var(--lh-btn);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow);
}
.route-go svg { width: 20px; height: 20px; }
.route-now > p { margin: 8px 0 0; color: var(--muted); font-size: var(--fs-meta); font-weight: 700; }
@media (max-width: 980px) {
  html:has(.route),
  body:has(.route) { height: auto; overflow: auto; }
  .desk:has(.route) { height: auto; max-height: none; overflow: auto; }
  .route { width: min(1120px, calc(100% - 16px)); overflow: visible; }
  .route-row { flex-wrap: wrap; }
  .route-card { flex: 1 1 calc(50% - 20px); }
  .route-next { display: none; }
  .route-top h1 { font-size: var(--fs-name); }
  .route-sum b { font-size: var(--fs-dialog); }
}

html:has(.growth),
body:has(.growth) { height: 100%; overflow: hidden; }
.desk:has(.growth) {
  height: 100dvh; max-height: 100dvh; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
  background: #f7f2ea;
}
.growth {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto; flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; gap: 14px;
  padding: 16px 0 18px; color: var(--ink);
}
.growth-top { flex: none; display: flex; align-items: center; gap: 14px; min-height: 58px; }
.growth-top .pal-back { flex: none; }
.growth-title { min-width: 0; }
.growth-top h1 { margin: 0; font-size: var(--fs-page); font-weight: 700; letter-spacing: 0; line-height: 1.15; }
.growth-top p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-meta); font-weight: 700; }
.growth-hero {
  flex: none; display: grid; grid-template-columns: minmax(220px, .95fr) minmax(240px, 1.05fr) auto;
  align-items: center; gap: 8px 18px;
  padding: 12px 22px 12px 14px; border-radius: 24px; background: #fff;
  box-shadow: var(--shadow-soft);
}
.growth-who { display: flex; align-items: center; gap: 6px; min-width: 0; }
.growth-who .pal-art { height: 96px; width: auto; max-width: 112px; object-fit: contain; }
.growth-who h2 { margin: 0; font-size: var(--fs-page); font-weight: 700; letter-spacing: 0; line-height: 1.2; }
.growth-meter { display: grid; gap: 4px; min-width: 0; }
.growth-meter small { color: var(--muted); font-size: var(--fs-meta); font-weight: 700; }
.growth-num { margin: 0; color: var(--muted-2); font-size: var(--fs-body); font-weight: 700; line-height: 1; }
.growth-num b { color: var(--pop); font-size: var(--fs-stat); font-weight: 700; margin-right: 2px; }
.growth-bar { display: flex; align-items: center; gap: 10px; }
.growth-bar i {
  flex: 1 1 auto; display: block; height: 10px; border-radius: 999px;
  background: var(--fill); overflow: hidden;
}
.growth-bar em { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pop), var(--pop)); }
.growth-bar span { flex: none; color: var(--muted-2); font-size: var(--fs-meta); font-weight: 700; }
.growth-days { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-label); font-weight: 700; }
.growth-days b { color: var(--pop); font-size: var(--fs-body); font-weight: 700; }
.growth-side {
  display: grid; justify-items: center; align-content: center; gap: 8px;
  min-width: 196px; padding-left: 22px; border-left: 1px solid var(--border);
}
.growth-route {
  height: 46px; padding: 0 16px 0 18px; border-radius: 999px;
  background: #fff; color: var(--pop);
  box-shadow: inset 0 0 0 1.5px #ffb5a0;
  display: inline-flex; align-items: center; gap: 2px;
  font-size: var(--fs-label); font-weight: 700;
}
.growth-route svg { width: 18px; height: 18px; }
.growth-side p { margin: 0; color: var(--muted-2); font-size: var(--fs-meta); font-weight: 700; text-align: center; }
.growth-main {
  flex: 1 1 auto; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .72fr);
  gap: 14px;
}
.growth-board, .growth-miles {
  min-height: 0; background: #fff; border-radius: 24px;
  box-shadow: var(--shadow-soft);
}
.growth-board { display: flex; flex-direction: column; padding: 16px 18px 12px; overflow: hidden; }
.growth-miles { display: flex; flex-direction: column; padding: 16px 16px 12px; }
.growth-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.growth-board h2, .growth-miles h2 { margin: 0; font-size: var(--fs-dialog); font-weight: 700; letter-spacing: 0; }
.growth-tabs { display: flex; align-items: center; gap: 2px; }
.growth-tabs button {
  height: 34px; padding: 0 14px; border-radius: 999px;
  color: var(--muted); font-size: var(--fs-meta); font-weight: 700;
}
.growth-tabs button.on { background: var(--pop-soft); color: var(--pop); }
.growth-empty { margin: 18px 4px 8px; color: var(--muted); font-size: var(--fs-meta); font-weight: 700; }
.growth-feed {
  list-style: none; margin: 6px 0 0; padding: 0;
  flex: 1 1 auto; min-height: 0; overflow: auto;
}
.growth-feed li {
  position: relative;
  display: grid; grid-template-columns: 72px 44px minmax(0, 1fr) auto;
  gap: 4px 12px; align-items: center;
  padding: 11px 4px;
}
.growth-feed li::before {
  content: ""; position: absolute; left: 105px; top: 0; bottom: 0; width: 2px;
  background: var(--pop-soft); z-index: 0;
}
.growth-feed li:first-child::before { top: 50%; }
.growth-feed li:last-child::before { bottom: 50%; }
.growth-feed time { display: grid; justify-items: end; line-height: 1.25; font-weight: 700; }
.growth-feed time b { color: var(--ink); font-size: var(--fs-meta); font-weight: 600; }
.growth-feed time small { color: var(--muted-2); font-size: var(--fs-meta); font-weight: 500; }
.growth-feed .mark {
  position: relative; z-index: 1;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
}
.growth-feed .mark svg { width: 20px; height: 20px; }
.growth-feed .kind-practice .mark { background: var(--pop); }
.growth-feed .kind-master .mark { background: var(--ok); }
.growth-feed .kind-meet .mark { background: #6eb0f2; }
.growth-feed .kind-note .mark { background: var(--pop); }
.growth-feed .kind-evolve .mark { background: var(--pop-soft); overflow: hidden; }
.growth-feed .kind-evolve .mark .pal-art { width: 38px; height: 38px; object-fit: contain; }
.growth-feed .txt { min-width: 0; }
.growth-feed .txt > b { display: inline; font-size: var(--fs-body); font-weight: 600; line-height: var(--lh-body); }
.growth-feed .txt p { margin: 2px 0 0; color: var(--muted-2); font-size: var(--fs-meta); font-weight: 500; line-height: var(--lh-meta); }
.growth-badge {
  display: inline-flex; align-items: center; margin-left: 8px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  background: var(--ok-soft); color: var(--ok);
  font-style: normal; font-size: var(--fs-tag); font-weight: 700; vertical-align: 1px;
}
.growth-feed .gain {
  min-width: 4.8em; text-align: right; color: var(--pop-deep);
  font-style: normal; font-size: var(--fs-body); font-weight: 600;
  line-height: var(--lh-body); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.growth-miles ol {
  list-style: none; margin: 12px 0 0; padding: 0 0 0 18px; position: relative;
  display: grid; gap: 8px; align-content: start;
}
.growth-miles ol::before {
  content: ""; position: absolute; left: 4px; top: 28px; bottom: 28px;
  border-left: 2px dashed var(--border);
}
.growth-miles li {
  position: relative;
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 28px;
  gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 16px;
}
.growth-miles li::before {
  content: ""; position: absolute; left: -18px; top: 50%;
  width: 10px; height: 10px; transform: translateY(-50%);
  border-radius: 50%; background: var(--border);
  box-shadow: 0 0 0 3px #fff;
}
.growth-miles li.open::before { background: var(--ok); }
.growth-miles li.now::before { background: var(--warn); }
.growth-miles li.now { background: var(--pop-soft); }
.growth-miles .ico {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden; background: var(--fill);
}
.growth-miles .ico.sprout { background: var(--ok-soft); color: var(--ok); }
.growth-miles .ico.sprout svg { width: 24px; height: 24px; }
.growth-miles .ico .pal-art { width: 40px; height: 40px; object-fit: contain; }
.growth-miles li.shut .ico { background: var(--fill); }
.growth-miles li.shut .pal-art { filter: grayscale(1); opacity: .5; }
.growth-miles li.now .ico { background: #fff; }
.growth-miles li b { display: block; font-size: var(--fs-body); font-weight: 600; line-height: var(--lh-body); }
.growth-miles li small { color: var(--muted); font-size: var(--fs-label); font-weight: 500; line-height: var(--lh-label); }
.growth-miles .yes, .growth-miles .lock {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
}
.growth-miles .yes svg, .growth-miles .lock svg { width: 15px; height: 15px; }
.growth-miles .yes.done { background: var(--ok); color: #fff; }
.growth-miles .yes.here { background: var(--pop); color: #fff; }
.growth-miles .lock { color: var(--muted-2); }
.growth-miles > p { margin: 12px 0 2px; text-align: center; color: var(--muted-2); font-size: var(--fs-meta); font-weight: 700; }
@media (max-width: 980px) {
  html:has(.growth),
  body:has(.growth) { height: auto; overflow: auto; }
  .desk:has(.growth) { height: auto; max-height: none; overflow: auto; }
  .growth { width: min(1120px, calc(100% - 16px)); overflow: visible; }
  .growth-hero, .growth-main { grid-template-columns: 1fr; }
  .growth-side { border-left: 0; border-top: 1px solid var(--border); padding: 12px 0 0; min-width: 0; }
  .growth-top h1, .growth-who h2 { font-size: var(--fs-name); }
  .growth-feed { overflow: visible; }
}
.license-gate {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px;
}
.license-gate section {
  width: min(440px, 100%); background: #fff; border-radius: 28px;
  padding: 28px 28px 24px; text-align: center;
  box-shadow: 0 16px 40px rgba(var(--ink-rgb), .12);
}
.license-gate img { width: 168px; height: auto; }
.license-gate h1 { margin: 12px 0 8px; font-size: var(--fs-page); font-weight: 700; }
.license-gate p { margin: 0 0 16px; color: var(--muted); font-size: var(--fs-label); font-weight: 700; }
.license-gate input {
  width: 100%; height: 52px; border: 0; border-radius: 16px; background: var(--fill);
  text-align: center; letter-spacing: .04em;
  font: 700 22px "Yuanti SC", "PingFang SC", "Hiragino Maru Gothic ProN", sans-serif;
}
.license-gate .err { min-height: 22px; margin: 10px 0; color: var(--err); }
.license-gate .go {
  height: var(--btn-h);
  min-height: var(--btn-h);
  margin-top: var(--space-4);
  padding: 0 24px;
  border-radius: var(--radius-btn);
  background: var(--pop-deep);
  color: #fff;
  font-size: var(--fs-btn);
  font-weight: 600;
  line-height: var(--lh-btn);
}
.license-gate .go:disabled { opacity: .6; }

/* —— 登录 / 注册（严格对齐设计稿，一屏内尽量不滚动） —— */
html:has(.auth-page),
body:has(.auth-page) {
  height: 100%;
  overflow: hidden;
}
.desk:has(.auth-page) {
  background: transparent;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
}
.auth-page {
  box-sizing: border-box;
  height: 100dvh;
  max-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 118, 87, .08), transparent 30%),
    linear-gradient(180deg, #FFFCF8 0%, var(--paper) 52%, var(--fill) 100%);
  font-family: var(--font);
  color: var(--ink);
}
.auth-card {
  width: min(var(--auth-max), 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  background: var(--card);
  border-radius: var(--radius-dialog);
  padding: var(--pad-card) var(--space-6) var(--space-4);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
}
.auth-brand { display: flex; justify-content: flex-start; margin-bottom: var(--space-3); }
.auth-logo { width: min(132px, 46%); height: auto; display: block; }
.auth-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-2);
  align-items: end;
  margin-bottom: var(--space-4);
  min-height: 0;
}
.auth-copy { min-width: 0; padding-bottom: 2px; }
.auth-copy h1 {
  margin: 0;
  font-size: var(--fs-page);
  font-weight: 700;
  letter-spacing: 0;
  line-height: var(--lh-page);
  color: var(--ink);
}
.auth-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: 500;
  line-height: var(--lh-meta);
}
.auth-buddy {
  width: 78px;
  height: 78px;
  object-fit: contain;
  display: block;
  margin-right: -4px;
  margin-bottom: -2px;
  filter: drop-shadow(0 6px 10px rgba(var(--ink-rgb), .1));
}
.auth-form { display: grid; gap: var(--space-4); }
.auth-field { display: grid; gap: var(--space-2); text-align: left; }
.auth-captcha {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: var(--space-3);
  align-items: end;
}
.auth-captcha .auth-field { min-width: 0; }
.auth-captcha .auth-box {
  height: var(--input-h);
  min-height: var(--input-h);
  box-sizing: border-box;
}
.auth-captcha-btn {
  width: 140px;
  height: var(--input-h);
  min-height: var(--input-h);
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--fill);
  box-sizing: border-box;
  overflow: hidden;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.auth-captcha-btn:disabled { opacity: .6; cursor: default; }
.auth-captcha-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.auth-captcha-img.is-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: 500;
  background: var(--fill);
}
.auth-label {
  font-size: var(--fs-label);
  font-weight: 600;
  line-height: var(--lh-label);
  color: var(--ink);
}
.auth-box {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--input-h);
  padding: 0 var(--space-4);
  border-radius: var(--radius-input);
  background: var(--fill);
  border: 1.5px solid transparent;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.auth-field.is-focus .auth-box,
.auth-box:focus-within {
  background: var(--card);
  border-color: var(--pop);
  box-shadow: 0 0 0 3px rgba(255, 118, 87, .16);
}
.auth-field.is-error .auth-box {
  border-color: var(--err);
  background: var(--err-soft);
}
.auth-ico {
  width: 20px;
  height: 20px;
  color: var(--muted-2);
  display: grid;
  place-items: center;
}
.auth-ico svg { width: 18px; height: 18px; display: block; }
.auth-box input {
  width: 100%;
  min-width: 0;
  height: calc(var(--input-h) - 8px);
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: var(--lh-body);
}
.auth-box input::placeholder { color: var(--muted-2); font-weight: 400; }
.auth-eye {
  width: 44px;
  height: 44px;
  margin: 0 -8px 0 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-2);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.auth-eye svg { width: 20px; height: 20px; }
.auth-eye:hover { color: var(--ink); background: rgba(var(--ink-rgb), .04); }
.auth-forgot {
  justify-self: end;
  margin: -4px 2px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: 500;
  cursor: pointer;
}
.auth-forgot:hover { color: var(--pop-deep); }
.auth-err {
  min-height: var(--lh-meta);
  margin: 0;
  color: var(--err);
  font-size: var(--fs-meta);
  font-weight: 500;
  line-height: var(--lh-meta);
  text-align: left;
}
.auth-err:empty { visibility: hidden; }
.auth-go {
  width: 100%;
  height: var(--btn-h);
  margin-top: 0;
  border: 0;
  border-radius: var(--radius-btn);
  background: var(--pop-deep);
  color: #fff;
  font-size: var(--fs-btn);
  font-weight: 600;
  line-height: var(--lh-btn);
  letter-spacing: 0;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.auth-go:hover { filter: brightness(1.03); }
.auth-go:active { transform: translateY(1px); }
.auth-go:disabled { opacity: .5; cursor: default; transform: none; }
.auth-switch {
  margin: 2px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: 500;
  line-height: var(--lh-meta);
}
.auth-switch button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--pop-deep);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.auth-hint {
  margin: 0;
  text-align: center;
  color: var(--muted-2);
  font-size: var(--fs-tag);
  font-weight: 500;
  line-height: var(--lh-tag);
}
.auth-foot {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted-2);
  font-size: var(--fs-tag);
  font-weight: 500;
  line-height: var(--lh-tag);
}
@media (max-width: 420px) {
  .auth-page { padding: var(--space-3); }
  .auth-card { padding: var(--space-4) var(--space-4) var(--space-3); }
  .auth-buddy { width: 68px; height: 68px; }
}
@media (max-height: 700px) {
  .auth-logo { width: min(112px, 40%); }
  .auth-buddy { width: 64px; height: 64px; }
  .auth-form { gap: var(--space-3); }
  .auth-box { min-height: 48px; height: 48px; }
  .auth-box input { height: 40px; }
  .auth-captcha .auth-box,
  .auth-captcha-btn {
    height: 48px;
    min-height: 48px;
  }
  .auth-go { height: 52px; }
  .auth-foot { margin-top: var(--space-3); padding-top: var(--space-2); }
}

/* UI V1.0：列表滚动区为底部导航预留 */
.studio .board,
.deeds-body,
.pal-records,
.grow .grow-map,
.grow .grow-detail {
  padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
}
.studio .dock,
.pal .dock {
  z-index: 20;
}
