/* Tema escuro é o padrão. O claro é opcional (botão no menu) e fica guardado no navegador. */
:root {
  --bg: #090b10;
  --surface: #12151d;
  --surface-2: #1a1e2a;
  --text: #eef0f6;
  --muted: #9aa2b8;
  --border: #242939;
  --primary: #8b6cff;
  --primary-2: #4c8dff;
  --primary-text: #ffffff;
  --user-bubble: #2c2a70;
  --tutor-bubble: #181c27;
  --wrong: #ff7b7b;
  --right: #4be3a0;
  --warn-bg: #3a2a12;
  --warn-text: #ffc078;
  --accent: #2ee6a6;
  --amber: #ffb648;
  --flame: #ff8a3d;
  --glow: rgba(139, 108, 255, .16);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 16px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #eef0f7;
  --text: #191c2b;
  --muted: #667089;
  --border: #dfe2ee;
  --primary: #6d4dff;
  --primary-2: #3b7bff;
  --user-bubble: #e6e3ff;
  --tutor-bubble: #ffffff;
  --wrong: #c92a2a;
  --right: #1f9d55;
  --warn-bg: #fff4e6;
  --warn-text: #a14a00;
  --accent: #0ca678;
  --amber: #e67700;
  --flame: #f76707;
  --glow: rgba(109, 77, 255, .10);
  --shadow: 0 10px 30px rgba(30, 30, 60, .10);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--primary); }
h1 { margin: 0 0 .5rem; font-size: 1.5rem; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.center { text-align: center; }

.chip, .tag {
  display: inline-block; padding: .1rem .6rem; border-radius: 999px;
  background: var(--user-bubble); font-size: .8rem; color: var(--text);
}

/* ---------- páginas ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 2rem 1.5rem 3rem; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 1.5rem;
}
.card.narrow { max-width: 440px; margin: 2rem auto; }
.stack { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .95rem; }
input[type="text"], input[type="email"], input[type="password"], select, textarea {
  font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: .55rem .7rem;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

.btn {
  font: inherit; cursor: pointer; padding: .55rem 1.1rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  text-decoration: none; display: inline-block; text-align: center;
}
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); font-weight: 600; }
.btn.small { padding: .3rem .7rem; font-size: .85rem; }
.btn:disabled { opacity: .55; cursor: default; }

.alert { background: var(--warn-bg); color: var(--warn-text); padding: .6rem .8rem; border-radius: 8px; margin: .75rem 0; }

.goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; }
.goal { flex-direction: row; align-items: center; gap: .6rem; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.goal:has(input:checked) { border-color: var(--primary); background: var(--user-bubble); }

.question { border: 1px solid var(--border); border-radius: 10px; padding: .8rem 1rem; margin: 0; }
.question legend { padding: 0 .4rem; font-weight: 600; }
.qnum { display: inline-block; min-width: 1.6rem; color: var(--muted); }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .4rem .8rem; }
.options label { flex-direction: row; align-items: center; gap: .5rem; }
.options .idk { color: var(--muted); }

.level-badge {
  width: 96px; height: 96px; margin: .5rem auto; border-radius: 50%;
  display: grid; place-items: center; font-size: 2rem; font-weight: 800;
  background: var(--primary); color: var(--primary-text);
}
.inline-form { margin-top: 1.5rem; display: flex; gap: .6rem; justify-content: center; align-items: flex-end; flex-wrap: wrap; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0; }
.error-list { list-style: none; margin: 0; padding: 0; }
.error-list li { padding: .75rem 0; border-top: 1px solid var(--border); }
.error-list .meta { font-size: .8rem; color: var(--muted); }
.wrong { color: var(--wrong); text-decoration: line-through; }
.right { color: var(--right); font-weight: 600; }

/* ---------- chat (ocupa a altura da janela, sem rolar a página inteira) ---------- */
.chat { width: 100%; max-width: 920px; display: flex; flex-direction: column; min-height: 0; padding: .75rem 1rem 1rem; }

.toolbar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding-bottom: .6rem; font-size: .85rem; }
.toolbar select { padding: .3rem .5rem; max-width: 260px; }
.toolbar form { margin: 0; }
.toolbar .toggle { flex-direction: row; align-items: center; gap: .35rem; color: var(--muted); }
.spacer { flex: 1; }

.messages { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: .9rem; padding: .5rem .25rem; }
.msg { display: flex; flex-direction: column; max-width: 85%; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.assistant { align-self: flex-start; }
.bubble {
  padding: .6rem .9rem; border-radius: 14px; border: 1px solid var(--border);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg.user .bubble { background: var(--user-bubble); border-color: transparent; border-bottom-right-radius: 4px; }
.msg.assistant .bubble { background: var(--tutor-bubble); border-bottom-left-radius: 4px; }
.speak { border: 0; background: none; cursor: pointer; font-size: 1rem; padding: 0 0 0 .4rem; opacity: .7; }
.speak:hover { opacity: 1; }
.typing .dots { letter-spacing: .2em; color: var(--muted); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.corrections { margin-top: .35rem; display: flex; flex-direction: column; gap: .3rem; max-width: 100%; }
.correction { font-size: .88rem; padding: .45rem .7rem; border-left: 3px solid var(--wrong); background: var(--surface); border-radius: 0 8px 8px 0; }
.correction .explain { color: var(--muted); }
.correction .tag { margin-left: .5rem; font-size: .72rem; }

.composer { display: flex; gap: .5rem; align-items: flex-end; padding-top: .6rem; }
.composer textarea { flex: 1; resize: none; max-height: 140px; }
.icon-btn { font-size: 1.2rem; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.icon-btn.on { background: var(--wrong); border-color: var(--wrong); animation: pulse 1s infinite; }
.icon-btn:disabled { opacity: .4; cursor: default; }

@media (max-width: 560px) {
  .msg { max-width: 94%; }
}

/* ---------- revisão / cartões ---------- */
.badge { display: inline-block; min-width: 1.3rem; padding: 0 .35rem; border-radius: 999px; background: var(--primary); color: var(--primary-text); font-size: .75rem; font-weight: 700; text-align: center; }
.review { max-width: 620px; margin: 1.5rem auto; text-align: center; }
.flash-front { font-size: 1.6rem; font-weight: 600; margin: 1.2rem 0; overflow-wrap: anywhere; }
.flash-back { font-size: 1.4rem; font-weight: 600; color: var(--right); margin: .6rem 0; overflow-wrap: anywhere; }
.review hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
.btn.wide { width: 100%; margin-top: .5rem; }
.btn small { display: block; font-weight: 400; opacity: .75; font-size: .72rem; }
.rate { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: 1rem; }
.rate .btn { padding: .6rem .3rem; }
.rate-again { border-color: var(--wrong); }
.rate-good { border-color: var(--primary); }
.rate-easy { border-color: var(--right); }
.add-card { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: .5rem; margin: 1rem 0; }
.card-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.card-row form { margin: 0; }
@media (max-width: 560px) {
  .add-card { grid-template-columns: 1fr; }
  .rate { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- painel de progresso ---------- */
h2 { margin: 0 0 .6rem; font-size: 1.1rem; }
.small-text { font-size: .82rem; }
.panel { margin-top: 1rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin-top: 1rem; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .9rem 1rem; }
.tile-num { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.tile-label { color: var(--muted); font-size: .85rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.two-col .panel { margin-top: 1rem; }

.legend { display: flex; gap: 1rem; font-size: .82rem; color: var(--muted); margin-bottom: .5rem; }
.legend.wrap { flex-wrap: wrap; gap: .4rem 1rem; margin-top: .6rem; }
.dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.s-msg { background: var(--primary); }
.s-rev { background: var(--accent); }
.s-err { background: var(--wrong); }
.bars { display: flex; align-items: stretch; gap: .35rem; height: 170px; }
.bars.short { height: 190px; gap: 1rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bar-pair { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--border); }
.bar { width: 42%; max-width: 22px; min-height: 2px; border-radius: 3px 3px 0 0; }
.bars.short .bar { width: 60%; max-width: 44px; }
.bar-label { text-align: center; font-size: .7rem; color: var(--muted); padding-top: .25rem; line-height: 1.2; }
.bar-num { text-align: center; font-size: .8rem; font-weight: 600; }
.trend { margin: .8rem 0 0; font-weight: 600; }

.hrow { display: grid; grid-template-columns: 8.5rem 1fr 2rem; gap: .5rem; align-items: center; margin: .35rem 0; font-size: .9rem; }
.htrack { background: var(--bg); border-radius: 999px; height: .7rem; overflow: hidden; }
.hfill { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.hnum { text-align: right; color: var(--muted); }
.error-list.tight li { padding: .5rem 0; }

.stack-bar { display: flex; height: 1rem; border-radius: 999px; overflow: hidden; background: var(--bg); gap: 2px; }
.seg { display: block; min-width: 6px; }
.c-new { background: var(--muted); }
.c-learn { background: var(--amber); }
.c-rev { background: var(--primary); }
.c-done { background: var(--accent); }

@media (max-width: 700px) {
  .two-col { grid-template-columns: 1fr; }
  .hrow { grid-template-columns: 7rem 1fr 2rem; }
}

/* ---------- lições ---------- */
.lesson-text { white-space: pre-line; margin: .5rem 0 1rem; }
.examples { list-style: none; margin: 0; padding: 0; }
.examples li { padding: .55rem 0; border-top: 1px solid var(--border); }
.examples .en { font-weight: 600; }
.loading { padding: .8rem 1rem; border-radius: 8px; background: var(--user-bubble); animation: pulse 1.4s infinite; margin: .75rem 0; }
.topic-form { display: flex; gap: .5rem; margin-top: 1rem; }
.topic-form input { flex: 1; }
.chips .btn { padding: .4rem .8rem; font-size: .9rem; }
.score { text-align: center; font-size: 3rem; font-weight: 800; margin: .5rem 0; }
.score span { font-size: 1.4rem; color: var(--muted); font-weight: 600; }
.score.good { color: var(--right); }
.result.ok { border-left: 3px solid var(--right); padding-left: .75rem; }
.result.no { border-left: 3px solid var(--wrong); padding-left: .75rem; }
@media (max-width: 560px) { .topic-form { flex-direction: column; } }

/* ---------- revisão digitada ---------- */
.typing-box { margin: .5rem 0 .25rem; }
.typing-box form { display: flex; gap: .5rem; }
.typing-box input { flex: 1; font-size: 1.1rem; text-align: center; }
.link-btn { background: none; border: 0; padding: .5rem; color: var(--muted); cursor: pointer; text-decoration: underline; font: inherit; font-size: .88rem; }
.link-btn:hover { color: var(--text); }
.verdict { margin: .75rem 0 0; padding: .55rem .8rem; border-radius: 8px; font-weight: 600; }
.verdict.ok { background: rgba(43, 138, 62, .16); color: var(--right); }
.verdict.close { background: var(--warn-bg); color: var(--warn-text); }
.verdict.bad { background: rgba(201, 42, 42, .14); color: var(--wrong); }
.typed-echo { font-weight: 400; font-size: .85rem; opacity: .9; }
.rate .btn.suggested { outline: 3px solid var(--primary); outline-offset: 1px; font-weight: 700; }
.mode-toggle { flex-direction: row; justify-content: center; align-items: center; gap: .4rem; margin-top: 1.2rem; color: var(--muted); font-size: .82rem; }

/* ---------- pronúncia ---------- */
.speak { text-align: center; }
.target { font-size: 1.7rem; font-weight: 600; line-height: 1.6; margin: 1rem 0 1.2rem; overflow-wrap: anywhere; }
.w { padding: 0 .15em; border-radius: 6px; }
.w-ok { background: rgba(43, 138, 62, .2); color: var(--right); }
.w-close { background: rgba(230, 119, 0, .22); color: var(--amber); }
.w-wrong { background: rgba(201, 42, 42, .18); color: var(--wrong); }
.w-missing { background: rgba(201, 42, 42, .18); color: var(--wrong); text-decoration: line-through; }
.w-ok-bg { background: var(--right); }
.w-close-bg { background: var(--amber); }
.w-wrong-bg, .w-missing-bg { background: var(--wrong); }
.speak-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.btn.mic { min-width: 9rem; font-size: 1.05rem; }
.btn.mic.on { background: var(--wrong); border-color: var(--wrong); color: #fff; animation: pulse 1s infinite; }
.heard-live { min-height: 1.6rem; margin-top: .8rem; color: var(--muted); font-style: italic; }
.result-box { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.score-line { display: flex; gap: 1rem; align-items: center; justify-content: center; text-align: left; margin-bottom: .6rem; }
.score-ring { width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; font-size: 1.7rem; font-weight: 800; border: 6px solid var(--border); flex: none; }
.score-ring.great { border-color: var(--right); color: var(--right); }
.score-ring.good { border-color: var(--accent); color: var(--accent); }
.score-ring.mid { border-color: var(--amber); color: var(--amber); }
.score-ring.low { border-color: var(--wrong); color: var(--wrong); }
.score-label { font-size: 1.2rem; font-weight: 700; }
.result-box .legend { justify-content: center; }
.result-actions { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-top: .8rem; }
.speak-foot { margin-top: 1rem; display: flex; justify-content: center; gap: 1rem; }
.tips { text-align: left; margin-top: 1rem; }
.tips-summary { font-weight: 600; }
.tip { padding: .6rem .8rem; border-left: 3px solid var(--primary); background: var(--bg); border-radius: 0 8px 8px 0; margin: .5rem 0; }
.tip p { margin: .2rem 0 0; }
.ipa { color: var(--muted); font-family: "Segoe UI", "Noto Sans", sans-serif; }
.note { max-width: 760px; margin: 1rem auto 0; }
@media (max-width: 560px) { .target { font-size: 1.35rem; } }

.col { display: flex; flex-direction: column; }
.col .panel:first-child { margin-top: 1rem; }

/* =====================================================================
   NOVO VISUAL: escuro por padrão, menu lateral, acento violeta -> azul
   ===================================================================== */
body {
  background:
    radial-gradient(900px 500px at 85% -10%, var(--glow), transparent 60%),
    radial-gradient(700px 400px at -5% 110%, rgba(46, 230, 166, .06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--primary); color: #fff; }
a { color: var(--primary); }
h1 { font-size: 1.7rem; letter-spacing: -.02em; }
h2 { letter-spacing: -.01em; }

/* ---------- estrutura: menu lateral + conteúdo ---------- */
.app { display: grid; grid-template-columns: 256px 1fr; height: 100dvh; }
.app.no-sidebar { grid-template-columns: 1fr; }
.content { overflow-y: auto; min-width: 0; display: flex; flex-direction: column; }
.content > main { flex: 1 0 auto; width: 100%; }
.mobilebar, .scrim { display: none; }
.plainbar { display: flex; justify-content: space-between; align-items: center; padding: 1.1rem 1.5rem; }

.sidebar {
  display: flex; flex-direction: column; gap: .15rem; padding: 1rem .8rem;
  background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto;
}
.side-brand { display: flex; align-items: center; gap: .65rem; padding: .35rem .5rem 1.1rem; font-weight: 800; font-size: 1.12rem; letter-spacing: -.01em; color: var(--text); text-decoration: none; }
.logo { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 6px 18px var(--glow); flex: none; }
.logo svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.side-nav { display: flex; flex-direction: column; gap: .15rem; }
.side-label { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 1rem .85rem .35rem; opacity: .8; }
.side-link {
  display: flex; align-items: center; gap: .8rem; padding: .62rem .85rem; border-radius: 12px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem;
  transition: background .15s, color .15s, transform .15s;
}
.side-link svg { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link.on { background: linear-gradient(90deg, var(--glow), transparent); color: var(--text); box-shadow: inset 3px 0 0 var(--primary); }
.side-link.on svg { stroke: var(--primary); }
.side-link .badge { margin-left: auto; }
.side-foot { margin-top: auto; padding-top: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.user-card { display: flex; align-items: center; gap: .7rem; padding: .65rem .75rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent)); flex: none; }
.user-name { font-weight: 700; line-height: 1.2; }
.user-level { font-size: .78rem; color: var(--muted); }
.foot-actions { display: flex; gap: .5rem; }
.foot-btn { flex: 1; display: grid; place-items: center; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.foot-btn:hover { background: var(--surface-2); color: var(--text); }
.foot-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- componentes mais macios ---------- */
.card { border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.btn { border-radius: 12px; padding: .62rem 1.15rem; font-weight: 600; background: var(--surface-2); transition: transform .12s, box-shadow .12s, background .15s, border-color .15s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--primary); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn.primary { border: 0; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 8px 22px var(--glow); }
.btn.primary:hover:not(:disabled) { box-shadow: 0 10px 28px rgba(139, 108, 255, .35); }
.btn.small { padding: .38rem .8rem; }
input[type="text"], input[type="email"], input[type="password"], select, textarea { border-radius: 12px; background: var(--surface-2); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.badge { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }
.chip, .tag { background: var(--surface-2); border: 1px solid var(--border); }
.tile, .goal, .question, .tip { background: var(--surface-2); }
.goal:has(input:checked) { background: var(--glow); }
.correction { background: var(--surface-2); }
.alert { border-radius: 12px; }
.level-badge { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 10px 30px var(--glow); }
.rate .btn.suggested { outline-color: var(--primary); }
.htrack, .stack-bar { background: var(--surface-2); }
.hfill { background: linear-gradient(90deg, var(--primary), var(--primary-2)); }
.s-msg { background: linear-gradient(180deg, var(--primary-2), var(--primary)); }

/* ---------- chat ---------- */
.chat-content { overflow: hidden; }
.chat-content > .chat-main { flex: 1 1 0; min-height: 0; display: flex; justify-content: center; }
.chat { height: 100%; padding: 1rem 1.25rem 1.25rem; }
.toolbar { padding-bottom: .8rem; }
.toolbar select { border-radius: 10px; }
.messages { padding: .5rem .25rem 1rem; gap: 1rem; }
.bubble { border-radius: 20px; padding: .7rem 1rem; line-height: 1.55; }
.msg.user .bubble { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-color: transparent; border-bottom-right-radius: 6px; box-shadow: 0 6px 18px var(--glow); }
.msg.assistant .bubble { background: var(--tutor-bubble); border-bottom-left-radius: 6px; }
.composer { align-items: center; gap: .5rem; margin-top: .5rem; padding: .45rem .5rem .45rem .6rem; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow); }
.composer:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--glow); }
.composer textarea { border: 0; background: transparent; outline: none; padding: .55rem .4rem; }
.composer textarea:focus { outline: none; }
.composer .btn { border-radius: 999px; padding: .6rem 1.3rem; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--text); background: var(--surface-2); }
.composer .icon-btn { flex: none; }
.icon-btn.on { background: var(--wrong); border-color: var(--wrong); color: #fff; }

/* ---------- entrada (login / cadastro / onboarding) ---------- */
.no-sidebar .card.narrow { margin-top: 2vh; }
.no-sidebar .page { padding-top: 1rem; }

/* ---------- celular: menu vira gaveta ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; inset: 0 auto 0 0; width: 285px; max-width: 86vw; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow); }
  .app.nav-open .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .app.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .mobilebar { display: flex; align-items: center; gap: .6rem; padding: .6rem .9rem; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 20; }
  .mobilebar .side-brand { padding: 0; font-size: 1.05rem; }
  .page { padding: 1.25rem 1rem 3rem; }
}

/* ---------- tela "Hoje" ---------- */
.hello h1 { margin-bottom: .2rem; }
.hello .muted { margin: 0 0 1.4rem; }
.wave { display: inline-block; animation: wave 2.4s ease-in-out 1; transform-origin: 70% 70%; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-8deg); } 50% { transform: rotate(10deg); } }

.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1rem; }
.hero { display: flex; flex-direction: column; justify-content: space-between; gap: 1.1rem; background: linear-gradient(160deg, var(--surface), var(--surface-2)); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 220px; height: 220px; background: radial-gradient(closest-side, var(--glow), transparent); pointer-events: none; }
.streak { display: flex; align-items: center; gap: 1rem; }
.flame { font-size: 3.2rem; filter: grayscale(1) opacity(.45); transition: filter .3s; }
.flame.lit { filter: none; animation: flicker 2.2s ease-in-out infinite; transform-origin: 50% 90%; text-shadow: 0 0 24px var(--flame); }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-1deg); } 50% { transform: scale(1.08) rotate(2deg); } }
.streak-num { font-size: 3rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.best { margin-left: auto; text-align: right; }
.best strong { color: var(--text); font-size: 1.1rem; }

.week { display: flex; justify-content: space-between; gap: .3rem; }
.day { display: flex; flex-direction: column; align-items: center; gap: .3rem; flex: 1; }
.day-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border); background: var(--surface); color: #fff; }
.day-dot svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.day.done .day-dot { background: linear-gradient(135deg, var(--flame), var(--amber)); border-color: transparent; box-shadow: 0 4px 14px rgba(255, 138, 61, .35); }
.day.today .day-dot { border-color: var(--primary); }
.day.today.done .day-dot { border-color: transparent; }
.day-letter { font-size: .72rem; color: var(--muted); font-weight: 700; }
.day.today .day-letter { color: var(--text); }

.cta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; border-radius: 14px; text-decoration: none; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 12px 30px var(--glow); transition: transform .15s, box-shadow .15s; margin-top: auto; }
.cta:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(139, 108, 255, .38); }
.cta-text { display: flex; flex-direction: column; }
.cta-title { font-size: 1.1rem; font-weight: 800; }
.cta small { opacity: .88; font-size: .85rem; }
.cta-arrow { width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .2); display: grid; place-items: center; flex: none; }
.cta-arrow svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.goal-card { display: flex; flex-direction: column; gap: 1rem; }
.goal-head { display: flex; align-items: center; gap: 1rem; }
.goal-head h2 { margin: 0; }
.goal-head p { margin: 0; }
.ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; position: relative; flex: none; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; font-size: 1.35rem; font-weight: 800; }
.ring small { font-size: .7rem; color: var(--muted); }

.tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.task { display: flex; align-items: center; gap: .85rem; padding: .7rem .8rem; border-radius: 14px; background: var(--surface-2); border: 1px solid transparent; color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.task:hover { border-color: var(--primary); transform: translateX(2px); }
.task-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--glow); color: var(--primary); flex: none; }
.task-icon svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.task.done .task-icon { background: var(--accent); color: #06281c; }
.task-body { display: flex; flex-direction: column; gap: .1rem; flex: 1; min-width: 0; }
.task-title { font-weight: 700; }
.task-detail { font-size: .8rem; }
.task-bar { height: 5px; border-radius: 999px; background: var(--border); overflow: hidden; margin-top: .25rem; }
.task-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .5s; }
.task.done .task-title { text-decoration: line-through; text-decoration-color: var(--muted); opacity: .8; }

.hard-title { margin: 1rem 0 .3rem; }
.mini-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: .4rem 0 1rem; }
.mini-tiles div { background: var(--surface-2); border-radius: 12px; padding: .7rem .6rem; text-align: center; }
.mini-tiles strong { display: block; font-size: 1.5rem; font-weight: 800; }
.mini-tiles span { font-size: .72rem; color: var(--muted); }

@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .flame.lit, .wave { animation: none; } .btn, .cta, .task { transition: none; } }

/* ---------- retoques ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.bubble { white-space: normal; }
.bubble .text { white-space: pre-wrap; }
.bubble .speak { vertical-align: middle; margin-left: .35rem; padding: 0 .2rem; }
.messages { scrollbar-gutter: stable; }

/* ---------- cartão de revisão maior ---------- */
.review { max-width: 700px; padding: 2.4rem 2.2rem 1.8rem; margin: 6vh auto 2rem; }
.flash-front { font-size: 2.3rem; letter-spacing: -.02em; margin: 1.6rem 0 1.4rem; }
.flash-back { font-size: 1.9rem; }
.typing-box input { font-size: 1.15rem; padding: .8rem 1rem; }
.rate .btn { padding: .8rem .3rem; }
@media (max-width: 560px) { .review { padding: 1.6rem 1.2rem; margin-top: 2vh; } .flash-front { font-size: 1.8rem; } }

/* ---------- aulas a partir do chat ---------- */
.lesson-btn { margin-top: .4rem; padding: .3rem .75rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--primary); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s; }
.lesson-btn:hover:not(:disabled) { background: var(--glow); border-color: var(--primary); }
.lesson-chip { align-self: flex-start; margin-top: .45rem; padding: .5rem .95rem; border-radius: 14px; border: 1px dashed var(--primary); background: var(--glow); color: var(--text); font: inherit; font-size: .88rem; text-align: left; cursor: pointer; transition: transform .12s, background .15s; }
.lesson-chip:hover:not(:disabled) { transform: translateY(-1px); background: rgba(139, 108, 255, .26); }
.lesson-chip strong { color: var(--primary); }
.lesson-btn:disabled, .lesson-chip:disabled { opacity: .75; cursor: progress; animation: pulse 1.2s infinite; }
.back-link { font-weight: 600; }

/* ---------- diagnóstico, plano e trilha ---------- */
.diag { max-width: 760px; margin: 0 auto; }
.diag-intro { padding: 2rem; }
.checks { margin: 1rem 0 1.4rem; padding-left: 1.2rem; color: var(--muted); }
.checks li { margin: .3rem 0; }
.diag-progress { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: .8rem; }
.diag-progress span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .3s; }
.diag-question { font-size: 1.25rem; line-height: 1.4; margin: .2rem 0 1rem; letter-spacing: -.01em; }
#answer { width: 100%; resize: vertical; min-height: 9rem; font-size: 1.02rem; line-height: 1.55; }
.align-right { text-align: right; }
.diag-sentence { font-size: 1.6rem; font-weight: 600; text-align: center; margin: 1.2rem 0; line-height: 1.5; }
#speak-area { text-align: center; }
.diag-nav { display: flex; align-items: center; gap: .6rem; margin-top: 1.1rem; }
.diag-nav .spacer { flex: 1; }

.plan { max-width: 1040px; margin: 0 auto; }
.plan-hero { display: flex; gap: 1.4rem; align-items: center; }
.level-badge.small { width: 84px; height: 84px; font-size: 1.7rem; margin: 0; flex: none; }
.plan-summary { margin: .3rem 0 .6rem; font-size: 1.05rem; line-height: 1.55; }
.inline-form.left { justify-content: flex-start; margin: .4rem 0 0; }
.chip.good { color: var(--right); border-color: rgba(75, 227, 160, .35); }
.weak { padding: .8rem 1rem; border-left: 3px solid var(--primary); background: var(--surface-2); border-radius: 0 12px 12px 0; margin: .6rem 0; }
.weak-topic { font-weight: 700; margin-bottom: .15rem; }

.trail-wrap { position: relative; margin: 1.2rem 0; }
/* A linha fica num "corredor" à esquerda (sob o círculo), fora do cartão: assim ela não some atrás do fundo opaco do cartão. */
.trail-rail, .trail-rail-fill { position: absolute; left: 21.5px; top: 6px; width: 3px; border-radius: 3px; z-index: 0; }
.trail-rail { bottom: 6px; background: var(--border); }
.trail-rail-fill { height: 0; background: linear-gradient(var(--accent), var(--primary)); transition: height .4s ease; }
.trail { position: relative; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.trail-step { position: relative; z-index: 1; display: flex; align-items: center; gap: 1rem; }
.trail-num {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
  font-size: 1.05rem; background: var(--surface); border: 2px solid var(--border); flex: none;
}
.trail-num svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.trail-step.current .trail-num { border-color: var(--primary); color: var(--primary); animation: trailPulse 1.8s ease-in-out infinite; }
.trail-step.done .trail-num { background: var(--accent); border-color: transparent; color: #06281c; }
.trail-card-inner {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 1rem; padding: .85rem 1.1rem;
  border-radius: 14px; background: var(--surface-2); border: 1px solid transparent;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.trail-step:hover .trail-card-inner { transform: translateX(3px); }
.trail-step.current .trail-card-inner { border-color: var(--primary); background: var(--glow); box-shadow: 0 10px 26px var(--glow); }
.trail-step.done .trail-card-inner { opacity: .72; }
.trail-body { flex: 1; min-width: 0; }
.trail-topic { font-weight: 700; }
@keyframes trailPulse { 0%, 100% { box-shadow: 0 0 0 0 var(--glow); } 50% { box-shadow: 0 0 0 7px transparent; } }
@media (prefers-reduced-motion: reduce) { .trail-step.current .trail-num { animation: none; } }
.trail-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.task-bar.big { height: 9px; margin: .3rem 0 .8rem; }
.trail-card { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap; margin-top: 1rem; }
.trail-card-body { flex: 1; min-width: 220px; }
.trail-card h2 { margin: 0 0 .2rem; }
.trail-card p { margin: 0 0 .4rem; }
.trail-celebrate { margin-top: 1.2rem; }
.plan-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1rem; align-items: start; }
.plan-grid .panel { margin-top: 0; }
@media (max-width: 860px) { .plan-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .plan-hero { flex-direction: column; text-align: center; }
  .trail-step { flex-wrap: wrap; }
  .trail-rail, .trail-rail-fill { left: 18.5px; }
  .trail-num { width: 40px; height: 40px; }
}

/* ---------- página do certificado ---------- */
.how { border: 1px solid var(--border); border-radius: 12px; padding: .2rem 1rem; margin: .6rem 0; background: var(--surface-2); }
.how summary { cursor: pointer; font-weight: 700; padding: .6rem 0; }
.how ol { margin: .2rem 0 .6rem; padding-left: 1.3rem; line-height: 1.65; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 0 .35rem; font-size: .9em; }

/* ---------- gerenciar contas (admin da casa) ---------- */
.admin-row { align-items: flex-start; }
.chip.good svg { width: 12px; height: 12px; vertical-align: -1px; margin-right: 2px; }
.btn.danger { color: var(--wrong); border-color: var(--wrong); }
.btn.danger:hover { background: rgba(201, 42, 42, .12); }
.btn.danger svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.danger-zone summary { cursor: pointer; list-style: none; }
.danger-zone summary::-webkit-details-marker { display: none; }
.confirm-delete { margin-top: .5rem; padding: .7rem .8rem; border: 1px dashed var(--wrong); border-radius: 10px; display: flex; flex-direction: column; gap: .5rem; min-width: 240px; }
.confirm-delete input { margin-top: .3rem; }

/* ---------- treino relâmpago ---------- */
.drill { max-width: 680px; margin: 0 auto; }
.drill-pattern-pt { font-size: 1.3rem; font-weight: 700; margin: .2rem 0 .6rem; color: var(--primary); }
.drill-progress { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: .8rem; }
.drill-progress span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .25s; }
.drill-timer { display: flex; justify-content: center; margin: .3rem 0 1.1rem; }
.drill-ring {
  --p: 100; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--amber) calc(var(--p) * 1%), var(--surface-2) 0);
}
.drill-ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.drill-ring span { position: relative; font-weight: 800; font-size: 1.2rem; color: var(--amber); }
.drill-ring.danger { background: conic-gradient(var(--wrong) calc(var(--p) * 1%), var(--surface-2) 0); }
.drill-ring.danger span { color: var(--wrong); animation: drillPulse .5s ease-in-out infinite; }
@keyframes drillPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .drill-ring.danger span { animation: none; } }
.drill-prompt { font-size: 1.55rem; font-weight: 700; text-align: center; margin: 1.1rem 0 1.3rem; line-height: 1.4; }
.drill-input { width: 100%; font-size: 1.15rem; padding: .8rem 1rem; text-align: center; margin-bottom: .8rem; }
.drill-nav .btn small { display: block; font-weight: 400; opacity: .75; font-size: .72rem; }
.result.close { border-left: 3px solid var(--amber); padding-left: .75rem; }

/* ---------- comemoração (confete) ---------- */
.confetti-piece {
  position: fixed; top: -12px; width: 8px; height: 14px; border-radius: 2px; z-index: 999;
  pointer-events: none; animation-name: confettiFall; animation-timing-function: cubic-bezier(.2, .6, .3, 1); animation-fill-mode: forwards;
}
@keyframes confettiFall { to { transform: translateY(105vh) rotate(560deg); opacity: .15; } }
.score.good { animation: scorePop .5s ease-out; }
@keyframes scorePop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .confetti-piece, .score.good { animation: none; } }

/* ---------- barras do progresso: entram crescendo ---------- */
.bar { transform-origin: bottom; animation: barGrow .5s ease-out; }
@keyframes barGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .bar { animation: none; } }

/* ---------- treino relâmpago: modo (digitar/falar) e ritmo ---------- */
.drill-options { display: flex; flex-direction: column; gap: 1rem; margin: 1.1rem 0; }
.opt-label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .3rem; }
.opt-seg { display: inline-flex; flex-wrap: wrap; gap: .25rem; padding: .25rem; background: var(--surface-2); border-radius: 12px; }
.opt-btn { font: inherit; font-size: .88rem; cursor: pointer; padding: .4rem .85rem; border-radius: 9px; border: 0; background: transparent; color: var(--muted); }
.opt-btn:hover:not(:disabled):not(.on) { color: var(--text); }
.opt-btn.on { background: var(--primary); color: var(--primary-text); font-weight: 600; }
.opt-btn:disabled { opacity: .45; cursor: not-allowed; }
.drill-voice { display: flex; justify-content: center; margin-bottom: .8rem; }
.mic-btn { min-width: 220px; font-size: 1.05rem; padding: .7rem 1.3rem; }
.mic-btn.on { background: var(--wrong); border-color: var(--wrong); color: #fff; animation: pulse 1s infinite; }

/* ---------- revisão: cabeçalho e explicação ---------- */
.review-head { display: flex; justify-content: center; margin-bottom: .6rem; }
.review-count { font-size: .8rem; padding: .2rem .7rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.how { text-align: left; font-size: .88rem; color: var(--muted); background: var(--surface-2); border-radius: 12px; padding: .55rem .9rem; margin: 0 0 1rem; }
.how summary { cursor: pointer; color: var(--text); font-weight: 600; }
.how p { margin: .5rem 0 0; }
.review-task { margin: .4rem 0 0; font-size: .95rem; color: var(--primary); font-weight: 600; }
.rate-title { margin: 1.1rem 0 .3rem; font-weight: 600; }
.rate-title .muted { font-weight: 400; font-size: .85rem; }

.rate-box { margin-top: 1.1rem; }
.rate-box .rate-title { margin: 0 0 .2rem; font-size: 1.05rem; font-weight: 700; }
.rate-box .rate-sub { margin: 0 0 .8rem; font-size: .88rem; color: var(--muted); }

/* ---------- professor (rosto) ---------- */
.tutor-avatar { position: relative; display: inline-block; flex: none; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 4px 14px var(--glow); }
.tutor-avatar svg { display: block; width: 100%; height: 100%; }
.tutor-avatar.sm { width: 34px; height: 34px; }
.tutor-avatar.lg { width: 54px; height: 54px; animation: tavGlow 2.8s ease-in-out infinite; }
.tutor-avatar.xl { width: 92px; height: 92px; animation: tavGlow 2.8s ease-in-out infinite; }
.tav-eye, .tav-mouth { transform-box: fill-box; transform-origin: center; }
.tav-eye { animation: tavBlink 4.6s infinite; }
.tav-eye + .tav-eye { animation-delay: 0s; }
.thinking .tav-eyes { animation: tavLook 1.1s ease-in-out infinite; }
.talking .tav-mouth { animation: tavTalk .26s ease-in-out infinite alternate; }
@keyframes tavBlink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
@keyframes tavLook { 0%, 100% { transform: translateX(-2px); } 50% { transform: translateX(2px); } }
@keyframes tavTalk { from { transform: scaleY(.5); } to { transform: scaleY(1.9); } }
@keyframes tavGlow { 0%, 100% { box-shadow: 0 4px 14px var(--glow), 0 0 0 0 var(--glow); } 50% { box-shadow: 0 4px 14px var(--glow), 0 0 0 9px transparent; } }
@media (prefers-reduced-motion: reduce) { .tutor-avatar, .tav-eye, .tav-eyes, .tav-mouth, .status-dot { animation: none !important; } }

.tutor-head { display: flex; align-items: center; gap: .85rem; padding: .1rem .25rem .8rem; }
.tutor-name { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.tutor-status { display: flex; align-items: center; gap: .45rem; font-size: .82rem; color: var(--muted); }
.status-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }

.msg.assistant { display: grid; grid-template-columns: 34px minmax(0, auto); column-gap: .6rem; align-items: start; }
.msg.assistant > .tutor-avatar { grid-row: 1 / span 4; margin-top: 2px; }
.msg.assistant > :not(.tutor-avatar) { grid-column: 2; }

.chat-hello { padding: .4rem 0 .2rem 2.6rem; }
.chat-hello p { margin: 0 0 .5rem; font-size: .88rem; }
.starters { justify-content: flex-start !important; }
.starters { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.starter { font: inherit; font-size: .9rem; cursor: pointer; padding: .5rem .9rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: border-color .15s, transform .15s; }
.starter:hover { border-color: var(--primary); transform: translateY(-1px); }
@media (max-width: 560px) { .tutor-avatar.lg { width: 44px; height: 44px; } .tutor-status { font-size: .76rem; } }

/* ---------- objetivos ---------- */
.card.mid { max-width: 820px; margin: 1.5rem auto; }
.goals.rich { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.goals.rich .goal { align-items: flex-start; }
.goals.rich .goal input { margin-top: .35rem; }
.goal-emoji { font-size: 1.5rem; line-height: 1.2; }
.goal-text { display: flex; flex-direction: column; gap: .1rem; }
.goal-text small { color: var(--muted); font-size: .8rem; line-height: 1.3; }
.goal.locked { opacity: .45; cursor: not-allowed; }

/* ---------- tradutor rápido (modal global) ---------- */
button.side-link { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; }
button.side-link { display: flex; align-items: center; gap: .8rem; padding: .62rem .85rem; border-radius: 12px; color: var(--muted); font-weight: 600; font-size: .95rem; transition: background .15s, color .15s; }
button.side-link:hover { background: var(--surface-2); color: var(--text); }

.modal-backdrop { position: fixed; inset: 0; background: rgba(4, 5, 10, .55); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 80; padding: 1rem; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 1.4rem; width: 100%; }
.translator-modal { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .2rem; }
.modal-head h2 { margin: 0; font-size: 1.15rem; display: flex; align-items: center; gap: .5rem; }
.modal-head h2 svg { width: 22px; height: 22px; stroke: var(--primary); fill: none; stroke-width: 2; }
#translator-form { display: flex; flex-direction: column; gap: .6rem; margin: .8rem 0 0; }
.translator-result { margin-top: 1.1rem; }
.translator-dir { display: inline-block; font-size: .78rem; color: var(--muted); background: var(--surface-2); padding: .15rem .6rem; border-radius: 999px; margin-bottom: .5rem; }
.translator-main { display: flex; align-items: center; gap: .5rem; font-size: 1.35rem; font-weight: 700; color: var(--primary); overflow-wrap: anywhere; }
.translator-example { margin-top: .8rem; padding-top: .6rem; border-top: 1px solid var(--border); font-size: .9rem; }
.translator-example p { margin: .15rem 0; }
#translator-save { margin-top: 1rem; }
@media (max-width: 560px) { .translator-modal { max-width: 100%; } }
