/*
 * Banco de exercicios — composicao limpa baseada na referencia aprovada.
 * Esta folha atua somente em exercicios/index.html e preserva a logica do banco.
 */

.exercise-bank-page [hidden] {
  display: none !important;
}

.exercise-bank-page {
  --bank-blue: #075fe5;
  --bank-blue-strong: #034fc5;
  --bank-blue-soft: #edf5ff;
  --bank-ink: #0c1833;
  --bank-muted: #5d6980;
  --bank-line: #dce4ef;
  --bank-soft: #f7f9fc;
  --bank-success: #149447;
  --bank-warning: #ffb128;
  background: #f7f9fc;
  color: var(--bank-ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.exercise-bank-page .site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 0 clamp(24px, 3.2vw, 64px);
  border-bottom: 1px solid var(--bank-line);
  background: rgba(255, 255, 255, .97);
  box-shadow: none;
  backdrop-filter: blur(14px);
}

.exercise-bank-page .site-header .brand {
  flex: 0 0 auto;
  gap: 10px;
  color: var(--bank-ink);
  font-family: Nunito, Inter, sans-serif;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -.035em;
}

.exercise-bank-page .site-header .brand-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  color: var(--bank-blue);
  font-size: 1.55rem;
}

.exercise-bank-page .site-header .main-nav {
  display: flex;
  align-self: stretch;
  align-items: stretch;
  gap: clamp(24px, 3.4vw, 62px);
  margin: 0 0 0 clamp(72px, 9vw, 180px);
}

.exercise-bank-page .site-header .main-nav a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0;
  border: 0;
  color: #17243d;
  background: transparent;
  font-size: .94rem;
  font-weight: 700;
}

.exercise-bank-page .site-header .main-nav a:hover,
.exercise-bank-page .site-header .main-nav a[aria-current="page"] {
  color: var(--bank-blue);
}

.exercise-bank-page .site-header .main-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--bank-blue);
}

.exercise-bank-page .bank-shell {
  width: min(1600px, calc(100% - 48px));
  margin: 0 auto;
  padding: 96px 0 56px;
}

.exercise-bank-page .bank-hero {
  padding: 0 0 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.exercise-bank-page .exercise-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  margin-bottom: 8px;
  color: var(--bank-muted);
  font-size: .8rem;
  font-weight: 600;
}

.exercise-bank-page .exercise-breadcrumb::before {
  content: "⌂";
  color: #7d899d;
  font-size: 1rem;
}

.exercise-bank-page .exercise-breadcrumb a {
  color: var(--bank-muted);
}

.exercise-bank-page .bank-hero-copy {
  align-items: flex-end;
}

.exercise-bank-page .bank-hero h1 {
  margin: 0 0 4px;
  color: var(--bank-ink);
  font-family: Nunito, Inter, sans-serif;
  font-size: clamp(1.75rem, 2.4vw, 2.3rem);
  font-weight: 900;
  letter-spacing: -.025em;
}

.exercise-bank-page .bank-hero p {
  max-width: 820px;
  margin: 0;
  color: var(--bank-muted);
  font-size: .94rem;
  line-height: 1.55;
}

.exercise-bank-page .bank-stat-grid,
.exercise-bank-page .bank-performance,
.exercise-bank-page .bank-filter-materia,
.exercise-bank-page .study-pet-widget {
  display: none !important;
}

.exercise-bank-page .bank-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.exercise-bank-page .bank-filter-panel {
  position: sticky;
  top: 88px;
  max-height: none;
  padding: 16px;
  overflow: visible;
  border: 1px solid var(--bank-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(18, 34, 65, .035);
}

.exercise-bank-page .bank-filter-head {
  padding: 2px 0 10px;
  border-bottom: 1px solid #edf1f6;
}

.exercise-bank-page .bank-filter-head h2 {
  color: var(--bank-ink);
  font-size: .96rem;
  font-weight: 800;
}

.exercise-bank-page .bank-search-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0 0 16px;
  border: 0;
  border-bottom: 1px solid #edf1f6;
  border-radius: 0;
  background: transparent;
}

.exercise-bank-page .bank-search-field {
  grid-column: 1 / -1;
  min-width: 0;
}

.exercise-bank-page .bank-search-field > label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.exercise-bank-page .bank-search-field > div {
  position: relative;
}

.exercise-bank-page .bank-search-field input {
  min-height: 42px;
  padding: 9px 60px 9px 13px;
  border: 1px solid #cfd8e5;
  border-radius: 8px;
  color: var(--bank-ink);
  background: #fff;
  font-size: .8rem;
}

.exercise-bank-page .bank-clear-search {
  position: absolute;
  top: 5px;
  right: 5px;
  bottom: 5px;
  min-width: 48px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: var(--bank-soft);
  color: var(--bank-blue);
  font-size: .7rem;
  cursor: pointer;
}

.exercise-bank-page .bank-search-bar > .button {
  justify-content: center;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: .73rem;
}

.exercise-bank-page .bank-filter-panel form {
  gap: 11px;
  margin-top: 13px;
}

.exercise-bank-page .bank-filter-panel label {
  gap: 5px;
  color: #24324a;
  font-size: .76rem;
  font-weight: 800;
}

.exercise-bank-page .bank-filter-panel select {
  min-height: 39px;
  padding: 8px 10px;
  border: 1px solid #cfd8e5;
  border-radius: 8px;
  color: #283750;
  background: #fff;
  font-size: .77rem;
}

.exercise-bank-page .bank-filter-panel [data-bank-clear-filters] {
  min-height: 40px;
  margin-top: 4px;
  border-radius: 8px;
  font-size: .78rem;
}

.exercise-bank-page .bank-results {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--bank-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(18, 34, 65, .035);
}

.exercise-bank-page .bank-status-tabs {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 34px);
  min-height: 48px;
  padding: 0 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--bank-line);
  scrollbar-width: none;
}

.exercise-bank-page .bank-status-tabs::-webkit-scrollbar {
  display: none;
}

.exercise-bank-page .bank-status-tabs button {
  position: relative;
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: #536078;
  font: inherit;
  font-size: .79rem;
  font-weight: 700;
  cursor: pointer;
}

.exercise-bank-page .bank-status-tabs button:hover,
.exercise-bank-page .bank-status-tabs button.is-active {
  color: var(--bank-blue);
}

.exercise-bank-page .bank-status-tabs button.is-active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--bank-blue);
}

.exercise-bank-page .bank-active-filters {
  min-height: 0;
  margin: 10px 4px 0;
}

.exercise-bank-page .bank-filter-chip {
  padding: 5px 9px;
  border-color: #cfe0f5;
  border-radius: 7px;
  background: var(--bank-blue-soft);
  color: var(--bank-blue-strong);
  font-size: .72rem;
}

.exercise-bank-page .bank-results-toolbar {
  align-items: center;
  min-height: 64px;
  margin: 0;
  padding: 10px 4px;
  border: 0;
  border-bottom: 1px solid var(--bank-line);
  border-radius: 0;
  background: transparent;
}

.exercise-bank-page .bank-results-toolbar h2 {
  color: var(--bank-ink);
  font-size: .95rem;
}

.exercise-bank-page .bank-view-controls {
  align-items: center;
  gap: 9px;
}

.exercise-bank-page .bank-view-controls > label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .72rem;
}

.exercise-bank-page .bank-view-controls select {
  width: auto;
  min-width: 150px;
  min-height: 38px;
  padding: 7px 28px 7px 10px;
  border-radius: 8px;
  font-size: .74rem;
}

.exercise-bank-page .bank-view-controls fieldset button,
.exercise-bank-page .bank-pagination button,
.exercise-bank-page .bank-page-numbers button {
  min-height: 38px;
  border-color: #cfd8e5;
  color: #34445e;
  background: #fff;
  font-size: .74rem;
}

.exercise-bank-page .bank-view-controls button.is-active,
.exercise-bank-page .bank-page-numbers button[aria-current="page"] {
  border-color: var(--bank-blue);
  background: var(--bank-blue);
  color: #fff;
}

.exercise-bank-page .bank-list-toolbar {
  margin: 10px 0;
  border-radius: 9px;
}

.exercise-bank-page .bank-status {
  margin: 12px 4px;
  border-radius: 8px;
}

.exercise-bank-page .bank-question-list {
  gap: 12px;
  padding-top: 12px;
}

.exercise-bank-page .bank-question-card {
  border: 1px solid var(--bank-line);
  border-radius: 11px;
  background: #fff;
  box-shadow: none;
}

.exercise-bank-page .bank-question-header {
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--bank-line);
  background: #fff;
}

.exercise-bank-page .bank-question-id {
  color: var(--bank-blue);
  font-size: .78rem;
}

.exercise-bank-page .bank-badges {
  margin-top: 7px;
}

.exercise-bank-page .bank-badge {
  padding: 5px 8px;
  border-radius: 6px;
  background: #eef4fb;
  color: #41536e;
  font-size: .68rem;
}

.exercise-bank-page .bank-badge.dificil,
.exercise-bank-page .bank-badge.avancada {
  background: #fff0ee;
  color: #a33d35;
}

.exercise-bank-page .bank-card-actions {
  gap: 6px;
}

.exercise-bank-page .bank-icon-button {
  min-height: 34px;
  padding: 6px 9px;
  border-color: #cfd8e5;
  border-radius: 7px;
  color: #3c4a62;
  background: #fff;
  font-size: .69rem;
}

.exercise-bank-page .bank-question-body {
  padding: 18px 16px 16px;
}

.exercise-bank-page .bank-question-body h3 {
  margin-bottom: 8px;
  color: #111b2f;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.55;
}

.exercise-bank-page .bank-source {
  margin-bottom: 14px;
  color: #718096;
  font-size: .72rem;
}

.exercise-bank-page .bank-answer-set {
  gap: 7px;
}

.exercise-bank-page .bank-answer-set legend {
  margin-bottom: 8px;
  font-size: .75rem;
}

.exercise-bank-page .bank-answer-option {
  min-height: 44px;
  gap: 12px;
  padding: 10px 12px;
  border-color: #d6deea;
  border-radius: 7px;
  color: #172238;
  font-size: .85rem;
}

.exercise-bank-page .bank-answer-option:hover {
  border-color: #8ab4ed;
  background: #f7fbff;
}

.exercise-bank-page .bank-question-controls {
  gap: 9px;
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid #edf1f6;
}

.exercise-bank-page .bank-question-controls .button {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 7px;
  font-size: .76rem;
}

.exercise-bank-page .button.primary {
  border-color: var(--bank-blue);
  background: var(--bank-blue);
}

.exercise-bank-page .button.primary:hover {
  border-color: var(--bank-blue-strong);
  background: var(--bank-blue-strong);
}

.exercise-bank-page .bank-solution {
  margin-top: 16px;
  padding: 0 16px 16px;
  overflow: hidden;
  border: 1px solid #dbe5f1;
  border-radius: 9px;
  background: #fbfdff;
}

.exercise-bank-page .bank-solution h4 {
  margin: 0 -16px 13px;
  padding: 12px 16px;
  border-bottom: 1px solid #dbe5f1;
  color: var(--bank-blue);
  background: #f2f7ff;
  font-size: .88rem;
}

.exercise-bank-page .bank-solution p,
.exercise-bank-page .bank-solution li {
  color: #33425b;
  font-size: .82rem;
  line-height: 1.65;
}

.exercise-bank-page .bank-solution li::marker {
  color: var(--bank-blue);
  font-weight: 900;
}

.exercise-bank-page .bank-solution .bank-final-answer {
  display: inline-block;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--bank-success);
  background: #ebfaef;
}

.exercise-bank-page .bank-pagination {
  margin: 16px 0 4px;
}

.exercise-bank-page .bank-page-status {
  color: var(--bank-muted);
  font-size: .75rem;
}

html[data-theme="dark"] .exercise-bank-page,
html[data-theme="dark"] .exercise-bank-page :is(.site-header, .bank-filter-panel, .bank-results, .bank-search-bar, .bank-results-toolbar, .bank-question-card, .bank-question-header, .bank-answer-option, .bank-icon-button, .bank-solution, .bank-search-field input, .bank-filter-panel select, .bank-view-controls select, .bank-view-controls fieldset button, .bank-pagination button, .bank-page-numbers button, .bank-random-refresh) {
  color: var(--bank-ink);
  border-color: var(--bank-line);
  background-color: #fff;
}

html[data-theme="dark"] .exercise-bank-page :is(.bank-hero p, .bank-source, .bank-results-toolbar p, .bank-page-status, .exercise-breadcrumb) {
  color: var(--bank-muted);
}

html[data-theme="dark"] .exercise-bank-page .bank-solution {
  background: #fbfdff;
}

@media (max-width: 1100px) {
  .exercise-bank-page .site-header .main-nav {
    gap: 24px;
    margin-left: 58px;
  }

  .exercise-bank-page .bank-layout {
    grid-template-columns: 270px minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .exercise-bank-page .site-header {
    min-height: 64px;
    padding: 0 18px;
  }

  .exercise-bank-page .site-header .brand {
    font-size: 1.16rem;
  }

  .exercise-bank-page .site-header .main-nav {
    display: none;
    margin: 0;
  }

  .exercise-bank-page .site-header .main-nav.is-open,
  .exercise-bank-page .site-header .main-nav[data-open="true"] {
    display: flex;
  }

  .exercise-bank-page .bank-shell {
    width: min(100% - 24px, 760px);
    padding-top: 82px;
  }

  .exercise-bank-page .bank-hero {
    padding-bottom: 16px;
  }

  .exercise-bank-page .bank-hero-copy {
    align-items: stretch;
    flex-direction: column;
  }

  .exercise-bank-page .bank-mobile-filter {
    align-self: flex-start;
  }

  .exercise-bank-page .bank-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .exercise-bank-page .bank-filter-panel {
    display: none;
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 120;
    width: min(360px, 94vw);
    height: 100dvh;
    padding: 18px;
    overflow-y: auto;
    border-radius: 16px 0 0 16px;
    box-shadow: -20px 0 50px rgba(12, 24, 51, .2);
  }

  .exercise-bank-page .bank-filter-panel.is-open {
    display: block;
  }

  .exercise-bank-page .bank-results {
    padding: 10px;
  }

  .exercise-bank-page .bank-results-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .exercise-bank-page .bank-view-controls {
    width: 100%;
  }

  .exercise-bank-page .bank-view-controls > label {
    margin-left: auto;
  }
}

@media (max-width: 560px) {
  .exercise-bank-page .bank-shell {
    width: calc(100% - 16px);
  }

  .exercise-bank-page .bank-hero h1 {
    font-size: 1.65rem;
  }

  .exercise-bank-page .bank-hero p {
    font-size: .86rem;
  }

  .exercise-bank-page .bank-results {
    padding: 8px;
    border-radius: 11px;
  }

  .exercise-bank-page .bank-status-tabs {
    gap: 5px;
  }

  .exercise-bank-page .bank-status-tabs button {
    padding: 0 8px;
  }

  .exercise-bank-page .bank-view-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .exercise-bank-page .bank-view-controls fieldset,
  .exercise-bank-page .bank-view-controls fieldset button,
  .exercise-bank-page .bank-view-controls > label,
  .exercise-bank-page .bank-view-controls select {
    width: 100%;
    margin-left: 0;
  }

  .exercise-bank-page .bank-question-header,
  .exercise-bank-page .bank-card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .exercise-bank-page .bank-card-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .exercise-bank-page .bank-question-body {
    padding: 15px 12px 12px;
  }

  .exercise-bank-page .bank-question-controls {
    display: grid;
  }

  .exercise-bank-page .bank-question-controls .button {
    width: 100%;
    justify-content: center;
  }

  .exercise-bank-page .bank-pagination {
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .exercise-bank-page * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}


/* Menu lateral de filtros no padrão visual da referência. */
.exercise-bank-page .bank-filter-panel form {
  display: grid;
  gap: 10px;
  margin-top: 0;
}

.exercise-bank-page .bank-filter-panel form > label,
.exercise-bank-page .bank-native-filter-shadow {
  display: none !important;
}

.exercise-bank-page .bank-reference-filters {
  display: grid;
}

.exercise-bank-page .bank-ref-filter-section {
  padding: 11px 0;
  border-bottom: 1px solid #e7ecf3;
}

.exercise-bank-page .bank-ref-filter-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  color: #162138;
  background: transparent;
  font: inherit;
  font-size: .79rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.exercise-bank-page .bank-ref-chevron {
  color: #31425e;
  font-size: .72rem;
}

.exercise-bank-page .bank-ref-chip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.exercise-bank-page .bank-ref-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 36px);
  padding: 6px 9px;
  overflow: hidden;
  border-radius: 7px;
  color: #0960d8;
  background: #e7f1ff;
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.exercise-bank-page .bank-ref-chip-close {
  color: #1670e8;
  font-size: 1rem;
  line-height: .8;
}

.exercise-bank-page .bank-ref-choice-list {
  display: grid;
  gap: 3px;
}

.exercise-bank-page .bank-ref-subject-list {
  max-height: 250px;
  margin-top: 8px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.exercise-bank-page .bank-ref-choice {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 28px;
  padding: 2px 0;
  border: 0;
  color: #4d596d;
  background: transparent;
  font: inherit;
  font-size: .75rem;
  text-align: left;
  cursor: pointer;
}

.exercise-bank-page .bank-ref-choice:hover {
  color: #0b5fce;
}

.exercise-bank-page .bank-ref-check {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid #b9c5d5;
  border-radius: 4px;
  color: #fff;
  background: #fff;
  font-size: .68rem;
  font-weight: 900;
}

.exercise-bank-page .bank-ref-choice.is-selected .bank-ref-check {
  border-color: #0b67e8;
  background: #0b67e8;
  box-shadow: 0 2px 5px rgba(11, 103, 232, .2);
}

.exercise-bank-page .bank-ref-choice.is-selected .bank-ref-choice-label {
  color: #18253c;
  font-weight: 700;
}

.exercise-bank-page .bank-ref-count {
  display: inline-grid;
  place-items: center;
  min-width: 25px;
  min-height: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #7a8698;
  background: #f0f3f7;
  font-size: .67rem;
  font-weight: 700;
}

.exercise-bank-page .bank-ref-choice[data-sidebar-filter="dificuldade"] .bank-ref-choice-label::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border-radius: 50%;
  background: #aab4c2;
}

.exercise-bank-page .bank-ref-choice[data-sidebar-value="facil"] .bank-ref-choice-label::before { background: #44c889; }
.exercise-bank-page .bank-ref-choice[data-sidebar-value="media"] .bank-ref-choice-label::before { background: #ffb938; }
.exercise-bank-page .bank-ref-choice[data-sidebar-value="dificil"] .bank-ref-choice-label::before { background: #f04b51; }
.exercise-bank-page .bank-ref-choice[data-sidebar-value="avancada"] .bank-ref-choice-label::before { background: #8a63df; }

.exercise-bank-page .bank-ref-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  padding: 0;
  border: 0;
  color: #0864df;
  background: transparent;
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
}

.exercise-bank-page .bank-ref-year-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  color: #667388;
  font-size: .7rem;
}

.exercise-bank-page .bank-ref-year-range input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid #cfd8e5;
  border-radius: 7px;
  color: #34425a;
  background: #fff;
  font: inherit;
  font-size: .73rem;
  appearance: textfield;
}

.exercise-bank-page .bank-ref-year-range input::-webkit-inner-spin-button,
.exercise-bank-page .bank-ref-year-range input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.exercise-bank-page .bank-filter-panel [data-bank-clear-filters] {
  min-height: 34px;
  margin: 2px 0 0;
  border: 0;
  color: #5d6a7e;
  background: transparent;
  font-size: .72rem;
}

.exercise-bank-page .bank-filter-panel .bank-apply-filters {
  display: inline-flex !important;
  justify-content: center;
  width: 100%;
  min-height: 43px;
  border-radius: 7px;
  box-shadow: 0 7px 16px rgba(7, 95, 229, .16);
  font-size: .82rem;
}

.exercise-bank-page .bank-filter-panel .bank-apply-filters::before {
  content: "▽";
  margin-right: 8px;
  transform: rotate(180deg);
  font-size: .9rem;
}

.exercise-bank-page .bank-filter-panel form.has-pending-filters .bank-apply-filters {
  box-shadow: 0 0 0 3px rgba(7, 95, 229, .14), 0 8px 18px rgba(7, 95, 229, .18);
}

html[data-theme="dark"] .exercise-bank-page :is(.bank-ref-filter-title, .bank-ref-choice, .bank-ref-year-range input) {
  color: #24324a;
}

@media (max-width: 820px) {
  .exercise-bank-page .bank-ref-choice {
    min-height: 34px;
    font-size: .8rem;
  }

  .exercise-bank-page .bank-ref-filter-title {
    font-size: .84rem;
  }
}


/* Painel mais largo e alinhado mais perto da borda esquerda. */
.exercise-bank-page .bank-shell {
  width: min(1840px, calc(100% - 32px));
}

.exercise-bank-page .bank-layout {
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 18px;
}

.exercise-bank-page .bank-filter-panel {
  padding: 18px;
}

@media (max-width: 1100px) and (min-width: 821px) {
  .exercise-bank-page .bank-layout {
    grid-template-columns: 310px minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .exercise-bank-page .bank-shell {
    width: min(100% - 24px, 760px);
  }

  .exercise-bank-page .bank-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* Cabeçalho, breadcrumb e título alinhados à referência aprovada. */
.exercise-bank-page .site-header {
  min-height: 84px;
  padding: 0 clamp(28px, 3.6vw, 70px);
}

.exercise-bank-page .site-header .brand {
  gap: 0;
  font-size: clamp(1.65rem, 2vw, 2rem);
  letter-spacing: -.045em;
}

.exercise-bank-page .site-header .brand-mark {
  display: none;
}

.exercise-bank-page .site-header .main-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  display: flex;
  align-items: stretch;
  gap: clamp(34px, 4.1vw, 72px);
  margin: 0;
  transform: translateX(-50%);
}

.exercise-bank-page .site-header .main-nav a {
  font-size: .96rem;
  font-weight: 700;
}

.exercise-bank-page .site-header .theme-toggle {
  position: absolute;
  top: 50%;
  right: clamp(20px, 3.2vw, 62px);
  min-height: 34px;
  gap: 6px;
  padding: 5px 10px;
  border-color: #dde5ef;
  border-radius: 8px;
  color: #40506a;
  background: #f8fafc;
  box-shadow: none;
  font-size: .72rem;
  font-weight: 700;
  transform: translateY(-50%);
}

.exercise-bank-page .site-header .theme-toggle:hover {
  border-color: #b9cae0;
  color: #0a5ed1;
  background: #f2f7fd;
  transform: translateY(-50%);
}

.exercise-bank-page .site-header .theme-toggle-icon {
  width: 16px;
  height: 16px;
  font-size: .9rem;
}

.exercise-bank-page .bank-shell {
  padding-top: 108px;
}

.exercise-bank-page .exercise-breadcrumb {
  gap: 9px;
  margin-bottom: 9px;
  color: #657187;
  font-size: .78rem;
  font-weight: 600;
}

.exercise-bank-page .exercise-breadcrumb::before {
  content: none;
}

.exercise-bank-page .exercise-breadcrumb a {
  color: #657187;
}

.exercise-bank-page .exercise-breadcrumb a:hover {
  color: #075fe5;
}

.exercise-bank-page .exercise-breadcrumb-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.exercise-bank-page .exercise-breadcrumb-home > span:first-child {
  color: #7f8b9d;
  font-size: 1rem;
  line-height: 1;
}

.exercise-bank-page .bank-hero {
  padding-bottom: 24px;
}

.exercise-bank-page .bank-hero h1 {
  margin: 0 0 4px;
  color: #101b31;
  font-family: Inter, system-ui, sans-serif;
  font-size: clamp(1.72rem, 2.1vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.16;
}

.exercise-bank-page .bank-hero p {
  color: #5f6b80;
  font-size: .93rem;
  line-height: 1.5;
}

/* O botão de tema realmente alterna toda a página, mantendo o azul da identidade. */
html[data-theme="dark"] .exercise-bank-page {
  --bank-ink: #edf4ff;
  --bank-muted: #aebdd2;
  --bank-line: #2d425f;
  --bank-soft: #14243a;
  color: #edf4ff;
  background: #0b1423;
}

html[data-theme="dark"] .exercise-bank-page .site-header {
  border-color: #263a55;
  background: rgba(12, 23, 39, .97);
}

html[data-theme="dark"] .exercise-bank-page .site-header :is(.brand, .main-nav a) {
  color: #eaf2ff;
}

html[data-theme="dark"] .exercise-bank-page .site-header .main-nav a:hover,
html[data-theme="dark"] .exercise-bank-page .site-header .main-nav a[aria-current="page"] {
  color: #69adff;
}

html[data-theme="dark"] .exercise-bank-page .site-header .theme-toggle {
  border-color: #324a68;
  color: #d7e5f7;
  background: #15243a;
}

html[data-theme="dark"] .exercise-bank-page :is(.bank-filter-panel, .bank-results, .bank-question-card, .bank-question-header, .bank-search-bar, .bank-results-toolbar) {
  color: #edf4ff;
  border-color: #2d425f;
  background: #101d31;
}

html[data-theme="dark"] .exercise-bank-page :is(.bank-hero h1, .bank-filter-head h2, .bank-ref-filter-title, .bank-question-body h3, .bank-results-toolbar h2) {
  color: #edf4ff;
}

html[data-theme="dark"] .exercise-bank-page :is(.bank-hero p, .exercise-breadcrumb, .exercise-breadcrumb a, .bank-source, .bank-page-status) {
  color: #aebdd2;
}

html[data-theme="dark"] .exercise-bank-page :is(.bank-search-field input, .bank-ref-year-range input, .bank-view-controls select, .bank-answer-option, .bank-icon-button, .bank-view-controls fieldset button, .bank-pagination button, .bank-page-numbers button) {
  color: #edf4ff;
  border-color: #3b5473;
  background: #14243a;
}

html[data-theme="dark"] .exercise-bank-page :is(.bank-filter-head, .bank-ref-filter-section, .bank-status-tabs, .bank-results-toolbar, .bank-question-controls) {
  border-color: #2d425f;
}

html[data-theme="dark"] .exercise-bank-page .bank-ref-choice {
  color: #c3d1e4;
}

html[data-theme="dark"] .exercise-bank-page .bank-ref-choice.is-selected .bank-ref-choice-label {
  color: #edf4ff;
}

html[data-theme="dark"] .exercise-bank-page .bank-ref-check {
  border-color: #506985;
  background: #14243a;
}

html[data-theme="dark"] .exercise-bank-page .bank-ref-choice.is-selected .bank-ref-check {
  border-color: #2d89f8;
  background: #1672df;
}

html[data-theme="dark"] .exercise-bank-page .bank-ref-chip {
  color: #a9d2ff;
  background: #173657;
}

html[data-theme="dark"] .exercise-bank-page .bank-ref-count {
  color: #b9c9dd;
  background: #1b2d45;
}

html[data-theme="dark"] .exercise-bank-page .bank-solution {
  color: #dce8f8;
  border-color: #36506f;
  background: #14243a;
}

html[data-theme="dark"] .exercise-bank-page .bank-solution h4 {
  border-color: #36506f;
  color: #75b6ff;
  background: #182c46;
}

html[data-theme="dark"] .exercise-bank-page .bank-solution :is(p, li) {
  color: #d2deee;
}

@media (max-width: 1120px) and (min-width: 761px) {
  .exercise-bank-page .site-header .brand {
    font-size: 1.48rem;
  }

  .exercise-bank-page .site-header .main-nav {
    gap: 27px;
  }

  .exercise-bank-page .site-header .theme-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .exercise-bank-page .site-header .theme-toggle {
    width: 34px;
    padding: 5px;
  }
}

@media (max-width: 760px) {
  .exercise-bank-page .site-header {
    min-height: 64px;
    padding: 0 16px;
  }

  .exercise-bank-page .site-header .brand {
    font-size: 1.24rem;
  }

  .exercise-bank-page .site-header .main-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 12px;
    bottom: auto;
    left: 12px;
    display: none;
    align-items: stretch;
    gap: 4px;
    margin: 0;
    transform: none;
  }

  .exercise-bank-page .site-header .main-nav.is-open {
    display: flex;
  }

  .exercise-bank-page .site-header .theme-toggle {
    position: static;
    width: 100%;
    min-height: 42px;
    justify-content: flex-start;
    transform: none;
  }

  .exercise-bank-page .site-header .theme-toggle:hover {
    transform: none;
  }

  .exercise-bank-page .bank-shell {
    padding-top: 82px;
  }
}


@media (min-width: 761px) {
  .exercise-bank-page .site-header .main-nav .theme-toggle {
    position: fixed;
    top: 42px;
    right: clamp(20px, 3.2vw, 62px);
  }
}


/* Correções finais: breadcrumb legível e tema fora da navegação central. */
.exercise-bank-page .exercise-breadcrumb > span,
.exercise-bank-page .exercise-breadcrumb-home > span,
.exercise-bank-page .exercise-breadcrumb > a {
  color: #657187;
}

.exercise-bank-page .exercise-breadcrumb > span[aria-current="page"] {
  color: #344158;
  font-weight: 700;
}

.exercise-bank-page .site-header > .theme-toggle {
  position: absolute;
  top: 50%;
  right: clamp(20px, 3.2vw, 62px);
  transform: translateY(-50%);
}

.exercise-bank-page .site-header > .theme-toggle:hover {
  transform: translateY(-50%);
}

html[data-theme="dark"] .exercise-bank-page .exercise-breadcrumb > span,
html[data-theme="dark"] .exercise-bank-page .exercise-breadcrumb-home > span,
html[data-theme="dark"] .exercise-bank-page .exercise-breadcrumb > a {
  color: #aebdd2;
}

html[data-theme="dark"] .exercise-bank-page .exercise-breadcrumb > span[aria-current="page"] {
  color: #e4edf9;
}

@media (max-width: 760px) {
  .exercise-bank-page .site-header > .theme-toggle {
    position: absolute;
    top: 50%;
    right: 56px;
    width: 34px;
    min-height: 34px;
    padding: 5px;
    justify-content: center;
    transform: translateY(-50%);
  }

  .exercise-bank-page .site-header > .theme-toggle:hover {
    transform: translateY(-50%);
  }

  .exercise-bank-page .site-header > .theme-toggle .theme-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
}


/* Padrão compartilhado com o cabeçalho das aulas: posicionamento e ritmo. */
@media (min-width: 761px) {
  .exercise-bank-page .site-header {
    min-height: 70px;
    justify-content: flex-start;
    padding: 0 clamp(20px, 4vw, 64px);
  }

  .exercise-bank-page .site-header .brand {
    flex: 0 0 auto;
    gap: 0;
    font-size: 1.28rem;
    letter-spacing: -.025em;
  }

  .exercise-bank-page .site-header .main-nav {
    position: static;
    inset: auto;
    align-self: stretch;
    align-items: stretch;
    gap: clamp(8px, 2vw, 26px);
    margin: 0 auto 0 clamp(72px, 7vw, 132px);
    transform: none;
  }

  .exercise-bank-page .site-header .main-nav a {
    min-height: 70px;
    font-size: .88rem;
  }

  .exercise-bank-page .site-header > .theme-toggle {
    top: 50%;
    right: clamp(20px, 3.2vw, 62px);
  }

  .exercise-bank-page .bank-shell {
    padding-top: 94px;
  }
}

@media (max-width: 760px) {
  .exercise-bank-page .site-header {
    min-height: 60px;
    padding: 0 14px;
  }

  .exercise-bank-page .site-header .brand {
    font-size: 1.1rem;
  }

  .exercise-bank-page .site-header .main-nav {
    top: calc(100% + 1px);
    right: 10px;
    left: 10px;
    gap: 0;
  }

  .exercise-bank-page .bank-shell {
    padding-top: 78px;
  }
}

/* Tema noturno consolidado do banco de exercicios.
   Mantem todas as superficies, textos e estados no mesmo sistema de contraste. */
html[data-theme="dark"] body.exercise-bank-page {
  --bank-blue: #5ca7ff;
  --bank-blue-strong: #7ab8ff;
  --bank-blue-soft: #173657;
  --bank-ink: #edf4ff;
  --bank-muted: #aebdd2;
  --bank-line: #2d425f;
  --bank-soft: #14243a;
  --bank-success: #54d4a4;
  color: #edf4ff !important;
  background: #08111f !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-shell {
  color: #edf4ff;
  background: transparent !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-hero {
  color: #edf4ff;
  border-color: #263b56 !important;
  background: #0d1b2e !important;
}

html[data-theme="dark"] body.exercise-bank-page :is(
  .bank-filter-panel,
  .bank-results,
  .bank-results-toolbar,
  .bank-list-toolbar,
  .bank-question-card,
  .bank-performance,
  .bank-report-dialog
) {
  color: #edf4ff !important;
  border-color: #2d425f !important;
  background: #101d31 !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .2) !important;
}

html[data-theme="dark"] body.exercise-bank-page :is(
  .bank-question-header,
  .bank-search-bar,
  .bank-status,
  .bank-performance-grid article
) {
  color: #edf4ff !important;
  border-color: #2d425f !important;
  background: #12233a !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-question-body {
  color: #edf4ff !important;
  background: #101d31 !important;
}

html[data-theme="dark"] body.exercise-bank-page :is(
  .bank-hero h1,
  .bank-filter-head h2,
  .bank-results-toolbar h2,
  .bank-question-body h3,
  .bank-answer-set legend,
  .bank-ref-filter-title,
  .bank-view-controls > label
) {
  color: #edf4ff !important;
}

html[data-theme="dark"] body.exercise-bank-page :is(
  .bank-hero p,
  .bank-source,
  .bank-results-toolbar p,
  .bank-page-status,
  .bank-validation-summary,
  .exercise-breadcrumb,
  .exercise-breadcrumb a,
  .bank-ref-year-range
) {
  color: #aebdd2 !important;
}

html[data-theme="dark"] body.exercise-bank-page :is(
  .bank-filter-head,
  .bank-ref-filter-section,
  .bank-status-tabs,
  .bank-results-toolbar,
  .bank-question-header,
  .bank-question-controls,
  .bank-search-bar
) {
  border-color: #2d425f !important;
}

html[data-theme="dark"] body.exercise-bank-page :is(
  .bank-search-field input,
  .bank-ref-year-range input,
  .bank-view-controls select,
  .bank-report-dialog input,
  .bank-report-dialog select,
  .bank-report-dialog textarea,
  .bank-answer-option,
  .bank-icon-button,
  .bank-view-controls fieldset button,
  .bank-pagination button,
  .bank-page-numbers button,
  .bank-random-refresh,
  .bank-clear-search
) {
  color: #e7f0ff !important;
  border-color: #3b5473 !important;
  background: #14243a !important;
}

html[data-theme="dark"] body.exercise-bank-page :is(
  .bank-search-field input,
  .bank-ref-year-range input,
  .bank-view-controls select,
  .bank-report-dialog input,
  .bank-report-dialog textarea
)::placeholder {
  color: #8092aa !important;
  opacity: 1;
}

html[data-theme="dark"] body.exercise-bank-page :is(
  .bank-answer-option:hover,
  .bank-icon-button:hover,
  .bank-view-controls fieldset button:hover,
  .bank-pagination button:hover,
  .bank-page-numbers button:hover,
  .bank-random-refresh:hover
) {
  color: #f4f8ff !important;
  border-color: #5a84b5 !important;
  background: #18304f !important;
}

html[data-theme="dark"] body.exercise-bank-page :is(
  .bank-view-controls button.is-active,
  .bank-page-numbers button[aria-current="page"],
  .button.primary
) {
  color: #fff !important;
  border-color: #1677e8 !important;
  background: #1677e8 !important;
}

html[data-theme="dark"] body.exercise-bank-page .button.primary:hover {
  border-color: #328ef5 !important;
  background: #328ef5 !important;
}

html[data-theme="dark"] body.exercise-bank-page .button.secondary {
  color: #dce8fb !important;
  border-color: #3b5473 !important;
  background: #14243a !important;
}

html[data-theme="dark"] body.exercise-bank-page .button.secondary:hover {
  color: #f4f8ff !important;
  border-color: #5a84b5 !important;
  background: #18304f !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-ref-choice {
  color: #c3d1e4 !important;
  background: transparent !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-ref-choice:hover {
  color: #8fc4ff !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-ref-choice.is-selected .bank-ref-choice-label {
  color: #edf4ff !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-ref-check {
  color: #fff !important;
  border-color: #506985 !important;
  background: #14243a !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-ref-choice.is-selected .bank-ref-check {
  border-color: #2d89f8 !important;
  background: #1672df !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-ref-chip {
  color: #b9dcff !important;
  background: #173657 !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-ref-count {
  color: #c5d3e4 !important;
  background: #1b2d45 !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-ref-more,
html[data-theme="dark"] body.exercise-bank-page .bank-clear-search {
  color: #7db8ff !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-badge {
  color: #dbe9f8 !important;
  background: #1b314d !important;
}

html[data-theme="dark"] body.exercise-bank-page :is(.bank-badge.dificil, .bank-badge.avancada) {
  color: #ffc5ca !important;
  background: #40212b !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-answer-option.is-correct {
  color: #d9fff0 !important;
  border-color: #318a70 !important;
  background: #10372d !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-answer-option.is-correct::after {
  color: #72e0b8 !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-answer-option.is-wrong {
  color: #ffe5e7 !important;
  border-color: #a94b5a !important;
  background: #3b1d26 !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-answer-option.is-wrong::after {
  color: #ff9eaa !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-question-feedback {
  color: #dceaff !important;
  border-color: #3c82cf !important;
  background: #142e4d !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-question-feedback.correct {
  color: #d9fff0 !important;
  border-color: #318a70 !important;
  background: #10372d !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-question-feedback.wrong {
  color: #ffe5e7 !important;
  border-color: #a94b5a !important;
  background: #3b1d26 !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-question-feedback p {
  color: inherit !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-status-tabs button {
  color: #aebdd2 !important;
  border-color: transparent !important;
  background: transparent !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-status-tabs button:hover,
html[data-theme="dark"] body.exercise-bank-page .bank-status-tabs button.is-active {
  color: #7db8ff !important;
  border-color: #5ca7ff !important;
  background: transparent !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-solution {
  color: #dce8f8 !important;
  border-color: #36506f !important;
  background: #14243a !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-solution h4 {
  color: #8ac2ff !important;
  border-color: #36506f !important;
  background: #182c46 !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-solution :is(p, li) {
  color: #d2deee !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-solution .bank-final-answer {
  color: #9ce8c8 !important;
  background: #10372d !important;
}

html[data-theme="dark"] body.exercise-bank-page .bank-icon-button[aria-pressed="true"] {
  color: #ffe39b !important;
  border-color: #8b6f2d !important;
  background: #372e18 !important;
}

html[data-theme="dark"] body.exercise-bank-page :is(
  .bank-question-card:focus-visible,
  .bank-results:focus-visible,
  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible
) {
  outline-color: #65aaff !important;
}
