/* BetterSpanish — app styles. Tokens first; dark mode through prefers-color-scheme or [data-theme]. */
:root {
  --bg: #fbf6ee; --surface: #ffffff; --surface-2: #f6eddf; --ink: #2b2118; --muted: #76675a; --line: #eadfcf;
  --primary: #b94a33; --primary-d: #8f3724; --primary-t: #fbe6df;
  --saffron: #f2a93b; --saffron-d: #8a5a0c; --saffron-t: #fff1d6;
  --teal: #1f7a8c; --teal-d: #155966; --teal-t: #dff1f4;
  --good: #2a9460; --good-d: #1d7048; --good-t: #def3e8;
  --bad: #d04444; --bad-d: #a53030; --bad-t: #fde4e4;
  /* -d = text colour on the tinted -t background; --sh-* = the darker edge of raised buttons; --*-fill = backgrounds that carry white text (all >= 4.5:1) */
  --sh-primary: #8f3724; --sh-teal: #155966; --sh-saffron: #c9821a; --sh-good: #1d7048; --sh-bad: #a53030;
  --primary-fill: #b94a33; --teal-fill: #1f7a8c; --good-fill: #23805a; --saffron-fill: #8a5a0c; --bad-fill: #d04444;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 6px 20px rgba(60, 40, 20, .06);
  --r: 16px; --r-s: 12px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --nav-h: 64px; --side-w: 232px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17120e; --surface: #231c16; --surface-2: #2d241c; --ink: #f5ebdd; --muted: #b3a393; --line: #3a2f26;
    --primary: #e0674c; --primary-t: #432219;
    --saffron-t: #43320f; --teal: #46b2c6; --teal-t: #143740;
    --good: #43b980; --good-t: #153a29; --bad: #ee6a6a; --bad-t: #44201f;
    --primary-d: #f29480; --teal-d: #46b2c6; --saffron-d: #f2a93b; --good-d: #43b980; --bad-d: #ee6a6a;
    --sh-primary: #b84c34; --sh-teal: #2d8697; --sh-saffron: #c9821a; --sh-good: #2f8f61; --sh-bad: #c44;
    --primary-fill: #c0472e; --teal-fill: #1f7a8c; --good-fill: #1d7048; --saffron-fill: #8a5a0c; --bad-fill: #c13b3b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17120e; --surface: #231c16; --surface-2: #2d241c; --ink: #f5ebdd; --muted: #b3a393; --line: #3a2f26;
  --primary: #e0674c; --primary-t: #432219;
  --saffron-t: #43320f; --teal: #46b2c6; --teal-t: #143740;
  --good: #43b980; --good-t: #153a29; --bad: #ee6a6a; --bad-t: #44201f;
    --primary-d: #f29480; --teal-d: #46b2c6; --saffron-d: #f2a93b; --good-d: #43b980; --bad-d: #ee6a6a;
    --sh-primary: #b84c34; --sh-teal: #2d8697; --sh-saffron: #c9821a; --sh-good: #2f8f61; --sh-bad: #c44;
    --primary-fill: #c0472e; --teal-fill: #1f7a8c; --good-fill: #1d7048; --saffron-fill: #8a5a0c; --bad-fill: #c13b3b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .4em; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }
a { color: var(--teal-d); }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .tiny { font-size: .78rem; }
.center { text-align: center; } .row { display: flex; align-items: center; gap: 10px; } .grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 14px; } .wrap { flex-wrap: wrap; }
.es { font-weight: 700; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
#app { min-height: 100vh; min-height: 100dvh; }
.shell { display: block; }
.main { max-width: 780px; margin: 0 auto; padding: 18px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: flex; background: var(--surface); border-top: 1px solid var(--line); z-index: 20; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 700; }
.tabbar a .ic { font-size: 1.45rem; line-height: 1; filter: grayscale(.9) opacity(.75); }
.tabbar a.on { color: var(--primary); } .tabbar a.on .ic { filter: none; }
.sidebar { display: none; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.4rem; letter-spacing: -.02em; color: var(--primary); text-decoration: none; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.topbar .brand { font-size: 1.25rem; min-width: 0; }
.topbar > .row { flex-wrap: nowrap; min-width: 0; }
/* narrow phones (375 px): brand, streak, XP and sync chip must fit one line — the word mark gives way, the logo stays */
@media (max-width: 420px) { .topbar .brand-name { display: none; } .topbar .pill { padding: 5px 9px; font-size: .85rem; } }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-weight: 800; font-size: .9rem; white-space: nowrap; }
.pill.fire { color: #d9531e; } .pill.xp { color: var(--saffron-d); } .pill.sync { color: var(--teal-d); cursor: pointer; }
@media (min-width: 900px) {
  .tabbar { display: none; }
  .sidebar { display: flex; flex-direction: column; gap: 6px; position: fixed; inset: 0 auto 0 0; width: var(--side-w); padding: 22px 14px; background: var(--surface); border-right: 1px solid var(--line); z-index: 20; }
  .sidebar .brand { padding: 0 8px 14px; }
  .sidebar a.nav { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; text-decoration: none; color: var(--muted); font-weight: 800; letter-spacing: .02em; text-transform: uppercase; font-size: .86rem; border: 2px solid transparent; }
  .sidebar a.nav .ic { font-size: 1.35rem; }
  .sidebar a.nav:hover { background: var(--surface-2); }
  .sidebar a.nav.on { color: var(--primary); background: var(--primary-t); border-color: color-mix(in srgb, var(--primary) 35%, transparent); }
  .sidebar .foot { margin-top: auto; display: grid; gap: 8px; }
  .main { margin-left: max(var(--side-w), calc(50% - 390px + var(--side-w) / 2)); margin-right: auto; padding-bottom: 60px; width: min(780px, calc(100% - var(--side-w) - 24px)); }
  .topbar .brand { display: none; }
}

/* ---------- buttons ---------- */
.btn { --c: var(--primary-fill); --cd: var(--sh-primary); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 22px; border: 0; border-radius: 14px; background: var(--c); color: #fff; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; font-size: .92rem; box-shadow: 0 4px 0 var(--cd); transition: transform .06s, box-shadow .06s, filter .15s; text-decoration: none; user-select: none; }
.btn:hover { filter: brightness(1.05); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--cd); }
.btn:disabled { --c: var(--line); --cd: var(--line); color: var(--muted); cursor: not-allowed; box-shadow: none; transform: none; filter: none; }
.btn.good { --c: var(--good-fill); --cd: var(--sh-good); } .btn.teal { --c: var(--teal-fill); --cd: var(--sh-teal); } .btn.saffron { --c: var(--saffron); --cd: var(--sh-saffron); color: #3b2706; }
.btn.bad { --c: var(--bad-fill); --cd: var(--sh-bad); }
.btn.ghost { background: var(--surface); color: var(--primary); box-shadow: 0 4px 0 var(--line); border: 2px solid var(--line); }
.btn.ghost:disabled { background: var(--surface-2); }
.btn.sm { min-height: 38px; padding: 6px 14px; font-size: .8rem; border-radius: 12px; box-shadow: 0 3px 0 var(--cd); }
.btn.ghost.sm { box-shadow: 0 3px 0 var(--line); }
.btn.block { width: 100%; }
.btn.text { background: none; box-shadow: none; color: var(--teal-d); text-transform: none; letter-spacing: 0; padding: 6px 8px; min-height: 0; font-weight: 700; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-size: 1.15rem; padding: 0; }
.icon-btn:hover { background: var(--surface-2); }
.speak { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--teal-t); color: var(--teal-d); display: inline-grid; place-items: center; font-size: 1.05rem; flex: none; padding: 0; }
.speak:hover { filter: brightness(.96); } .speak.slow { font-size: .9rem; }
.speak.big { width: 76px; height: 76px; font-size: 2rem; background: var(--teal-fill); color: #fff; box-shadow: 0 5px 0 var(--sh-teal); }
.speak.playing { animation: pulse .9s infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card.flat { box-shadow: none; }
.card h3 { margin-bottom: .3em; }
.hero { background: linear-gradient(135deg, var(--primary-fill), color-mix(in srgb, var(--primary-fill) 70%, var(--saffron-fill))); color: #fff; border: 0; position: relative; overflow: hidden; }
.hero h2, .hero p { color: #fff; } .hero .muted { color: #ffe9e2; }
.hero::after { content: "☀"; position: absolute; right: -14px; top: -26px; font-size: 130px; opacity: .13; }
.hero .btn { --c: #fff; --cd: #e9c9bf; color: #8f3724; }
.grid { display: grid; gap: 12px; } .grid > * { min-width: 0; } .grid > .card + .card { margin-top: 0; } /* the grid gap spaces the cards: the stacked-card margin pushed every card but the first 12 px down */ .g2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); } .g3 { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.chip { display: inline-flex; gap: 5px; align-items: center; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 800; background: var(--surface-2); color: var(--muted); }
.chip.teal { background: var(--teal-t); color: var(--teal-d); } .chip.good { background: var(--good-t); color: var(--good-d); } .chip.saffron { background: var(--saffron-t); color: var(--saffron-d); } .chip.primary { background: var(--primary-t); color: var(--primary-d); }
.bar { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--good); border-radius: 99px; transition: width .35s; }
.bar.sm { height: 7px; } .bar.saffron > i { background: var(--saffron); } .bar.primary > i { background: var(--primary); }
.ring { --p: 0; --c: var(--good); width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0); position: relative; flex: none; }
.ring::before { content: ""; position: absolute; inset: 7px; background: var(--surface); border-radius: 50%; }
.ring > span { position: relative; font-weight: 900; font-size: .95rem; }
.stat { text-align: center; padding: 12px 8px; } .stat b { display: block; font-size: 1.5rem; font-weight: 900; } .stat span { font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: thin; }
.tabs button { flex: none; border: 2px solid var(--line); background: var(--surface); border-radius: 99px; padding: 6px 14px; font-weight: 800; font-size: .85rem; }
.tabs button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.empty { text-align: center; padding: 30px 14px; color: var(--muted); } .empty .big { font-size: 3rem; display: block; }

/* ---------- home / path ---------- */
.today { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.week { display: flex; gap: 6px; justify-content: space-between; margin-top: 10px; }
.week .d { flex: 1; text-align: center; font-size: .7rem; font-weight: 800; color: var(--muted); }
.week .d i { display: grid; place-items: center; width: 28px; height: 28px; margin: 0 auto 3px; border-radius: 50%; background: var(--line); font-style: normal; font-size: .8rem; }
.week .d.on i { background: var(--saffron); color: #3b2706; } .week .d.today i { outline: 2px solid var(--primary); outline-offset: 2px; }
.level-head { display: flex; align-items: center; gap: 12px; margin: 26px 0 10px; }
.level-badge { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-weight: 900; color: #fff; background: var(--teal-fill); font-size: 1.1rem; flex: none; }
.level-badge.A2 { background: var(--good-fill); } .level-badge.B1 { background: var(--saffron-fill); } .level-badge.B2 { background: var(--primary-fill); }
.units { display: grid; gap: 10px; }
.unit { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 12px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--r); text-decoration: none; color: inherit; }
.unit:hover:not(.locked) { border-color: var(--teal); }
.unit .em { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.7rem; background: var(--surface-2); }
.unit.current { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-t); } .unit.current .em { background: var(--primary-t); }
.unit.done .em { background: var(--good-t); } .unit.locked { opacity: .62; }
.unit h3 { margin: 0; font-size: 1rem; } .unit .sub { font-size: .82rem; color: var(--muted); }
.unit .bar { margin-top: 6px; }
.path { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 0 24px; }
.node { --o: 0px; position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; transform: translateX(var(--o)); text-decoration: none; color: inherit; width: 130px; text-align: center; }
.node .disc { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; font-size: 1.9rem; background: var(--primary-fill); color: #fff; box-shadow: 0 6px 0 var(--sh-primary); border: 0; transition: transform .08s; }
.node:active .disc { transform: translateY(4px); box-shadow: 0 2px 0 var(--sh-primary); }
.node.done .disc { background: var(--saffron); box-shadow: 0 6px 0 var(--sh-saffron); }
.node.locked .disc { background: var(--line); box-shadow: 0 6px 0 var(--line); filter: grayscale(1); opacity: .8; }
.node.weak .disc { background: var(--surface-2); color: var(--ink); border: 3px dashed var(--saffron); box-shadow: 0 6px 0 var(--sh-saffron); }
.node.test .disc { background: var(--teal-fill); box-shadow: 0 6px 0 var(--sh-teal); }
.node.next .disc { animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.node .lbl { font-weight: 800; font-size: .86rem; line-height: 1.15; } .node .lsub { font-size: .72rem; color: var(--muted); max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node .stars { font-size: .75rem; letter-spacing: 1px; color: var(--saffron-d); }
.node .start { position: absolute; top: -26px; background: var(--surface); border: 2px solid var(--line); border-radius: 10px; font-weight: 900; font-size: .72rem; padding: 2px 8px; color: var(--primary); text-transform: uppercase; }

/* ---------- lesson player ---------- */
.player { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; }
.p-top { display: flex; align-items: center; gap: 12px; padding: 12px 14px; max-width: 760px; width: 100%; margin: 0 auto; }
.p-top .bar { flex: 1; height: 14px; } .p-top .bar > i { background: var(--good); }
.p-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.p-inner { max-width: 760px; margin: 0 auto; padding: 8px 16px 40px; }
.p-foot { border-top: 2px solid var(--line); background: var(--surface); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.p-foot .in { max-width: 760px; margin: 0 auto; display: flex; gap: 12px; align-items: center; }
.p-foot .btn { flex: 1; }
.p-foot.good { background: var(--good-t); border-color: var(--good); } .p-foot.bad { background: var(--bad-t); border-color: var(--bad); }
.fb { max-width: 760px; margin: 0 auto 10px; display: grid; gap: 4px; }
.fb h3 { margin: 0; display: flex; align-items: center; gap: 8px; } .good .fb h3 { color: var(--good-d); } .bad .fb h3 { color: var(--bad-d); }
.fb .ans { font-weight: 800; } .fb .why { font-size: .92rem; }
.ex-title { font-size: 1.35rem; font-weight: 900; margin: 6px 0 14px; }
.ex-sub { color: var(--muted); font-weight: 700; margin: -8px 0 14px; }
.focus { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 2px solid var(--line); }
.focus .big { font-size: 1.5rem; font-weight: 900; } .focus .emo { font-size: 2.4rem; }
.opts { display: grid; gap: 10px; }
.opts.two { grid-template-columns: 1fr 1fr; } @media (max-width: 460px) { .opts.two { grid-template-columns: 1fr; } }
.opt { text-align: left; display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 14px; background: var(--surface); font-weight: 700; min-height: 54px; }
.opt .k { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; font-size: .75rem; font-weight: 900; color: var(--muted); flex: none; }
.opt:hover:not(:disabled) { background: var(--surface-2); }
.opt.sel { border-color: var(--teal); background: var(--teal-t); } .opt.sel .k { border-color: var(--teal); color: var(--teal-d); }
.opt.right { border-color: var(--good); background: var(--good-t); } .opt.wrong { border-color: var(--bad); background: var(--bad-t); }
.opt:disabled { cursor: default; }
.bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 6px 0; min-height: 58px; }
.line-area { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; min-height: 64px; padding: 8px 0; border-bottom: 2px solid var(--line); background: repeating-linear-gradient(transparent 0 49px, var(--line) 49px 51px); margin-bottom: 14px; }
.tile { padding: 8px 14px; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 12px; background: var(--surface); font-weight: 700; font-size: 1.02rem; user-select: none; }
.tile:hover:not(:disabled) { background: var(--surface-2); } .tile.ghost { visibility: hidden; }
.tile:disabled { cursor: default; }
.input { width: 100%; padding: 13px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 1.05rem; }
.input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-t); }
.input.right { border-color: var(--good); background: var(--good-t); } .input.wrong { border-color: var(--bad); background: var(--bad-t); }
textarea.input { min-height: 190px; resize: vertical; line-height: 1.55; }
.sentence { font-size: 1.25rem; font-weight: 700; line-height: 2.1; }
.sentence .gapin { display: inline-block; width: 8.5ch; min-width: 5ch; margin: 0 4px; padding: 2px 6px; border: 0; border-bottom: 3px solid var(--teal); background: var(--teal-t); border-radius: 8px 8px 0 0; font: inherit; text-align: center; }
.sentence .gapin.right { border-color: var(--good); background: var(--good-t); } .sentence .gapin.wrong { border-color: var(--bad); background: var(--bad-t); }
.sentence .blank { display: inline-block; line-height: 1.25; min-width: 4.5ch; border-bottom: 3px solid var(--ink); margin: 0 4px; text-align: center; color: var(--teal-d); }
.hintline { color: var(--muted); font-weight: 700; margin-bottom: 12px; }
.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; } .pairs .col { display: grid; gap: 10px; align-content: start; }
.pairs .opt { justify-content: center; text-align: center; }
.pairs .opt.done { opacity: .45; pointer-events: none; border-style: dashed; box-shadow: none; } /* matched pairs stay visible, greyed out */
.ttable { width: 100%; border-collapse: separate; border-spacing: 0 8px; } .ttable td { padding: 0 6px; } .ttable td:first-child { width: 36%; font-weight: 800; color: var(--muted); }
.tf { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.statement { font-size: 1.2rem; font-weight: 700; padding: 18px; border-radius: var(--r); background: var(--surface); border: 2px solid var(--line); margin-bottom: 16px; }
.teach { text-align: center; padding: 18px 8px; } .teach .emo { font-size: 4.2rem; line-height: 1.1; margin-bottom: 6px; }
.teach .word { font-size: 2.2rem; font-weight: 900; color: var(--primary); display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
.teach .tr { font-size: 1.35rem; font-weight: 700; margin: 6px 0 12px; } .teach .pos { margin: 0 0 10px; }
.teach .exbox { text-align: left; background: var(--surface); border: 2px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-top: 14px; }
.teach .note { text-align: left; margin-top: 12px; background: var(--saffron-t); border-radius: var(--r-s); padding: 10px 12px; font-size: .92rem; }
.bubbles { display: grid; gap: 10px; }
.bubble { max-width: 86%; padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--surface); border: 2px solid var(--line); }
.bubble.r { justify-self: end; background: var(--teal-t); border-color: transparent; border-radius: 18px 18px 6px 18px; }
.bubble .sp { font-size: .72rem; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.bubble .t { display: flex; gap: 8px; align-items: flex-start; } .bubble .en { font-size: .88rem; color: var(--muted); margin-top: 2px; }
.bubble.hl { outline: 3px solid var(--saffron); }
.passage p { font-size: 1.08rem; line-height: 1.75; } .passage .w { cursor: pointer; border-radius: 4px; border-bottom: 2px dotted var(--teal); } .passage .w:hover { background: var(--teal-t); }
.gloss { display: grid; gap: 8px; } .gloss .g { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.callout { padding: 12px 14px; border-radius: var(--r-s); background: var(--surface-2); margin: 10px 0; }
.audio-only { display: grid; place-items: center; gap: 12px; padding: 22px; text-align: center; }
.compare { width: 100%; box-sizing: border-box; margin: 0; } .compare-row { flex-wrap: wrap; justify-content: center; } .compare .btn.playing { border-color: var(--teal); }
.mic { width: 92px; height: 92px; border-radius: 50%; border: 0; background: var(--primary-fill); color: #fff; font-size: 2.3rem; box-shadow: 0 6px 0 var(--sh-primary); display: inline-grid; place-items: center; }
.mic.rec { background: var(--bad-fill); box-shadow: 0 6px 0 var(--sh-bad); animation: pulse 1s infinite; }
.meter { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; width: 220px; } .meter > i { display: block; height: 100%; width: 0; background: var(--good); }
.heard { min-height: 1.6em; font-weight: 700; color: var(--teal-d); }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.wc { font-weight: 800; } .wc.ok { color: var(--good-d); } .wc.low { color: var(--bad-d); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; opacity: .95; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
.summary { text-align: center; padding: 24px 8px; } .summary .big { font-size: 4.5rem; } .summary .stars { font-size: 2.4rem; letter-spacing: 6px; }
.summary .row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.summary .box { padding: 12px; border-radius: var(--r); border: 2px solid var(--line); background: var(--surface); } .summary .box b { display: block; font-size: 1.5rem; }
.ach-pop { display: flex; gap: 12px; align-items: center; text-align: left; margin: 10px 0; padding: 10px 14px; border-radius: var(--r); background: var(--saffron-t); border: 2px solid var(--saffron); }
.ach-pop .ic { font-size: 2rem; }

/* ---------- grammar blocks / reference ---------- */
.blocks > * + * { margin-top: 12px; }
.blocks p { margin: 0; line-height: 1.65; }
.blocks h4 { font-size: 1.05rem; color: var(--primary); margin: 18px 0 0; text-transform: none; }
.blocks table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 12px; overflow: hidden; font-size: .95rem; border: 1px solid var(--line); }
.blocks caption { text-align: left; font-weight: 800; color: var(--muted); padding: 0 0 6px; caption-side: top; font-size: .85rem; }
.blocks th, .blocks td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.blocks th { background: var(--surface-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.blocks tr:last-child td { border-bottom: 0; }
.tbl-wrap { overflow-x: auto; }
.cell { display: inline-flex; gap: 6px; align-items: flex-start; }
.cell .speak { width: 26px; height: 26px; font-size: .72rem; }
.exs { display: grid; gap: 6px; } .exi { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 10px; }
.exi .en { color: var(--muted); font-size: .9rem; }
.blocks ul { margin: 0; padding-left: 1.2em; } .blocks li { margin: 3px 0; }
.tip, .warn { padding: 10px 14px; border-radius: 12px; border-left: 5px solid; font-size: .96rem; }
.tip { background: var(--teal-t); border-color: var(--teal); } .warn { background: var(--bad-t); border-color: var(--bad); }
.tip::before { content: "💡 "; } .warn::before { content: "⚠️ "; }
.search { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 6px 0 10px; }
.vlist { display: grid; gap: 6px; } .vi { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.topex-line { display: flex; gap: 8px; align-items: flex-start; } .topex-line .grow { min-width: 0; }
.vi .em { font-size: 1.4rem; width: 32px; text-align: center; }
.conj { width: 100%; border-collapse: collapse; } .conj td { padding: 6px 8px; border-bottom: 1px solid var(--line); } .conj td:first-child { color: var(--muted); font-weight: 700; width: 36%; }
.conj td.irr { color: var(--primary); font-weight: 800; }

/* ---------- misc: modal, toast, forms, flashcards ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20, 12, 6, .55); z-index: 80; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.video-card { margin: 12px 0; } .video-card .em { font-size: 1.6rem; } .video-frame { margin-top: 10px; aspect-ratio: 16 / 9; background: #000; border-radius: var(--r-s); overflow: hidden; }
.video-frame video, .video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.modal.wide { width: min(720px, 100%); }
.modal { width: min(460px, 100%); max-height: 90vh; overflow: auto; background: var(--surface); border-radius: 20px; padding: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.field { display: grid; gap: 4px; margin-bottom: 12px; } .field label { font-weight: 800; font-size: .85rem; color: var(--muted); }
.err { color: var(--bad-d); font-weight: 700; font-size: .9rem; min-height: 1.2em; }
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); display: grid; justify-items: center; gap: 8px; z-index: 95; pointer-events: none; }
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 700; box-shadow: var(--shadow); animation: fade .2s; max-width: 90vw; }
.flash { perspective: 900px; }
.flash .face { min-height: 260px; display: grid; place-items: center; text-align: center; padding: 24px; border-radius: 22px; background: var(--surface); border: 2px solid var(--line); box-shadow: var(--shadow); cursor: pointer; }
.flash .q { font-size: 2.1rem; font-weight: 900; } .flash .em { font-size: 3.6rem; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.grades .btn { flex-direction: column; gap: 0; padding: 8px 4px; font-size: .78rem; min-height: 56px; } .grades .btn small { font-size: .68rem; opacity: .85; text-transform: none; letter-spacing: 0; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.switch:last-child { border-bottom: 0; }
.switch.blocked { opacity: .6; } .switch.blocked input[type=checkbox] { cursor: not-allowed; background: repeating-linear-gradient(45deg, var(--line), var(--line) 4px, transparent 4px, transparent 8px); outline: 1px dashed var(--muted, #888); }
.switch input[type=checkbox] { width: 46px; height: 26px; appearance: none; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input[type=checkbox]:checked { background: var(--good); } .switch input[type=checkbox]:checked::after { transform: translateX(20px); }
select.input { appearance: auto; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ach { text-align: center; padding: 12px 8px; border-radius: var(--r); border: 2px solid var(--line); background: var(--surface); } .ach .ic { font-size: 2.2rem; display: block; } .ach.lock { opacity: .45; filter: grayscale(1); } .ach b { display: block; font-size: .88rem; } .ach span { font-size: .74rem; color: var(--muted); }
.spark { display: flex; gap: 8px; align-items: flex-end; height: 110px; padding-top: 8px; } .spark .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; font-size: .68rem; font-weight: 800; color: var(--muted); }
.spark .b i { width: 100%; max-width: 34px; min-height: 4px; border-radius: 8px 8px 3px 3px; background: var(--saffron); } .spark .b i.z { background: var(--line); }
.splash { display: grid; place-items: center; min-height: 100vh; text-align: center; gap: 10px; padding: 24px; }
.spinner { width: 34px; height: 34px; border: 4px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto; } @keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ---------- special-character bar, shell extras ---------- */
.chars { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 0; }
.chr { min-width: 36px; height: 40px; padding: 0 6px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); font-weight: 800; font-size: 1.05rem; box-shadow: 0 2px 0 var(--line); }
.chr:hover { background: var(--surface-2); } .chr:active { transform: translateY(2px); box-shadow: none; }
.view-host { min-height: 40vh; }
@media (min-width: 900px) { .topbar { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }

.main:focus, #main:focus { outline: none; }
.toc ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; } .toc .btn.text { padding: 3px 4px; font-size: .92rem; }

/* stories (graded readers, ui/stories.js) */
.story-row.locked { opacity: .62; }
.story-text .para { display: flex; gap: 10px; align-items: flex-start; padding: 6px 8px; margin: 0 -8px; border-radius: var(--r-s); transition: background .2s; }
.story-text .para p { margin: 0; }
.story-text .para + .para { margin-top: 10px; }
.story-text .para.hl { background: var(--saffron-t); }
/* comic strip: a paragraph that opens with «Viñeta N.» is a panel */
.story-text .para.panel { background: var(--surface); color: var(--ink); border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 14px 0 0; box-shadow: 3px 3px 0 var(--line); }
.story-text .para.panel + .para:not(.panel) { margin-top: 6px; }
.story-text .para.panel.hl { background: var(--saffron-t); }
.story-text .panel-cap { display: inline-block; font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--teal-fill); border-radius: 6px; padding: 1px 8px; margin-right: 4px; }
.story-text .para .speak { margin-top: 4px; }
.story-text .sp { font-weight: 800; color: var(--teal-d); font-size: .9rem; }
.story-text .tr { color: var(--muted); font-size: .95rem; margin-top: 4px; line-height: 1.5; }
.story-tip { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 10px); z-index: 5; box-shadow: var(--shadow); border: 1px solid var(--line); background: var(--surface); }
@media (min-width: 900px) { .story-tip { bottom: 16px; } }

/* learning engine v2 — review UI (flashcard modes, quick rounds, My mistakes, Home load cards) */
.qbar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin: 0 0 12px; }
.qbar i { display: block; height: 100%; background: var(--teal); transform-origin: left center; animation-name: qbar; animation-timing-function: linear; animation-fill-mode: forwards; }
.qbar.over { background: var(--saffron-t); } .qbar.over i { background: var(--saffron); }
@keyframes qbar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .qbar i { animation-name: none; } }
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 999px; padding: 2px; gap: 2px; background: var(--surface); }
.seg button { border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 800; font-size: .85rem; padding: 6px 12px; border-radius: 999px; cursor: pointer; min-height: 34px; }
.seg button[aria-pressed="true"] { background: var(--primary-fill); color: #fff; }
.flash-type .input { font-size: 1.2rem; text-align: center; }
.flash-prompt { font-size: 1.7rem; font-weight: 900; }
.mn { background: var(--saffron-t); border-radius: var(--r-s); padding: 8px 10px; }
.mistake-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.mistake-row:first-of-type { border-top: 0; }
.mistake-row .grow { min-width: 0; overflow-wrap: anywhere; }
.plan-card .grid { gap: 10px; }
.load-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* practice sets (§13): partner lines, emoji scenes, source panels, DELE sentence banks, the «timed» clock */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.bubble.partner { max-width: 100%; border-color: var(--teal-t); }
.bubble.partner .btn.text { padding: 4px 0 0; }
/* situations (branching spoken role-plays): the conversation log, the stage with the microphone / typed field, the result turns */
.sit-chat .bubble.partner { max-width: 94%; }
.sit-chat .bubble.r.ok { background: var(--good-t); }
.sit-chat .bubble.r.helped { background: var(--saffron-t); }
.sit-chat .bubble.r.missed { background: var(--bad-t); }
.sit-stage { gap: 10px; }
.sit-mic { display: grid; justify-items: center; gap: 6px; }
.sit-typed .row { gap: 8px; } .sit-typed .input { flex: 1 1 auto; min-width: 0; }
.sit-turn { border-left: 5px solid var(--line); } .sit-turn.ok { border-left-color: var(--good); } .sit-turn.helped { border-left-color: var(--saffron); } .sit-turn.missed { border-left-color: var(--bad); }
.scene { container-type: inline-size; max-width: 560px; margin: 8px auto 14px; padding: 10px; border-radius: var(--r); background: linear-gradient(180deg, var(--teal-t), var(--surface-2)); border: 2px solid var(--line); }
.scene.small { max-width: 380px; padding: 6px; }
.scene-grid { display: grid; grid-template-columns: repeat(var(--cols, 8), 1fr); line-height: 1; text-align: center; font-size: 1.6rem; }
@supports (width: 1cqi) { .scene-grid { font-size: calc(100cqi / var(--cols, 8) * .78); } }
.scene-grid span { display: block; padding: 2px 0; }
.scene.svg svg { display: block; width: 100%; height: auto; border-radius: calc(var(--r) - 4px); }
.scene.svg { position: relative; }
.scene.svg.has-words { margin-bottom: 8px; }
.sc-dots { position: absolute; inset: 6px; pointer-events: none; }
.scene.svg:not(.small) .sc-dots { inset: 10px; }
.sc-dot { position: absolute; transform: translate(-50%, -50%); min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box; border-radius: 10px; background: var(--primary, #c2410c); color: #fff; font: 700 .75rem/20px system-ui, sans-serif; text-align: center; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.sc-words { list-style: none; counter-reset: sw; margin: 0 auto 14px; padding: 0; max-width: 560px; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px 12px; }
.sc-words li { counter-increment: sw; display: flex; align-items: center; gap: 6px; font-size: .95rem; }
.sc-words li::before { content: counter(sw); flex: none; min-width: 20px; height: 20px; border-radius: 10px; background: var(--primary, #c2410c); color: #fff; font: 700 .75rem/20px system-ui, sans-serif; text-align: center; }
.sc-words li .speak { order: 3; margin-left: auto; }
.prompts { margin: 0 0 12px; padding-left: 1.3em; } .prompts li { margin: 4px 0; }
.vchip-en { font-weight: 600; opacity: .85; }
.source summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.source-text p { margin: 8px 0 0; line-height: 1.65; }
.sbank { display: grid; gap: 8px; margin-top: 8px; }
.sb-row { display: flex; gap: 10px; align-items: flex-start; } .sb-row .grow { min-width: 0; overflow-wrap: anywhere; }
.sb-l { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 900; background: var(--teal-t); color: var(--teal-d); }
.gapctx { padding: 4px 14px; border-left: 4px solid var(--saffron); background: var(--surface); border-radius: var(--r-s); margin-bottom: 10px; }
.gapctx p { margin: 6px 0; font-size: 1rem; line-height: 1.65; }
.p-clock { flex: none; font-variant-numeric: tabular-nums; } .p-clock.over { background: var(--saffron-t); color: var(--saffron-d); }
.set-row.locked { opacity: .62; }
.gapctx p { font-weight: 500; }

/* ---- Spain packs (Practice → 🇪🇸 Spain) */
.sp-dots { display: inline-flex; gap: 5px; margin-top: 6px; }
.sp-dots i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); background: transparent; display: block; }
.sp-dots i.on { background: var(--teal); border-color: var(--teal); }
.sp-row { text-decoration: none; }
section.card[aria-labelledby] h2 { scroll-margin-top: 70px; }
.sc-words[hidden] { display: none; }
/* Practice → Talk (AI conversation partner) */
.talk-tile { text-decoration: none; color: inherit; }
.talk-tile.off { opacity: .6; cursor: not-allowed; }
.talk-log { min-height: 120px; align-content: start; }
.talk-controls { margin-top: 6px; }
.talk-controls[hidden], .talk-controls [hidden] { display: none; }
.talk-prio { padding: 8px 0; border-top: 1px solid var(--line); } .talk-prio:first-of-type { border-top: 0; }
.talk-wrong { color: var(--bad-d); font-weight: 900; } .talk-right { color: var(--good-d); font-weight: 900; }
.talk-end .ach-pop { margin: 0; }
.talk-controls textarea.input { min-height: 0; line-height: 1.4; }

/* ---------- Partner cards (Practice → 🤝 Partner cards; ui/partner-cards.js). Print: A4, two columns, dashed cut lines ---------- */
.pc-area { display: none; }
.pc-screen-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .pc-screen-grid { grid-template-columns: 1fr 1fr; } .pc-screen-grid .pc-pick:has(.pc-card.photo) { grid-column: 1 / -1; } }
.pc-pick { position: relative; } .pc-pick.on .pc-card { outline: 3px solid var(--primary); }
.pc-check { display: inline-block; font-size: .85rem; font-weight: 700; margin-bottom: 4px; cursor: pointer; }
.pc-card { background: #fff; color: #1a1a1a; border: 1px dashed #777; border-radius: 6px; padding: 10px 12px; font-size: .88rem; line-height: 1.35; overflow: hidden; min-width: 0; }
.pc-head { display: flex; justify-content: space-between; gap: 8px; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #555; margin-bottom: 2px; }
.pc-lv { font-weight: 900; border: 1px solid #555; border-radius: 4px; padding: 0 5px; }
.pc-title { font-size: 1rem; margin-bottom: 4px; } .pc-sub { color: #555; font-size: .8rem; }
.pc-note { font-size: .78rem; color: #555; margin: 0 0 4px; }
.pc-qs { margin: 0; padding-left: 1.2em; } .pc-qs li { margin-bottom: 4px; }
.pc-es { font-weight: 700; } .pc-en { color: #555; font-size: .8em; font-style: italic; } .pc-fu { font-size: .85em; } .pc-listen { font-size: .75em; color: #555; }
.pc-setting { margin: 0 0 4px; font-style: italic; font-size: .85em; }
.pc-cols { display: grid; grid-template-columns: 1fr; gap: 6px 12px; } @media (min-width: 560px) { .pc-cols { grid-template-columns: 1fr 1fr; } }
.pc-setting { grid-column: 1 / -1; } .pc-twist { margin-top: 4px; } .pc-role p { margin: 0 0 4px; } .pc-lines ul { margin: 2px 0 4px; padding-left: 1.1em; font-size: .9em; }
.pc-phr ul { margin: 2px 0 0; padding-left: 1.1em; } .pc-twist { margin: 4px 0 0; padding: 3px 6px; border: 1px solid #999; border-radius: 4px; font-size: .85em; }
.pc-photo { display: grid; grid-template-columns: 1fr; gap: 8px; } @media (min-width: 560px) { .pc-photo { grid-template-columns: 55% 1fr; } }
.pc-pic svg { width: 100%; height: auto; display: block; } .pc-emoji { font-size: 1.25rem; line-height: 1.25; text-align: center; } .pc-erow { display: flex; justify-content: center; } .pc-erow span { flex: 1; min-width: 0; }
.pc-words { font-size: .75em; margin: 4px 0 0; }
.pc-text { background: #fff; color: #1a1a1a; border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; font-size: .9rem; }
.pc-text h2 { margin-top: 0; } .pc-text h3 { margin: 10px 0 2px; } .pc-text ul { margin: 2px 0; padding-left: 1.2em; }
.pc-rub table { width: 100%; border-collapse: collapse; font-size: .85em; } .pc-rub th, .pc-rub td { border: 1px solid #999; padding: 3px 5px; text-align: left; vertical-align: top; } .pc-score { white-space: nowrap; text-align: center; }
.pc-previews > * + * { margin-top: 12px; }
/* paper preview: how a printed sheet looks (also used by the test) */
.pc-doc .pc-sheet { box-sizing: border-box; width: 210mm; height: 297mm; padding: 8mm; background: #fff; }
.pc-doc .pc-grid { display: grid; grid-template-columns: 1fr 1fr; align-content: start; }   /* row heights = the card heights below (core: rowMm / WIDE_MM) */
.pc-doc .pc-card { box-sizing: border-box; height: 93mm; } .pc-doc.pc-pp8 .pc-card.interview { height: 70mm; }
.pc-doc .pc-card { border-radius: 0; margin: 0; border: 1px dashed #777; break-inside: avoid; }
.pc-doc .pc-card.photo { grid-column: 1 / -1; }
.pc-doc .pc-photo { grid-template-columns: 52% 1fr; }
.pc-doc .pc-cols { display: block; column-count: 2; column-gap: 4mm; }   /* the two text columns balance themselves */
.pc-doc .pc-cols > div { display: contents; } .pc-doc .pc-role, .pc-doc .pc-lines, .pc-doc .pc-phr, .pc-doc .pc-twist { break-inside: avoid; } .pc-doc .pc-setting { column-span: all; }
/* print type size: a card is ~100 mm wide, so the screen sizes are far too big */
.pc-doc .pc-card.situation, .pc-doc.pc-pp8 .pc-card.situation, .pc-doc .pc-card.photo { font-size: 7pt; line-height: 1.22; padding: 2mm 3mm; }
.pc-doc .pc-card { font-size: 8.3pt; line-height: 1.28; padding: 2.5mm 3mm; } .pc-doc.pc-pp8 .pc-card { font-size: 7.4pt; padding: 2mm 2.5mm; }
.pc-doc .pc-title { font-size: 1.1em; margin-bottom: 2px; } .pc-doc .pc-head { font-size: .85em; } .pc-doc .pc-note { font-size: .9em; margin-bottom: 2px; } .pc-doc .pc-qs li { margin-bottom: 2px; }
.pc-doc .pc-text { font-size: 9.5pt; }
.pc-doc .pc-text { overflow: hidden; }
@page { size: A4; margin: 0; }
@media print {
  body.pc-printing { background: #fff; }
  body.pc-printing .sidebar, body.pc-printing .tabbar, body.pc-printing .topbar, body.pc-printing .pc-screen, body.pc-printing .toast { display: none !important; }
  body.pc-printing .shell, body.pc-printing .main { display: block; margin: 0; padding: 0; max-width: none; width: auto; }
  body.pc-printing .pc-area { display: block; }
  body.pc-printing .pc-doc .pc-sheet { break-after: page; page-break-after: always; margin: 0; border: 0; box-shadow: none; }
  body.pc-printing .pc-doc .pc-sheet:last-child { break-after: auto; page-break-after: auto; }
  body.pc-printing .pc-doc .pc-card { box-shadow: none; }
  body.pc-printing * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
