/* Say it — paleta "correio aéreo" */
:root {
  --ink: #14213D;
  --ink-2: #3B4A66;
  --ink-3: #6A7791;
  --blue: #2457C5;
  --blue-2: #5B86E5;
  --sky: #DDE9FB;
  --sky-2: #EEF4FD;
  --paper: #F7F9FC;
  --white: #FFFFFF;
  --red: #E4473B;
  --sun: #F6B940;
  --mint: #3DB389;
  --line: #D5DEEC;

  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --text: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;

  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 10px;
  --wrap: 1120px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; margin: 0; letter-spacing: -0.02em; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 6px; }
main:focus { outline: none; }
svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px max(20px, calc((100vw - var(--wrap)) / 2));
  background: rgba(247, 249, 252, .88);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 1.35rem/1 var(--display); letter-spacing: -0.03em; }
.brand svg { width: 36px; height: 36px; stroke: none; }
.brand svg path[stroke] { stroke: var(--red); fill: none; }
.streak { margin: 0; font-size: .95rem; color: var(--ink-2); }
.streak:not(:empty)::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--mint); margin-right: 8px; vertical-align: 1px; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px; border: 0;
  font: 700 1rem/1 var(--text); text-decoration: none;
  transition: transform .15s var(--ease), background .15s;
}
.btn svg { width: 20px; height: 20px; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #1C49AA; }
.btn-ghost { background: var(--white); color: var(--blue); box-shadow: inset 0 0 0 1.5px var(--line); padding: 10px 16px; }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--blue-2); }

/* ---------- hero ---------- */
.hero {
  max-width: var(--wrap); margin: 0 auto; padding: 40px 20px 56px;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center;
}
.hero-kicker { margin: 0 0 18px; font: 700 1rem/1 var(--text); color: var(--blue); }
.hero-line {
  font-size: clamp(2.6rem, 6.4vw, 5.2rem); font-weight: 800; line-height: .98; letter-spacing: -0.035em;
  max-width: 13ch; text-wrap: balance;
}
.hero-say { display: flex; align-items: flex-start; gap: 22px; }
.hero-play {
  flex: none; width: 76px; height: 76px; margin-top: 6px; border-radius: 50%; border: 0;
  background: var(--red); color: #fff; display: grid; place-items: center;
  box-shadow: 0 0 0 0 rgba(228, 71, 59, .35); transition: transform .15s var(--ease);
}
.hero-play svg { width: 30px; height: 30px; fill: currentColor; stroke: none; margin-left: 4px; }
.hero-play:hover { transform: scale(1.05); }
.hero-play.on { animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(228, 71, 59, .4); } 100% { box-shadow: 0 0 0 22px rgba(228, 71, 59, 0); } }
.hero-line { transition: color .3s; }
.hero-line.speaking { color: var(--blue); }
@media (max-width: 560px) { .hero-play { width: 56px; height: 56px; } .hero-play svg { width: 22px; height: 22px; } .hero-say { gap: 14px; } }
.hero-pt { margin: 18px 0 0; font-size: 1.15rem; color: var(--ink-3); font-style: italic; }
.hero-sub { margin: 28px 0 0; max-width: 46ch; color: var(--ink-2); }
.hero-actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-art { margin: 0; }
.hero-art img { width: 100%; height: auto; }
.hero-art.no-img { display: none; }

/* ---------- biblioteca ---------- */
.library, .tapes { max-width: var(--wrap); margin: 0 auto; padding: 0 20px 56px; }
.library-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.library h2, .tapes h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
.tabs { display: inline-flex; background: var(--sky); border-radius: 999px; padding: 5px; }
.tabs button { border: 0; background: none; padding: 10px 22px; border-radius: 999px; font-weight: 700; color: var(--ink-2); }
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; }

.units { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.unit a {
  display: flex; flex-direction: column; height: 100%;
  text-decoration: none; background: var(--white); border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px var(--line); overflow: hidden;
  transition: box-shadow .2s, transform .2s var(--ease);
}
.unit a:hover { box-shadow: inset 0 0 0 2px var(--blue-2); transform: translateY(-2px); }
.unit-art { display: block; aspect-ratio: 640 / 300; background: var(--sky); overflow: hidden; }
.unit-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }
.unit-lesson .unit-art { background: #FDEFD2; }
.unit-extra .unit-art { background: #DCF2E8; }
.unit-body { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 18px; flex: 1; }
.unit-label { font: 700 .9rem/1.2 var(--text); color: var(--blue); }
.unit-lesson .unit-label { color: #A86A00; }
.unit-extra .unit-label { color: #1F7A57; }
.unit-title { font: 700 1.2rem/1.2 var(--display); letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.unit-meta { font-size: .92rem; color: var(--ink-3); margin-top: auto; padding-top: 10px; }
.meter { display: block; height: 6px; border-radius: 6px; background: var(--sky-2); overflow: hidden; margin-top: 8px; }
.meter span { display: block; height: 100%; background: var(--mint); border-radius: 6px; }
.empty { color: var(--ink-3); }

.section-note { color: var(--ink-2); max-width: 60ch; margin: 8px 0 20px; }
.tape-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tape-list li { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center; background: var(--white); border-radius: var(--r-md); padding: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.tape-num { font: 800 1.6rem/1 var(--display); color: var(--blue); text-align: center; }
.tape-players { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }

/* ---------- player original ---------- */
.orig { display: grid; grid-template-columns: 40px auto 1fr auto; align-items: center; gap: 10px; background: var(--sky-2); border-radius: 999px; padding: 6px 14px 6px 6px; }
.orig.on { background: var(--sky); }
.orig-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; }
.orig-btn svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.orig-btn svg path[d^="M8 5"] { fill: none; stroke: currentColor; stroke-width: 3; }
.orig-label { font-weight: 700; font-size: .95rem; white-space: nowrap; }
.orig-seek { width: 100%; accent-color: var(--blue); min-width: 60px; }
.orig-time { font-size: .85rem; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- página da lição ---------- */
.unit-page { max-width: 900px; margin: 0 auto; padding: 12px 20px 96px; }
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink-2); font-weight: 700; padding: 8px 0; }
.back svg { width: 20px; height: 20px; }
.back:hover { color: var(--blue); }
.unit-hero { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: center; padding: 16px 0 28px; }
.unit-hero-label { margin: 0 0 10px; font-weight: 700; color: var(--blue); }
.unit-hero h1 { font-size: clamp(2.4rem, 6vw, 3.8rem); font-weight: 800; letter-spacing: -0.035em; }
.unit-hero-sub { margin: 12px 0 0; font-size: 1.15rem; color: var(--ink-2); max-width: 44ch; }
.unit-hero-actions { margin-top: 24px; }
.unit-hero-art { width: 100%; height: auto; }

.orig-box { background: var(--white); border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--line); padding: 18px; margin-bottom: 24px; }
.orig-box h2 { display: flex; align-items: center; gap: 10px; font: 700 1.05rem/1.2 var(--text); letter-spacing: 0; margin-bottom: 14px; }
.orig-box h2 svg { width: 22px; height: 22px; color: var(--blue); }
.orig-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }

.toc { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: thin; }
.toc a { flex: none; text-decoration: none; padding: 8px 14px; border-radius: 999px; background: var(--sky-2); font-size: .95rem; color: var(--ink-2); white-space: nowrap; }
.toc a:hover { background: var(--sky); color: var(--ink); }

.toolbar {
  position: sticky; top: 64px; z-index: 10;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 0; margin-bottom: 8px; background: var(--paper);
  font-size: .95rem; color: var(--ink-2);
}
.seg { display: inline-flex; background: var(--sky); border-radius: 999px; padding: 4px; }
.seg button { white-space: nowrap; border: 0; background: none; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: .92rem; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--white); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 33, 61, .12); }
.hide-toggle { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; cursor: pointer; font-weight: 700; }
.hide-toggle input { width: 20px; height: 20px; accent-color: var(--blue); }

.sec { padding-top: 32px; }
.sec-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 14px; }
.sec-type { margin: 0 0 4px; font-weight: 700; font-size: .9rem; color: var(--red); }
.sec h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); }
.sec-inst { margin: 6px 0 0; color: var(--ink-2); max-width: 60ch; }
.sec-head .btn { flex: none; }

.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.item {
  position: relative; display: grid; gap: 6px;
  background: var(--white); border-radius: var(--r-md); padding: 14px 18px 14px 18px;
  box-shadow: inset 0 0 0 1px var(--line); cursor: pointer;
  transition: box-shadow .15s, background .15s;
}
.item:hover { box-shadow: inset 0 0 0 1.5px var(--blue-2); }
.item.is-playing { box-shadow: inset 0 0 0 2px var(--blue); background: var(--sky-2); }
.item.heard::after { content: ""; position: absolute; top: 18px; right: 16px; width: 9px; height: 9px; border-radius: 50%; background: var(--mint); }
.item.is-model { background: #FFF8E8; box-shadow: inset 0 0 0 1px #F3DDA6; }
.cue { margin: 0; font-size: .92rem; font-weight: 700; color: var(--ink-3); }
.cue-model { color: #A86A00; }
.lines { display: grid; gap: 6px; }
.line { margin: 0; display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start; padding-right: 22px; }
.pbtn { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--sky); color: var(--blue); transition: background .15s, color .15s; }
.pbtn svg { width: 14px; height: 14px; fill: currentColor; stroke: none; margin-left: 2px; }
.line:hover .pbtn { background: var(--blue); color: #fff; }
.line.speaking .pbtn { background: var(--red); color: #fff; }
.en { font-size: 1.15rem; line-height: 1.45; padding-top: 3px; }
.two .s-B .pbtn { background: #FDEFD2; color: #A86A00; }
.two .s-B .en { color: var(--ink-2); }
.two .s-B.speaking .pbtn { background: var(--red); color: #fff; }
.line.speaking .en { color: var(--ink); }
.pt { margin: 0 0 0 42px; color: var(--ink-3); font-style: italic; font-size: .98rem; }
.hide-en .en { color: transparent; background: var(--sky-2); border-radius: 6px; user-select: none; transition: color .2s; }
.hide-en .item:hover .en, .hide-en .item.is-playing .en, .hide-en .item:focus-visible .en { color: inherit; background: none; }

.items-reading { gap: 0; background: var(--white); border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--line); padding: 8px; }
.items-reading .item { box-shadow: none; padding: 8px 10px; background: transparent; }
.items-reading .item:hover { background: var(--sky-2); }
.items-reading .item.is-playing { background: var(--sky); box-shadow: none; }
.items-reading .en { font-family: var(--text); font-size: 1.2rem; }

.loading, .notfound { max-width: 700px; margin: 80px auto; padding: 0 20px; color: var(--ink-2); }
.notfound h1 { font-size: 2.4rem; color: var(--ink); margin-bottom: 12px; }
.notfound .btn { margin-top: 20px; }

/* ---------- modo treino ---------- */
.drill {
  position: fixed; inset: 0; z-index: 50;
  display: grid; grid-template-rows: auto auto 1fr auto;
  background: var(--ink); color: #fff;
  padding: max(14px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
}
.drill[hidden] { display: none; }
.drill-top { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 12px; max-width: 980px; width: 100%; margin: 0 auto; }
.drill-title { margin: 0; color: #AFC0E0; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drill-count { margin: 0; color: #AFC0E0; font-variant-numeric: tabular-nums; font-size: .95rem; }
.drill-bar { max-width: 980px; width: 100%; margin: 12px auto 0; height: 4px; background: rgba(255, 255, 255, .12); border-radius: 4px; overflow: hidden; }
.drill-bar span { display: block; height: 100%; width: 0; background: var(--sun); transition: width .4s var(--ease); }
.icon-btn { width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .08); color: #fff; display: grid; place-items: center; }
.icon-btn:hover { background: rgba(255, 255, 255, .16); }
.icon-btn svg { width: 22px; height: 22px; }

.drill-stage { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 22px; max-width: 980px; width: 100%; margin: 0 auto; padding: 24px 0; position: relative; }
.drill-cue { margin: 0; color: var(--sun); font-size: clamp(1.05rem, 2.4vw, 1.35rem); font-weight: 700; max-width: 60ch; }
.drill-cue:empty { display: none; }
.drill-lines { display: grid; gap: 18px; }
.dline {
  margin: 0; font: 800 clamp(1.9rem, 5.6vw, 4rem)/1.06 var(--display); letter-spacing: -0.03em;
  text-wrap: balance; color: rgba(255, 255, 255, .55); transition: color .25s, filter .35s;
}
.dline.s-B { color: rgba(175, 192, 224, .55); }
.dline.speaking { color: #fff; }
.dline.s-B.speaking { color: #FFE2A3; }
.dline.veiled { filter: blur(14px); color: rgba(255, 255, 255, .35); user-select: none; }
.dline.done { color: #fff; font-size: clamp(1.5rem, 4vw, 2.6rem); }
.turn { position: absolute; right: 0; bottom: 0; width: 120px; height: 120px; display: grid; place-items: center; }
.turn svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.turn-bg { stroke: rgba(255, 255, 255, .12); stroke-width: 8; }
.turn-fg { stroke: var(--red); stroke-width: 8; stroke-dasharray: 327; stroke-dashoffset: 0; }
.turn span { font-weight: 700; font-size: .95rem; text-align: center; max-width: 80px; line-height: 1.15; }
.turn[hidden] { display: none; }

.drill-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; max-width: 980px; width: 100%; margin: 0 auto; }
.drill .seg { background: rgba(255, 255, 255, .08); justify-self: start; }
.drill .seg button { color: #AFC0E0; }
.drill .seg button[aria-pressed="true"] { background: #fff; color: var(--ink); }
.transport { display: flex; align-items: center; gap: 14px; }
.play-big { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--sun); color: var(--ink); display: grid; place-items: center; }
.play-big svg { width: 28px; height: 28px; stroke-width: 3; }
.play-big .i-play { display: none; fill: currentColor; stroke: none; margin-left: 4px; }
.drill.paused .play-big .i-play { display: block; }
.drill.paused .play-big .i-pause { display: none; }
.speed { justify-self: end; border: 0; background: rgba(255, 255, 255, .08); color: #fff; border-radius: 999px; padding: 10px 16px; font-weight: 700; min-width: 72px; }

/* ---------- responsivo ---------- */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 16px; gap: 8px; }
  .hero-art { order: -1; max-width: 420px; }
  .unit-hero { grid-template-columns: 1fr; }
  .unit-hero-art { order: -1; max-width: 300px; }
  .toolbar { top: 60px; }
  .hide-toggle { margin-left: 0; }
}
@media (max-width: 560px) {
  body { font-size: 1rem; }
  .sec-head { flex-direction: column; }
  .drill-controls { grid-template-columns: 1fr 1fr; }
  .transport { grid-column: 1 / -1; grid-row: 1; justify-content: center; }
  .drill .seg button { padding: 7px 10px; font-size: .85rem; }
  .turn { width: 92px; height: 92px; }
  .en { font-size: 1.08rem; }
  .orig { grid-template-columns: 40px auto 1fr; }
  .orig-time { display: none; }
}

/* ---------- conta ---------- */
.topbar-right { display: flex; align-items: center; gap: 16px; }
.btn-small { padding: 10px 18px; font-size: .95rem; background: var(--ink); color: #fff; }
.btn-small:hover { background: var(--blue); }
.btn-small.btn-ghost { background: var(--white); color: var(--blue); }
.account { position: relative; }
.acct-btn { display: flex; align-items: center; gap: 8px; border: 0; background: var(--white); box-shadow: inset 0 0 0 1px var(--line); border-radius: 999px; padding: 4px 14px 4px 4px; font-weight: 700; min-height: 44px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font: 800 1rem/1 var(--display); }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); width: min(300px, calc(100vw - 32px)); background: var(--white); border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line), 0 18px 40px -12px rgba(20, 33, 61, .3); padding: 16px; display: grid; gap: 12px; z-index: 30; }
.acct-menu[hidden] { display: none; }
.acct-who { margin: 0; display: grid; gap: 2px; }
.acct-who span { color: var(--ink-3); font-size: .92rem; word-break: break-all; }
.acct-sync { margin: 0; font-size: .9rem; color: #1F7A57; }
.acct-sync[data-state="offline"] { color: #A86A00; }
.acct-sync::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 8px; vertical-align: 1px; }

.auth { border: 0; padding: 0; border-radius: var(--r-lg); width: min(440px, calc(100vw - 24px)); background: var(--white); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(20, 33, 61, .5); }
.auth::backdrop { background: rgba(20, 33, 61, .55); backdrop-filter: blur(3px); }
.auth form { padding: 28px 26px 26px; display: grid; gap: 14px; position: relative; }
.auth-close { position: absolute; top: 14px; right: 14px; background: var(--sky-2); color: var(--ink); width: 44px; height: 44px; }
.auth-close:hover { background: var(--sky); }
.auth-tabs { display: inline-flex; justify-self: start; background: var(--sky); border-radius: 999px; padding: 4px; }
.auth-tabs button { border: 0; background: none; padding: 9px 18px; border-radius: 999px; font-weight: 700; color: var(--ink-2); }
.auth-tabs button[aria-selected="true"] { background: var(--white); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 33, 61, .12); }
.auth h2 { font-size: 1.8rem; margin-top: 6px; }
.auth-lead { margin: -4px 0 4px; color: var(--ink-2); }
.field { display: grid; gap: 6px; font-weight: 700; font-size: .95rem; }
.field[hidden] { display: none; }
.field input, .w-in {
  font: 400 1.0625rem/1.3 var(--text); color: var(--ink);
  border: 0; border-radius: 12px; padding: 13px 14px; background: var(--sky-2);
  box-shadow: inset 0 0 0 1.5px var(--line); width: 100%; min-height: 48px;
}
.field input:focus, .w-in:focus { outline: none; box-shadow: inset 0 0 0 2px var(--blue); background: var(--white); }
.field-hint { margin: -6px 0 0; font-size: .9rem; color: var(--ink-3); }
.auth-error { margin: 0; color: #B3261E; font-weight: 700; min-height: 0; }
.auth-error:empty { display: none; }
.auth-submit { justify-content: center; width: 100%; padding: 16px; font-size: 1.05rem; }
.auth-submit:disabled { opacity: .7; cursor: progress; }

.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: var(--ink); color: #fff; padding: 14px 20px; border-radius: 14px; max-width: calc(100vw - 32px); box-shadow: 0 12px 30px -10px rgba(20, 33, 61, .5); }
.toast[hidden] { display: none; }

/* ---------- modo escrita ---------- */
.seg-view button { display: inline-flex; align-items: center; gap: 6px; }
.seg-view svg { width: 18px; height: 18px; }
.write-note { display: none; margin: 0 0 8px; padding: 12px 16px; border-radius: 14px; background: #FFF8E8; color: var(--ink-2); font-size: .98rem; }
.write-mode .write-note { display: block; }
.link-btn { border: 0; background: none; padding: 0; color: var(--blue); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.write { display: none; }
.write-mode .write { display: grid; gap: 10px; margin-top: 6px; cursor: default; }
.write-mode .item:not(.is-model):not(.checked) .en { color: transparent; background: var(--sky-2); border-radius: 6px; user-select: none; }
.write-mode .item:not(.is-model):not(.checked) .line { cursor: pointer; }
.write-mode .item:not(.is-model) { cursor: default; }
.w-field { display: grid; gap: 4px; }
.w-label { font-size: .88rem; font-weight: 700; color: var(--ink-3); }
.w-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.w-retry { display: none; }
.checked .w-retry { display: inline-flex; }
.checked .w-check { display: none; }
.checked .w-in { background: var(--white); }
.checked .w-in.ok { box-shadow: inset 0 0 0 2px var(--mint); }
.checked .w-in.bad { box-shadow: inset 0 0 0 2px #F3B4AE; }
.w-feedback { margin: 0; flex: 1 1 100%; display: grid; gap: 4px; }
.w-feedback:empty { display: none; }
.w-feedback .ok { color: #1F7A57; font-weight: 700; }
.w-feedback .bad { color: var(--ink-2); font-size: .95rem; }
.w-answer { font-size: 1.08rem; }
.w-answer mark { background: #FDE2DF; color: #9E1F15; border-radius: 4px; padding: 0 3px; font-weight: 700; }
.write-mode .item.right { box-shadow: inset 0 0 0 1.5px #A9DFC9; }
.write-mode .item.heard::after { display: none; }
.write-mode .item.right::after { content: ""; display: block; position: absolute; top: 16px; right: 16px; width: 22px; height: 22px; border-radius: 50%; background: var(--mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }

/* ---------- celular ---------- */
@media (max-width: 640px) {
  .topbar { padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
  .streak { display: none; }
  .acct-name { display: none; }
  .acct-btn { padding: 4px; }
  .toolbar { position: static; gap: 8px; padding: 8px 0; }
  .toolbar > span { display: none; }
  .seg button { padding: 9px 12px; min-height: 40px; }
  .hide-toggle { font-size: .9rem; }
  .unit-page { padding: 8px 16px calc(96px + env(safe-area-inset-bottom)); }
  .item { padding: 12px 14px; }
  .line { grid-template-columns: 40px 1fr; padding-right: 26px; }
  .pbtn { width: 40px; height: 40px; }
  .pt { margin-left: 50px; }
  .sec-head .btn { align-self: flex-start; }
  .hero { padding: 8px 16px 40px; }
  .library, .tapes { padding: 0 16px 48px; }
  .units { grid-template-columns: 1fr 1fr; gap: 12px; }
  .unit-body { padding: 12px 12px 14px; }
  .unit-title { font-size: 1rem; }
  .unit-label, .unit-meta { font-size: .82rem; }
  .auth form { padding: 24px 18px 20px; }
}
@media (max-width: 380px) { .units { grid-template-columns: 1fr; } }
@media (hover: none) { .unit a:hover { transform: none; } .item:not(.is-playing):not(.right):not(.is-model):hover { box-shadow: inset 0 0 0 1px var(--line); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
