:root {
  --brand-blue: #25558A;
  --academic-blue: #3566A8;
  --clinical-blue: #3F7FB6;
  --light-blue: #4A8FC4;
  --ui-bg: #F2F4F7;
  --medical-line: rgba(37, 85, 138, 0.06);
  --medical-dot: rgba(53, 102, 168, 0.07);
  --blue: #3566A8;
  --indigo: #25558A;
  --purple: #3566A8;
  --pink: #e83e8c;
  --red: #e74a3b;
  --orange: #fd7e14;
  --yellow: #f6c23e;
  --green: #1cc88a;
  --teal: #20c9a6;
  --cyan: #36b9cc;
  --white: #fff;
  --gray: #858796;
  --gray-dark: #5a5c69;
  --primary: #25558A;
  --secondary: #858796;
  --success: #1cc88a;
  --info: #3F7FB6;
  --warning: #ffae0c!important;
  --danger: #f04546!important;
  --light: #F2F4F7;
  --dark: #5a5c69;
  --breakpoint-xs: 0;
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
  --font-family-sans-serif: "Nunito",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
  --font-family-monospace: SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
}

.bg-primary {
  background-color: var(--brand-blue) !important;
}

.bg-success {
  background-color: #2ce080!important;
}

.text-success {
  color: #166534!important;
}

.text-info {
  color: #475569!important;
}

.text-primary {
  color: var(--brand-blue) !important;
}

.text-incorrect {
  color: #ff3a44;
}

.btn-crear {
  margin-bottom: 10px;
  margin-right: 5px;
}

.chk-select {
  margin-right: 10px;
}

.list-group-item {
  position: relative;
  display: block;
  padding: .75rem .75rem;
  margin-bottom: -1px;
  background-color: #fff;
  border: 1px solid rgba(0,0,0,.125);
}

.custom-switch {
  padding-left: .75rem;
}

@media (min-width: 300px) {
  h6 {
    font-size: .85rem;
  }
}

.incorrect {
  color: #f2664a;
}

.correct {
  color: #4cb85c;
}

.explicacion {
  font-size: 1rem;
}

.bg-gradient-primary {
  background-color: var(--brand-blue) !important;
  background-image: linear-gradient(165deg, var(--brand-blue) 0%, var(--clinical-blue) 100%);
  background-size: cover;
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 12px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.brand-logo-horizontal-img {
  width: 148px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.auth-logo-img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin-bottom: 1rem;
}

.auth-logo-horizontal-img {
  width: 196px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  margin-bottom: 1rem;
}

.auth-logo-vertical-img {
  width: 132px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  margin-bottom: 1rem;
}

.register-section {
  border: 1px solid #d7dfeb;
  border-radius: 14px;
  padding: 14px 14px 8px;
  margin-bottom: 14px;
}

.register-section-title {
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: #1f3b72;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.register-section-personal {
  background: #f6faff;
}

.register-section-plan {
  background: #f8f9ff;
}

.register-section-security {
  background: #f5fbf7;
}

.btn-primary {
  color: white;
  background-color: var(--brand-blue);
  border-color: var(--brand-blue);
}

.btn-primary:hover {
  color: white;
  background-color: var(--academic-blue);
  border-color: var(--academic-blue);
}

.btn-primary:not(:disabled):not(.disabled):active, .show > .btn-primary.dropdown-toggle {
  color: #fff;
  background-color: var(--clinical-blue);
  border-color: var(--clinical-blue);
}

.progress-bar {
  background-color: #2ce080;
}

.progress {
  background-color: #aaadaf;
}

.text-dark {
  color: #111827!important;
}

.badge.badge-primary.badge-pill.ml-1 {
  background-color: var(--brand-blue) !important;
}

.fa-info-circle {
  color: var(--academic-blue);
}

.text-nouses {
  color: var(--brand-blue) !important;
}

.text-uses {
  color: #590375;
}

.fa-eye {
  color: var(--academic-blue);
}

.page-item.active .page-link {
  background-color: var(--brand-blue);
  border-color: var(--brand-blue);
}

.custom-control-input:checked ~ .custom-control-label:before {
  background-color: var(--brand-blue);
}


#account-status a.alert-link {
  text-decoration: underline;
}

#practice-questions .card {
  border-radius: 8px;
}

#plans-list .border {
  border-color: #d4d8dd !important;
}

/* Responsive baseline for desktop/tablet/mobile without changing flows */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

html {
  font-size: 16px;
}

body {
  color: #111827;
  line-height: 1.5;
  background-color: var(--ui-bg);
  background-image:
    radial-gradient(circle at 22px 22px, var(--medical-dot) 1.4px, transparent 1.5px),
    linear-gradient(var(--medical-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--medical-line) 1px, transparent 1px);
  background-size: 44px 44px, 44px 44px, 44px 44px;
}

h1, .h1 { font-size: 2rem; line-height: 1.2; font-weight: 800; }
h2, .h2 { font-size: 1.75rem; line-height: 1.25; font-weight: 800; }
h3, .h3 { font-size: 1.5rem; line-height: 1.3; font-weight: 700; }
h4, .h4 { font-size: 1.25rem; line-height: 1.35; font-weight: 700; }
h5, .h5 { font-size: 1.1rem; line-height: 1.4; font-weight: 600; }
h6, .h6 { font-size: 1rem; line-height: 1.45; font-weight: 600; }

.text-muted,
.text-gray-500,
.text-gray-600 {
  color: #475569 !important;
}

.text-danger {
  color: #b91c1c !important;
}

small,
.small {
  font-size: 0.875rem;
  line-height: 1.4;
}

.form-control,
.form-control-user,
.btn,
.custom-select {
  min-height: 42px;
}

.form-control-user {
  color: #1f2937;
  background-color: #fff;
}

.form-control-user:focus {
  color: #1f2937;
}

select.form-control-user {
  color: #1f2937 !important;
  background-color: #fff !important;
  -webkit-text-fill-color: #1f2937 !important;
  text-shadow: 0 0 0 #1f2937;
}

select.form-control-user option {
  color: #1f2937 !important;
}

select.form-control-user::-ms-value {
  color: #1f2937 !important;
}

textarea.form-control {
  min-height: 110px;
}

.card {
  border-radius: 10px;
}

.sidebar {
  position: relative;
  z-index: 1035;
}

.topbar {
  position: relative;
  z-index: 1030;
}

#content {
  padding-top: 0;
}

@media (min-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
  }

  #content-wrapper {
    margin-left: 14rem;
  }

  .sidebar.toggled + #content-wrapper,
  #wrapper.toggled #content-wrapper {
    margin-left: 6.5rem;
  }

  .topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 14rem;
  }

  #wrapper.toggled .topbar {
    left: 6.5rem;
  }

  #content {
    padding-top: 4.5rem;
  }
}

@media (max-width: 767.98px) {
  .topbar {
    position: sticky;
    top: 0;
  }

  #content-wrapper {
    margin-left: 0;
  }

  #content {
    padding-top: 0;
  }
}

.topbar .container-fluid {
  gap: 0.5rem;
}

#question-choices .custom-control {
  padding: 0.6rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  background: #fff;
  color: #111827;
}

#question-choices .custom-control-label {
  color: #111827;
  font-weight: 600;
}

#question-stem {
  color: #111827;
}

@media (max-width: 991.98px) {
  .container-fluid {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .topbar h5,
  .topbar .h5 {
    font-size: 1rem;
    margin-bottom: 0;
  }

  .badge.badge-primary,
  .badge.badge-danger {
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .card-header {
    padding: 0.7rem 0.9rem;
  }

  .card-body {
    padding: 0.9rem;
  }
}

@media (max-width: 767.98px) {
  .bg-gradient-primary .container {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .bg-gradient-primary .card.shadow-lg {
    margin-top: 1.25rem !important;
    margin-bottom: 1.25rem !important;
  }

  .bg-gradient-primary .card .p-5 {
    padding: 1.15rem !important;
  }

  .btn-user,
  #register-submit-btn,
  #login-submit-btn {
    min-height: 46px;
    font-weight: 700;
  }

  #topics-grid .topic-option {
    margin-bottom: 0.5rem !important;
  }

  #topics-grid .border.rounded.p-2 {
    padding: 0.65rem !important;
  }

  #question-count-select {
    max-width: 100% !important;
  }

  #result-details .card,
  #practice-questions .card {
    margin-bottom: 0.65rem;
  }
}

@media (max-width: 575.98px) {
  h4, .h4 {
    font-size: 1.1rem;
  }

  h5, .h5 {
    font-size: 1rem;
  }

  .small {
    font-size: 0.875rem;
  }

  .topbar .dropdown-menu {
    right: 0;
    left: auto;
    width: min(92vw, 320px);
  }
}

.flash-deck-actions .btn {
  white-space: nowrap;
  min-height: 38px;
}

.flash-deck-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
}

.flash-deck-actions .btn.disabled {
  pointer-events: none;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  background: #e2e8f0;
  color: #0f172a;
  background-size: cover;
  background-position: center;
}

.fc-flip-scene {
  perspective: 1200px;
  min-height: 260px;
  cursor: pointer;
  outline: none;
}

.fc-flip-card {
  position: relative;
  width: 100%;
  min-height: 260px;
  transition: transform 0.45s ease;
  transform-style: preserve-3d;
}

.fc-flip-card.is-flipped {
  transform: rotateY(180deg);
}

.fc-flip-face {
  position: absolute;
  inset: 0;
  border: 1px solid #d9dfeb;
  border-radius: 12px;
  background: #fff;
  padding: 1rem;
  backface-visibility: hidden;
  overflow: auto;
}

.fc-flip-face.fc-back {
  transform: rotateY(180deg);
}

.fc-flip-face p {
  line-height: 1.45;
}

.fc-study-shortcuts .badge {
  margin-left: 0.25rem;
  font-weight: 600;
  border: 1px solid #dfe4ee;
}

.focus-block {
  border: 1px solid #e4eaf2;
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
  background: #fff;
}

.focus-block .progress {
  height: 8px;
}

.focus-plan-block {
  border-top: 1px solid #edf0f6;
  padding-top: 0.35rem;
}

.focus-progress-track {
  background: #eceff7;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.focus-progress-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8d64ff 0%, #6c42e7 100%);
}

.focus-progress-label {
  font-size: 0.8rem;
  color: #5e6474;
}

.focus-consistency-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.focus-consistency-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid #e6ebf3;
  border-radius: 10px;
  padding: 0.5rem 0.6rem;
  background: #fbfcff;
}

.focus-consistency-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f2eaff;
  font-size: 1rem;
}

.dashboard-kpi-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.kpi-sparkline {
  width: 118px;
  height: 44px;
}

.kpi-sparkline #metric-attempts-spark-path {
  fill: none;
  stroke: #7c5bd6;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kpi-sparkline #metric-attempts-spark-fill {
  fill: rgba(124, 91, 214, 0.12);
}

.kpi-ring {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: conic-gradient(#7c5bd6 0deg, #7c5bd6 0deg, #e8e9ef 0deg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.kpi-ring::after {
  content: '';
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff;
}

.kpi-ring span {
  position: absolute;
  font-weight: 700;
  font-size: 0.95rem;
  color: #2f2f3a;
}

.kpi-bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 52px;
  min-width: 122px;
}

.kpi-bars span {
  width: 12px;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #9f8de8 0%, #7c5bd6 100%);
}

.kpi-streak-icon {
  font-size: 2rem;
  line-height: 1;
}

.quickstart-hero {
  background: linear-gradient(135deg, #4a2a90 0%, #3f2d9f 50%, #2f1f74 100%);
  border-radius: 12px;
  padding: 0.95rem;
}

.quickstart-hero-head .badge {
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.quickstart-actions .quickstart-action {
  border-radius: 12px;
  border: 1px solid #dbe3ef;
  min-height: 68px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.quickstart-action-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(116, 126, 156, 0.25);
  flex-shrink: 0;
}

.quickstart-action-text {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.quickstart-action-meta {
  margin-top: 0.12rem;
  font-size: 0.85rem;
  line-height: 1.15;
  opacity: 0.85;
}

.quickstart-action-info {
  background: #eef3ff;
  color: #243b7a;
}

.quickstart-action-danger {
  background: #fff0f1;
  color: #7b2534;
}

.quickstart-action-warning {
  background: #fff7e8;
  color: #7a571a;
}

.quickstart-action-soft {
  background: #f4efff;
  color: #5d3a99;
}

.quickstart-actions .quickstart-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(31, 41, 55, 0.08);
}

.topic-perf-item {
  border-bottom: 1px solid #eef2f7;
  padding-bottom: 0.45rem;
}

.topic-perf-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.topic-perf-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.topic-perf-topic {
  font-weight: 600;
  color: #2b2f3a;
  line-height: 1.2;
}

.topic-perf-score {
  color: #2b2f3a;
  font-size: 0.98rem;
}

.topic-perf-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.topic-perf-tag-weak {
  background: #fff1f3;
  color: #9f3046;
  border-color: #ffd5dd;
}

.topic-perf-tag-mid {
  background: #fff8e8;
  color: #8b6416;
  border-color: #ffe2a4;
}

.topic-perf-tag-strong {
  background: #ebfff4;
  color: #1f7a4e;
  border-color: #bcefd4;
}

.topic-perf-track {
  height: 12px;
  border-radius: 999px;
  background: #e8ebf3;
  overflow: hidden;
}

.topic-perf-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.topic-perf-fill-weak {
  background: linear-gradient(90deg, #f05b61 0%, #f0903b 100%);
}

.topic-perf-fill-mid {
  background: linear-gradient(90deg, #f05b61 0%, #f2bd31 55%, #6ecb6d 100%);
}

.topic-perf-fill-strong {
  background: linear-gradient(90deg, #f09e33 0%, #7ed26f 55%, #2ebc86 100%);
}

.study-path-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.study-path-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.9rem;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.study-path-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
}

.study-path-topic {
  font-weight: 800;
  color: #1f2a44;
}

.study-path-reason {
  font-size: 0.85rem;
  color: #667085;
}

.study-path-badge {
  background: #f2e9ff;
  color: #5f3dc4;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.85rem;
  height: fit-content;
}

.study-path-meta {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 0.6rem;
}

.study-path-actions {
  display: grid;
  gap: 0.45rem;
}

.study-path-actions .btn {
  text-align: left;
  font-weight: 600;
}

.study-path-modal-block {
  border: 1px solid #e6ebf2;
  border-radius: 12px;
  padding: 0.85rem;
  background: #f8fafc;
}

.study-path-modal-label {
  font-weight: 700;
  color: #1f2a44;
  margin-bottom: 0.35rem;
}

.study-path-modal-includes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.study-path-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.study-path-chip i {
  color: #7c5bd6;
}

.sim-table-classic thead th {
  border-top: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #262b36;
}

.sim-table-classic tbody td {
  color: #262b36;
  font-size: 1rem;
}

.sim-table-classic tbody tr td {
  border-top: 1px solid #edf1f6;
}

.sim-table-classic {
  min-width: 520px;
}

.exam-builder-status {
  border: 1px solid #e0e5ef;
}

.exam-builder-card {
  border: 1px solid #e4e9f2;
  border-radius: 14px;
}

.exam-mode-card {
  border: 1px solid #d7deea;
  border-radius: 14px;
  min-height: 112px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-align: left;
  position: relative;
}

.exam-mode-card.is-active {
  border-color: #3566A8;
  box-shadow: 0 0 0 2px rgba(126, 91, 233, 0.15) inset;
  background: #fcfaff;
}

.exam-mode-icon {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2fb;
  color: #5d6a86;
  font-size: 1.55rem;
  flex-shrink: 0;
}

.exam-mode-icon-tutor {
  background: #e4f8ea;
  color: #2e8b57;
}

.exam-mode-copy strong {
  display: block;
  font-size: 1.85rem;
  line-height: 1.05;
  color: #1f2430;
}

.exam-mode-copy small {
  display: block;
  margin-top: 0.2rem;
  color: #5e6678;
  font-size: 1.05rem;
}

#exam-count-chips {
  gap: 0.55rem;
}

.exam-count-chip {
  min-width: 86px;
  border-radius: 999px;
  border: 1px solid #d8deea;
  background: #fff;
  font-weight: 700;
  color: #232938;
}

.exam-count-chip.is-active {
  background: linear-gradient(135deg, #4A8FC4 0%, #25558A 100%);
  border-color: #3566A8;
  color: #fff;
}

.exam-summary-box {
  border: 1px solid #e4e9f2;
  border-radius: 12px;
  padding: 0.95rem 1rem;
  background: #fafcff;
}

.exam-generate-btn {
  min-height: 48px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 999px;
}

.exam-tip {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.exam-tip i {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.exam-tip:nth-child(1) i { background: #ffecee; color: #c14d63; }
.exam-tip:nth-child(2) i { background: #e9f5ff; color: #3778ab; }
.exam-tip:nth-child(3) i { background: #e8f9f0; color: #2e8d61; }

.exam-topics-grid .topic-option .row {
  border: 1px solid #dce2ed !important;
  border-radius: 14px !important;
  background: #f8fafc;
  padding: 0.62rem 0.78rem !important;
  cursor: pointer;
}

.exam-topics-grid .topic-option.is-selected .row {
  border-color: #3566A8 !important;
  box-shadow: 0 0 0 1px rgba(53, 102, 168, 0.14) inset;
  background: #edf4fb;
}

.exam-topics-grid .custom-control-label::before,
.exam-topics-grid .custom-control-label::after {
  top: 0.15rem;
}

.exam-topics-toggle {
  white-space: nowrap;
}

.exam-topics-toggle .custom-control {
  margin-bottom: 0;
  padding-left: 2.2rem;
  min-height: 1.3rem;
  display: inline-flex;
  align-items: center;
}

.exam-topics-toggle .custom-control-label {
  margin-bottom: 0;
}

.exam-topics-toggle .custom-control-label::before,
.exam-topics-toggle .custom-control-label::after {
  top: 0.08rem;
}

.flash-kpi-card {
  border: 1px solid #e4e9f2;
  border-radius: 14px;
}

.flash-kpi-icon {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.8rem;
  font-size: 1.55rem;
}

.flash-kpi-icon-primary { background: #e8f1fb; color: #25558A; }
.flash-kpi-icon-warning { background: #fff5da; color: #d0a10f; }
.flash-kpi-icon-success { background: #e8f9f0; color: #2e9d62; }
.flash-kpi-icon-info { background: #e8f0ff; color: #2c7be5; }

.flash-decks-panel {
  border: 1px solid #e4e9f2;
  border-radius: 14px;
}

.flash-decks-help {
  border: 1px solid #e1e8f4;
}

.flash-deck-card {
  border: 1px solid #e3e8f2;
  border-radius: 14px;
  background: #fff;
  padding: 1rem;
  min-height: 100%;
}

.flash-decks-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 768px) {
  .flash-decks-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .flash-decks-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1600px) {
  .flash-decks-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.flash-deck-title {
  margin: 0;
  font-size: 1.95rem;
  line-height: 1.08;
  color: #1f2430;
}

.flash-state-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.14rem 0.62rem;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.flash-state-idle { background: #f0f2f7; color: #495063; border-color: #dde2ec; }
.flash-state-progress { background: #fff4d9; color: #8a6a19; border-color: #f6deb0; }
.flash-state-done { background: #ddf8e8; color: #1f7d4f; border-color: #bdeecf; }

.flash-topic-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #25558A;
  color: #fff;
  padding: 0.16rem 0.64rem;
  font-size: 0.82rem;
  margin-right: 0.35rem;
  margin-bottom: 0.3rem;
}

.flash-topic-more {
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem;
  color: #5a6275;
}

.flash-deck-metrics {
  display: flex;
  gap: 1rem;
}

.flash-deck-metrics > div {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-right: 1rem;
}

.flash-deck-metrics > div:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0.2rem;
  top: 4px;
  height: 75%;
  width: 1px;
  background: #e3e7ef;
}

.flash-deck-metrics strong {
  font-size: 1.9rem;
  line-height: 1;
  color: #1f2430;
}

.flash-deck-metrics span {
  font-size: 0.95rem;
  color: #394052;
}

.flash-deck-actions .btn {
  min-width: 40px;
  min-height: 38px;
}

.fc-study-status {
  border: 1px solid #d6e2f4;
  border-radius: 10px;
  background: #eaf2ff;
  color: #2f4f7b;
}

.fc-study-breadcrumb {
  font-size: 1.8rem;
  line-height: 1.2;
  color: #5a6275;
}

.fc-study-breadcrumb strong {
  color: #1f2430;
}

.fc-study-controls .btn-group .btn {
  min-width: 92px;
}

.fc-study-toolbar {
  gap: 0.75rem;
}

.fc-study-deck-picker {
  min-width: 230px;
  max-width: 320px;
  width: 100%;
}

.fc-study-controls {
  justify-content: flex-end;
}

.fc-study-progress-card {
  border: 1px solid #e4e9f2;
  border-radius: 12px;
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

.fc-study-main-card {
  border: 1px solid #e4e9f2;
  border-radius: 14px;
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

.fc-study-main-card .card-body {
  padding: 1.25rem;
}

.fc-reveal-btn {
  min-height: 44px;
  border-radius: 999px;
  padding-left: 1.2rem;
  padding-right: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #4A8FC4 0%, #25558A 100%);
  border-color: #3566A8;
}

.fc-front-copy {
  max-width: 100%;
  text-align: center;
  font-size: clamp(1.25rem, 1.2vw + 1rem, 2rem);
  line-height: 1.35;
  color: #1f2430;
  word-break: break-word;
}

.fc-study-main-card .fc-flip-face.fc-front {
  flex-direction: column;
}

.fc-back-copy {
  font-size: 1.05rem;
  line-height: 1.45;
  color: #1f2430;
}

.fc-back-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #6a7386;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.fc-back-copy ul {
  padding-left: 1.1rem;
}

.fc-back-copy li {
  margin-bottom: 0.3rem;
}

.fc-rating-pills {
  gap: 0.45rem;
}

.fc-rate-pill {
  border-radius: 999px;
  min-height: 38px;
  padding: 0.35rem 0.85rem;
  border: 1px solid transparent;
  font-weight: 600;
}

.fc-rate-forgot {
  background: #ffe9ea;
  color: #b53743;
  border-color: #f9cdd1;
}

.fc-rate-hard {
  background: #fff2db;
  color: #a76811;
  border-color: #f5d6a5;
}

.fc-rate-good {
  background: #e3f9ed;
  color: #1f8c59;
  border-color: #bdebd1;
}

.fc-rate-easy {
  background: #e4f1ff;
  color: #2a73c5;
  border-color: #bfdbff;
}

.fc-study-footer-card {
  border: 0;
  background: transparent;
}

.fc-study-footer-card .card-body {
  padding-top: 0.25rem;
}

@media (max-width: 767.98px) {
  .fc-flip-scene,
  .fc-flip-card {
    min-height: 300px;
  }

  .fc-study-shortcuts {
    margin-top: 0.35rem;
  }

  #fc-deck-select {
    min-width: 160px !important;
  }

  .flash-deck-actions {
    min-width: 170px;
  }

  .flash-deck-actions .btn {
    width: 100%;
  }

  .focus-consistency-grid {
    grid-template-columns: 1fr;
  }

  .topic-perf-title {
    max-width: calc(100% - 74px);
  }

  .dashboard-kpi-card .card-body {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.55rem;
  }

  .kpi-sparkline,
  .kpi-bars {
    width: 100%;
    min-width: 0;
  }

  .kpi-bars {
    justify-content: flex-start;
  }

  .quickstart-hero .h5 {
    font-size: 1.05rem;
  }

  .quickstart-actions .quickstart-action {
    min-height: 60px;
  }

#export-history-btn {
  min-height: 42px;
  white-space: nowrap;
  padding: 0.6rem 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
}

  .exam-mode-card {
    min-height: 88px;
  }

  .exam-mode-copy strong {
    font-size: 1.35rem;
  }

  .exam-mode-copy small {
    font-size: 1rem;
  }

  .exam-count-chip {
    min-width: 72px;
  }

  .flash-deck-title {
    font-size: 1.45rem;
  }

  .flash-deck-metrics strong {
    font-size: 1.55rem;
  }

  .fc-study-breadcrumb {
    font-size: 1.35rem;
  }

  .fc-front-copy {
    max-width: 100%;
    font-size: 1.55rem;
  }

  .fc-reveal-btn {
    width: 100%;
    margin-bottom: 0.55rem;
  }

  .fc-study-shortcuts {
    width: 100%;
  }

  .fc-study-toolbar {
    align-items: stretch !important;
  }

  .fc-study-deck-picker {
    max-width: 100%;
  }

  .fc-study-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .fc-rating-pills {
    gap: 0.35rem;
  }

  .fc-rate-pill {
    min-height: 34px;
    padding: 0.3rem 0.65rem;
    font-size: 0.82rem;
  }

  #fc-mastery-select {
    max-width: 100%;
  }
}

@media (max-width: 575.98px) {
  .topbar .container-fluid {
    row-gap: 0.35rem;
  }

  .topbar h5,
  .topbar .h5 {
    font-size: 0.96rem;
  }

  .card-header p {
    line-height: 1.25;
  }

  #filter-topic,
  #dash-topic {
    font-size: 0.95rem;
  }

}

@media (min-width: 768px) and (max-width: 1199.98px) {
  #export-history-btn {
    min-width: 130px;
    white-space: nowrap;
  }

  .sim-table-classic {
    min-width: 560px;
  }

  .exam-mode-copy strong {
    font-size: 1.55rem;
  }

  .exam-mode-copy small {
    font-size: 1.08rem;
  }
}
