/* Camada pública de apresentação. O tema claro original não é modificado.
   Toda estilização escura fica em screen: impressão/PDF usa CSS claro de origem. */
.pc-theme-toggle{
  appearance:none;display:inline-flex;align-items:center;justify-content:center;
  gap:6px;flex:0 0 auto;min-width:82px;min-height:42px;padding:8px 11px;
  border:2px solid var(--ink);border-radius:4px;background:var(--white);
  color:var(--ink);box-shadow:3px 3px 0 var(--ink);
  font:900 12px/1.2 Inter,Arial,Helvetica,sans-serif;cursor:pointer;
}
.pc-theme-toggle[aria-pressed="true"]{border-color:#28a8ff}
.pc-theme-toggle:hover{transform:translateY(-1px)}
.pc-theme-toggle:focus-visible{outline:3px solid #28a8ff;outline-offset:3px}
.pc-theme-icon{font-size:18px;line-height:1}
.site-nav .pc-theme-toggle{min-width:85px}
@media(max-width:720px){
  .screen-toolbar .pc-theme-toggle{padding:8px 5px!important;min-width:0;box-shadow:2px 2px 0 #000000}
  .screen-toolbar .pc-theme-label{display:none}
  .screen-toolbar .pc-theme-toggle{min-width:38px}
  .site-nav .pc-theme-toggle{min-width:42px;padding:7px 9px}
  .site-nav .pc-theme-label{display:none}
}
@media print{.pc-theme-toggle{display:none!important}}

@media screen {
  :root[data-pc-theme="dark"]{
    color-scheme:dark;
    --pc-base:#121212;
    --pc-surface:#171b27;
    --pc-raised:#242a3a;
    --pc-text:#f0f3fc;
    --pc-soft:#cbd1e1;
    --pc-border:#64718a;
    --pc-blue:#49c5fe;
    --pc-pink:#fc8ad9;
    --ink:#f0f3fc;
    --paper:#121212;
    --white:#171b27;
    --blue:#49c5fe;
    --cyan:#49c5fe;
    --pink:#fc8ad9;
    --purple:#fc8ad9;
    --green:#47dc8d;
    --muted:#cbd1e1;
    --line:#64718a;
    --shadow:8px 8px 0 #000000;
  }
  html[data-pc-theme="dark"] body{
    color:var(--pc-text);
    /* Fundo plano como no título final aprovado; sem halo de luz. */
    background:var(--pc-base);
  }
  html[data-pc-theme="dark"] .site-header,
  html[data-pc-theme="dark"] .screen-toolbar{
    background:rgba(13,15,22,.97);border-bottom-color:var(--pc-border);
  }
  html[data-pc-theme="dark"] .site-footer{background:#090a10;border-top-color:var(--pc-border)}
  html[data-pc-theme="dark"] .site-footer p{color:var(--pc-soft)}
  html[data-pc-theme="dark"] :is(.hero-card,.info-card,.course-card,.module-card,.error-card,
    .card,.mission,.command-card,.starter-pack,.starter-lang,.answer,
    .pc-ex-bottom-nav,.module-nav,.module-nav a){
    background:var(--pc-surface);color:var(--pc-text);
    border-color:var(--pc-border);
    box-shadow:5px 5px 0 #000000;
  }
  html[data-pc-theme="dark"] :is(.course-card p,.module-card p,.section-lead,
    .command-card p,.command-note,.starter-pack>p){color:var(--pc-soft)}
  html[data-pc-theme="dark"] :is(.btn,.site-nav .youtube,.screen-toolbar button:not(.primary),
    .channel-link,.pc-ex-toolbar-link,.pc-ex-bottom-nav a,
    .solution-open-chatgpt-btn,.pc-theme-toggle){
    background:var(--pc-raised);color:var(--pc-text);
    border-color:var(--pc-border);box-shadow:3px 3px 0 #000000;
  }
  html[data-pc-theme="dark"] .site-nav :is(a:hover,a:focus-visible){
    background:var(--pc-raised);border-color:var(--pc-pink);
  }
  /* Superfícies de destaque que no tema claro são amarelas:
     mesma linguagem visual da etiqueta "Aprenda praticando" no tema escuro.
     Não alterar --yellow: valores digitados nos resultados mantêm seu amarelo. */
  html[data-pc-theme="dark"] :is(.btn.primary,.screen-toolbar .primary,.mission-badge,
    .eyebrow,.tag,.xp,.pc-ex-bottom-nav a:nth-child(2),.solution-copy-prompt-btn){
    background:var(--pc-blue);
    color:#000000;
    border:3px solid #000000;
    box-shadow:5px 5px 0 #000000;
  }
  html[data-pc-theme="dark"] :is(.info-card:nth-child(3),.module-card:nth-child(4n+4)){
    border-top-color:var(--pc-blue);
  }
  html[data-pc-theme="dark"] :is(.level,.easy,.medium,.boss,.check,.tip,.note,.alt,
    .footer-box,.command-note,.starter-title){
    background:var(--pc-raised);color:var(--pc-text);
    border-color:var(--pc-border);
  }
  html[data-pc-theme="dark"] :is(.output-label,.hero-card .label,.section-title .num,
    .section-head .num){color:var(--pc-pink)}
  /* Inversão final aprovada: "Aprenda praticando" em azul com texto preto;
     "com Covre" e acentos de navegação/números em rosa-lilás, sem glow. */
  html[data-pc-theme="dark"] :is(.brand span,.toolbar-brand span,.hero h1 em){
    color:var(--pc-pink);
    text-shadow:none;
  }
  /* O contorno/sombra precisam ser pretos, como no tema claro,
     mesmo quando --ink é texto claro no tema escuro. */
  html[data-pc-theme="dark"] body .hero .eyebrow{
    background:var(--pc-blue);
    color:#000000;
    border:3px solid #000000;
    box-shadow:5px 5px 0 #000000;
    text-shadow:none;
  }
  html[data-pc-theme="dark"] .hero-card .label{
    color:var(--pc-pink);
    text-shadow:none;
  }
  html[data-pc-theme="dark"] :is(.hero-card,.info-card,.course-card,.module-card,
    .error-card,.card,.mission,.command-card,.starter-pack,.starter-lang,
    .pc-ex-bottom-nav,.module-nav,.module-nav a,.solution-validator,
    .pcenv-viewer,.pcenv-filters button,.pcenv-sort,.pc-theme-toggle){
    box-shadow:5px 5px 0 #000000;
  }
  html[data-pc-theme="dark"] :is(.pc-ex-input-note,.pc-ex-single .mission-fold-content .pc-ex-input-note){
    color:var(--pc-soft);border-left-color:#ffc400;
  }
  html[data-pc-theme="dark"] .pc-ex-input-note strong{color:var(--pc-text)}
  html[data-pc-theme="dark"] :is(.mission-fold-summary:hover,.solution-validator-summary:hover){
    background:var(--pc-raised);border-color:var(--pc-border);
  }
  html[data-pc-theme="dark"] :is(.mission-fold-summary::after,.solution-validator-summary::after){
    background:var(--pc-blue);
    color:#000000;
    border-color:#000000;
    box-shadow:2px 2px 0 #000000;
  }
  html[data-pc-theme="dark"] :is(.pc-module-phase-banner,.footer-box,.module-nav .nav-next,
    .skip-link){
    background:var(--pc-blue);
    color:#000000;
    border-color:#000000;
    box-shadow:5px 5px 0 #000000;
  }
  html[data-pc-theme="dark"] .command-card:nth-child(4){
    border-top-color:var(--pc-blue);
  }
  html[data-pc-theme="dark"] :is(.pc-ex-completion-slot .exercise-completion-toggle,
    .mission-meta .exercise-completion-toggle){
    background:var(--pc-raised);color:var(--pc-text);border-color:var(--pc-border)
  }
  html[data-pc-theme="dark"] :is(.pc-ex-completion-slot .exercise-completion-toggle[data-completed="true"],
    .mission-meta .exercise-completion-toggle[data-completed="true"]){
    background:#16452f;color:#b4ffd5;border-color:#47dc8d
  }
  html[data-pc-theme="dark"] .exercise-completion-warning{color:#ffb3bd}
  html[data-pc-theme="dark"] .solution-validator{
    background:var(--pc-surface);color:var(--pc-text);border-color:var(--pc-border);
    box-shadow:5px 5px 0 #000000;
  }
  html[data-pc-theme="dark"] .solution-validator-meta,
  html[data-pc-theme="dark"] .solution-external-note{color:var(--pc-soft)}
  html[data-pc-theme="dark"] :is(.solution-prompt-manual,.solution-feedback){
    background:var(--pc-raised);color:var(--pc-text);border-color:var(--pc-border)
  }
  html[data-pc-theme="dark"] .solution-feedback[data-status="ok"]{background:#173a2e;color:#c6ffde}
  html[data-pc-theme="dark"] .solution-feedback[data-status="erro"]{background:#33283c;color:#ffe2f4}
  html[data-pc-theme="dark"] .solution-code{border-color:var(--pc-border)}
  html[data-pc-theme="dark"] :is(.course-overall-progress,.module-progress-track,
    .course-overall-track,.pc-module-progress,.pc-module-progress-track,.pc-module-phase-banner){
    background:var(--pc-surface);color:var(--pc-text);border-color:var(--pc-border)
  }
  html[data-pc-theme="dark"] :is(.course-overall-count,.module-progress-count,.pc-module-progress-foot,
    .pc-module-xp-value){color:var(--pc-soft)}
  html[data-pc-theme="dark"] .pc-module-progress-percent{color:var(--pc-pink)}
  html[data-pc-theme="dark"] :is(.course-overall-percent,.module-progress-meta strong,
    .pc-module-progress-header strong){color:var(--pc-pink)}
  html[data-pc-theme="dark"] :is(.course-overall-fill,.module-progress-fill,.pc-module-progress-fill){
    background:var(--pc-blue)
  }
  html[data-pc-theme="dark"] :is(.pcenv-root,.pc-lab-home .panel,.pcenv-catalog-source){
    background:var(--pc-surface);color:var(--pc-text);border-color:var(--pc-border)
  }
  html[data-pc-theme="dark"] .pcenv-root{
    --ink:var(--pc-text);--accent:var(--pc-blue);
    background:linear-gradient(155deg,#172437,#111723);
  }
  html[data-pc-theme="dark"] :is(.pcenv-intro h3,.pcenv-eyebrow,
    .pcenv-intro p,.pcenv-tools,.pcenv-visible-count){color:var(--pc-soft)}
  html[data-pc-theme="dark"] :is(.pcenv-filters button,.pcenv-sort,.pcenv-viewer,
    .pcenv-viewer button,.pcenv-item){
    background:var(--pc-raised);color:var(--pc-text);
    border-color:var(--pc-border);box-shadow:3px 3px 0 #000000;
  }
  html[data-pc-theme="dark"] :is(.pcenv-filters button[aria-pressed="true"],
    .pcenv-hide[aria-pressed="true"]){background:#553347;color:#ffe5f6;border-color:var(--pc-pink)}
  /* Os envelopes ilustrados têm papel bege: manter texto escuro apenas dentro deles. */
  html[data-pc-theme="dark"] .pcenv-slot{color:#26313c}
  html[data-pc-theme="dark"] .pcenv-root .pcenv-case:hover{color:#26313c}
  html[data-pc-theme="dark"] :is(.pc-profile-menu,.pc-profile-dialog,
    .pc-profile-dialog-head,.pc-profile-module,.pc-profile-stat-card){
    background:var(--pc-surface);color:var(--pc-text);border-color:var(--pc-border)
  }
  html[data-pc-theme="dark"] :is(.pc-profile-option,.pc-profile-tab,
    .pc-profile-close,.pc-profile-reset-input,.pc-profile-reset-cancel){
    background:var(--pc-raised);color:var(--pc-text);border-color:var(--pc-border)
  }
  html[data-pc-theme="dark"] :is(.pc-profile-identity p,.pc-profile-stat-card span,
    .pc-profile-module-head span,.pc-profile-explanation){color:var(--pc-soft)}
  html[data-pc-theme="dark"] .pc-profile-option:is(:hover,:focus-visible){background:#263d5d}
  html[data-pc-theme="dark"] .pc-profile-privacy{color:var(--pc-blue)}
  html[data-pc-theme="dark"] .pc-profile-tab.selected{background:#20559a;color:#fff}
  html[data-pc-theme="dark"] .pc-profile-danger{background:#39242d;color:#ffc6d0;border-color:#e76d84}
  html[data-pc-theme="dark"] :is(.pc-account-guest,.pc-account-button,.pc-profile-trigger){
    color:var(--pc-text);border-color:var(--pc-border)
  }
  /* O seletor do perfil autenticado tem fundo branco próprio:
     texto preto para nome e seta, sem mudar login convidado nem o modal. */
  html[data-pc-theme="dark"] .pc-profile-trigger{
    background:#ffffff;
    color:#000000;
    border-color:#161616;
  }
  html[data-pc-theme="dark"] :is(.pc-account-notice,.pc-profile-reset-success){
    background:#153b2a;color:#c5ffe0;border-color:#47dc8d
  }
  html[data-pc-theme="dark"] :is(.pc-profile-reset-status,.pc-profile-danger-title){color:#ffb0bf}
  /* Em cartões de comandos, o selo bege precisa de texto escuro:
     --ink passa a branco no tema escuro, mas o fundo do selo continua claro. */
  html[data-pc-theme="dark"] .command-card .command-name{
    background:#f7f5ef;
    color:#101114;
    border-color:#101114;
  }
  /* O botão da galeria usa fundo claro: não herdar texto branco de .pcenv-root.
     Preservar também a distinção visual e o contraste quando acionado. */
  html[data-pc-theme="dark"] .pcenv-root .pcenv-hide[aria-pressed="false"]{
    background:#f7f5ef;
    color:#101114;
    border:2px solid #101114;
    box-shadow:4px 4px 0 #000000;
    font-weight:900;
  }
  html[data-pc-theme="dark"] .pcenv-root .pcenv-hide[aria-pressed="true"]{
    background:#553347;
    color:#ffe5f6;
    border:2px solid var(--pc-pink);
    box-shadow:4px 4px 0 #000000;
    font-weight:900;
  }
  /* Abrir/Recolher pertence ao mesmo padrão azul, preto e sombra dos selos XP/Missão.
     A ação continua sendo o summary nativo, sem trocar comportamento ou texto. */
  html[data-pc-theme="dark"] .solution-validator .solution-validator-summary::after{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:42px;
    padding:8px 14px;
    background:var(--pc-blue);
    color:#000000;
    border:3px solid #000000;
    box-shadow:5px 5px 0 #000000;
    font-weight:1000;
    line-height:1.2;
  }
  html[data-pc-theme="dark"] .pc-theme-toggle{border-color:var(--pc-pink)}
  html[data-pc-theme="dark"] .watermark{color:rgba(231,237,255,.055)}
  html[data-pc-theme="dark"] .watermark:nth-child(even){color:rgba(73,197,254,.055)}
  html[data-pc-theme="dark"] :where(a,button,summary,select,input,textarea):focus-visible{
    outline:3px solid #66caff;outline-offset:3px
  }
}

/* Refinamentos da homologação: contraste das etiquetas e toolbar sem linha solta. */
@media screen {
  html[data-pc-theme="dark"] .activity-tag,
  html[data-pc-theme="dark"] .activity-tag.build,
  html[data-pc-theme="dark"] .activity-tag.system {
    background:#20516b;color:#f4fbff;border-color:#56c8f1;
  }
  html[data-pc-theme="dark"] .activity-tag:is(.read,.complete,.evolve,.bossmission) {
    background:#533047;color:#ffe5f6;border-color:#fc8ad9;
  }
  html[data-pc-theme="dark"] .activity-tag:is(.syntax,.typefix,.logic,.calc) {
    background:#29435d;color:#f4fbff;border-color:#85c7fc;
  }
  html[data-pc-theme="dark"] .pcenv-slot .pcenv-case-button,
  html[data-pc-theme="dark"] .pcenv-slot .pcenv-flying-card,
  html[data-pc-theme="dark"] .pcenv-slot .pcenv-envelope-message {
    color:#25313e;
  }
  html[data-pc-theme="dark"] .pc-ex-single .pc-ex-completion-slot .exercise-completion-toggle {
    color:var(--pc-text);
  }
}
@media screen and (max-width:720px) {
  .screen-toolbar .toolbar-actions {
    flex-wrap:wrap;
    justify-content:flex-start;
  }
  .screen-toolbar .toolbar-actions>.pc-account-controls {
    flex-basis:100%;
  }
  html .pc-ex-single .screen-toolbar .toolbar-actions {
    display:grid;
    grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr) minmax(0,1fr) 42px;
    gap:6px;
  }
  html .pc-ex-single .screen-toolbar .toolbar-actions>.pc-account-controls {
    grid-column:1/-1;
  }
  html .pc-ex-single .screen-toolbar .pc-theme-toggle {
    min-width:42px;min-height:42px;
  }
}
