:root {
  color-scheme: light;
  --ink: #352b39;
  --muted: #685f6a;
  --purple: #564266;
  --line: #ded9d1;
  --paper: #faf8f3;
  --cream: #fffdf8;
  --lavender: #e6deed;
  --focus: #60427e;
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
[hidden] { display: none !important; }
button, select, input, textarea { font: inherit; }
button, select { touch-action: manipulation; }
button { cursor: pointer; color: inherit; }
button:disabled, select:disabled { cursor: default; }
:where(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.skip-link { position: absolute; z-index: 20; left: 12px; top: -80px; background: white; padding: 12px; color: var(--ink); }
.skip-link:focus { top: 8px; }
.topbar { background: var(--cream); border-bottom: 1px solid var(--line); }
.topbar-inner, .learn-shell, .session-inner { width: min(1196px, calc(100% - clamp(40px, 8.6vw, 138px))); margin-inline: auto; }
.topbar-inner { height: 76px; display: flex; align-items: center; gap: clamp(24px, 5vw, 82px); }
.brand, .nav-link, .parents-button, .full-button, .start-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.brand { flex: none; background: none; border: 0; padding: 0; gap: 11px; color: #382d3c; font-size: 24px; font-weight: 800; letter-spacing: -1.35px; }
.brand img { display: block; width: 44px; height: 44px; }
.brand b { font-weight: 800; color: #715780; }
.learn-nav { align-self: stretch; display: flex; gap: 20px; }
.nav-link { position: relative; border: 0; background: transparent; padding: 0 7px; color: #605863; font-weight: 600; font-size: 14px; }
.nav-link .icon { width: 17px; height: 17px; }
.nav-link.current { color: #59446a; }
.nav-link.current::after { content: ""; height: 3px; border-radius: 2px 2px 0 0; position: absolute; bottom: 0; left: 5px; right: 5px; background: #8d759b; }
.parents-button { margin-left: auto; padding: 0 16px; min-height: 44px; border: 1px solid #d5ced5; border-radius: 12px; background: transparent; font-size: 14px; font-weight: 600; }
.parents-button:hover, .full-button:hover, .page-button:not(:disabled):hover { background: #eee8f0; border-color: #b6a7c0; }
.learn-shell { padding-block: 27px 38px; }
.welcome { isolation: isolate; overflow: hidden; position: relative; min-height: 230px; display: flex; align-items: center; border-radius: 23px; border: 1px solid #d8cde0; background: #e5dced; }
.welcome-content { max-width: 67%; padding: 24px clamp(23px, 3.2vw, 50px) 25px; z-index: 2; }
.status-tag { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #c7b9d1; background: #f2ecf6; border-radius: 99px; padding: 5px 10px; font-size: 12px; color: #53415f; line-height: 1.1; font-weight: 700; }
.status-tag i { width: 7px; height: 7px; border-radius: 50%; background: #74957a; box-shadow: 0 0 0 2px #e4e9dc; }
.status-tag[data-state="listening"] i { background: #42774e; }
.status-tag[data-state="paused"] i { background: #ba8744; }
.welcome h1 { font-size: clamp(36px, 3.85vw, 59px); line-height: 1.1; letter-spacing: -.062em; margin: 13px 0 6px; font-weight: 750; color: #3e3048; }
.welcome h1 em { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.075em; }
.welcome p { color: #5b5063; font-size: clamp(15px, 1.4vw, 19px); line-height: 1.42; margin: 0 0 18px; }
.start-button { min-height: 46px; border-radius: 11px; border: 1px solid #503c60; background: var(--purple); color: #fff; padding-inline: 18px 20px; font-size: 15px; font-weight: 700; box-shadow: 0 2px 0 #45344f; }
.start-button:hover { background: #49364f; }
.start-button .icon { width: 17px; height: 17px; }
.welcome-art { position: absolute; right: 0; bottom: 0; width: min(53%, 555px); height: 100%; object-fit: fill; pointer-events: none; z-index: 1; }
.learn-layout { margin-top: 30px; display: grid; grid-template-columns: minmax(0, 1fr) clamp(249px, 23vw, 318px); gap: clamp(24px, 3vw, 43px); align-items: start; }
.board-section { min-width: 0; outline: none; }
.board-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 18px; }
.board-heading h2 { font-size: clamp(25px, 2.45vw, 34px); letter-spacing: -.055em; font-weight: 750; line-height: 1.16; margin: 0 0 5px; }
.board-heading p { color: var(--muted); font-size: 14px; line-height: 1.45; margin: 0; }
.page-controls { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.page-button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid #d7d0cf; border-radius: 50%; background: var(--cream); color: #5e4d65; }
.page-button .icon { width: 16px; height: 16px; stroke-width: 2.3; }
.page-button:disabled { opacity: .43; }
.image-grid { display: grid; grid-template-columns: repeat(var(--columns,2), minmax(0, 1fr)); gap: clamp(12px, 1.3vw, 20px); }
.image-card {
  --surface: #f4e3d8; --edge: #e6d3c8;
  display: grid; grid-template-rows: minmax(74px, 1fr) auto; align-items: center; width: 100%; overflow: hidden;
  min-width: 0; min-height: 165px; padding: 4px 14px 10px; margin: 0; position: relative;
  background: var(--surface); border: 1px solid var(--edge); border-radius: 18px; text-align: left;
}
.image-card[data-palette="1"] { --surface: #e4ecdf; --edge: #d3ddce; }
.image-card[data-palette="2"] { --surface: #f3ead4; --edge: #e6dbbf; }
.image-card[data-palette="3"] { --surface: #dfeaf0; --edge: #cfdde5; }
.image-card[data-palette="4"] { --surface: #eae2ef; --edge: #dacee1; }
.image-card[data-palette="5"] { --surface: #f2e3e3; --edge: #e6d3d5; }
.image-card:not(:disabled):hover { border-color: #a68eac; box-shadow: inset 0 0 0 1px #b19bb7; }
.image-card[aria-pressed="true"], .image-card[data-active="true"] { border-color: #755388; box-shadow: inset 0 0 0 3px #8f6ea0; }
.image-card[data-active="true"] .sound-dot, .image-card[aria-pressed="true"] .sound-dot { background: #675076; color: white; }
.card-art { height: clamp(98px, 10.1vw, 141px); width: 100%; min-width: 0; min-height: 0; position: relative; align-self: center; display: grid; place-items: center; }
.card-art img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
.card-bottom { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding-left: 3px; }
.card-label { font-weight: 700; font-size: clamp(21px, 1.75vw, 28px); letter-spacing: -.055em; line-height: 1.1; overflow-wrap: anywhere; }
.sound-dot { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #ffffff91; color: #5e5361; display: grid; place-items: center; }
.sound-dot .icon { width: 15px; height: 15px; }
.glyph { padding-inline: 4px; font-family: Georgia, serif; font-style: italic; font-size: clamp(28px, 5vw, 64px); letter-spacing: -.07em; color: #65516d; text-align: center; }
.image-grid.compact .image-card { min-height: 117px; padding: 3px 9px 8px; border-radius: 14px; }
.image-grid.compact .card-art { height: clamp(62px, 7vw, 98px); }
.image-grid.compact .card-label { font-size: clamp(16px, 1.45vw, 23px); }
.image-grid.compact .sound-dot { width: 24px; height: 24px; }
.image-grid.compact .sound-dot .icon { width: 13px; height: 13px; }
.page-count { margin: 12px 0 0; text-align: center; color: #756c75; line-height: 1.3; font-size: 12px; }
.exercise-side { display: grid; gap: 15px; }
.setting-panel, .star-panel { border: 1px solid var(--line); border-radius: 18px; background: var(--cream); }
.setting-panel { padding: clamp(16px, 1.8vw, 25px); }
.panel-title { display: flex; align-items: center; gap: 10px; margin: 0 0 22px; font-size: 21px; font-weight: 700; letter-spacing: -.055em; }
.panel-symbol, .activity-symbol { flex: none; display: grid; place-items: center; border-radius: 10px; background: #eee8f3; color: #695377; }
.panel-symbol { width: 34px; height: 34px; }
.panel-symbol .icon { width: 19px; height: 19px; }
.setting-field label, .flow-field legend { display: block; padding: 0; font-size: 13px; font-weight: 700; color: #504650; margin-bottom: 8px; }
.select-wrap { position: relative; }
.select-wrap select { width: 100%; border: 1px solid #d6ced2; background: #fffdf9; color: var(--ink); border-radius: 9px; min-height: 46px; padding: 7px 31px 7px 12px; font-size: 15px; appearance: none; cursor: pointer; }
.select-wrap .icon { position: absolute; right: 13px; top: 16px; width: 15px; height: 15px; }
.flow-field { padding: 0; border: 0; margin: 20px 0 18px; }
.flow-buttons { display: grid; grid-template-columns: 1fr 1.15fr; padding: 3px; background: #f0ede9; border: 1px solid #e1dad5; border-radius: 10px; }
.flow-buttons button { min-width: 0; display: flex; justify-content: center; align-items: center; gap: 5px; border: 1px solid transparent; background: transparent; color: #685e68; padding: 9px 3px; min-height: 42px; border-radius: 7px; font-size: 12px; font-weight: 650; }
.flow-buttons button[aria-pressed="true"] { background: #e9e1ef; border-color: #cdbed6; color: #584367; }
.flow-buttons button:hover { color: var(--ink); }
.flow-buttons .icon { width: 16px; height: 16px; }
.full-button { background: none; border: 0; border-top: 1px solid #e6e1d9; border-radius: 0; width: 100%; padding: 13px 5px 0; min-height: 44px; color: #5e5560; font-size: 13px; font-weight: 600; }
.full-button .icon { width: 15px; height: 15px; }
.star-panel { display: flex; align-items: center; gap: 14px; padding: 16px 21px; background: #f7f0e2; border-color: #e8dfce; }
.star-illustration { width: 62px; flex: none; }
.star-illustration svg { display: block; }
.star-panel h2 { margin: 0 0 2px; font-size: 17px; line-height: 1.2; letter-spacing: -.045em; }
.star-panel p { margin: 0; display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: #716351; }
.star-panel strong { font-size: 24px; font-weight: 700; line-height: 1.12; color: #57432f; }
.pair-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 2vw, 24px); }
.pair-board h3 { font-size: 15px; margin: 0 0 10px; color: #5b4b63; }
.pair-board .image-grid { gap: 9px; }
.pair-board .image-card { min-height: 115px; padding: 2px 8px 8px; border-radius: 13px; }
.pair-board .card-art { height: clamp(56px, 6vw, 84px); }
.pair-board .card-label { font-size: clamp(15px, 1.2vw, 20px); }
.pair-board .sound-dot { width: 22px; height: 22px; }
.pair-board .sound-dot .icon { width: 12px; height: 12px; }
.step-view { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; background: #f4eff5; border: 1px solid #dfd4e4; border-radius: 12px; padding: 10px 12px; margin-bottom: 13px; }
.step-view strong { font-size: 14px; margin-right: 4px; }
.step-chip { display: inline-flex; gap: 4px; align-items: center; border-radius: 7px; padding: 5px 8px; font-size: 16px; }
.step-chip.active { color: #fff; background: #695378; }
.step-chip.added { box-shadow: inset 0 0 0 1.5px #9175a1; }
.step-chip img { width: 42px; height: 30px; object-fit: contain; }
.step-view .placeholder { color: var(--muted); }
.empty-board,.boot-message { background: #fff6db; border: 1px solid #e2d3ab; border-radius: 12px; padding: 15px 20px; line-height: 1.5; }
.speech-note { padding: 9px 13px; margin: 0 0 12px; border-left: 3px solid #b49ac2; border-radius: 3px; background: #f0eaf4; color: #56475d; font-size: 13px; line-height: 1.45; }
.boot-message { margin: 0 0 18px; }
body.has-session .learn-shell { padding-bottom: 112px; }
.session-bar { position: fixed; bottom: 0; left: 0; right: 0; background: #fffcf8; border-top: 1px solid #d9cfd9; box-shadow: 0 -3px 16px #40344712; z-index: 8; }
.session-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 11px max(11px, env(safe-area-inset-bottom)); }
.session-state { display: flex; align-items: center; gap: 11px; min-width: 0; }
.activity-symbol { width: 39px; height: 39px; }
.session-state strong, .session-state small { display: block; }
.session-state strong { font-size: 16px; }
.session-state small { font-size: 12px; margin-top: 2px; color: var(--muted); }
.session-actions { display: flex; gap: 6px; flex: none; }
.session-actions button { min-height: 47px; display: inline-flex; justify-content: center; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid #d9cfd9; border-radius: 9px; background: #fffdf8; font-size: 14px; font-weight: 650; }
.session-actions .icon { width: 16px; height: 16px; }
.session-actions .pause-button { background: #eae1ee; }
.session-actions .stop-button { color: #75453e; border-color: #ddc4bc; background: #f4e4dc; }
.session-actions button:hover { filter: brightness(.96); }
.session-actions button:disabled { opacity: .5; }
@media(min-width:1500px){ .learn-shell { padding-top: 32px; } .welcome { min-height:245px; } }
@media(max-width:900px){
  .topbar-inner,.learn-shell,.session-inner { width: calc(100% - 44px); }
  .learn-layout { gap: 20px; grid-template-columns: minmax(0,1fr) 241px; }
  .setting-panel { padding: 16px; }
  .welcome-art { width: 50%; } .image-card { min-height: 150px; }
  .pair-board .image-grid { grid-template-columns: 1fr; }
  .pair-board .image-card { grid-template-columns: minmax(44px, 35%) 1fr; grid-template-rows:auto; min-height:70px; }
  .pair-board .card-art { height:52px; }
  .pair-board .sound-dot { display:none; }
}
@media(max-width:730px){
  .learn-layout { grid-template-columns: 1fr; gap: 23px; }
  .exercise-side { display:grid; grid-template-columns: minmax(0,1.4fr) minmax(145px,.8fr); align-items: start; }
  .card-art { height: 113px; }
  .welcome { min-height: 210px; }
  .welcome-art { width: 50%; height: auto; }
  .topbar-inner { gap: 20px; }
  .learn-nav { gap: 4px; }
  .parents-button { padding-inline: 10px; }
  .brand { font-size:21px; gap:6px; }
  .brand img { width:38px; height:38px; }
  .nav-link { font-size:13px; }
  .session-inner { flex-wrap: wrap; gap: 7px; }
  .session-actions { flex: 1; justify-content: end; }
  .session-actions button { padding: 8px; }
  .pair-board .image-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .pair-board .image-card { display:grid; grid-template-columns:1fr; grid-template-rows:minmax(40px,1fr) auto; }
}
@media(max-width:540px){
  .topbar-inner,.learn-shell,.session-inner { width: calc(100% - 28px); }
  .topbar-inner { height: auto; min-height: 97px; display:grid; grid-template-columns:1fr auto; grid-template-rows:auto auto; gap:0 10px; padding-top:9px; }
  .brand { justify-self:start; } .parents-button { grid-column:2; grid-row:1; min-height:44px; font-size:13px; }
  .learn-nav { grid-row:2; grid-column:1/-1; gap:14px; }
  .nav-link { min-height:43px; padding-inline:6px; }
  .learn-shell { padding-top:15px; }
  .welcome { min-height:201px; border-radius:16px; align-items:flex-start; }
  .welcome-content { max-width:78%; padding:15px 0 17px 17px; }
  .welcome-art { width:68%; height:auto; bottom:0; right:-13%; }
  .welcome h1 { font-size:clamp(29px,7vw,37px); margin-top:12px; }
  .welcome p { font-size:14px; max-width:205px; margin-bottom:13px; }
  .status-tag { font-size:10px; padding:4px 8px; }
  .start-button { min-height:44px; font-size:14px; padding:0 13px; }
  .learn-layout { margin-top:22px; }
  .board-heading { margin-bottom:13px; }
  .board-heading h2 { font-size:25px; }
  .board-heading p { font-size:13px; }
  .page-controls { gap:3px; }
  .image-card { min-height:137px; padding:3px 8px 8px; border-radius:13px; }
  .card-art { height:93px; }
  .card-label { font-size:20px; } .sound-dot { width:24px; height:24px; }
  .image-grid { gap:10px; } .image-grid.compact { gap:6px; }
  .image-grid.compact .image-card { min-height:92px; padding:1px 3px 6px; border-radius:9px; grid-template-rows:minmax(42px,1fr) auto; }
  .image-grid.compact .card-art { height:47px; } .image-grid.compact .card-label { font-size:14px; } .image-grid.compact .sound-dot { display:none; }
  .exercise-side { grid-template-columns:1fr; }
  .star-panel { padding:11px 16px; } .star-illustration { width:50px; }
  .session-actions { justify-content:stretch; display:grid; grid-template-columns:repeat(4,1fr); flex-basis:100%; gap:4px; }
  .session-actions button { padding:4px 2px; font-size:12px; } .session-actions .icon { width:14px; }
  .session-inner { padding-top:7px; }
  .session-state { gap:8px; } .activity-symbol { width:30px; height:30px; }
  body.has-session .learn-shell { padding-bottom:140px; }
  .pair-board { gap:10px; } .pair-board .image-grid { gap:5px; }
  .pair-board .card-art { height:43px; } .pair-board .image-card { min-height:86px; padding:1px 3px 5px; }
  .pair-board .card-label { font-size:13px; }
}
@media(max-width:350px){
  .welcome-content { max-width:84%; } .welcome-art { right:-14%; }
  .card-art { height:80px; } .image-card { min-height:125px; }
  .session-actions button { flex-direction:column; gap:2px; }
}
@media(forced-colors:active){ .status-tag i,.nav-link.current::after { background:Highlight; } .image-card[data-active="true"],.image-card[aria-pressed="true"] { outline:3px solid Highlight; } }

#mic-live{display:grid;min-width:80px;max-width:175px;gap:2px;color:var(--ink);font-size:.77rem}#mic-live label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#mic-level{width:100%;height:13px}@media(max-width:730px){#mic-live{max-width:115px;margin-left:auto}}
