/* Estudos: só tokens de cor (sem hex), fonte mínima 12px, alvos de 44px. */
.studies{min-width:0}
.studies p,.study-lead,.study-steps span{line-height:1.6}
.study-head-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.study-how{min-height:44px;padding:0 10px;color:var(--teal);font-size:13px;font-weight:600;text-decoration:underline;text-underline-offset:3px}
.study-how:hover{color:var(--ink)}
.study-badge{display:inline-grid;place-items:center;min-width:22px;height:22px;padding:0 6px;border-radius:11px;background:var(--coral);color:var(--white);font-size:12px;font-weight:700;margin-left:2px}

/* primeiro uso e "Como funciona" */
.study-welcome{max-width:640px;padding:8px 0 30px}
.study-welcome h2{font-size:21px;margin-bottom:6px}
.study-lead{font-size:14px;color:var(--ink);margin:0 0 14px;overflow-wrap:anywhere}
.study-steps{list-style:none;counter-reset:step;margin:18px 0 24px;padding:0;display:flex;flex-direction:column;gap:14px}
.study-steps li{counter-increment:step;display:grid;grid-template-columns:36px 1fr;gap:4px 12px;align-items:start}
.study-steps li::before{content:counter(step);grid-row:1/3;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:var(--teal-light);color:var(--teal);font-weight:700;font-size:15px}
.study-steps strong{font-size:15px;color:var(--ink)}
.study-steps span{font-size:13px;color:var(--muted)}

/* títulos e dicas "?" */
.study-section-title,.study-chart-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:24px 0 16px;flex-wrap:wrap}
.study-title-group{display:flex;align-items:center;gap:4px}
.study-section-title h2{font-size:19px}
.study-section-title h2:focus{outline:none}
.study-section-title h2:focus-visible{outline:3px solid var(--teal);outline-offset:3px}
.study-chart-heading h3{font-size:16px}
.study-chart-heading span{font-size:12px;color:var(--muted)}
.study-tip{display:inline-grid;place-items:center;width:44px;height:44px;margin:-10px -6px -10px 0;background:none;border:0;color:var(--teal);cursor:pointer;flex-shrink:0}
.study-tip span[aria-hidden]{display:grid;place-items:center;width:22px;height:22px;border:1.5px solid var(--teal);border-radius:50%;font-size:12px;font-weight:700;line-height:1}
.study-tip[aria-expanded=true] span[aria-hidden]{background:var(--teal);color:var(--white)}
.study-tip-text{font-size:13px;line-height:1.6;color:var(--ink);background:var(--teal-light);border-left:3px solid var(--teal);padding:10px 12px;margin:6px 0 12px;max-width:640px}
.study-tip-text[hidden]{display:none}

/* filtros */
.study-filters{display:flex;align-items:end;gap:12px;flex-wrap:wrap;padding:0 0 20px;margin-bottom:8px;border-bottom:1px solid var(--line)}
.study-filters label,.study-day{display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--muted);min-width:0;flex:1 1 140px}
.study-filters label:first-child{flex:2 1 200px}
.study-filters .study-search{flex:2 1 200px}
.study-filters input,.study-filters select,.study-day input{width:100%;min-width:0;min-height:44px;font-size:13px}
.study-clear{flex-shrink:0}
.study-day{flex:0 1 190px}

/* blocos da aba Hoje */
.study-block{margin:0 0 30px}
.study-block>h3{font-size:16px;margin:0 0 12px}
.study-late-note,.study-done{display:flex;align-items:center;gap:8px;font-size:14px;line-height:1.6;margin:0 0 12px}
.study-late-note{color:var(--coral);font-weight:600}
.study-done{color:var(--teal);padding:16px;background:var(--teal-light);border-radius:6px}
.study-late-note svg,.study-done svg{width:18px;height:18px;flex-shrink:0}
.study-review-list{display:flex;flex-direction:column;border-top:1px solid var(--line)}
.study-review-row{display:flex;align-items:center;gap:20px;padding:18px 0 18px 14px;border-bottom:1px solid var(--line);border-left:4px solid transparent}
.study-review-row.overdue{border-left-color:var(--coral-accent);background:var(--coral-light)}
.study-review-when{display:flex;flex-direction:column;gap:4px;flex:0 0 180px;font-size:13px;color:var(--teal)}
.study-review-when strong{font-size:13px}
.study-review-when span{display:flex;align-items:center;gap:6px;font-size:12px;line-height:1.5}
.study-review-row.overdue .study-review-when,.study-review-row.overdue .study-review-when span{color:var(--coral);font-weight:600}
.study-review-when svg{width:16px;height:16px;flex-shrink:0}
.study-review-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}
.study-review-body small{font-size:12px;color:var(--muted)}
.study-review-body h4{font-size:15px;overflow-wrap:anywhere;margin:0}
.study-review-body p{font-size:13px;color:var(--ink);margin:0}
.study-review-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.study-locked{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--muted);margin:0;min-height:44px}
.study-locked svg{width:16px;height:16px;flex-shrink:0}
.study-upcoming{margin:0 0 30px;border:1px solid var(--line);border-radius:6px}
.study-upcoming summary{cursor:pointer;min-height:44px;display:flex;align-items:center;padding:0 14px;font-size:14px;font-weight:600}
.study-upcoming ul{list-style:none;margin:0;padding:0 14px 8px}
.study-upcoming li{display:flex;flex-wrap:wrap;gap:4px 12px;padding:10px 0;border-top:1px solid var(--line);font-size:13px;line-height:1.5}
.study-upcoming li strong{flex:0 0 120px}
.study-upcoming li span{color:var(--muted)}
.study-upcoming li span:first-of-type{flex:1 1 200px;color:var(--ink);overflow-wrap:anywhere}

/* cartões de assunto */
.study-cards,.study-topic-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:14px}
.study-card{display:flex;flex-direction:column;gap:8px;padding:16px;border:1px solid var(--line);border-radius:8px;background:var(--white);min-width:0}
.study-card>small{font-size:12px;color:var(--muted)}
.study-card-title{font-size:15px;margin:0}
.study-topic-title{font-size:15px;font-weight:700;color:var(--ink);text-align:left;white-space:normal;line-height:1.4;overflow-wrap:anywhere;min-height:44px;justify-content:flex-start;padding:0}
.study-topic-title:hover{color:var(--teal);text-decoration:underline}
.study-next{display:block;font-size:13px;font-weight:600;color:var(--teal);margin:0}
.study-card-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:4px 0 0}
.study-card-stats div{display:flex;flex-direction:column;gap:2px}
.study-card-stats dt{font-size:12px;color:var(--muted)}
.study-card-stats dd{margin:0;font-size:15px;font-weight:700;color:var(--ink)}
.study-card-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:auto;padding-top:6px}
.study-card-actions .icon-button{width:44px;height:44px}
.study-more-btn{margin-top:14px}
.study-progress{height:8px;border-radius:4px;background:var(--line);overflow:hidden;margin:6px 0 2px;max-width:220px}
.study-progress span{display:block;height:100%;background:var(--teal)}
.study-status{display:block;font-size:12px;color:var(--muted);margin:4px 0 0}
.study-status.complete{color:var(--teal);font-weight:600}
.study-status.warning{color:var(--coral);font-weight:600}
.study-mastered{display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:12px;margin:8px 0;background:var(--violet-light);border-left:3px solid var(--violet);border-radius:4px}
.study-mastered p{display:flex;align-items:center;gap:8px;margin:0;font-size:13px;font-weight:600;color:var(--violet)}
.study-mastered svg{width:16px;height:16px;flex-shrink:0}
.study-question-link,.study-detail-link{display:inline-flex;align-items:center;gap:6px;min-height:44px;max-width:100%;color:var(--teal);font-size:13px;font-weight:600;text-decoration:underline;text-underline-offset:3px;overflow-wrap:anywhere}
.study-question-link svg,.study-detail-link svg{width:16px;height:16px;flex-shrink:0}
.study-question-link:hover,.study-detail-link:hover{color:var(--ink)}

/* tabela de assuntos (tela larga) e cartões (abaixo de 900px) */
.study-topic-table-wrap,.study-table-scroll{width:100%;overflow-x:auto}
.study-table{width:100%;border-collapse:collapse;text-align:left;font-size:13px}
.study-table thead th{font-weight:600;color:var(--muted);font-size:12px;background:var(--paper);padding:12px 10px}
.study-table td,.study-table tbody th{padding:14px 10px;border-bottom:1px solid var(--line);vertical-align:top;font-weight:400}
.study-table tbody th{min-width:220px;max-width:380px}
.study-table small{display:block;font-size:12px;color:var(--muted);margin:4px 0;line-height:1.5}
.study-table .study-subject{font-size:13px;font-weight:600;color:var(--teal);text-decoration:underline;min-height:44px;padding:0}
.study-topic-table td:nth-child(n+2){white-space:nowrap}
.study-actions{display:flex;gap:4px;flex-wrap:wrap}
.study-actions .icon-button{width:44px;height:44px}
.study-topic-cards{display:none}
@media(max-width:899px){.study-topic-table-wrap{display:none}.study-topic-cards{display:grid}}

/* números */
.study-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border-bottom:1px solid var(--line);margin:16px 0 24px}
.study-metrics:has(>div:last-child:nth-child(2)){grid-template-columns:repeat(2,minmax(0,1fr))}
.study-metrics>div{padding:4px 18px 20px 0;display:flex;flex-direction:column;gap:6px;min-width:0}
.study-metrics>div+div{padding-left:18px;border-left:1px solid var(--line)}
.study-metric-label{display:flex;align-items:center;font-size:13px;color:var(--muted);min-height:24px}
.study-metrics strong{font-size:28px;line-height:1.2;color:var(--ink);overflow-wrap:anywhere}
.study-metrics small{font-size:12px;color:var(--muted);line-height:1.5}
.study-metrics .study-tip-text{margin-top:4px}
.study-bars{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:18px;padding:0 12px 20px;border-bottom:1px solid var(--line)}
.study-bars>div{display:flex;flex-direction:column;align-items:center;gap:8px;min-width:0}
.study-bars strong{font-size:13px;font-weight:600}
.study-bars small{font-size:12px;color:var(--muted);white-space:nowrap}
.study-bar-track{height:100px;width:100%;max-width:48px;display:flex;align-items:flex-end;background:var(--paper);border:1px solid var(--line);border-radius:3px;overflow:hidden}
.study-bar-track span{width:100%;background:var(--teal);min-height:0}
.study-bars>div:last-child .study-bar-track span{background:var(--coral-accent)}

/* histórico e meus erros */
.study-segmented{display:flex;gap:6px;flex-wrap:wrap;margin:0 0 16px}
.study-segmented button{min-height:44px;padding:0 14px;font-size:13px;border:1px solid var(--line);border-radius:6px;background:var(--white);color:var(--ink)}
.study-segmented button[aria-pressed=true]{background:var(--teal);border-color:var(--teal);color:var(--white);font-weight:700}
.study-entry{display:flex;align-items:flex-start;gap:18px;border-bottom:1px solid var(--line);padding:20px 0}
.study-entry-date{min-width:64px;display:flex;flex-direction:column;gap:4px}
.study-entry-date strong{font-size:13px}
.study-entry-date small{font-size:12px;color:var(--muted)}
.study-entry-body{flex:1;min-width:0}
.study-entry-body>small{font-size:12px;color:var(--muted)}
.study-entry-body h3{font-size:16px;margin:4px 0 8px;overflow-wrap:anywhere}
.study-entry-meta{display:flex;gap:6px 14px;flex-wrap:wrap;font-size:13px;color:var(--teal)}
.study-entry-body p{font-size:14px;white-space:pre-wrap;overflow-wrap:anywhere;margin:12px 0;line-height:1.6}
.study-check{display:flex!important;flex-direction:row!important;align-items:center;gap:10px;min-height:44px;font-size:13px;color:var(--ink);cursor:pointer;width:fit-content}
.study-check input{width:20px;height:20px;accent-color:var(--teal);margin:0}
.study-empty{padding:40px 16px;text-align:center;color:var(--muted)}
.study-empty>svg{width:32px;height:32px;margin-bottom:12px}
.study-empty p{font-size:14px;line-height:1.6;max-width:460px;margin:0 auto}
.study-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:18px 0;font-size:13px;color:var(--muted)}
.study-pagination>div{display:flex;gap:6px}
.study-pagination .icon-button{width:44px;height:44px}

/* formulários */
.study-field{display:flex;flex-direction:column;gap:6px;min-width:0}
.study-field input,.study-field select,.study-field textarea{min-height:44px}
.study-hint{font-size:12px;line-height:1.5;color:var(--muted)}
#modalContent [aria-invalid=true]{border-color:var(--coral)!important;box-shadow:0 0 0 1px var(--coral)}
#modalContent .form-error{font-size:13px;font-weight:600;line-height:1.5;margin:12px 0 0}
#modalContent .form-error:empty{margin:0}
.study-more{border:1px solid var(--line);border-radius:6px;padding:0 12px}
.study-more summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-size:13px;font-weight:600;color:var(--ink)}
.study-more[open]{padding-bottom:12px}
.study-more>.form-grid{margin-top:4px}
.study-more[hidden]{display:none}
.study-kind{border:0;padding:0;margin:0;min-width:0}
.study-kind legend{font-size:12px;font-weight:500;color:var(--muted);margin-bottom:6px;padding:0}
.study-kind-options{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.study-choice{display:flex!important;flex-direction:row!important;align-items:flex-start;gap:10px;min-height:56px;padding:12px;border:1px solid var(--line);border-radius:6px;cursor:pointer;background:var(--white)}
.study-choice input{width:20px;height:20px;margin:2px 0 0;accent-color:var(--teal);flex-shrink:0}
.study-choice span{display:flex;flex-direction:column;gap:2px}
.study-choice strong{font-size:14px;color:var(--ink)}
.study-choice small{font-size:12px;color:var(--muted);line-height:1.5}
.study-choice:has(input:checked){border-color:var(--teal);background:var(--teal-light);box-shadow:inset 0 0 0 1px var(--teal)}
.study-kind[disabled] .study-choice{cursor:default}
.study-range{font-size:13px;font-weight:600;color:var(--teal);margin:0;min-height:1.5em}
.study-sequence{border-left:3px solid var(--teal);padding:10px 12px;background:var(--teal-light);font-size:13px;line-height:1.6;color:var(--ink);overflow-wrap:anywhere;margin:0}
.study-sequence:empty{display:none}
#study-schedule-preview>div{display:flex;justify-content:space-between;gap:12px;padding:4px 0;flex-wrap:wrap}
#study-schedule-preview strong,#study-schedule-preview span{font-size:13px}
.study-callout{display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:12px;border-left:3px solid var(--violet);background:var(--violet-light);border-radius:4px}
.study-callout p{display:flex;align-items:flex-start;gap:8px;margin:0;font-size:13px;line-height:1.6;color:var(--ink)}
.study-callout svg{width:16px;height:16px;flex-shrink:0;margin-top:3px}
.study-callout[hidden]{display:none}

/* detalhes e exclusão */
.study-detail-sub{font-size:13px;color:var(--muted)}
.study-detail dt{font-size:12px;color:var(--muted);margin:16px 0 4px}
.study-detail dd{margin:0;font-size:14px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}
.study-delete-warning{display:flex;align-items:flex-start;gap:8px;font-size:14px;margin-top:14px;line-height:1.6;color:var(--coral);font-weight:600}
.study-delete-warning svg{width:18px;height:18px;flex-shrink:0;margin-top:3px}

/* abas de estudos em telas estreitas */
@media(max-width:820px){
  .study-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 0}
  .study-metrics>div:nth-child(3){padding-left:0;border-left:0}
  .study-bars{gap:10px;padding-left:0;padding-right:0}
  .study-review-row{flex-wrap:wrap;gap:12px}
  .study-review-when{flex:1 1 100%}
  .study-review-actions{justify-content:flex-start;flex:1 1 100%}
}
@media(max-width:560px){
  .study-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible;gap:0}
  .study-tabs button{font-size:13px;padding:12px 8px;justify-content:center}
  .study-tabs button:last-child:nth-child(5){grid-column:1/-1}
  .study-kind-options{grid-template-columns:1fr}
  .study-metrics strong{font-size:24px}
  .study-metrics>div{padding-right:10px}
  .study-metrics>div+div{padding-left:12px}
  .study-metrics>div:nth-child(3){padding-left:0}
  .study-entry{gap:10px;flex-wrap:wrap}
  .study-entry-date{min-width:52px}
  .study-entry .study-actions{margin-left:auto}
  .study-entry-body h3{font-size:15px}
  .study-filters{gap:10px}
  .study-filters label:first-child,.study-filters .study-search{flex-basis:100%}
  .study-bars{gap:6px}
  .study-section-title h2{font-size:17px}
  .study-review-row{padding-left:10px}
  .study-upcoming li strong{flex-basis:100%}
}

/* Navegação lateral (regras globais que já moravam aqui; mantidas sem mudança) */
.nav-item .nav-short{display:none}
@media(max-width:560px){.sidebar nav .nav-item .nav-full{display:none}.sidebar nav .nav-item .nav-short{display:block}.sidebar nav{grid-template-columns:repeat(7,minmax(0,1fr))}.sidebar nav .nav-item{padding:8px 1px}.sidebar nav .nav-item span{font-size:12px}}
.study-review-row.done .study-review-when span{display:flex;gap:6px;align-items:center;color:var(--teal)}
@media(max-width:650px){.study-tabs{display:flex;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin;gap:4px;padding-bottom:2px;scroll-snap-type:x proximity}.study-tabs [role=tab]{flex:0 0 auto;white-space:nowrap;scroll-snap-align:start}}

/* ---------- Concursos ---------- */
.study-contests-title{font-size:19px;margin:8px 0 16px}
.study-contests{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:16px}
.study-contest-card{position:relative;display:flex;flex-direction:column;gap:10px;padding:20px;border:1px solid var(--line);border-left:4px solid var(--coral-accent);border-radius:10px;background:var(--white);min-width:0;transition:box-shadow .15s,border-color .15s}
.study-contest-card:hover{box-shadow:0 6px 20px #20252b14;border-color:var(--field-border)}
.study-contest-card:focus-within{box-shadow:0 0 0 3px var(--teal)}
.study-contest-card>small{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.02em}
.study-contest-card h2{font-size:20px;line-height:1.3;margin:0}
.study-contest-open{all:unset;cursor:pointer;color:var(--ink);font-family:var(--display);font-weight:600}
.study-contest-open:focus-visible{outline:none}
/* o cartão inteiro abre o concurso (o botão do título cobre o cartão) */
.study-contest-open::after{content:"";position:absolute;inset:0;border-radius:10px}
.study-contest-org{font-weight:400;color:var(--muted)}
.study-contest-exam{display:flex;align-items:center;gap:8px;font-size:14px;color:var(--teal);font-weight:600;margin:0}
.study-contest-exam svg{width:18px;height:18px}
.study-contest-card .study-card-stats{grid-template-columns:repeat(4,minmax(0,1fr))}
.study-contest-card .study-progress{max-width:none}
/* editar e excluir ficam acima da área clicável do cartão */
.study-contest-actions{position:relative;z-index:1;display:flex;gap:6px;justify-content:flex-end;margin-top:2px}
.study-back{min-height:44px}
/* ---------- Abas de matéria ---------- */
.study-subject-tabs{display:flex;gap:8px;overflow-x:auto;padding:4px 2px 12px;margin:4px 0 8px;scrollbar-width:thin;scroll-snap-type:x proximity}
.study-subject-tabs button{flex:0 0 auto;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;border:1px solid var(--line);border-radius:999px;background:var(--white);color:var(--ink);font-size:14px;white-space:nowrap;scroll-snap-align:start}
.study-subject-tabs button:hover{border-color:var(--field-border)}
.study-subject-tabs button[aria-pressed=true]{background:var(--coral);border-color:var(--coral);color:var(--white);font-weight:700}
.study-subject-count{display:inline-grid;place-items:center;min-width:26px;height:24px;padding:0 6px;border-radius:12px;background:var(--paper);color:var(--muted);font-size:12px;font-weight:700}
.study-subject-tabs button[aria-pressed=true] .study-subject-count{background:var(--white);color:var(--coral)}
@media(max-width:650px){.study-contests{grid-template-columns:1fr}.study-contest-card .study-card-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.study-contest-card h2{font-size:18px}}
@media(min-width:651px){.study-subject-tabs{flex-wrap:wrap;overflow:visible}}

/* ---------- Cronograma de estudo ---------- */
.study-plan{border:1px solid var(--line);border-left:4px solid var(--teal);border-radius:10px;background:var(--white);padding:20px;margin:8px 0 28px}
.study-plan h3{display:flex;align-items:center;gap:8px;font-size:18px;margin:0}
.study-plan h3 svg{color:var(--teal)}
.study-plan-empty p{margin:10px 0 16px;line-height:1.6;color:var(--muted)}
.study-plan-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;flex-wrap:wrap;margin-bottom:16px}
.study-plan-head p{margin:6px 0 0;font-size:14px;color:var(--muted)}
.study-slots{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:14px}
.study-slot{display:flex;flex-direction:column;gap:8px;padding:16px;border:1px solid var(--line);border-radius:8px;background:var(--paper)}
.study-slot.done{background:var(--teal-light);border-color:var(--teal)}
.study-slot-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.study-slot-head h4{font-size:16px;margin:0;flex:1;min-width:0}
.study-slot-number{display:inline-grid;place-items:center;width:28px;height:28px;border-radius:50%;background:var(--teal);color:var(--white);font-weight:700;font-size:14px;flex-shrink:0}
.study-slot-ok{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:700;color:var(--teal)}
.study-slot-ok svg{width:18px;height:18px}
.study-slot-progress-text{margin:0;font-size:14px;color:var(--ink)}
.study-slot .study-progress{max-width:none}
.study-slot-actions{display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin-top:4px}
.study-slot-topic{font-size:13px;color:var(--muted)}
.study-slot-clock{display:flex;align-items:baseline;gap:10px;margin:0}
.study-slot-clock strong{font-family:var(--display);font-size:32px;font-variant-numeric:tabular-nums;color:var(--ink)}
.study-slot-clock span{font-size:13px;color:var(--muted)}
.study-slot-buttons{display:flex;gap:8px;flex-wrap:wrap}
.study-plan-rest{display:flex;align-items:center;gap:10px;margin:0;padding:14px;border-radius:8px;background:var(--paper);font-size:15px}
.study-plan-note{display:flex;align-items:flex-start;gap:8px;margin:14px 0 0;font-size:14px;color:var(--muted);line-height:1.5}
.study-plan-note svg{width:18px;height:18px;flex-shrink:0;margin-top:2px}
.study-week{margin-top:16px}
.study-week summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-weight:600;color:var(--teal)}
.study-week tr.is-today th,.study-week tr.is-today td{background:var(--teal-light);font-weight:700}
/* formulário */
.study-days>div{display:flex;gap:8px;flex-wrap:wrap}
.study-day-choice{display:inline-flex;align-items:center;gap:6px;min-height:44px;min-width:64px;padding:0 12px;border:1px solid var(--field-border);border-radius:8px;cursor:pointer;font-weight:600;color:var(--ink)}
.study-day-choice:has(input:checked){background:var(--teal);border-color:var(--teal);color:var(--white)}
.study-time>div{display:flex;gap:12px;flex-wrap:wrap}
.study-time label{display:flex;flex-direction:column;gap:6px;min-width:120px}
.study-plan-preview-wrap h3{font-size:16px;margin:8px 0}
.study-plan-preview-wrap .study-lead{display:flex;gap:8px;align-items:flex-start}
.study-plan-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:10px;margin:10px 0 12px}
.study-plan-grid fieldset{border:1px solid var(--line);border-radius:8px;padding:10px;margin:0;display:grid;gap:8px}
.study-plan-grid legend{font-weight:700;padding:0 4px;color:var(--ink)}
.study-plan-grid select{min-height:44px}
/* barra do cronômetro em outras telas */
.study-dock{position:fixed;right:16px;bottom:calc(16px + env(safe-area-inset-bottom));z-index:30;display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:12px;background:var(--ink);color:var(--white);box-shadow:0 10px 30px #20252b40;max-width:calc(100vw - 32px)}
.study-dock[hidden]{display:none}
.study-dock>svg{width:22px;height:22px;flex-shrink:0}
.study-dock div{display:flex;flex-direction:column;min-width:0}
.study-dock small{font-size:12px;color:#d5dadd;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px}
.study-dock strong{font-family:var(--display);font-size:20px;font-variant-numeric:tabular-nums}
.study-dock button{min-width:44px;min-height:44px;display:grid;place-items:center;border-radius:8px;color:var(--white);background:#ffffff1f}
.study-dock button:focus-visible{outline:3px solid var(--white);outline-offset:2px}
@media(max-width:820px){.study-dock{bottom:calc(84px + env(safe-area-inset-bottom));right:12px;left:12px}}
/* janela do alarme */
.study-alarm{border:0;border-radius:16px;padding:32px 28px;max-width:420px;width:calc(100vw - 32px);text-align:center;background:var(--white);color:var(--ink);box-shadow:0 20px 60px #20252b66}
.study-alarm::backdrop{background:#20252bcc}
.study-alarm-icon{display:grid;place-items:center;width:84px;height:84px;margin:0 auto 16px;border-radius:50%;background:var(--coral-light);color:var(--coral);animation:study-alarm-pulse 1s ease-in-out infinite}
.study-alarm-icon svg{width:44px;height:44px}
.study-alarm h2{font-size:24px;margin:0 0 10px}
.study-alarm p{font-size:16px;line-height:1.6;margin:0 0 20px;color:var(--ink)}
.study-alarm-hint{font-size:14px!important;color:var(--coral)!important;font-weight:600}
.study-alarm-off{width:100%;min-height:56px;font-size:18px;justify-content:center}
@keyframes study-alarm-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.08)}}
@media(prefers-reduced-motion:reduce){.study-alarm-icon{animation:none}}
@media(max-width:650px){.study-plan{padding:16px}.study-slots{grid-template-columns:1fr}.study-plan-grid{grid-template-columns:1fr 1fr}}
#study-plan-form [hidden]{display:none!important}
/* Etiqueta do tópico do curso (campo "Tópico ou onde está no curso") */
.study-topic-tag{display:inline-flex;align-items:center;gap:6px;width:fit-content;margin:6px 0 2px;padding:4px 10px;border-radius:999px;background:var(--violet-light);color:var(--violet);font-size:13px;font-weight:700;line-height:1.3}
.study-topic-tag svg{width:15px;height:15px;flex-shrink:0}
.study-topic-table th[scope=row] .study-topic-tag{display:flex}
/* ---------- Revisão de didática e acabamento (ciclo de revisão) ---------- */
/* Seu próximo passo (aba Hoje) */
.study-next-step{display:flex;align-items:center;justify-content:space-between;gap:16px 24px;flex-wrap:wrap;padding:18px 20px;margin:0 0 24px;border-radius:10px;background:var(--teal-light);border:1px solid var(--teal)}
.study-next-step>div{flex:1 1 320px;min-width:0}
.study-next-step h3{display:flex;align-items:center;gap:8px;margin:0 0 6px;font-size:13px;font-weight:700;color:var(--teal);text-transform:uppercase;letter-spacing:.04em}
.study-next-step h3 svg{width:18px;height:18px;flex-shrink:0}
.study-next-step p{margin:0;font-size:15px;line-height:1.6;color:var(--ink);overflow-wrap:anywhere}
.study-next-step .btn{flex-shrink:0}
@media(max-width:560px){.study-next-step{padding:16px}.study-next-step .btn{width:100%;justify-content:center}}
/* textos de apoio abaixo dos títulos */
.study-block-hint,.study-tab-lead{font-size:13px;line-height:1.6;color:var(--muted);margin:-6px 0 14px;max-width:720px}
.study-tab-lead{font-size:14px;color:var(--ink);margin:-6px 0 4px}
.study-count{font-size:13px;color:var(--muted);margin:0 0 12px}
/* Como funciona: mapa das abas */
.study-how-title{font-size:16px;margin:20px 0 8px}
.study-how-map{margin:0;display:flex;flex-direction:column;border-top:1px solid var(--line)}
.study-how-map>div{display:grid;grid-template-columns:110px 1fr;gap:4px 12px;padding:10px 0;border-bottom:1px solid var(--line)}
.study-how-map dt{font-size:14px;font-weight:700;color:var(--ink)}
.study-how-map dd{margin:0;font-size:13px;line-height:1.6;color:var(--muted)}
@media(max-width:560px){.study-how-map>div{grid-template-columns:1fr}}
/* revisões: 3 números lado a lado */
.study-metrics:has(>div:last-child:nth-child(3)){grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:820px){.study-metrics:has(>div:last-child:nth-child(3))>div:nth-child(3){padding-left:12px;border-left:1px solid var(--line)}}
@media(max-width:560px){.study-metrics:has(>div:last-child:nth-child(3)) strong{font-size:22px}}
.study-review-before{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:600;color:var(--violet);background:var(--violet-light);padding:10px 12px;border-radius:6px;margin:0 0 12px}
.study-review-before svg{width:18px;height:18px;flex-shrink:0}
/* formulários: espaço no resumo das revisões, campos alinhados pela base */
.study-more summary{gap:6px}
.study-field>label{flex:1}
.study-field>label>:is(input,select,textarea){margin-top:auto}
.study-topic-title{min-width:44px}
.study-schedule-help{display:block;margin:-6px 0 14px}
#study-schedule-preview>div{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:baseline}
#study-schedule-preview span{text-align:right}
/* cronograma: dias em linha e sem borda padrão do navegador */
.study-days{border:0;padding:0;margin:0;min-width:0}
.study-days legend{font-size:12px;font-weight:500;color:var(--muted);margin-bottom:6px;padding:0}
.study-days .study-hint{display:block;margin-top:8px}
.study-day-choice{flex-direction:row!important;justify-content:center}
.study-day-choice input{width:18px;height:18px;margin:0;accent-color:var(--white)}
.study-time{border:0;padding:0;margin:0;min-width:0}
.study-time legend{font-size:12px;font-weight:500;color:var(--muted);margin-bottom:6px;padding:0}
@media(max-width:560px){.study-plan-grid{grid-template-columns:1fr}}
/* cartão do concurso */
.study-contest-progress{margin:-4px 0 0;font-size:12px;color:var(--muted)}
.study-contest-actions{align-items:center}
.study-contest-go{display:inline-flex;align-items:center;gap:6px;margin-right:auto;font-size:14px;font-weight:700;color:var(--teal);pointer-events:none}
.study-contest-go svg{width:16px;height:16px}
.study-contest-card:hover .study-contest-go{text-decoration:underline;text-underline-offset:3px}
@media(max-width:560px){.study-metrics:has(>div:last-child:nth-child(3)) .study-metric-label{min-height:40px;align-items:flex-start;line-height:1.4}}
.study-time select{min-height:44px}
.study-filters input:focus,.study-filters input:focus-within,.study-filters select:focus,.study-day input:focus,.study-day input:focus-within{outline:3px solid var(--teal);outline-offset:1px}
/* Números > Por matéria: no celular cada matéria vira um cartão (sem rolagem lateral cortando o texto) */
@media(max-width:560px){
  .study-subject-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .study-subject-table,.study-subject-table tbody{display:block}
  .study-subject-table tr{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 12px;padding:14px 0;border-bottom:1px solid var(--line)}
  .study-subject-table tbody th{grid-column:1/-1;min-width:0;max-width:none;padding:0;border:0}
  .study-subject-table td{padding:0;border:0;font-size:15px;font-weight:700;color:var(--ink)}
  .study-subject-table td::before{content:attr(data-label);display:block;font-size:12px;font-weight:400;color:var(--muted);margin-bottom:2px}
  .study-subject-table td:first-of-type{grid-column:1/-1}
  .study-subject-table td small{font-weight:400}
}
/* Revisões misturadas (v28): botão da sequência e aviso dentro do formulário. */
.study-session-start{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:0 0 14px}
.study-session-start small{font-size:13px;line-height:1.5;color:var(--muted);flex:1 1 220px}
.study-session-note{display:flex;align-items:flex-start;gap:8px;font-size:14px;line-height:1.5;color:var(--teal);background:var(--teal-light,#e6f1ef);padding:10px 12px;border-radius:6px;margin:0 0 12px}
.study-session-note svg{width:18px;height:18px;flex-shrink:0;margin-top:2px}
/* Cronograma (v29): link direto para as questões do assunto sugerido. */
.study-slot-link{text-decoration:none}
.study-field-attention input{outline:3px solid var(--teal);outline-offset:2px}
/* Revisão (v30): botão Abrir questões em destaque no formulário. */
.study-review-open{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:0 0 14px}
.study-review-open small{font-size:13px;color:var(--muted);flex:1 1 200px}
.study-review-actions .study-slot-link,.study-review-actions [data-focus="bank"]{white-space:nowrap}
