:root {color-scheme:light;}
* {box-sizing:border-box;}
html,body {margin:0; min-height:100%; background:#fff; color:#111;}
body,button,select,input,textarea {font:14px/1.5 Consolas,"Lucida Console","Courier New",monospace;}
body {overflow-y:scroll;}
main {padding:19px 22px 45px; max-width:960px;}
.screen[hidden], [hidden] {display:none!important;}
.plain-title {font-weight:normal; font-size:14px; margin:0 0 22px;}
.field {display:grid; grid-template-columns:105px minmax(180px,400px); column-gap:10px; align-items:center; margin:0 0 12px;}
.field label {color:#222;}
select,input[type="text"],textarea {background:white; color:#111; padding:5px 6px; border:1px solid #888; border-radius:0; max-width:100%;}
textarea {resize:vertical; min-height:75px; width:100%; max-width:100%; margin-top:5px; padding:7px 9px;}
input[type="text"] {min-width:0;}
button {background:#fff; color:#111; border:1px solid #888; padding:5px 12px; border-radius:0; cursor:pointer;}
button:hover, button:focus-visible {background:#eee;}
button:disabled {opacity:0.35; cursor:default; background:white;}
.buttons {display:flex; align-items:center; flex-wrap:wrap; gap:14px; margin-top:24px;}
.note {color:#555; font-size:13px;}
#quantity {white-space:nowrap;}
#study .bar {display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:28px; max-width:900px;}
.right-bar {display:flex;align-items:center;gap:18px;}
#notebook-toggle {min-width:94px;}
#counter {font-size:13px; color:#555; font-variant-numeric:tabular-nums;}
#question {white-space:pre-wrap; overflow-wrap:anywhere; font-size:14px; line-height:1.68; margin:0 0 22px;}
#question.richquestion {white-space:normal;}
#question.richquestion h2 {font:inherit; margin:0 0 12px; font-weight:normal;}
#question.richquestion p {margin:0 0 11px;}
#question.richquestion table {border-collapse:collapse; font:inherit; margin:13px 0 20px; max-width:100%;} 
#question.richquestion table td, #question.richquestion table th {border:1px solid #999; padding:5px 9px; vertical-align:middle;}
#question.richquestion table p {margin:0;}
#question.richquestion img {display:block;max-width:100%;max-height:70vh;object-fit:contain;margin:12px 0 20px;}
#explanation:has(.rich-comment) {white-space:normal;}
#explanation-body.rich-comment {white-space:normal;}
#explanation-body.rich-comment p {margin:0 0 11px;}
#explanation-body.rich-comment table {border-collapse:collapse;max-width:100%;font:inherit;margin:12px 0 20px;}
#explanation-body.rich-comment td, #explanation-body.rich-comment th {border:1px solid #999;padding:5px 9px;vertical-align:middle;}
#explanation-body.rich-comment table p {margin:0;}
#explanation-body.rich-comment img {display:block;max-width:100%;max-height:70vh;object-fit:contain;margin:12px 0 20px;}
#question.richquestion ul, #question.richquestion ol {padding-left:30px;}
#figures img {display:block; max-width:100%; max-height:70vh; object-fit:contain; margin:12px 0 22px;}
#options {display:flex; flex-direction:column; align-items:stretch; gap:2px; max-width:890px;}
.option-row {display:flex; align-items:flex-start; gap:3px; width:100%;}
.option-row .option {flex:1 1 auto; min-width:0; width:auto;}
.scissors {flex:0 0 29px; width:29px; min-height:38px; padding:6px 1px; border:1px solid transparent; background:white; text-align:center; font-family:"Segoe UI Symbol","DejaVu Sans",sans-serif; font-size:18px; line-height:1.5; color:#333;}
.scissors:hover, .scissors:focus-visible {background:#eee;}
.scissors[aria-pressed="true"] {color:#111;}
.option-row.cut .option .letter, .option-row.cut .option .body {text-decoration:line-through; text-decoration-thickness:1px; color:#666;}
.option {display:flex; gap:11px; width:100%; text-align:left; border:1px solid transparent; padding:8px 7px; background:#fff; line-height:1.6;}
.option:hover {background:#f2f2f2;}
.option:focus-visible {outline:1px solid #111; outline-offset:1px;}
.option.selected {background:#eee; border-left:2px solid #333; padding-left:6px;}
.option .letter {flex:0 0 29px;}
.option .body {white-space:pre-wrap; overflow-wrap:anywhere;}
#result {margin-top:19px; white-space:pre-wrap;}
#feedback-actions {display:flex; gap:14px; align-items:center; margin:11px 0 5px; flex-wrap:wrap;}
.linkbutton {border:0; padding:0; text-decoration:underline; text-underline-offset:3px;}
.linkbutton:hover {background:transparent;}
#explanation {margin-top:16px; border-top:1px solid #bbb; padding-top:13px; white-space:pre-wrap; line-height:1.65; overflow-wrap:anywhere; max-width:890px;}
#explanation-title {margin-bottom:12px;}
#missing-figure {color:#555; margin-top:12px;}
#navigation {display:flex; align-items:center; gap:12px; margin-top:29px;}
#navigation #next {margin-left:2px;}
details {margin-top:48px; color:#444; max-width:560px;}
details summary {cursor:pointer; user-select:none;}
.small-button {font-size:12px; padding:4px 9px; margin:10px 6px 0 0;}
#storage-message {margin:10px 0; font-size:12px;}
input[type=file] {position:absolute; width:1px; height:1px; opacity:0; pointer-events:none;}
#empty-session {margin-top:18px;}
#notebook-panel {max-width:880px; border:1px solid #bcbcbc; margin:-8px 0 25px; padding:13px 15px 15px;}
#notebook-panel .panel-title {margin-bottom:8px;}
#question-notebook-list {margin-bottom:8px;}
#question-notebook-list label {display:flex;align-items:center;gap:9px;margin:7px 0;cursor:pointer;}
#question-notebook-list input[type="checkbox"] {width:15px;height:15px;accent-color:#333;}
.inline-create {display:flex;align-items:center; flex-wrap:wrap;gap:8px;margin:9px 0;}
.inline-create input {min-width:160px; max-width:350px; flex:1 1 210px; padding:5px 7px;}
#notebook-panel .inline-create {margin-bottom:18px;}
.notebook-row {display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:8px 0;}
.notebook-row .nb-name {width:330px;max-width:100%;overflow-wrap:anywhere;}
.notebook-row input[type="text"] {width:330px;max-width:100%;padding:4px 7px;}
.notebook-row button {margin:0;}
.label-block {display:block;margin-top:6px;}
.small-status {font-size:12px;color:#555; margin-top:6px;min-height:18px;}
#question-note {width:100%;}
#notebooks-settings {margin-top:34px;}
#data-settings {margin-top:18px;}

@media (max-width:620px) {main {padding:14px 12px 40px;} .field {grid-template-columns:1fr; row-gap:3px;} #study .bar {margin-bottom:20px;} .option {padding:9px 3px;} .option.selected {padding-left:2px;} #question {line-height:1.6;}}

/* Aprimoramentos da versao 2: visual minimalista, acessivel e responsivo. */
.setup-header,.report-header {display:flex;align-items:center;justify-content:space-between;gap:12px;max-width:920px;margin-bottom:22px;}
.setup-header .plain-title {margin:0;}
.theme-button {white-space:nowrap;margin:0;font-size:12px;}
input[type="search"] {min-width:0;background:#fff;color:#111;padding:5px 6px;border:1px solid #888;border-radius:0;max-width:100%;width:100%;}
.secondary-actions {display:flex;gap:10px;flex-wrap:wrap;margin-top:7px;}
.secondary-actions .small-button {margin:0;}
.setup-help {margin-top:20px;max-width:740px;}
#study .bar {flex-wrap:wrap;}
#study .right-bar {gap:9px;flex-wrap:wrap;justify-content:flex-end;}
#study .right-bar .small-button {margin:0;}
#flag[aria-pressed="true"] {font-weight:bold;}
.mock-meta {display:flex;justify-content:space-between;align-items:center;gap:14px;max-width:900px;margin:-8px 0 24px;padding:9px 0;border-top:1px solid #ddd;border-bottom:1px solid #ddd;color:#555;font-size:13px;}
.mock-meta strong {font-weight:normal;color:#111;font-variant-numeric:tabular-nums;}
.option.keyboard-selected {outline:2px solid #666;outline-offset:-2px;background:#eee;}
.option.correct-answer {border-left:3px solid #24764a;padding-left:5px;}
.option.wrong-answer {border-left:3px solid #b44141;padding-left:5px;}
.keyboard-hint {margin-top:12px;}
#navigation {flex-wrap:wrap;}
#finish-sim {border-color:#333;font-weight:bold;}
.report-header {margin-bottom:40px;}
.report-title {font-size:17px;font-weight:normal;margin:0 0 15px;}
.report-score {font-size:18px;line-height:1.5;margin-bottom:7px;}
.report-divider {border-top:1px solid #bbb;margin:22px 0 14px;max-width:890px;}
.report-row {display:flex;justify-content:space-between;align-items:center;gap:16px;min-height:44px;border-bottom:1px solid #ddd;max-width:890px;padding:7px 0;}
.report-row span {overflow-wrap:anywhere;}
.report-row button {flex-shrink:0;margin:0;}
#question.richquestion .table-scroll,#explanation-body.rich-comment .table-scroll {max-width:100%;overflow-x:auto;margin:13px 0 20px;}
#question.richquestion .table-scroll table,#explanation-body.rich-comment .table-scroll table {margin:0;min-width:max-content;}
#question.richquestion pre,#explanation-body.rich-comment pre {white-space:pre;overflow-x:auto;max-width:100%;padding:11px 13px;border:1px solid #ccc;background:#f7f7f7;}
#question.richquestion code,#explanation-body.rich-comment code {font-family:Consolas,"Courier New",monospace;overflow-wrap:anywhere;}
#question.richquestion table th,#explanation-body.rich-comment table th {background:#f2f2f2;}
@media(max-width:620px) {
  #study .bar {align-items:flex-start;}
  #study .right-bar {justify-content:flex-start;gap:6px;}
  #counter {align-self:center;}
  #flag,#notebook-toggle {min-width:auto;}
  .mock-meta {align-items:flex-start;flex-wrap:wrap;}
  .report-row {align-items:flex-start;}
  .report-score {font-size:16px;}
}
/* Tema escuro: todas as areas essenciais mantem contraste alto. */
html[data-theme="dark"],html[data-theme="dark"] body {background:#121519;color:#e8edf3;}
html[data-theme="dark"] .field label,html[data-theme="dark"] #mock-meta strong {color:#e8edf3;}
html[data-theme="dark"] .note,html[data-theme="dark"] #counter,html[data-theme="dark"] #mock-meta,
html[data-theme="dark"] #missing-figure,html[data-theme="dark"] .small-status,
html[data-theme="dark"] #quantity {color:#b0bbc9;}
html[data-theme="dark"] details {color:#cbd2dc;}
html[data-theme="dark"] button,html[data-theme="dark"] select,
html[data-theme="dark"] input[type="text"],html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] textarea {background:#171d23;color:#edf1f5;border-color:#75808d;}
html[data-theme="dark"] button:hover,html[data-theme="dark"] button:focus-visible {background:#26313b;}
html[data-theme="dark"] button:disabled {background:#171d23;}
html[data-theme="dark"] .scissors,html[data-theme="dark"] .option {background:#121519;color:#edf1f5;border-color:transparent;}
html[data-theme="dark"] .option:hover,html[data-theme="dark"] .scissors:hover {background:#24303a;}
html[data-theme="dark"] .option.selected,html[data-theme="dark"] .option.keyboard-selected {background:#2b3845;}
html[data-theme="dark"] .option.keyboard-selected {outline-color:#9aaebe;}
html[data-theme="dark"] .option:focus-visible {outline-color:#dee8f0;}
html[data-theme="dark"] .option-row.cut .option .letter,html[data-theme="dark"] .option-row.cut .option .body {color:#92a0ad;}
html[data-theme="dark"] #explanation {border-top-color:#65717d;}
html[data-theme="dark"] #notebook-panel {border-color:#667584;}
html[data-theme="dark"] .report-divider,html[data-theme="dark"] .mock-meta,
html[data-theme="dark"] .report-row {border-color:#495865;}
html[data-theme="dark"] #question.richquestion table td,html[data-theme="dark"] #question.richquestion table th,
html[data-theme="dark"] #explanation-body.rich-comment table td,html[data-theme="dark"] #explanation-body.rich-comment table th {border-color:#7e8e9f;}
html[data-theme="dark"] #question.richquestion table th,html[data-theme="dark"] #explanation-body.rich-comment table th {background:#28323c;}
html[data-theme="dark"] #question.richquestion pre,html[data-theme="dark"] #explanation-body.rich-comment pre {background:#1b2530;border-color:#64717e;}
html[data-theme="dark"] #notebook-toggle,html[data-theme="dark"] #flag {background:#171d23;}
html[data-theme="dark"] #finish-sim {border-color:#e5edf6;}
html[data-theme="dark"] #question-notebook-list input[type="checkbox"] {accent-color:#accbf0;}


/* Evita expansao horizontal causada pelo texto longo dos menus em telas pequenas. */
#setup .field {grid-template-columns:125px minmax(0,400px);}
#setup .field select {min-width:0;width:100%;}
@media(max-width:620px) {#setup .field {grid-template-columns:minmax(0,1fr);}}

/* Melhorias v4: novos recursos de estudo mantendo a linguagem visual original. */
:root {--reading-size:16px;}
#question {font-size:var(--reading-size);}
.option {font-size:var(--reading-size);}
#explanation,#explanation-body {font-size:var(--reading-size);}
#question.richquestion h2,#question.richquestion table,#explanation-body.rich-comment table {font-size:inherit;}
#question.richquestion table {font-size:var(--reading-size);}
.font-config {display:flex;align-items:center;gap:12px;margin:13px 0;flex-wrap:wrap;}
.font-config button {padding:3px 9px;min-width:40px;}
#font-label {min-width:65px;text-align:center;color:#555;}
.compact-details {margin:1px 0 15px;max-width:650px;padding:4px 0 1px;}
.compact-details .note {font-size:12px;}
.topic-checks {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px 14px;max-height:225px;overflow-y:auto;padding:10px 0;}
.topic-checks label {display:flex;align-items:flex-start;gap:7px;cursor:pointer;font-size:12px;line-height:1.4;}
.topic-checks input[type="checkbox"] {flex:0 0 auto;margin-top:3px;accent-color:#555;}
.question-meta-bar {display:flex;align-items:center;justify-content:space-between;gap:9px;max-width:890px;margin:-8px 0 8px;flex-wrap:wrap;}
.question-details {color:#60656d;font-size:12px;line-height:1.65;overflow-wrap:anywhere;}
.question-details b {color:#20242b;font-weight:600;}
#make-mix {margin:0;white-space:nowrap;font-size:12px;}
.question-subjects {display:flex;align-items:center;flex-wrap:wrap;gap:6px;max-width:890px;margin-bottom:21px;font-size:12px;color:#666;}
.subject-tag {display:inline-block;border:1px solid #d9dee2;background:#f8f9fa;color:#35414b;padding:2px 7px;}
.mix-banner {display:flex;align-items:center;justify-content:space-between;gap:10px;max-width:890px;margin:0 0 22px;border:1px solid #c5d4db;background:#f3f7f9;padding:7px 11px;font-size:12px;flex-wrap:wrap;}
.mix-banner button {margin:0;}
.stats-summary {display:flex;gap:20px;flex-wrap:wrap;padding:8px 0 17px;margin-bottom:14px;border-bottom:1px solid #ddd;max-width:890px;}
.stats-number {font-size:20px;font-weight:500;display:block;line-height:1.5;}
.stats-metric {font-size:12px;color:#555;}
.stats-head {max-width:890px;display:flex;justify-content:space-between;border-bottom:1px solid #ddd;padding-bottom:8px;color:#666;font-size:12px;gap:8px;}
.stats-item {display:flex;align-items:center;gap:10px;padding:14px 0;border-bottom:1px solid #e2e5e8;max-width:890px;}
.stats-item-main {flex:1;min-width:0;}
.stats-item-title {font-size:13px;overflow-wrap:anywhere;}
.stats-bar {height:6px;background:#e5e8ed;margin-top:8px;max-width:500px;overflow:hidden;}
.stats-fill {height:100%;background:#45586a;min-width:0;}
.stats-stats {font-size:12px;color:#555;width:142px;text-align:right;flex:none;}
.stats-item button {margin:0;flex:none;}
#sim-history-list {margin-top:12px;max-width:880px;}
.history-line {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid #ddd;flex-wrap:wrap;}
.history-line button {margin:0;}
html[data-theme="dark"] .question-details,html[data-theme="dark"] .question-subjects,html[data-theme="dark"] #font-label,
html[data-theme="dark"] .stats-metric,html[data-theme="dark"] .stats-head,html[data-theme="dark"] .stats-stats {color:#aab5c0;}
html[data-theme="dark"] .question-details b {color:#edf1f5;}
html[data-theme="dark"] .subject-tag {border-color:#516272;background:#202a34;color:#dce5ee;}
html[data-theme="dark"] .mix-banner {border-color:#526b7c;background:#202a32;}
html[data-theme="dark"] .stats-bar {background:#35414d;}
html[data-theme="dark"] .stats-fill {background:#b0cadc;}
html[data-theme="dark"] .stats-summary,html[data-theme="dark"] .stats-head,
html[data-theme="dark"] .stats-item,html[data-theme="dark"] .history-line {border-color:#465463;}
@media(max-width:620px){.topic-checks{grid-template-columns:1fr;}.stats-item{flex-wrap:wrap;}.stats-stats{text-align:left;width:auto;}.question-meta-bar{align-items:flex-start;}}


/* Versao 5: apresenta tabelas dos comentarios com a estrutura do livro. */
#explanation-body.rich-comment .table-scroll {
  display:block;width:100%;max-width:100%;overflow-x:auto;overflow-y:visible;
  -webkit-overflow-scrolling:touch;scrollbar-width:thin;
  border:1px solid #c9ced4;margin:12px 0 21px;
}
#explanation-body.rich-comment .table-scroll table {
  width:max-content;max-width:none;min-width:min(100%,580px);
  border-collapse:collapse;margin:0;line-height:1.45;
}
#explanation-body.rich-comment table td,#explanation-body.rich-comment table th {
  padding:7px 10px;border:1px solid #d1d5d9;vertical-align:middle;
  white-space:normal;overflow-wrap:normal;max-width:465px;
}
#explanation-body.rich-comment table th {
  font-weight:600;text-align:left;background:#eff2f4;
}
#explanation-body.rich-comment table caption {
  text-align:left;font-weight:600;padding:7px 10px;background:#eff2f4;
}
#explanation-body.rich-comment table .numeric-cell {text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums;}
#explanation-body.rich-comment table .table-total-row {background:#eff2f4;font-weight:600;}
#explanation-body.rich-comment table p {margin:0;}
html[data-theme="dark"] #explanation-body.rich-comment .table-scroll {border-color:#647482;}
html[data-theme="dark"] #explanation-body.rich-comment table td,
html[data-theme="dark"] #explanation-body.rich-comment table th {border-color:#536373;}
html[data-theme="dark"] #explanation-body.rich-comment table th,
html[data-theme="dark"] #explanation-body.rich-comment table caption,
html[data-theme="dark"] #explanation-body.rich-comment table .table-total-row {background:#28343e;color:#e9f0f6;}
/* Estrutura do site publico, sem login */
.site-masthead{padding:0 0 17px;margin:0 0 25px;border-bottom:1px solid #e0e2e4;max-width:890px;}
.site-wordmark{display:inline-block;max-width:100%;font:600 27px/1.2 Consolas,"Lucida Console","Courier New",monospace;letter-spacing:-.9px;color:inherit;text-decoration:none;overflow-wrap:break-word;margin-bottom:5px;}
.site-wordmark:hover,.site-wordmark:focus-visible{text-decoration:underline;text-underline-offset:4px;}
.site-subtitle{color:#707780;font-size:12px;margin:0;letter-spacing:.12px;}
.site-welcome{max-width:620px;line-height:1.75;font-size:13px;color:#252b2f;margin:0 0 11px;}
.site-storage-info{font-size:12px;line-height:1.7;color:#5b626a;max-width:750px;margin:0 0 28px;}
.site-storage-info b{font-weight:600;color:#32383d;}
html[data-theme="dark"] .site-masthead{border-color:#45515c;}
html[data-theme="dark"] .site-subtitle,html[data-theme="dark"] .site-storage-info{color:#a7b1bb;}
html[data-theme="dark"] .site-welcome,html[data-theme="dark"] .site-storage-info b{color:#e0e6ee;}
@media (max-width:620px){.site-masthead{margin-bottom:19px;padding-bottom:13px;}.site-wordmark{font-size:21px;letter-spacing:-.7px;}}
