/* =====================================================================
   talking: visual identity
   Idea: a language notebook. Warm paper by day, blackboard by night, a red pen for corrections,
   a highlighter for what to remember. Serif display type for the language itself.
   ===================================================================== */

:root {
  --paper: #f2ecdf;
  --paper-2: #e9e1d0;
  --card: #fbf8f1;
  --ink: #1d1a15;
  --ink-2: #4a453b;
  --ink-3: #7a7366;
  --rule: rgba(29, 26, 21, .16);
  --rule-strong: rgba(29, 26, 21, .5);
  --red: #d63a1f;          /* the red pen */
  --green: #1e6b4e;
  --mark: #f6c945;         /* the highlighter */
  --data: #1f6b6b;
  --stage1: #c8643f;       /* set per tutor */
  --stage2: #a94e2e;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15130f; --paper-2: #1e1b16; --card: #201d18;
    --ink: #f0eadd; --ink-2: #c9c2b2; --ink-3: #8f887a;
    --rule: rgba(240, 234, 221, .16); --rule-strong: rgba(240, 234, 221, .5);
    --red: #ff6a4d; --green: #58c79a; --mark: #e7b92f; --data: #5cc0c0;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-ui); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
/* paper grain */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .3  0 0 0 0 .22  0 0 0 .16 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@media (prefers-color-scheme: dark) { body::before { mix-blend-mode: screen; opacity: .18; } }
main { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; padding: 14px 18px calc(8px + env(safe-area-inset-bottom)); min-height: 100vh; display: flex; flex-direction: column; gap: 14px; }

::selection { background: var(--mark); color: #1d1a15; }
:focus-visible { outline: 2.5px solid var(--red); outline-offset: 3px; border-radius: 6px; }

/* ---------- Icons ---------- */
.ico-wrap { display: inline-flex; line-height: 0; vertical-align: -.2em; }
.ico { display: block; }

/* ---------- Buttons ---------- */
button { font: inherit; font-weight: 600; cursor: pointer; color: var(--ink); background: transparent; border: 1.5px solid var(--ink); border-radius: 999px; padding: .6rem 1.15rem; transition: transform .15s var(--ease), background .15s, color .15s; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
button:active { transform: scale(.97); }
button:disabled { opacity: .4; cursor: not-allowed; }
button.primary { background: var(--ink); color: var(--paper); margin-left: auto; padding: .8rem 1.4rem; }
button.primary.small { padding: .4rem .9rem; font-size: .85rem; margin-left: 0; }
button.ghost { background: transparent; }
button.link { border: 0; padding: .3rem .1rem; background: none; color: var(--ink); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; font-weight: 500; }
button.link:disabled { visibility: hidden; }
button.icon { width: 42px; height: 42px; padding: 0; border-color: var(--rule-strong); border-width: 1px; }
button.icon.small { width: 34px; height: 34px; }
select, input, textarea { font: inherit; color: var(--ink); background: var(--card); border: 1.5px solid var(--rule-strong); border-radius: 12px; padding: .7rem .85rem; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2rem; }
input[type="checkbox"] { accent-color: var(--red); width: 18px; height: 18px; padding: 0; }

/* ---------- Top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.wordmark { font-family: var(--font-display); font-weight: 600; font-size: 1.55rem; letter-spacing: -.03em; font-variation-settings: "opsz" 72, "SOFT" 100, "WONK" 1; text-decoration: none; color: var(--ink); line-height: 1; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; }
.wordmark .mark { height: 1.35em; width: auto; flex: none; margin-top: -2px; }
.wordmark i { color: var(--red); font-style: normal; }
.top-actions { display: flex; gap: 8px; }
.personas { flex-basis: 100%; order: 3; }
.persona { display: inline-flex; align-items: center; gap: 10px; padding: 0; border: 0; border-radius: 0; font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.persona .mini-pic { width: 26px; height: 26px; border-radius: 50%; flex: none; border: 1.5px solid var(--ink); }
.persona .nm { color: var(--ink-2); }
.settings { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px; border: 1px solid var(--rule); border-radius: 18px; background: var(--card); }
.settings label { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 120px; font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.settings label select { font-family: var(--font-ui); text-transform: none; letter-spacing: 0; font-size: .95rem; }
.settings button { flex-basis: 100%; justify-content: flex-start; }
.install-hint { flex-basis: 100%; margin: 0; font-size: .85rem; color: var(--ink-3); }

/* ---------- Stage: the tutor in an arched window ---------- */
.stage { position: relative; display: flex; justify-content: center; overflow: hidden; background: var(--stage1); border-radius: 999px 999px 26px 26px; isolation: isolate; box-shadow: 0 0 0 1.5px var(--ink); }
.stage::before { content: ""; position: absolute; z-index: -1; left: 50%; top: 14%; width: 78%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: var(--stage2); opacity: .55; }
.stage::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: .35; mix-blend-mode: multiply; background-image: inherit; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2'/><feColorMatrix values='0 0 0 0 .1  0 0 0 0 .08  0 0 0 0 .05  0 0 0 .22 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.avatar { position: relative; width: 100%; height: clamp(250px, 44vh, 500px); background-size: cover; background-position: 50% 15%; }
.avatar canvas { display: block; }
.ring { position: absolute; z-index: 1; left: 50%; top: 46%; width: 62%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid var(--paper); opacity: 0; pointer-events: none; }
.stage[data-state="listening"] .ring { animation: ring 1.6s ease-out infinite; }
@keyframes ring { 0% { opacity: .85; transform: translate(-50%, -50%) scale(.88); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.4); } }
.dots { position: absolute; z-index: 3; top: 16%; right: 16%; display: none; gap: 5px; padding: 8px 12px; background: var(--paper); border-radius: 14px 14px 14px 3px; border: 1.5px solid var(--ink); }
.stage[data-state="thinking"] .dots { display: flex; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); animation: dot 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
.badge { position: absolute; z-index: 3; left: 50%; bottom: 12px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 10px; border-radius: 999px; background: var(--paper); color: var(--ink); border: 1.5px solid var(--ink); font-family: var(--font-mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.stage[data-state="speaking"] .badge::before { background: var(--red); animation: blink 1s infinite; }
.stage[data-state="listening"] .badge::before { background: var(--green); animation: blink .8s infinite; }
.stage[data-state="thinking"] .badge::before, .stage[data-state="loading"] .badge::before { background: var(--mark); animation: blink .9s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.loadbar { position: absolute; z-index: 3; left: 18%; right: 18%; top: 16px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--paper) 45%, transparent); overflow: hidden; }
.loadbar i { display: block; height: 100%; width: 0; background: var(--paper); transition: width .25s ease; }

/* ---------- Captions ---------- */
.captions { display: flex; flex-direction: column; gap: 12px; min-height: 110px; }
.coach-line { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.35rem, 5.4vw, 1.7rem); line-height: 1.22; letter-spacing: -.01em; font-variation-settings: "opsz" 72, "SOFT" 50; text-wrap: balance; }
.coach-line:empty { display: none; }
.coach-line::before { content: "\201C"; color: var(--red); font-weight: 700; margin-right: .06em; }
.you-line { margin: 0; align-self: flex-end; max-width: 92%; font-family: var(--font-mono); font-size: .82rem; color: var(--ink-2); text-align: right; padding-bottom: 2px; border-bottom: 1.5px dashed var(--rule-strong); }
.you-line:empty { display: none; }
.you-line::before { content: "você · "; color: var(--ink-3); }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.suggest-lbl { width: 100%; font-family: var(--font-mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3); }
.chip { text-align: left; font-weight: 500; font-size: .92rem; border: 1px solid var(--rule-strong); border-left: 5px solid var(--mark); border-radius: 6px 14px 14px 6px; padding: .5rem .8rem; background: var(--card); }
.chip:hover { background: var(--paper-2); }
.fix { padding: 8px 0 8px 14px; border-left: 3px solid var(--red); animation: rise .35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.fix-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; font-family: var(--font-display); font-size: 1.25rem; line-height: 1.3; }
.fix .old { color: var(--red); text-decoration: line-through; text-decoration-thickness: 2px; }
.fix .new { font-weight: 600; color: var(--ink); background: linear-gradient(transparent 58%, var(--mark) 58%); padding: 0 .12em; animation: wipe .6s var(--ease) both; }
@keyframes wipe { from { background-size: 0 100%; } to { background-size: 100% 100%; } }
.fix .why { margin-top: 6px; font-size: .9rem; color: var(--ink-2); }
.ok { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--green); font-family: var(--font-mono); font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; animation: rise .35s var(--ease); }
.tip { padding: 10px 12px; border-radius: 12px; background: var(--paper-2); border: 1px dashed var(--rule-strong); font-size: .9rem; animation: rise .35s var(--ease); }
.tip b { display: block; font-family: var(--font-mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3); margin-bottom: 2px; font-weight: 500; }
.status { margin: 0; min-height: 1.1em; color: var(--ink-3); font-size: .85rem; }
.status.err { color: var(--red); font-weight: 600; }
.skip { align-self: flex-end; padding: .35rem .8rem; font-size: .82rem; border-width: 1px; border-color: var(--rule-strong); }

/* repeat the right sentence */
.retry { padding: 14px 16px; border: 2px solid var(--ink); border-radius: 18px; background: var(--card); box-shadow: 5px 5px 0 var(--ink); animation: rise .35s var(--ease); }
.retry-title { font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3); display: flex; justify-content: space-between; gap: 8px; }
.retry-phrase { margin: 8px 0 10px; font-family: var(--font-display); font-size: 1.5rem; line-height: 1.2; font-weight: 500; background: linear-gradient(transparent 62%, var(--mark) 62%); display: inline; }
.retry-row { display: flex; justify-content: space-between; margin-top: 12px; }

/* ---------- Dock (mic) ---------- */
.dock { position: sticky; bottom: 0; z-index: 5; margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--paper) 80%, transparent); }
footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
footer #end { justify-self: start; border-color: var(--rule-strong); border-width: 1px; font-size: .9rem; }
footer .foot-right { justify-self: end; display: flex; align-items: center; gap: 8px; }
footer #ask { font-size: .8rem; padding: 8px 10px; white-space: nowrap; }
#mic { width: 76px; height: 76px; padding: 0; border-radius: 50%; background: var(--ink); color: var(--paper); border: 0; position: relative; box-shadow: 0 0 0 5px var(--paper), 0 0 0 6.5px var(--ink); }
#mic.rec { background: var(--red); animation: mic 1.2s infinite; }
@keyframes mic { 0% { box-shadow: 0 0 0 5px var(--paper), 0 0 0 6.5px var(--red), 0 0 0 6.5px color-mix(in srgb, var(--red) 40%, transparent); } 100% { box-shadow: 0 0 0 5px var(--paper), 0 0 0 6.5px var(--red), 0 0 0 20px transparent; } }
.textform { display: flex; gap: 8px; }
.textform input { flex: 1; }
.textform button { background: var(--ink); color: var(--paper); }
.log { color: var(--ink-3); font-size: .85rem; margin-bottom: 70px; }
.log summary { cursor: pointer; font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
#history p { margin: 4px 0; } #history .m { color: var(--red); } #history .u { color: var(--ink); }

/* ---------- Overlays (wizard, test, tutor, progress, job, report) ---------- */
.wizard { position: fixed; inset: 0; z-index: 20; background: var(--paper); overflow: auto; display: flex; justify-content: center; padding: 18px; }
.wiz-card { position: relative; width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 12px; padding-bottom: 28px; }
.wiz-card h2 { margin: 10px 0 0; font-family: var(--font-display); font-weight: 500; font-size: clamp(1.9rem, 8vw, 2.5rem); line-height: 1.05; letter-spacing: -.025em; font-variation-settings: "opsz" 96, "SOFT" 60; text-wrap: balance; }
.wiz-card h3 { margin: 18px 0 4px; font-family: var(--font-mono); font-weight: 500; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); }
.wiz-sub { margin: 0 0 6px; color: var(--ink-2); font-size: 1.02rem; }
.wiz-bar { height: 3px; background: var(--rule); position: relative; }
.wiz-fill { height: 100%; background: var(--ink); transition: width .4s var(--ease); position: relative; }
.wiz-fill::after { content: ""; position: absolute; right: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.wiz-top { display: flex; justify-content: space-between; align-items: center; min-height: 30px; margin-top: 6px; }
.wiz-count { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; color: var(--ink-3); }
.wiz-body { display: flex; flex-direction: column; gap: 8px; }
.wiz-body > input, .wiz-body input[type="time"], .wiz-body input[type="date"] { width: 100%; font-size: 1.25rem; font-family: var(--font-display); }
.wiz-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(to top, var(--paper) 78%, transparent); z-index: 2; }
.wiz-skips { display: flex; gap: 16px; align-items: center; }
.note { color: var(--ink-3); font-size: .88rem; margin: 4px 0; }
.note.center { text-align: center; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; padding: 6px 0; }
.check input { margin-top: 2px; flex: none; }
.summary { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: .95rem; }
.summary dt { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); padding-top: 3px; }
.summary dd { margin: 0; font-weight: 500; }

/* options: ruled list rows, selected = inverted ink */
.opts { display: grid; gap: 0 14px; counter-reset: o; }
.opts.cols1 { grid-template-columns: 1fr; } .opts.cols2 { grid-template-columns: 1fr 1fr; } .opts.cols3 { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; justify-content: flex-start; padding: 13px 10px; border: 0; border-top: 1px solid var(--rule); border-radius: 0; background: transparent; color: var(--ink); font-weight: 500; transition: background .15s, color .15s, border-radius .15s; }
.opts.cols1 .opt::before, .opts.cols2 .opt::before { counter-increment: o; content: counter(o, upper-alpha); font-family: var(--font-mono); font-size: .7rem; width: 1.4em; color: var(--ink-3); flex: none; }
.opt .txt { display: flex; flex-direction: column; flex: 1; }
.opt .lbl { font-weight: 600; } .opt .dsc { font-size: .84rem; color: var(--ink-3); font-weight: 400; }
.opt .code { font-family: var(--font-mono); font-size: .72rem; border: 1.5px solid currentColor; border-radius: 6px; padding: 1px 6px; flex: none; }
.opt:hover { background: var(--paper-2); border-radius: 12px; }
.opt.on, .opt[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-radius: 12px; border-color: transparent; }
.opt.on::before, .opt.on .dsc { color: color-mix(in srgb, var(--paper) 65%, transparent); }
.opts.cols3 .opt { justify-content: center; text-align: center; border: 1.5px solid var(--rule-strong); border-radius: 999px; }
.opts.cols3 .opt::before { content: none; }
.opt.right { background: var(--green); color: #fff; border-radius: 12px; } .opt.wrong { background: var(--red); color: #fff; border-radius: 12px; } .opt.dim { color: var(--ink-3); }
.opt.right::before, .opt.wrong::before { color: rgba(255, 255, 255, .7); }

.assess-list { margin: 6px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.spinner { width: 34px; height: 34px; margin: 28px 0; border: 3px solid var(--rule); border-top-color: var(--red); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Vocabulary test: flash card ---------- */
.word-card { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 190px; margin: 14px 4px; padding: 24px; background: var(--card); border: 2px solid var(--ink); border-radius: 22px; box-shadow: 6px 6px 0 var(--ink); transform: rotate(-1.2deg); transition: transform .16s var(--ease), opacity .16s; }
.word-card .word { font-family: var(--font-display); font-size: clamp(2.4rem, 12vw, 3.4rem); font-weight: 500; letter-spacing: -.02em; font-variation-settings: "opsz" 120, "SOFT" 70, "WONK" 1; }
.word-card.out-yes { transform: translateX(70px) rotate(8deg); opacity: 0; } .word-card.out-no { transform: translateX(-70px) rotate(-10deg); opacity: 0; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.ans { padding: 1rem; font-size: 1.05rem; border-width: 2px; }
.ans.no { color: var(--red); border-color: var(--red); } .ans.yes { background: var(--ink); color: var(--paper); }

/* ---------- Level report: the stamp ---------- */
.level-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 0 6px; }
.level-badge { width: 132px; height: 132px; display: grid; place-items: center; border-radius: 50%; border: 3px solid var(--red); color: var(--red); font-family: var(--font-display); font-weight: 700; font-size: 3.6rem; letter-spacing: -.03em; transform: rotate(-7deg); box-shadow: inset 0 0 0 5px var(--paper), inset 0 0 0 7px var(--red); font-variation-settings: "opsz" 144, "WONK" 1; }
.level-name { font-family: var(--font-display); font-style: italic; font-size: 1.35rem; margin-top: 8px; }
.level-meta { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 30px 1fr 44px; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: .76rem; }
.bar-track { height: 8px; background: var(--rule); border-radius: 4px; overflow: hidden; } .bar-fill { height: 100%; background: var(--ink); }
.bar-val { color: var(--ink-3); text-align: right; }
.mail-box { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--rule-strong); border-radius: 18px; background: var(--card); }
.mail-box h3 { margin-top: 0; }
.mail-box input[type="email"] { width: 100%; }

/* ---------- Tutor picker ---------- */
.lock-note { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--mark); color: #1d1a15; font-size: .9rem; font-weight: 500; }
.tutors { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.tutor-card { display: flex; gap: 14px; padding: 12px; border-radius: 20px; border: 1.5px solid var(--rule-strong); background: var(--card); cursor: pointer; transition: transform .15s var(--ease), box-shadow .15s; }
.tutor-card:hover { transform: translateY(-2px); }
.tutor-card.on { border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); }
.tutor-pic { width: 96px; height: 120px; border-radius: 999px 999px 12px 12px; flex: none; border: 1.5px solid var(--ink); }
.tutor-pic.big { width: 120px; height: 150px; margin: 0 auto; display: block; }
.tutor-body { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.tutor-title { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-family: var(--font-display); font-size: 1.5rem; font-weight: 500; line-height: 1; }
.badge-rec { font-family: var(--font-mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border-radius: 999px; background: var(--mark); color: #1d1a15; font-weight: 500; }
.tutor-tag { font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.tutor-bio { margin: 6px 0 0; font-size: .93rem; } .tutor-best { margin: 2px 0; font-size: .84rem; color: var(--ink-3); }
.modal-back { position: fixed; inset: 0; background: rgba(20, 17, 12, .7); display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 30; }
.modal { background: var(--paper); border: 2px solid var(--ink); border-radius: 24px; padding: 24px; max-width: 380px; width: 100%; text-align: center; display: flex; flex-direction: column; gap: 8px; box-shadow: 7px 7px 0 var(--ink); }
.modal h3 { margin: 10px 0 0; font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; line-height: 1.1; letter-spacing: -.01em; text-transform: none; color: var(--ink); }
.modal p { margin: 0; color: var(--ink-2); }
.modal-row { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.modal-row .primary { margin-left: 0; }

/* ---------- Report overlay ---------- */
.report { position: fixed; inset: 0; background: rgba(20, 17, 12, .7); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.report-card { background: var(--paper); border: 2px solid var(--ink); max-width: 480px; width: 100%; border-radius: 24px; padding: 22px; max-height: 90vh; overflow: auto; box-shadow: 7px 7px 0 var(--ink); }
.report-card h2 { margin: 0 0 10px; font-family: var(--font-display); font-weight: 500; font-size: 1.9rem; letter-spacing: -.02em; }
.report-card h3 { margin: 16px 0 4px; font-family: var(--font-mono); font-weight: 500; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); }
.report-card ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.report-card > button { margin-top: 16px; }
.score { font-family: var(--font-display); font-size: 3.4rem; font-weight: 600; line-height: 1; color: var(--red); letter-spacing: -.03em; }
.scores { display: flex; gap: 10px; }
.score-box { flex: 1; padding: 12px 8px; border-radius: 16px; border: 1.5px solid var(--rule-strong); text-align: center; }
.score-box .score { font-size: 2.2rem; color: var(--ink); }
.score-box.main { background: var(--ink); color: var(--paper); border-color: var(--ink); } .score-box.main .score { color: var(--mark); }
.kpi-lbl { font-family: var(--font-mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3); }
.score-box.main .kpi-lbl { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.answer-card { padding: 12px 14px; border-radius: 16px; border: 1px solid var(--rule-strong); margin: 10px 0; }
.ans-q { font-family: var(--font-display); font-size: 1.12rem; font-weight: 500; line-height: 1.25; margin-bottom: 4px; }
.ans-better { margin-top: 8px; padding: 8px 12px; border-left: 3px solid var(--green); background: var(--card); border-radius: 0 10px 10px 0; } .ans-better p { margin: 2px 0; }

/* ---------- Interview ---------- */
.ivbar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--card); font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.ivbar #ivText { flex: 1; }
textarea { width: 100%; resize: vertical; line-height: 1.45; }
.file-row { display: flex; align-items: center; gap: 12px; } .file-pick { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 3px 11px; border-radius: 999px; border: 1.5px solid var(--rule-strong); font-family: var(--font-mono); font-size: .72rem; }

/* ---------- Progress ---------- */
.prog-head { display: flex; justify-content: space-between; align-items: center; }
.viz { --s1: var(--data); position: relative; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px; margin: 6px 0; }
.kpi { padding: 12px 0; border-top: 1.5px solid var(--ink); }
.kpi-val { font-family: var(--font-display); font-size: 2.3rem; font-weight: 500; line-height: 1; letter-spacing: -.03em; font-variation-settings: "opsz" 96, "SOFT" 40; }
.kpi-sub { font-size: .78rem; color: var(--ink-3); margin-top: 2px; }
.viz-block { padding: 16px 0 14px; border-top: 1.5px solid var(--ink); display: flex; flex-direction: column; gap: 8px; }
.viz-block h3 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 1.3rem; letter-spacing: -.01em; text-transform: none; color: var(--ink); }
.viz-sub { margin: 0; font-size: .82rem; color: var(--ink-3); }
.viz-svg { width: 100%; height: auto; display: block; overflow: visible; }
.viz-grid { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 4; } .viz-axis { stroke: var(--rule-strong); stroke-width: 1; }
.viz-goal { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 5 4; }
.viz-tick { fill: var(--ink-3); font-size: 10px; font-family: var(--font-mono); } .viz-val { fill: var(--ink); font-size: 11px; font-weight: 700; font-family: var(--font-mono); }
.viz-bar { fill: var(--data); } .viz-line { fill: none; stroke: var(--red); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-area { fill: var(--red); opacity: .09; } .viz-dot { fill: var(--red); stroke: var(--paper); stroke-width: 2; }
.viz-svg g[tabindex]:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.viz-insight { margin: 0; font-size: .92rem; } .viz-empty { margin: 0; color: var(--ink-3); font-size: .9rem; }
.viz-hbars { display: flex; flex-direction: column; gap: 9px; }
.hbar-row { display: grid; grid-template-columns: 96px 1fr 28px; align-items: center; gap: 8px; font-size: .86rem; }
.hbar-val { text-align: right; font-family: var(--font-mono); font-weight: 600; }
.hbar-track { height: 12px; } .hbar-fill { height: 100%; background: var(--ink); border-radius: 0 4px 4px 0; }
.viz-tip { position: absolute; z-index: 5; pointer-events: none; padding: 5px 10px; border-radius: 8px; background: var(--ink); color: var(--paper); font-family: var(--font-mono); font-size: .72rem; white-space: nowrap; }
.viz-table summary { cursor: pointer; font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.viz-table table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: .8rem; }
.viz-table th, .viz-table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--rule); } .viz-table th { font-family: var(--font-mono); font-size: .66rem; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.mistakes-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-family: var(--font-display); font-size: 1.05rem; }
.mistakes-list .old { color: var(--red); text-decoration: line-through; text-decoration-thickness: 2px; } .mistakes-list .new { font-weight: 600; background: linear-gradient(transparent 60%, var(--mark) 60%); } .mistakes-list .times { color: var(--ink-3); font-family: var(--font-mono); font-size: .8rem; }
.level-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.level-list li { display: flex; align-items: center; gap: 12px; }
.level-list .lv { min-width: 40px; text-align: center; padding: 2px 8px; border-radius: 999px; border: 1.5px solid var(--red); color: var(--red); font-family: var(--font-display); font-weight: 700; }
.level-list .lv-src { font-family: var(--font-mono); font-size: .72rem; color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
@media print { body > *:not(#assess) { display: none !important; } #assess { position: static; overflow: visible; } .wiz-nav, .mail-box { display: none; } body::before, .wizard::before { display: none; } }

/* English fragments inside an explanation: the highlighter */
.fix .why mark, .why mark { background: linear-gradient(transparent 55%, var(--mark) 55%); color: inherit; font-family: var(--font-display); font-weight: 600; padding: 0 .1em; }

.retry-hint { margin: 10px 0 0; font-size: .78rem; color: var(--ink-3); }
#ask { display: inline-flex; align-items: center; gap: 6px; }
#ask.rec { background: var(--red); color: var(--paper); }

/* ---------- Account, plans, usage ---------- */
.usage-chip { height: 42px; padding: 0 .85rem; border-width: 1px; border-color: var(--rule-strong); font-family: var(--font-mono); font-size: .76rem; font-weight: 500; gap: .4rem; }
.usage-chip.low { border-color: var(--mark); box-shadow: inset 0 -3px 0 var(--mark); }
.usage-chip.out { border-color: var(--red); color: var(--red); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.field input { width: 100%; font-size: 1.05rem; }
.auth-form .primary { width: 100%; margin-left: 0; }
.auth-swap { text-align: center; margin-top: 6px; }
.form-err { margin: 0; min-height: 1.2em; color: var(--red); font-weight: 600; font-size: .9rem; }
.check a { color: var(--ink); }
.plan-grid { display: grid; gap: 12px; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1.5px solid var(--rule-strong); border-radius: 18px; background: var(--card); }
.plan-card.pick { border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); }
.plan-card.mine { background: var(--paper-2); }
.plan-card h3 { margin: 0; color: var(--ink); font-family: var(--font-display); font-size: 1.35rem; letter-spacing: -.01em; text-transform: none; font-weight: 500; }
.plan-card .badge-rec { position: absolute; top: -10px; right: 14px; }
.plan-price b { font-family: var(--font-display); font-size: 1.9rem; font-weight: 500; }
.plan-price span, .plan-min { color: var(--ink-3); font-size: .92rem; margin: 0; }
.plan-card button { margin-top: 8px; width: 100%; margin-left: 0; }
.plan-close, .acct-foot { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 8px; }
.meter { height: 10px; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--card); }
.meter > i { display: block; height: 100%; background: var(--ink); }
.acct-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.acct-actions .primary { margin-left: 0; }
button.danger, button.link.danger { color: var(--red); }
button.primary.danger { background: var(--red); color: #fff; border-color: var(--red); }

/* ---------- Histórico de conversas ---------- */
.hist-list { display: flex; flex-direction: column; }
.hist-list h3 { margin-top: 20px; }
.hist-item { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 12px 2px; border: 0; border-top: 1.5px solid var(--rule); background: none; color: var(--ink); font: inherit; cursor: pointer; min-height: 56px; }
.hist-item:hover, .hist-item:focus-visible { background: var(--paper-2); }
.hist-title { font-family: var(--font-display); font-size: 1.12rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hist-meta { font-size: .8rem; color: var(--ink-3); }
.hist-thread { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.bubble { max-width: 92%; padding: 10px 14px; border-radius: 14px; border: 1.5px solid var(--rule-strong); background: var(--card); overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; background: var(--paper-2); }
.bubble .who { display: block; font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 2px; }
.bubble p { margin: 0; line-height: 1.45; white-space: pre-wrap; }
.hist-fix { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--rule-strong); display: flex; flex-direction: column; gap: 2px; font-size: .92rem; }
.hist-fix .old { color: var(--red); text-decoration: line-through; }
.hist-fix .new { color: var(--green); font-weight: 600; }
.hist-fix small { color: var(--ink-3); }
.hist-fix.ok { color: var(--ink-2); }

/* ---------- Dudu: modo sem filtro ---------- */
.uncensor { margin-top: 4px; padding: 12px 14px; border: 1.5px dashed var(--rule-strong); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; }
.uncensor-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.uncensor-row input { flex: none; width: 22px; height: 22px; margin-top: 1px; accent-color: var(--red); }

.fix .roast { font-weight: 700; margin-bottom: 6px; }
