/* Pika AI Tutor — app styles. Tokens only (see tokens.css, Pika Design System). Light mode only, no emoji. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Nunito", system-ui, sans-serif;
  font-weight: var(--font-bold);
  font-size: 17px;
  line-height: 26px;
  color: var(--text-primary);
  background: var(--surface-bg);
  font-feature-settings: var(--font-features-default);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }
.app { min-height: 100%; display: flex; flex-direction: column; }

/* ---------- type helpers ---------- */
.overline { font-size: 11px; line-height: 1; font-weight: var(--font-bold); letter-spacing: .6px; text-transform: uppercase; color: var(--text-secondary); }
.label { font-size: 13px; line-height: 1; font-weight: var(--font-semibold); letter-spacing: .3px; color: var(--text-secondary); }
.micro { font-size: 11px; line-height: 1; font-weight: var(--font-bold); letter-spacing: .6px; color: var(--text-secondary); }
.title1 { font-size: 24px; line-height: 32px; font-weight: var(--font-extrabold); color: var(--text-heading); margin: 0; }
.title2 { font-size: 20px; line-height: 28px; font-weight: var(--font-extrabold); color: var(--text-heading); margin: 0; }
.display { font-size: 32px; line-height: 40px; font-weight: var(--font-black); color: var(--text-heading); margin: 0; }
.muted { color: var(--text-secondary); font-weight: var(--font-semibold); }
.caption { font-size: 14px; line-height: 20px; font-weight: var(--font-regular); color: var(--text-secondary); }
.numeric { font-feature-settings: var(--font-features-numeric); }

/* ---------- icons (Iconsax via mask, color = currentColor) ---------- */
.ic { display: inline-block; width: var(--icon-md); height: var(--icon-md); background: currentColor; flex: none;
      -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.ic.sm { width: var(--icon-sm); height: var(--icon-sm); }
.ic.lg { width: var(--icon-lg); height: var(--icon-lg); }

/* ---------- buttons: the 3D push-down is for buttons only ---------- */
.btn {
  --bg: var(--color-primary); --depth: var(--color-primary-shadow); --fg: var(--text-on-brand);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 50px; padding: 0 var(--space-5); border: 0; border-radius: var(--radius-xl);
  background: var(--bg); color: var(--fg); border-bottom: var(--button-depth) solid var(--depth);
  font-size: 15px; line-height: 20px; font-weight: var(--font-extrabold); letter-spacing: .8px; text-transform: uppercase;
  cursor: pointer; user-select: none; transition: transform var(--motion-fast) var(--ease-spring), border-bottom-width var(--motion-fast);
}
.btn:active { transform: translateY(3px); border-bottom-width: 1px; }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring-shadow); }
.btn[disabled] { --bg: var(--surface-disabled); --depth: var(--neutral-200); --fg: var(--text-disabled); cursor: not-allowed; }
.btn.lg { min-height: 60px; font-size: 17px; }
.btn.sm { min-height: 40px; padding: 0 var(--space-4); font-size: 13px; border-radius: var(--radius-lg); }
.btn.block { width: 100%; }
.btn.secondary { --bg: var(--surface-card); --depth: var(--neutral-200); --fg: var(--text-link); box-shadow: inset 0 0 0 2px var(--neutral-200); }
.btn.danger { --bg: var(--color-error); --depth: var(--color-error-shadow); }
.btn.reward { --bg: var(--color-reward); --depth: var(--color-reward-shadow); --fg: var(--text-on-warning); }
.btn.ghost { --bg: transparent; --depth: transparent; --fg: var(--text-secondary); border-bottom-width: 0; text-transform: none; letter-spacing: 0; font-size: 15px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: var(--radius-pill); border: 0; display: inline-flex; align-items: center; justify-content: center;
  background: var(--state-hover); color: var(--text-primary); cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--state-pressed); }
.icon-btn.on { background: var(--surface-primary); color: var(--cyan-600); }

/* ---------- golden soft card ---------- */
.card { background: var(--surface-soft); border: 1px solid var(--border-soft); box-shadow: var(--shadow-soft); border-radius: var(--radius-2xl); padding: var(--space-5); }
.card.white { background: var(--surface-card); box-shadow: var(--shadow-soft-on-white); }
.card.tight { padding: var(--space-4); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.input, select.input {
  height: 52px; padding: 0 var(--space-4); border-radius: var(--radius-xl); border: 1.5px solid var(--border-default);
  background: var(--surface-card); font-size: 17px; font-weight: var(--font-bold); color: var(--text-heading); outline: none; width: 100%;
}
.input::placeholder { color: var(--text-placeholder); font-weight: var(--font-semibold); }
.input:focus { border-color: var(--border-focus); box-shadow: var(--focus-ring-shadow); }
.error-text { color: var(--color-error); font-size: 14px; line-height: 20px; font-weight: var(--font-semibold); min-height: 20px; }

/* ---------- chips / segmented ---------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip {
  min-height: 44px; padding: 0 var(--space-4); border-radius: var(--radius-pill); border: 1.5px solid var(--border-default);
  background: var(--surface-card); color: var(--text-heading); font-size: 15px; font-weight: var(--font-extrabold); cursor: pointer;
  display: inline-flex; align-items: center; gap: var(--space-2);
}
.chip.selected { border-color: var(--cyan-400); color: var(--cyan-600); background: var(--surface-primary); box-shadow: var(--shadow-brand-sm); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: var(--z-header); display: flex; align-items: center; gap: var(--space-3);
          min-height: var(--header-height); padding: var(--space-2) var(--screen-padding); background: var(--glass-tint);
          backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--glass-border); }
.topbar .grow { flex: 1; min-width: 0; }
.topbar .t { font-size: 17px; line-height: 24px; font-weight: var(--font-extrabold); color: var(--text-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { height: 28px; color: var(--color-primary); }
.logo img { height: 28px; width: auto; }

/* ---------- auth ---------- */
.auth { flex: 1; display: grid; place-items: center; padding: var(--space-8) var(--screen-padding); }
.auth-card { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: var(--space-4); }
.auth-hero { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); text-align: center; }
.auth-hero img.mascot { width: 140px; height: 140px; object-fit: contain; }
.tabs { display: flex; background: var(--surface-sunken); border-radius: var(--radius-pill); padding: 4px; }
.tabs button { flex: 1; min-height: 44px; border: 0; border-radius: var(--radius-pill); background: transparent; font-weight: var(--font-extrabold); font-size: 15px; color: var(--text-secondary); cursor: pointer; }
.tabs button.active { background: var(--surface-card); color: var(--cyan-600); box-shadow: var(--shadow-soft-sm); }

/* ---------- home ---------- */
.page { width: 100%; max-width: 1080px; margin: 0 auto; padding: var(--space-6) var(--screen-padding) var(--space-12); display: flex; flex-direction: column; gap: var(--space-6); }
.hero { display: flex; align-items: center; gap: var(--space-5); }
.hero img { width: 112px; height: 112px; object-fit: contain; flex: none; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.stat { display: flex; align-items: center; gap: var(--space-3); }
.stat .circle { width: 48px; height: 48px; border-radius: var(--radius-pill); display: grid; place-items: center; flex: none; }
.stat .num { font-size: 24px; line-height: 28px; font-weight: var(--font-black); color: var(--neutral-900); }
.c-cyan { background: var(--surface-primary); color: var(--cyan-500); }
.c-amber { background: var(--icon-amber-bg); color: var(--icon-amber); }
.c-coral { background: var(--icon-coral-bg); color: var(--icon-coral); }
.c-lime { background: var(--icon-lime-bg); color: var(--icon-lime); }
.c-indigo { background: var(--icon-indigo-bg); color: var(--icon-indigo); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.mode { display: flex; align-items: center; gap: var(--space-4); text-align: left; cursor: pointer; border: 1px solid var(--border-soft); transition: transform var(--motion-fast); }
.mode:hover { transform: translateY(-2px); }
.mode.selected { border-color: var(--cyan-400); box-shadow: var(--shadow-brand-sm); }
.mode .circle { width: 56px; height: 56px; border-radius: var(--radius-pill); display: grid; place-items: center; flex: none; }
.mode .mt { font-size: 17px; line-height: 24px; font-weight: var(--font-extrabold); color: var(--text-heading); }
.mode .md { font-size: 14px; line-height: 20px; font-weight: var(--font-semibold); color: var(--text-secondary); margin-top: 2px; }
.start-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); justify-content: space-between; }
.list { display: flex; flex-direction: column; gap: var(--space-2); }
.row { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-4); cursor: pointer; box-shadow: var(--shadow-soft-sm); color: var(--text-secondary); }
.row .rt { font-size: 15px; line-height: 22px; font-weight: var(--font-extrabold); color: var(--text-heading); }
.row .rd { font-size: 13px; line-height: 18px; font-weight: var(--font-semibold); color: var(--text-secondary); }
.row .grow { flex: 1; min-width: 0; }
.empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); padding: var(--space-6); text-align: center; }
.empty img { width: 96px; height: 96px; object-fit: contain; }

/* ---------- learning session ---------- */
.session { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: var(--space-4); padding: var(--space-4) var(--screen-padding);
           max-width: 1600px; width: 100%; margin: 0 auto; min-height: 0; height: calc(100vh - var(--header-height) - 16px); }
.board-card { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-5) var(--space-3); border-bottom: 1px solid var(--neutral-100); }
.board { flex: 1; overflow-y: auto; padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); scroll-behavior: smooth; }
.side { display: flex; flex-direction: column; gap: var(--space-3); min-height: 0; }
.cam-card { padding: var(--space-3); }
.cam-wrap { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--neutral-800); aspect-ratio: 4 / 3; }
.cam-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-off { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--text-inverse); padding: var(--space-4); }
.cam-badge { position: absolute; top: var(--space-2); left: var(--space-2); padding: 6px 10px; border-radius: var(--radius-pill); background: var(--surface-overlay); color: var(--text-inverse); }
.cam-actions { display: flex; gap: var(--space-2); margin-top: var(--space-3); flex-wrap: wrap; }
.cam-actions .btn { flex: 1; }
.switch { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; font-size: 14px; font-weight: var(--font-bold); color: var(--text-secondary); }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: var(--radius-pill); background: var(--neutral-300); position: relative; cursor: pointer; transition: background var(--motion-normal); flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: var(--radius-pill); background: var(--white); box-shadow: var(--shadow-raised); transition: transform var(--motion-normal) var(--ease-spring); }
.switch input:checked { background: var(--color-primary); }
.switch input:checked::after { transform: translateX(18px); }

.chat-card { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.chat { flex: 1; overflow-y: auto; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.msg { max-width: 88%; padding: var(--space-2) var(--space-3); border-radius: var(--radius-lg); font-size: 15px; line-height: 22px; animation: pop var(--motion-normal) var(--ease-spring); word-wrap: break-word; }
.msg.tutor { align-self: flex-start; background: var(--surface-card); border: 1px solid var(--neutral-100); color: var(--text-primary); }
.msg.user { align-self: flex-end; background: var(--surface-primary); color: var(--neutral-800); border: 1px solid var(--cyan-100); }
.msg.pending { border-style: dashed; color: var(--text-secondary); }
.msg.caption-live { align-self: flex-end; background: transparent; border: 1.5px dashed var(--cyan-200); color: var(--text-secondary); }
.msg.bc { align-self: flex-start; background: transparent; color: var(--text-secondary); font-size: 13px; line-height: 18px; padding: 0 var(--space-2); font-weight: var(--font-semibold); }
.msg.notice { align-self: center; background: var(--surface-sunken); color: var(--text-secondary); font-size: 13px; line-height: 18px; font-weight: var(--font-semibold); }
.msg img { border-radius: var(--radius-md); max-height: 160px; }
.msg.speaking { border-color: var(--cyan-400); box-shadow: var(--shadow-brand-sm); }
.composer { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3); border-top: 1px solid var(--neutral-100); background: var(--surface-card); }
.composer .input { height: 48px; flex: 1; min-width: 0; font-size: 15px; }
.mic-dock { display: flex; align-items: center; gap: var(--space-3); }
.mic-btn { width: 64px; min-width: 64px; min-height: 60px; padding: 0; border-radius: var(--radius-pill); }
.mic-btn.off { --bg: var(--surface-card); --depth: var(--neutral-200); --fg: var(--text-secondary); box-shadow: inset 0 0 0 2px var(--neutral-200); }
.level { flex: 1; height: 8px; border-radius: var(--radius-pill); background: var(--neutral-150); overflow: hidden; }
.level > i { display: block; height: 100%; width: 0; background: var(--color-primary); border-radius: var(--radius-pill); transition: width 80ms linear; }

.status { display: inline-flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-3); min-height: 32px; border-radius: var(--radius-pill); background: var(--surface-sunken); color: var(--text-secondary); font-size: 13px; font-weight: var(--font-extrabold); white-space: nowrap; }
.status .dot { width: 10px; height: 10px; border-radius: var(--radius-pill); background: currentColor; }
.status.listening { background: var(--surface-success); color: var(--green-500); }
.status.listening .dot { animation: pulse 1.4s infinite; }
.status.thinking { background: var(--surface-warning); color: var(--orange-500); }
.status.thinking .dot { animation: blink .8s infinite alternate; }
.status.speaking { background: var(--surface-primary); color: var(--cyan-600); }
.status.speaking .dot { animation: pulse .7s infinite; }
.timer { font-feature-settings: var(--font-features-numeric); color: var(--text-secondary); font-size: 15px; }

/* ---------- board blocks ---------- */
.blk { animation: rise var(--motion-slow) var(--ease-in-signature); }
.blk-title { font-size: 20px; line-height: 28px; font-weight: var(--font-black); color: var(--text-heading); margin: 0; }
.blk-text { font-size: 17px; line-height: 26px; color: var(--text-primary); margin: 0; }
.blk-text.note { color: var(--text-secondary); font-weight: var(--font-semibold); }
.blk-text.hint, .blk-text.success, .blk-text.warning { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius-xl); background: var(--surface-card); box-shadow: var(--shadow-soft-sm); }
.blk-text .chip-ic { width: 32px; height: 32px; border-radius: var(--radius-pill); display: grid; place-items: center; color: var(--white); flex: none; }
.blk-text.hint .chip-ic { background: var(--color-reward); }
.blk-text.success .chip-ic { background: var(--color-correct); }
.blk-text.warning .chip-ic { background: var(--color-warning); }
.blk-problem { padding: var(--space-4) var(--space-5); border-radius: var(--radius-xl); background: var(--surface-card); border: 1.5px solid var(--cyan-100); }
.blk-problem .body { margin-top: var(--space-2); font-size: 17px; line-height: 28px; color: var(--text-heading); }
.blk-plan { padding: var(--space-4) var(--space-5); border-radius: var(--radius-xl); background: var(--surface-card); box-shadow: var(--shadow-soft-sm); }
.plan-steps { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.plan-steps li { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-2) var(--space-3); border-radius: var(--radius-lg); transition: background var(--motion-normal); }
.plan-steps .dot { width: 28px; height: 28px; border-radius: var(--radius-pill); display: grid; place-items: center; flex: none; margin-top: 1px;
                   background: var(--neutral-100); color: var(--text-secondary); font-size: 13px; font-weight: var(--font-black); }
.plan-steps .body { flex: 1; min-width: 0; }
.plan-steps .st { font-size: 16px; line-height: 26px; font-weight: var(--font-bold); color: var(--text-heading); }
.plan-steps .res { font-size: 15px; line-height: 24px; color: var(--green-500); font-weight: var(--font-bold); }
.plan-steps .res:empty { display: none; }
.plan-steps li.todo .st { color: var(--text-secondary); }
.plan-steps li.current { background: var(--surface-primary); }
.plan-steps li.current .dot { background: var(--color-primary); color: var(--white); animation: pulse 1.4s infinite; }
.plan-steps li.done .dot { background: var(--color-correct); color: var(--white); }
.plan-steps li.error { background: var(--surface-error); }
.plan-steps li.error .dot { background: var(--color-error); color: var(--white); }
.plan-steps li.pulse-once { animation: pop var(--motion-normal) var(--ease-spring); }
/* sub-questions under a step: question, formula/hint, the answer once the student finds it */
.plan-steps .asks { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.plan-steps .asks:empty { display: none; }
.plan-steps .asks > li { display: block; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
                         background: var(--surface-card); border-left: 3px solid var(--color-primary); }
.plan-steps .asks > li.answered { border-left-color: var(--color-correct); }
.plan-steps .asks .q { font-size: 15px; line-height: 22px; font-weight: var(--font-bold); color: var(--text-heading); }
.plan-steps .asks .q:empty, .plan-steps .asks .hint:empty, .plan-steps .asks .a:empty { display: none; }
.plan-steps .asks .hint { margin-top: var(--space-1); padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm);
                          background: var(--surface-warning); color: var(--text-primary); font-size: 14px; line-height: 22px; }
.plan-steps .asks .hint::before { content: "Gợi ý: "; font-weight: var(--font-extrabold); color: var(--orange-500); }
.plan-steps .asks .a { margin-top: var(--space-1); font-size: 15px; line-height: 22px; font-weight: var(--font-bold); color: var(--green-500); }
.plan-steps .asks .a::before { content: "→ "; }
.blk-plan .conclude { display: flex; gap: var(--space-3); align-items: flex-start; margin-top: var(--space-3); padding: var(--space-3) var(--space-4);
                      border-radius: var(--radius-lg); background: var(--surface-success); color: var(--text-heading); font-size: 16px; line-height: 24px; font-weight: var(--font-bold); }
.blk-plan .conclude .chip-ic { width: 32px; height: 32px; border-radius: var(--radius-pill); display: grid; place-items: center; color: var(--white); background: var(--color-correct); flex: none; }
.blk-math { padding: var(--space-3) var(--space-4); border-radius: var(--radius-xl); background: var(--surface-card); box-shadow: var(--shadow-soft-sm); overflow-x: auto; }
.blk-math .lbl { margin-bottom: var(--space-2); }
.blk-steps { counter-reset: s; display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.blk-steps li { counter-increment: s; display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius-xl); background: var(--surface-card); box-shadow: var(--shadow-soft-sm); }
.blk-steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: var(--radius-pill); background: var(--surface-primary); color: var(--cyan-600); display: grid; place-items: center; font-size: 13px; font-weight: var(--font-black); flex: none; margin-top: 2px; }
.blk-steps .note { color: var(--text-secondary); font-size: 14px; line-height: 20px; font-weight: var(--font-semibold); }
.blk-svg { border-radius: var(--radius-xl); background: var(--surface-card); box-shadow: var(--shadow-soft-sm); padding: var(--space-3); }
.blk-svg svg { width: 100%; height: auto; display: block; }
.blk-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface-card); border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-soft-sm); font-size: 15px; }
.blk-table th { background: var(--surface-primary); color: var(--cyan-600); text-align: left; padding: var(--space-2) var(--space-3); font-weight: var(--font-extrabold); }
.blk-table td { padding: var(--space-2) var(--space-3); border-top: 1px solid var(--neutral-100); }
.blk-quiz { display: flex; flex-direction: column; gap: var(--space-3); }
.blk-quiz .q { font-size: 17px; line-height: 26px; font-weight: var(--font-extrabold); color: var(--text-heading); }
.opt { min-height: 56px; padding: var(--space-3) var(--space-4); border-radius: var(--radius-2xl); border: 1.5px solid var(--border-soft); background: var(--surface-card); box-shadow: var(--shadow-soft-sm);
       color: var(--text-heading); font-size: 17px; font-weight: var(--font-extrabold); text-align: left; cursor: pointer; transition: transform var(--motion-fast); }
.opt:active { transform: scale(.98); }
.opt.selected { border-color: var(--cyan-400); color: var(--cyan-600); background: color-mix(in srgb, var(--cyan-500) 8%, var(--surface-card)); box-shadow: var(--shadow-brand-sm); }
.photo { position: relative; border-radius: var(--radius-xl); overflow: hidden; background: var(--surface-card); box-shadow: var(--shadow-soft-sm); }
.photo img { width: 100%; }
.photo .box { position: absolute; border: 2.5px solid var(--neutral-400); border-radius: var(--radius-sm); }
.photo .box.ok { border-color: var(--color-correct); background: color-mix(in srgb, var(--green-500) 8%, transparent); }
.photo .box.error { border-color: var(--color-error); background: color-mix(in srgb, var(--red-500) 10%, transparent); }
.photo .box b { position: absolute; top: -12px; left: -12px; width: 24px; height: 24px; border-radius: var(--radius-pill); background: var(--neutral-500); color: var(--white); font-size: 12px; line-height: 24px; text-align: center; }
.photo .box.ok b { background: var(--color-correct); }
.photo .box.error b { background: var(--color-error); }
.photo .note { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--space-2) var(--space-3); background: var(--surface-overlay); color: var(--text-inverse); font-size: 14px; line-height: 20px; }
.board-empty { margin: auto; display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3); max-width: 360px; }
.board-empty img { width: 132px; height: 132px; object-fit: contain; }

/* ---------- toast / modal ---------- */
.toast { position: fixed; left: 50%; bottom: var(--space-6); transform: translateX(-50%); z-index: var(--z-toast); background: var(--neutral-800); color: var(--text-inverse);
         padding: var(--space-3) var(--space-5); border-radius: var(--radius-pill); font-size: 15px; box-shadow: var(--shadow-modal); animation: pop var(--motion-normal) var(--ease-spring); max-width: 90vw; }
.overlay { position: fixed; inset: 0; z-index: var(--z-modal); background: var(--surface-overlay); display: grid; place-items: center; padding: var(--space-4); }
.modal { width: 100%; max-width: 440px; background: var(--surface-card); border-radius: var(--radius-2xl); box-shadow: var(--shadow-modal); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); text-align: center; align-items: center; }
.modal img { width: 120px; height: 120px; object-fit: contain; }

/* ---------- history ---------- */
.history-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--space-4); align-items: start; }
.history-grid .board { padding: 0; overflow: visible; }

/* ---------- motion ---------- */
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes blink { from { opacity: .35; } to { opacity: 1; } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .session { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (max-width: 900px) {
  .session { grid-template-columns: 1fr; height: auto; }
  .board-card { min-height: 52vh; }
  .chat-card { min-height: 48vh; }
  .modes { grid-template-columns: 1fr; }
  .history-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .topbar { gap: var(--space-2); padding-left: var(--space-3); padding-right: var(--space-3); }
  .topbar .t { font-size: 15px; }
  .topbar .grow .micro { display: none; }
  .topbar .status { padding: 0 var(--space-2); }
  .topbar .status > span:last-child { display: none; }  /* colour + motion of the dot still show the state */
  .topbar .timer { font-size: 13px; }
  .topbar .btn.sm { padding-left: var(--space-3); padding-right: var(--space-3); }
  .stats { grid-template-columns: 1fr; }
  .hero img { width: 80px; height: 80px; }
  .display { font-size: 24px; line-height: 32px; }
}
