:root {
  color-scheme: light;
  --bg: #f7f3ea;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #e8dfcf;
  --brand: #6d5dfc;
  --brand-dark: #372fb5;
  --gold: #f3b956;
  --green: #16885e;
  --red: #c2413d;
  --soft: #fff8e8;
  --shadow: 0 18px 50px rgba(23, 32, 51, .10);
  --radius: 24px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(109, 93, 252, .16), transparent 38rem),
    radial-gradient(circle at bottom right, rgba(243, 185, 86, .18), transparent 34rem),
    var(--bg);
  color: var(--ink);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .72; }

.boot-card {
  width: min(420px, calc(100% - 32px));
  margin: 18vh auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px;
  text-align: center;
}
.logo-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--ink), var(--brand));
  color: #fff;
  font-weight: 900;
  letter-spacing: -.04em;
  box-shadow: 0 14px 30px rgba(109, 93, 252, .25);
}
.logo-mark.large { width: 76px; height: 76px; border-radius: 26px; font-size: 1.4rem; }

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 28px;
  padding: clamp(20px, 5vw, 72px);
  align-items: center;
}
.auth-page.single { grid-template-columns: minmax(0, 780px); justify-content: center; }
.auth-hero, .auth-card, .card {
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(232, 223, 207, .9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.auth-hero { padding: clamp(28px, 5vw, 64px); }
.auth-hero h1 { font-size: clamp(2.5rem, 6vw, 5.4rem); line-height: .95; margin: 24px 0 18px; letter-spacing: -.07em; }
.auth-hero p { color: var(--muted); font-size: 1.12rem; max-width: 62ch; line-height: 1.7; }
.auth-hero ul { margin: 28px 0 0; padding-left: 22px; color: #354052; line-height: 1.8; }
.auth-card { padding: 30px; }
.auth-card.wide { max-width: 820px; }
.auth-card h2 { margin-top: 0; font-size: 1.9rem; letter-spacing: -.04em; }
.auth-card form, .settings-card form { display: grid; gap: 16px; }
label { display: grid; gap: 8px; color: #334155; font-weight: 700; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
textarea { resize: vertical; line-height: 1.6; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(109, 93, 252, .12); }
pre { overflow: auto; background: #111827; color: #e5e7eb; padding: 20px; border-radius: 18px; }

.primary-btn, .secondary-btn, .ghost-btn, .link-btn, .sample-chip, .tab, .category-btn, .studied-row, .option {
  border: 0;
  border-radius: 999px;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.primary-btn {
  background: linear-gradient(135deg, var(--ink), var(--brand));
  color: #fff;
  padding: 14px 20px;
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(109, 93, 252, .22);
}
.secondary-btn {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 13px 18px;
  font-weight: 850;
}
.secondary-btn.full { width: 100%; margin-top: 12px; }
.ghost-btn { background: rgba(255,255,255,.12); color: #fff; padding: 10px 14px; font-weight: 850; }
.link-btn { background: transparent; color: var(--brand-dark); padding: 12px 4px; font-weight: 850; }
.primary-btn:hover, .secondary-btn:hover, .sample-chip:hover, .option:hover { transform: translateY(-1px); }

.app-shell { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: #172033;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.brand { display: flex; gap: 14px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand strong { display: block; font-size: 1.05rem; }
.brand span { color: rgba(255,255,255,.62); font-size: .82rem; }
.tabs { display: grid; gap: 10px; }
.tab {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.82);
  text-align: left;
  padding: 14px 16px;
  font-weight: 850;
}
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 14px 34px rgba(0,0,0,.22); }
.user-card { margin-top: auto; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 22px; padding: 18px; display: grid; gap: 10px; }
.user-card small { color: rgba(255,255,255,.58); }
.user-card strong { word-break: break-word; }
.main-panel { padding: clamp(18px, 4vw, 46px); max-width: 1280px; width: 100%; }

.alert { padding: 14px 16px; border-radius: 18px; margin-bottom: 16px; font-weight: 750; }
.alert.error { background: #fff0f0; color: var(--red); border: 1px solid #ffd0d0; }
.alert.success { background: #ecfdf5; color: var(--green); border: 1px solid #bcebd8; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.page-head h1 { margin: 4px 0 8px; font-size: clamp(2rem, 4vw, 3.6rem); line-height: 1; letter-spacing: -.07em; }
.page-head p { margin: 0; color: var(--muted); max-width: 68ch; line-height: 1.6; }
.eyebrow { color: var(--brand-dark) !important; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 900; }
.card { padding: clamp(20px, 3vw, 30px); margin-bottom: 20px; }
.card.soft { background: var(--soft); }
.textarea-label { margin-bottom: 8px; }
.form-footer { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-top: 16px; }
.form-footer small, .muted { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.sample-chip { background: #fff; border: 1px solid var(--line); padding: 10px 14px; color: #334155; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 24px; box-shadow: 0 8px 24px rgba(23, 32, 51, .06); }
.stat-card strong { display: block; font-size: 2.3rem; letter-spacing: -.05em; }
.stat-card span { color: var(--muted); }
.center-card { text-align: center; padding: 54px 28px; }

.exercise-summary { display: flex; justify-content: space-between; gap: 18px; align-items: center; }
.exercise-summary strong { display: block; font-size: 1.2rem; }
.exercise-summary span { color: var(--muted); }
.score-pill, .type-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #ecfdf5;
  color: var(--green);
  padding: 10px 14px;
  font-weight: 900;
}
.post-exercise-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  background: #fffdf6;
}
.post-exercise-card h2 { margin: 0 0 8px; letter-spacing: -.03em; }
.post-exercise-card p { margin: 0; color: var(--muted); line-height: 1.55; }
.post-exercise-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

.question-list { display: grid; gap: 18px; }
.question-card { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 22px; box-shadow: 0 8px 24px rgba(23,32,51,.06); }
.question-card.is-correct { border-color: rgba(22, 136, 94, .45); }
.question-card.is-wrong { border-color: rgba(194, 65, 61, .45); }
.question-top { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: .9rem; }
.question-top strong { color: var(--brand-dark); }
.question-sentence { font-size: 1.25rem; line-height: 1.55; font-weight: 760; }
.option-grid { display: grid; gap: 10px; }
.option { text-align: left; background: #f8fafc; border: 1px solid #e5e7eb; padding: 13px 15px; color: #273244; border-radius: 16px; }
.option b { margin-right: 8px; }
.option.selected { background: #eeeefe; border-color: rgba(109, 93, 252, .55); }
.option.correct-option { background: #ecfdf5; border-color: rgba(22, 136, 94, .6); color: #075e3f; }
.option.wrong-option { background: #fff1f2; border-color: rgba(194, 65, 61, .55); color: #991b1b; }
.correction-box { margin-top: 16px; padding: 16px; border-radius: 18px; line-height: 1.6; }
.correction-box.ok { background: #ecfdf5; color: #075e3f; }
.correction-box.bad { background: #fff1f2; color: #7f1d1d; }
.correction-box p { margin: 8px 0 0; }

.sort-select { max-width: 240px; }
.studied-layout { display: grid; grid-template-columns: 260px minmax(220px, 340px) minmax(0, 1fr); gap: 18px; align-items: start; }
.category-panel h2, .studied-list-card h2 { margin-top: 0; }
.category-btn { width: 100%; display: flex; justify-content: space-between; gap: 14px; padding: 13px 14px; margin-bottom: 8px; background: #f8fafc; color: #334155; border: 1px solid #e5e7eb; }
.category-btn.active { background: var(--ink); color: #fff; }
.studied-list { display: grid; gap: 8px; max-height: 560px; overflow: auto; padding-right: 4px; }
.studied-row { width: 100%; display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: left; background: #f8fafc; color: #334155; padding: 12px 14px; border: 1px solid #e5e7eb; border-radius: 16px; }
.studied-row span { font-weight: 850; }
.studied-row small { color: var(--muted); white-space: nowrap; }
.studied-row.active { background: #eeeefe; border-color: rgba(109, 93, 252, .45); }
.detail-card h2 { font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.06em; margin: 12px 0; }
.detail-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.detail-head small { color: var(--muted); }
.ipa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
.ipa-grid div { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 18px; padding: 16px; }
.ipa-grid span { display: block; color: var(--muted); font-size: .82rem; }
.ipa-grid strong { font-size: 1.1rem; }
.examples-list { padding-left: 22px; line-height: 1.7; }
.examples-list li { margin-bottom: 10px; }
.examples-list small { display: block; color: var(--muted); }
details { border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-top: 20px; }
summary { cursor: pointer; font-weight: 900; }
.details-content { margin-top: 14px; color: #334155; line-height: 1.65; }

.settings-card { max-width: 620px; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .tabs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tab { text-align: center; padding: 12px 8px; }
  .user-card { margin-top: 0; }
  .studied-layout { grid-template-columns: 1fr; }
  .studied-list { max-height: 340px; }
}

@media (max-width: 760px) {
  .auth-page { grid-template-columns: 1fr; padding: 18px; }
  .auth-hero h1 { font-size: 3rem; }
  .page-head, .form-footer, .exercise-summary, .post-exercise-card { flex-direction: column; align-items: stretch; }
  .stats-grid, .ipa-grid { grid-template-columns: 1fr; }
  .tabs { display: flex; overflow-x: auto; padding-bottom: 6px; }
  .tab { min-width: 108px; }
  .main-panel { padding: 18px; }
  .question-top, .detail-head { flex-direction: column; }
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.input-actions small { color: var(--muted); }
.voice-btn { white-space: nowrap; }
.study-results { margin-bottom: 20px; }
.study-results > h2 { margin: 0 0 6px; font-size: 1.8rem; letter-spacing: -.04em; }
.study-results > p { margin: 0 0 14px; }
.study-result-card h2 { font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.06em; margin: 12px 0; }
.study-explanation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.study-explanation-grid > div {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 16px;
}
.study-explanation-grid h3 { margin-top: 0; }
.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 12px 0 16px;
}
.search-row input { min-width: 0; }

@media (max-width: 760px) {
  .study-explanation-grid, .search-row { grid-template-columns: 1fr; }
}

.exercise-progress-card {
  position: sticky;
  top: 18px;
  z-index: 8;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(226, 232, 240, .9);
  box-shadow: 0 16px 42px rgba(23, 32, 51, .09);
}
.exercise-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}
.exercise-progress-head strong {
  display: block;
  font-size: 1.15rem;
}
.exercise-progress-head span {
  color: var(--muted);
  display: block;
  margin-top: 4px;
  line-height: 1.45;
}
.progress-percent,
.score-mini {
  min-width: 72px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eeeefe;
  color: var(--brand-dark);
  font-weight: 950;
  font-size: 1.05rem;
}
.score-mini {
  background: #ecfdf5;
  color: var(--green);
}
.progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}
.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-dark), var(--brand));
  transition: width .25s ease;
}
.question-list.has-sticky-submit {
  padding-bottom: 110px;
}
.sticky-submit-bar {
  position: sticky;
  bottom: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  margin-top: 18px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(226, 232, 240, .95);
  border-radius: 24px;
  box-shadow: 0 18px 48px rgba(23, 32, 51, .16);
  backdrop-filter: blur(14px);
}
.sticky-submit-bar strong {
  display: block;
  font-size: 1rem;
}
.sticky-submit-bar span {
  display: block;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.35;
}
.sticky-submit-bar .primary-btn:disabled,
.primary-btn:disabled {
  cursor: not-allowed;
  opacity: .55;
  filter: grayscale(.15);
}
.score-panel {
  text-align: center;
  background: radial-gradient(circle at 50% 10%, #ffffff 0, #fffdf6 48%, #f6f0ff 100%);
  border: 1px solid rgba(109, 93, 252, .16);
}
.score-panel .eyebrow {
  margin: 0 0 8px;
}
.score-big {
  font-size: clamp(4rem, 11vw, 8rem);
  line-height: .88;
  letter-spacing: -.09em;
  font-weight: 950;
  color: var(--ink);
}
.score-percent-big {
  margin-top: 8px;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  font-weight: 950;
  color: var(--brand-dark);
}
.score-emoji {
  font-size: clamp(3rem, 9vw, 6rem);
  line-height: 1;
  margin: 14px 0 10px;
}
.score-panel p:last-child {
  margin: 0 auto;
  color: var(--muted);
  max-width: 54ch;
  line-height: 1.6;
}
.correction-status {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}
.correction-status span {
  opacity: .88;
}
.answer-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 14px;
}
.answer-review {
  background: rgba(255, 255, 255, .65);
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 16px;
  padding: 12px;
}
.answer-review small {
  display: block;
  margin-bottom: 4px;
  font-size: .78rem;
  color: rgba(15, 23, 42, .62);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.answer-review b {
  display: block;
  line-height: 1.45;
}
.answer-review.selected-ok,
.answer-review.correct-answer {
  border-color: rgba(22, 136, 94, .32);
}
.answer-review.selected-bad {
  border-color: rgba(194, 65, 61, .32);
}

@media (max-width: 760px) {
  .exercise-progress-card {
    top: 10px;
  }
  .exercise-progress-head,
  .sticky-submit-bar,
  .answer-review-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }
  .sticky-submit-bar {
    bottom: 10px;
    border-radius: 20px;
  }
}


/* v8 - theme, reset, and PDF selection tools */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f172a;
  --panel: #111827;
  --ink: #f8fafc;
  --muted: #a7b0c0;
  --line: #263347;
  --brand: #8b7cff;
  --brand-dark: #b6adff;
  --gold: #f3b956;
  --green: #6ee7b7;
  --red: #fca5a5;
  --soft: #172033;
  --shadow: 0 18px 50px rgba(0, 0, 0, .34);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(139, 124, 255, .18), transparent 38rem),
    radial-gradient(circle at bottom right, rgba(243, 185, 86, .10), transparent 34rem),
    var(--bg);
}

:root[data-theme="dark"] .auth-hero,
:root[data-theme="dark"] .auth-card,
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .stat-card,
:root[data-theme="dark"] .question-card,
:root[data-theme="dark"] .secondary-btn,
:root[data-theme="dark"] .sample-chip,
:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select {
  background: rgba(17, 24, 39, .92);
  color: var(--ink);
  border-color: var(--line);
}

:root[data-theme="dark"] .sidebar {
  background: #0b1220;
}

:root[data-theme="dark"] .tab.active {
  background: #f8fafc;
  color: #172033;
}

:root[data-theme="dark"] .auth-hero ul,
:root[data-theme="dark"] label,
:root[data-theme="dark"] .details-content {
  color: #d7deea;
}

:root[data-theme="dark"] .category-btn,
:root[data-theme="dark"] .studied-row,
:root[data-theme="dark"] .option,
:root[data-theme="dark"] .ipa-grid div,
:root[data-theme="dark"] .study-explanation-grid > div,
:root[data-theme="dark"] .exercise-progress-card,
:root[data-theme="dark"] .sticky-submit-bar,
:root[data-theme="dark"] .progress-track {
  background: #172033;
  color: #e5e7eb;
  border-color: #263347;
}

:root[data-theme="dark"] .category-btn.active {
  background: linear-gradient(135deg, #f8fafc, #dbe2ff);
  color: #172033;
}

:root[data-theme="dark"] .studied-row.active,
:root[data-theme="dark"] .option.selected {
  background: rgba(139, 124, 255, .22);
  border-color: rgba(139, 124, 255, .5);
}

:root[data-theme="dark"] .post-exercise-card,
:root[data-theme="dark"] .score-panel {
  background: linear-gradient(135deg, #111827, #172033);
}

:root[data-theme="dark"] .score-big {
  color: var(--ink);
}

:root[data-theme="dark"] .answer-review {
  background: rgba(15, 23, 42, .62);
  border-color: rgba(255, 255, 255, .12);
}

:root[data-theme="dark"] .answer-review small {
  color: rgba(248, 250, 252, .68);
}

:root[data-theme="dark"] .alert.error {
  background: rgba(127, 29, 29, .24);
  border-color: rgba(252, 165, 165, .35);
  color: #fecaca;
}

:root[data-theme="dark"] .alert.success {
  background: rgba(6, 78, 59, .24);
  border-color: rgba(110, 231, 183, .35);
  color: #bbf7d0;
}

.selection-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(248, 250, 252, .78);
}

:root[data-theme="dark"] .selection-toolbar {
  background: rgba(15, 23, 42, .62);
}

.selection-toolbar span {
  color: var(--muted);
  font-weight: 800;
  margin-right: auto;
}

.compact {
  padding: 9px 12px !important;
  font-size: .88rem;
}

.studied-list.selectable {
  gap: 10px;
}

.studied-row-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.select-checkbox {
  width: 22px;
  height: 22px;
  padding: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.danger-zone {
  border-color: rgba(194, 65, 61, .28);
}

.danger-zone h2 {
  margin-top: 0;
}

.danger-zone p {
  color: var(--muted);
  line-height: 1.6;
}

.danger-btn {
  border-color: rgba(194, 65, 61, .32);
  color: #991b1b;
}

:root[data-theme="dark"] .danger-btn {
  color: #fecaca;
}

@media (max-width: 760px) {
  .selection-toolbar {
    align-items: stretch;
  }

  .selection-toolbar span {
    width: 100%;
  }

  .selection-toolbar .compact {
    width: 100%;
  }
}

/* v9 - ajustes visíveis para tema e exportação */
.theme-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 6px 0 18px;
}

.theme-choice {
  border: 1px solid rgba(109, 93, 252, .22);
  background: rgba(255, 255, 255, .72);
  border-radius: 22px;
  padding: 18px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 6px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, .06);
}

.theme-choice span {
  font-size: 30px;
}

.theme-choice strong {
  color: var(--ink);
  font-size: 17px;
}

.theme-choice small {
  color: var(--muted);
  line-height: 1.45;
}

.theme-choice.active {
  border-color: var(--brand);
  box-shadow: 0 18px 44px rgba(109, 93, 252, .20);
  outline: 3px solid rgba(109, 93, 252, .12);
}

.export-shortcut-card {
  margin-top: 4px;
}

.export-shortcut-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.export-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

:root[data-theme="dark"] .theme-choice {
  background: rgba(30, 41, 59, .72);
  border-color: rgba(148, 163, 184, .18);
}

:root[data-theme="dark"] .theme-choice.active {
  border-color: #a78bfa;
  outline-color: rgba(167, 139, 250, .18);
}

@media (max-width: 720px) {
  .theme-choice-grid {
    grid-template-columns: 1fr;
  }

  .export-shortcut-head {
    flex-direction: column;
  }
}

/* v10 - Início/dashboard profissional */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, .65fr);
  gap: 24px;
  align-items: stretch;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 12% 18%, rgba(109, 93, 252, .18), transparent 30rem),
    linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(255, 248, 232, .86));
}
.home-hero::after {
  content: '';
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  right: -80px;
  top: -90px;
  background: radial-gradient(circle, rgba(109, 93, 252, .20), transparent 68%);
  pointer-events: none;
}
.home-hero-copy {
  position: relative;
  z-index: 1;
}
.home-hero h1 {
  margin: 8px 0 12px;
  font-size: clamp(2.6rem, 6vw, 5.3rem);
  line-height: .92;
  letter-spacing: -.08em;
}
.home-hero p {
  color: var(--muted);
  line-height: 1.75;
  max-width: 68ch;
}
.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.home-score-card {
  position: relative;
  z-index: 1;
  min-height: 260px;
  border-radius: 28px;
  padding: 26px;
  display: grid;
  place-items: center;
  text-align: center;
  background:
    linear-gradient(160deg, rgba(23, 32, 51, .96), rgba(55, 47, 181, .88)),
    var(--ink);
  color: #fff;
  box-shadow: 0 26px 58px rgba(55, 47, 181, .28);
}
.home-score-card strong {
  display: block;
  font-size: 1.15rem;
  margin-top: 10px;
}
.home-score-card small {
  color: rgba(255, 255, 255, .70);
  line-height: 1.5;
  max-width: 28ch;
}
.home-ring {
  --value: 0;
  width: 150px;
  height: 150px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #172033 0 54%, transparent 55%),
    conic-gradient(#fff calc(var(--value) * 1%), rgba(255, 255, 255, .20) 0);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 18px 42px rgba(0, 0, 0, .24);
}
.home-ring span {
  font-size: 2.2rem;
  font-weight: 950;
  letter-spacing: -.05em;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.dashboard-metric {
  margin-bottom: 0;
  min-height: 205px;
  display: grid;
  align-content: start;
  gap: 8px;
  background: rgba(255, 255, 255, .90);
  border: 1px solid rgba(232, 223, 207, .86);
}
.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #f4f1ff;
  font-size: 1.45rem;
}
.dashboard-metric strong {
  display: block;
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  line-height: .95;
  letter-spacing: -.07em;
  color: var(--ink);
}
.dashboard-metric span {
  color: var(--ink);
  font-weight: 900;
}
.dashboard-metric small {
  color: var(--muted);
  line-height: 1.45;
}
.home-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: 18px;
  align-items: start;
}
.secondary-home-panels {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.analytics-card {
  min-height: 340px;
}
.analytics-card h2 {
  margin: 2px 0 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  letter-spacing: -.05em;
}
.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}
.category-bars {
  display: grid;
  gap: 16px;
}
.category-bar-row {
  display: grid;
  gap: 8px;
}
.category-bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.category-bar-meta strong {
  color: var(--ink);
}
.category-bar-meta span {
  color: var(--muted);
  font-size: .9rem;
  white-space: nowrap;
}
.category-bar-track {
  height: 13px;
  border-radius: 999px;
  background: #eceff5;
  overflow: hidden;
}
.category-bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-dark), var(--brand), #9f8cff);
  box-shadow: 0 10px 22px rgba(109, 93, 252, .20);
}
.focus-card {
  background:
    radial-gradient(circle at top right, rgba(243, 185, 86, .20), transparent 20rem),
    rgba(255, 255, 255, .90);
}
.focus-list {
  display: grid;
  gap: 12px;
  margin: 22px 0;
}
.focus-list div {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(248, 250, 252, .78);
}
.focus-list b {
  font-size: 2rem;
  color: var(--brand-dark);
  line-height: 1;
  letter-spacing: -.05em;
}
.focus-list span {
  color: var(--muted);
  line-height: 1.45;
}
.mini-progress {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.mini-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: .92rem;
}
.recent-list,
.session-list {
  display: grid;
  gap: 10px;
}
.recent-item,
.session-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(248, 250, 252, .82);
  border-radius: 18px;
  padding: 14px 16px;
  color: var(--ink);
}
.recent-item span,
.session-item strong {
  font-weight: 900;
}
.recent-item small,
.session-item small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.session-item b {
  color: var(--brand-dark);
  white-space: nowrap;
}
:root[data-theme="dark"] .home-hero {
  background:
    radial-gradient(circle at 12% 18%, rgba(139, 124, 255, .18), transparent 30rem),
    linear-gradient(135deg, rgba(17, 24, 39, .96), rgba(23, 32, 51, .92));
}
:root[data-theme="dark"] .dashboard-metric,
:root[data-theme="dark"] .focus-card {
  background: rgba(17, 24, 39, .92);
  border-color: var(--line);
}
:root[data-theme="dark"] .metric-icon,
:root[data-theme="dark"] .focus-list div,
:root[data-theme="dark"] .recent-item,
:root[data-theme="dark"] .session-item,
:root[data-theme="dark"] .category-bar-track {
  background: #172033;
  border-color: #263347;
}
:root[data-theme="dark"] .home-score-card {
  background: linear-gradient(160deg, #0b1220, rgba(55, 47, 181, .66));
}
:root[data-theme="dark"] .home-ring {
  background:
    radial-gradient(circle at center, #0b1220 0 54%, transparent 55%),
    conic-gradient(#f8fafc calc(var(--value) * 1%), rgba(255, 255, 255, .14) 0);
}
@media (max-width: 1180px) {
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-panels,
  .secondary-home-panels { grid-template-columns: 1fr; }
}
@media (max-width: 1050px) {
  .tabs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .home-hero { grid-template-columns: 1fr; }
  .home-score-card { min-height: auto; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .section-title-row,
  .category-bar-meta,
  .recent-item,
  .session-item { flex-direction: column; align-items: flex-start; }
  .focus-list div { grid-template-columns: 1fr; }
  .home-actions > button { width: 100%; }
}
