/* ==========================================================================
   NOTIFAST 3.0 — DYNAMIC SHOWCASE (TACTILE PAPERCRAFT & APP COMPONENT MIRROR)
   High fidelity components, live beacons, markdown editor, and P2P sharing.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. LA CAJA MÁGICA DE ESTUDIO (MINIMALIST STUDIO UNBOXING)
   -------------------------------------------------------------------------- */

.magic-box-showcase {
  position: relative;
  max-width: 1100px;
  margin: 40px auto 80px;
  padding: 60px 24px;
  text-align: center;
  overflow: visible;
}

.box-stage {
  position: relative;
  width: 100%;
  max-width: 820px;
  height: 520px;
  margin: 40px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
  transform-style: preserve-3d;
}

/* SVG Orbital Trajectories */
.hub-orbit-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  max-width: 800px;
  height: 520px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}

.orbit-path {
  fill: none;
  stroke: rgba(158, 27, 50, 0.09);
  stroke-width: 1.25;
  stroke-dasharray: 4 6;
}

.orbit-inner {
  stroke: rgba(42, 123, 123, 0.1);
  stroke-dasharray: 3 5;
}

.orbit-beam {
  stroke: rgba(158, 27, 50, 0.1);
  stroke-width: 1;
  stroke-dasharray: 3 5;
  transition: stroke 0.3s, stroke-width 0.3s;
}

/* Central NotiFast Brand Floating Anchor */
.study-chest-container.notifast-core-hub {
  position: relative;
  width: 200px;
  height: 200px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.notifast-floating-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: floatBrandCenter 4.5s infinite ease-in-out alternate;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  user-select: none;
}

.notifast-floating-brand:hover {
  transform: scale(1.06) translateY(-4px);
}

.notifast-icon-aura {
  position: absolute;
  top: 40px;
  left: 50%;
  width: 150px;
  height: 150px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(191, 9, 47, 0.16) 0%, rgba(42, 123, 123, 0.08) 50%, transparent 75%);
  pointer-events: none;
  animation: pulseAura 3.5s infinite alternate ease-in-out;
}

@keyframes pulseAura {
  0% { transform: translate(-50%, -50%) scale(0.92); opacity: 0.5; }
  100% { transform: translate(-50%, -50%) scale(1.15); opacity: 0.85; }
}

.notifast-core-icon {
  width: 104px;
  height: 104px;
  border-radius: 26px;
  box-shadow: 0 14px 32px rgba(158, 27, 50, 0.18), 0 4px 10px rgba(0, 0, 0, 0.04);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s;
}

.notifast-floating-brand:hover .notifast-core-icon {
  transform: rotate(2deg) scale(1.02);
  box-shadow: 0 18px 40px rgba(158, 27, 50, 0.26);
}

.notifast-core-name {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.notifast-core-pill {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-primary);
  background: var(--brand-primary-light);
  padding: 3px 12px;
  border-radius: var(--radius-pill);
}

@keyframes floatBrandCenter {
  0% { transform: translateY(0); }
  100% { transform: translateY(-12px); }
}

/* Rayos de luz interior */
.chest-glow-rays {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 420px;
  height: 420px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(191, 9, 47, 0.12) 0%, rgba(42, 123, 123, 0.08) 45%, transparent 70%);
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
  animation: pulseRays 4.5s infinite alternate ease-in-out;
}

@keyframes pulseRays {
  0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.45; }
  100% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.75; }
}

/* Popout Feature Cards (Orbiting Around NotiFast) */
.popout-item {
  position: absolute;
  border-radius: 16px;
  padding: 10px 16px;
  background: #FFFFFF;
  border: 1px solid var(--border-hairline);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 15;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s, border-color 0.3s;
  will-change: transform;
}

.popout-item:hover {
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
  animation-play-state: paused;
  z-index: 25;
}

.popout-notes:hover {
  transform: translateY(-4px) rotate(-1.5deg) scale(1.04);
}

.popout-grades:hover {
  transform: translateY(-4px) rotate(2deg) scale(1.04);
}

.popout-agenda:hover {
  transform: translateY(-4px) rotate(-1.5deg) scale(1.04);
}

.popout-nearby:hover {
  transform: translateY(-4px) rotate(1.5deg) scale(1.04);
}

.popout-subjects:hover {
  transform: translateX(-50%) scale(1.04) !important;
}

.popout-alerts:hover {
  transform: translateX(-50%) scale(1.04) !important;
}

.popout-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.popout-icon-box svg {
  width: 20px;
  height: 20px;
}

.popout-text-stack {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 2px;
}

.popout-title {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.popout-meta {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.2;
}

/* Specific Card Themes & Positions in the 820x520 Stage */
.popout-notes {
  top: 36px;
  left: 20px;
  border-color: rgba(158, 27, 50, 0.2);
  animation: floatPop1 4.5s infinite ease-in-out alternate;
}
.icon-notes-tint { background: #FFF1F2; color: #BE123C; }

.popout-grades {
  top: 30px;
  right: 20px;
  border-color: rgba(21, 128, 61, 0.2);
  animation: floatPop2 5s infinite ease-in-out alternate;
}
.icon-grades-tint { background: #F0FDF4; color: #15803D; }

.popout-agenda {
  bottom: 40px;
  left: 20px;
  border-color: rgba(42, 123, 123, 0.2);
  animation: floatPop3 4.2s infinite ease-in-out alternate;
}
.icon-agenda-tint { background: #F0FDFA; color: #0F766E; }

.beacon-mini-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #BF092F;
  margin-right: 4px;
  animation: beaconPulse 1.8s infinite;
}

.popout-nearby {
  bottom: 40px;
  right: 20px;
  border-color: rgba(2, 132, 199, 0.2);
  animation: floatPop4 4.8s infinite ease-in-out alternate;
}
.icon-nearby-tint { background: #F0F9FF; color: #0284C7; }

.popout-subjects {
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  border-color: rgba(217, 119, 6, 0.2);
  animation: floatPop5 4.6s infinite ease-in-out alternate;
}
.icon-subjects-tint { background: #FFFBEB; color: #B45309; }

.popout-alerts {
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  border-color: rgba(124, 58, 237, 0.2);
  animation: floatPop6 4.4s infinite ease-in-out alternate;
}
.icon-alerts-tint { background: #F5F3FF; color: #7C3AED; }

@keyframes floatPop1 {
  0% { transform: translateY(0) rotate(-3deg); }
  100% { transform: translateY(-12px) rotate(-1deg); }
}

@keyframes floatPop2 {
  0% { transform: translateY(0) rotate(3deg); }
  100% { transform: translateY(-14px) rotate(5deg); }
}

@keyframes floatPop3 {
  0% { transform: translateY(0) rotate(-2deg); }
  100% { transform: translateY(-10px) rotate(-4deg); }
}

@keyframes floatPop4 {
  0% { transform: translateY(0) rotate(2deg); }
  100% { transform: translateY(-12px) rotate(0deg); }
}

@keyframes floatPop5 {
  0% { transform: translateX(-50%) translateY(0); }
  100% { transform: translateX(-50%) translateY(-6px); }
}

@keyframes floatPop6 {
  0% { transform: translateX(-50%) translateY(0); }
  100% { transform: translateX(-50%) translateY(6px); }
}

/* Barra Flotante de Radar Scrollytelling (Sincronizada con el scroll) */
.hub-floating-radar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  opacity: 0;
  pointer-events: none;
  z-index: 990;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.hub-floating-radar.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.radar-brand-mini {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding-right: 8px;
  border-right: 1px solid var(--border-hairline);
  text-decoration: none;
  transition: transform 0.2s ease;
}

.radar-brand-mini:hover {
  transform: scale(1.1);
}

.radar-mini-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.radar-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.radar-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.radar-chip svg {
  width: 14px;
  height: 14px;
}

.radar-chip:hover {
  color: var(--brand-primary);
  background: var(--brand-primary-light);
}

.radar-chip.active {
  background: var(--brand-primary);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(158, 27, 50, 0.25);
}

/* Spotlight Highlight when navigated from hub card */
@keyframes spotlightPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(191, 9, 47, 0.6), 0 24px 48px rgba(158, 27, 50, 0.15);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(191, 9, 47, 0.25), 0 28px 56px rgba(158, 27, 50, 0.25);
    transform: scale(1.025);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(191, 9, 47, 0), 0 20px 40px rgba(0, 0, 0, 0.08);
    transform: scale(1);
  }
}

.section-spotlight-active {
  animation: spotlightPulse 1.8s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* --------------------------------------------------------------------------
   2. FILAS DINÁMICAS EN ZIG-ZAG
   -------------------------------------------------------------------------- */

.dynamic-feature-row {
  max-width: 1200px;
  margin: 0 auto;
  padding: 70px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
  position: relative;
}

.row-reverse {
  grid-template-columns: 1fr 1fr;
}

.row-reverse .feature-visual {
  order: -1;
}

.feature-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: fit-content;
}

.feature-title {
  font-size: clamp(2rem, 3.5vw, 2.6rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.feature-desc {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.feature-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.feature-bullets li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.45;
}

.bullet-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background-color: var(--brand-secondary-light);
  color: var(--brand-secondary);
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   3. HORARIO EN CURSO: ScheduleLiveStatusCard.kt
   -------------------------------------------------------------------------- */

.schedule-live-card {
  background: #FFFFFF;
  border: 1.5px solid rgba(158, 27, 50, 0.25);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-smooth);
}

.schedule-live-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.08);
}

.live-beacon-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.beacon-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.beacon-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #BF092F;
  box-shadow: 0 0 0 0 rgba(191, 9, 47, 0.6);
  animation: beaconPulse 1.8s infinite;
}

@keyframes beaconPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(191, 9, 47, 0.7); opacity: 1; }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(191, 9, 47, 0); opacity: 0.8; }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(191, 9, 47, 0); opacity: 1; }
}

.beacon-text {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #BF092F;
}

.beacon-remaining {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.live-class-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.live-subject-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.live-subject-time {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Linear progress bar matching Compose LinearProgressIndicator */
.schedule-progress-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.schedule-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background-color: var(--bg-surface-container);
  overflow: hidden;
  position: relative;
}

.schedule-progress-bar .progress-fill {
  height: 100%;
  background: var(--brand-primary);
  border-radius: 4px;
  transition: width 1s ease-in-out;
}

.schedule-progress-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.live-actions-row {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.btn-take-notes {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--brand-primary);
  color: #FFFFFF;
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 0.875rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(158, 27, 50, 0.25);
  transition: transform 0.2s, background-color 0.2s;
}

.btn-take-notes:hover {
  background: var(--brand-primary-hover);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   4. EDITOR DE TEXTO EN MARKDOWN: NoteEditorBottomSheet.kt & DockedAccessoryToolbar.kt
   -------------------------------------------------------------------------- */

.note-editor-simulator {
  background: #FFFFFF;
  border: 1.5px solid var(--border-hairline);
  border-radius: 24px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s;
}

.note-editor-simulator:hover {
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.09);
}

.editor-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-hairline);
  background: #FAFAF9;
}

.editor-icon-btn {
  background: transparent;
  border: none;
  font-size: 1rem;
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.editor-header-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}

.editor-header-actions {
  display: flex;
  gap: 8px;
}

.editor-pill-btn {
  background: var(--bg-surface-container);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.editor-pill-btn.active {
  background: var(--brand-secondary-light);
  color: var(--brand-secondary);
  border-color: var(--brand-secondary);
}

.editor-save-btn {
  background: var(--brand-primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.editor-meta-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  gap: 12px;
  flex-wrap: wrap;
}

.editor-subject-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: #EFF6FF;
  color: #1D4ED8;
  font-size: 0.75rem;
  font-weight: 700;
}

.editor-tags-list {
  display: flex;
  gap: 6px;
}

.editor-tag-chip {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  background: var(--bg-surface-container);
  padding: 3px 8px;
  border-radius: 6px;
}

.editor-title-container {
  padding: 6px 16px 10px;
}

.editor-note-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

/* Docked Accessory Toolbar (52dp Compose Surface) */
.markdown-toolbar {
  height: 48px;
  background: #F4F4F5;
  border-top: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  overflow-x: auto;
}

.tb-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #3F3F46;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.2s;
}

.tb-btn:hover {
  background: #E4E4E7;
}

.tb-badge {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 800;
}

.tb-divider {
  width: 1px;
  height: 20px;
  background-color: #D4D4D8;
  margin: 0 4px;
}

.tb-fx {
  color: #7C3AED;
}

/* Rich Editor Sheet Content */
.rich-editor-sheet {
  padding: 16px;
  background: #FFFFFF;
  max-height: 280px;
  overflow-y: auto;
}

.rendered-markdown-content h5 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--brand-primary);
  margin-bottom: 6px;
}

.rendered-markdown-content p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
}

.math-latex-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-left: 3px solid #7C3AED;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: #4C1D95;
  font-weight: 600;
}

.interactive-todo-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-primary);
  cursor: pointer;
}

.todo-item.checked span {
  text-decoration: line-through;
  color: var(--text-muted);
}

.editor-quote-card {
  border-left: 3px solid var(--brand-primary);
  padding: 6px 12px;
  background: #FFF1F2;
  border-radius: 4px;
  font-size: 0.8125rem;
  font-style: italic;
  color: #881337;
  margin: 0;
}

/* --------------------------------------------------------------------------
   5. CALIFICACIONES: MainAverageDashboard.kt
   -------------------------------------------------------------------------- */

/* Selector de Escalas de Calificación Adaptable (0-10, 0-20, 100%, A-F) */
.grade-scale-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
  margin-bottom: 6px;
}

.scale-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #FFFFFF;
  border: 1.5px solid var(--border-hairline);
  cursor: pointer;
  text-align: left;
  transition: all 0.25s var(--ease-smooth);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.scale-chip:hover {
  border-color: var(--brand-secondary);
  background: #F0FDF4;
  transform: translateY(-2px);
}

.scale-chip.active {
  border-color: var(--brand-success);
  background: #F0FDF4;
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.15);
}

.scale-chip-title {
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--text-primary);
}

.scale-chip.active .scale-chip-title {
  color: var(--brand-success);
}

.scale-chip-meta {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.scale-cycle-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface-container);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  width: fit-content;
}

.cycle-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--brand-success);
  box-shadow: 0 0 0 0 rgba(21, 128, 61, 0.6);
  animation: cyclePulse 1.8s infinite;
}

@keyframes cyclePulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(21, 128, 61, 0.6); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(21, 128, 61, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(21, 128, 61, 0); }
}

.average-scale-max {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.scale-value-morph {
  animation: scaleValuePop 0.35s ease-out;
}

@keyframes scaleValuePop {
  0% { transform: scale(0.92); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

.grades-dashboard-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.main-average-card {
  background: #FFFFFF;
  border: 1.5px solid var(--border-hairline);
  border-radius: 24px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.average-global-label {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--brand-primary);
  text-transform: uppercase;
}

.average-score-display {
  font-family: var(--font-mono);
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1.5px;
  line-height: 1;
}

.grades-global-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background-color: var(--bg-surface-container);
  overflow: hidden;
}

.grades-global-progress-bar .progress-fill {
  height: 100%;
  background: var(--brand-primary);
  border-radius: 4px;
  transition: width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.average-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  font-size: 0.875rem;
  font-weight: 700;
}

.subject-grade-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.subject-grade-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 16px;
  background: #FFFFFF;
  border: 1px solid var(--border-hairline);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.s-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.s-icon svg {
  width: 20px;
  height: 20px;
}

.s-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.s-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
}

.s-weights {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.s-score {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--brand-success);
}

/* --------------------------------------------------------------------------
   6. CALENDARIO DE EVALUACIONES: AgendaMonthCalendarView.kt & AgendaEvaluationCard.kt
   -------------------------------------------------------------------------- */

.section-evaluations-calendar {
  position: relative;
}

/* Filtros Rápidos de Evaluaciones */
.eval-filters-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 8px;
}

.eval-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: #FFFFFF;
  border: 1.5px solid var(--border-hairline);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.eval-filter-chip:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  transform: translateY(-1px);
}

.eval-filter-chip.active {
  background: var(--brand-primary-light);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  box-shadow: 0 4px 10px rgba(158, 27, 50, 0.15);
}

.chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.dot-exam {
  background-color: var(--brand-primary);
}

.dot-project {
  background-color: var(--brand-secondary);
}

.dot-graded {
  background-color: var(--brand-success);
}

/* Tarjeta Contenedora del Calendario */
.evaluations-calendar-container {
  background: #FFFFFF;
  border: 1.5px solid var(--border-hairline);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: box-shadow 0.3s, transform 0.3s;
}

.evaluations-calendar-container:hover {
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.09);
}

/* Cabecera del Mes (Chevron Left / Mes Año / Hoy / Chevron Right) */
.calendar-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-hairline);
}

.cal-month-title-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.cal-month-title {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.cal-month-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.cal-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cal-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.cal-nav-btn:hover {
  background: var(--bg-surface-container);
  color: var(--text-primary);
}

.cal-nav-btn svg {
  width: 18px;
  height: 18px;
}

.cal-today-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface-container);
  color: var(--brand-primary);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.cal-today-btn:hover {
  background: var(--brand-primary-light);
  border-color: var(--brand-primary);
}

.cal-today-btn svg {
  width: 14px;
  height: 14px;
}

/* Matriz de Días */
.calendar-matrix-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calendar-weekdays-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  padding: 0 4px;
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 0 4px;
}

.cal-day-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
  padding: 0;
}

.cal-day-cell:hover:not(.cal-day-empty) {
  background: var(--bg-surface-container);
  transform: scale(1.1);
}

.cal-day-cell.cal-day-empty {
  cursor: default;
  pointer-events: none;
}

.cal-day-num {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}

.cal-day-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  margin-top: 3px;
  display: block;
}

.dot-ruby-eval {
  background-color: var(--brand-primary);
}

.dot-aqua-eval {
  background-color: var(--brand-secondary);
}

.dot-amber-eval {
  background-color: #D97706;
}

/* Día Seleccionado Activo */
.cal-day-cell.cal-day-selected {
  background: var(--brand-primary);
  box-shadow: 0 4px 12px rgba(158, 27, 50, 0.35);
  transform: scale(1.08);
}

.cal-day-cell.cal-day-selected .cal-day-num {
  color: #FFFFFF;
  font-weight: 800;
}

.cal-day-cell.cal-day-selected .cal-day-dot {
  background-color: #FFFFFF;
}

/* Hoy / Próximo Examen */
.cal-day-cell.cal-day-today:not(.cal-day-selected) {
  background: var(--brand-primary-light);
}

.cal-day-cell.cal-day-today:not(.cal-day-selected) .cal-day-num {
  color: var(--brand-primary);
  font-weight: 800;
}

/* Panel de Evaluaciones del Día */
.daily-evaluations-panel {
  border-top: 1px solid var(--border-hairline);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.daily-evals-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.daily-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.evals-header-icon {
  width: 16px;
  height: 16px;
  color: var(--brand-primary);
}

.daily-title {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--text-primary);
}

.daily-count-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--brand-primary);
}

.daily-status-hint {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* Tarjeta Tactil Fiel a AgendaEvaluationCard.kt */
.eval-cards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agenda-eval-card {
  background: #FFFFFF;
  border: 1px solid var(--border-hairline);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
}

.agenda-eval-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.agenda-eval-card:active {
  transform: scale(0.97); /* 0.97f Compose Spring Physics */
}

.eval-icon-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.eval-icon-circle svg {
  width: 20px;
  height: 20px;
}

.eval-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.eval-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.eval-card-title {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
}

.eval-weight-chip {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  flex-shrink: 0;
}

.eval-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.75rem;
}

.eval-subject-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
}

.eval-subject-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.eval-time-status {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--brand-primary);
}

.eval-time-status.status-graded {
  color: var(--brand-secondary);
}

/* Estado Vacío de Evaluaciones */
.eval-empty-card {
  padding: 24px 16px;
  border-radius: 16px;
  border: 1px dashed var(--border-hairline);
  background: #FAFAF9;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.eval-empty-icon {
  width: 28px;
  height: 28px;
  color: var(--text-muted);
}

.eval-empty-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.eval-empty-desc {
  font-size: 0.6875rem;
  color: var(--text-muted);
  max-width: 280px;
}

/* --------------------------------------------------------------------------
   7. ANALÍTICAS Y PROYECCIONES: AcademicAnalyticsContent.kt & GradeSimulatorCard.kt
   -------------------------------------------------------------------------- */

.section-analytics-dashboard {
  position: relative;
}

/* Presets del Simulador de Nota */
.sim-presets-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
  margin-bottom: 8px;
}

.sim-preset-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 14px;
  border-radius: 14px;
  background: #FFFFFF;
  border: 1.5px solid var(--border-hairline);
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
  text-align: left;
}

.sim-preset-chip:hover {
  border-color: var(--brand-secondary);
  background: #F0FDFA;
  transform: translateY(-2px);
}

.sim-preset-chip.active {
  border-color: var(--brand-secondary);
  background: #F0FDFA;
  box-shadow: 0 4px 12px rgba(42, 123, 123, 0.18);
}

.preset-label {
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--text-primary);
}

.sim-preset-chip.active .preset-label {
  color: var(--brand-secondary);
}

.preset-sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* Contenedor del Dashboard Analítico */
.analytics-dashboard-container {
  background: #FFFFFF;
  border: 1.5px solid var(--border-hairline);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: box-shadow 0.3s, transform 0.3s;
}

.analytics-dashboard-container:hover {
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.09);
}

/* 1. Hero de Diagnóstico Predictivo (AnalyticsHeroCard.kt) */
.analytics-hero-banner {
  background: #F0FDFA;
  border: 1px solid rgba(42, 123, 123, 0.22);
  border-radius: 18px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-diag-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-diag-label {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--brand-secondary);
  text-transform: uppercase;
  display: block;
}

.hero-diag-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 2px;
}

.hero-diag-stat {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--brand-secondary);
  line-height: 1;
}

.diag-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background-color: rgba(42, 123, 123, 0.15);
  overflow: hidden;
}

.diag-progress-fill {
  height: 100%;
  background: var(--brand-secondary);
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 2. Simulador Interactivo de Calificación Requerida (GradeSimulatorCard.kt) */
.grade-simulator-card {
  background: #FAFAF9;
  border: 1px solid var(--border-hairline);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.simulator-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sim-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(42, 123, 123, 0.12);
  color: var(--brand-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sim-icon-box svg {
  width: 20px;
  height: 20px;
}

.sim-header-text {
  text-align: left;
}

.sim-title {
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
}

.sim-subject-name {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Banner de Estado Dinámico */
.sim-status-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  transition: all 0.25s ease;
}

.sim-status-banner.status-achievable {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.sim-status-banner.status-at-risk {
  background: #FFFBEB;
  color: #D97706;
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.sim-status-banner.status-impossible {
  background: #FFF1F2;
  color: #9E1B32;
  border: 1px solid rgba(158, 27, 50, 0.2);
}

.sim-status-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sim-status-text {
  font-size: 0.75rem;
  font-weight: 700;
}

/* Fila de Estadísticas */
.sim-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sim-stat-box {
  background: #FFFFFF;
  border: 1px solid var(--border-hairline);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.sim-stat-box.stat-highlight {
  border-color: rgba(42, 123, 123, 0.3);
  background: #F0FDFA;
}

.sim-stat-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 600;
}

.sim-stat-val {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.sim-stat-val small {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.sim-stat-val.val-required {
  color: var(--brand-secondary);
}

.sim-stat-sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* Slider Interactivo */
.sim-slider-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
}

.sim-slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sim-slider-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sim-slider-badge {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 800;
  background: var(--brand-secondary-light);
  color: var(--brand-secondary);
  padding: 2px 8px;
  border-radius: 6px;
}

.sim-range-input {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-surface-container);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.sim-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-secondary);
  box-shadow: 0 2px 6px rgba(42, 123, 123, 0.4);
  cursor: pointer;
  transition: transform 0.15s;
}

.sim-range-input::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.sim-range-input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-secondary);
  box-shadow: 0 2px 6px rgba(42, 123, 123, 0.4);
  cursor: pointer;
  border: none;
}

.sim-slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* 3. Histograma de Distribución de Notas (GradeDistributionHistogram.kt) */
.histogram-preview-card {
  background: #FFFFFF;
  border: 1px solid var(--border-hairline);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hist-title {
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--text-primary);
}

.hist-meta {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.hist-bars-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  align-items: flex-end;
  height: 100px;
  padding-bottom: 4px;
}

.hist-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
}

.hist-bar-wrapper {
  flex: 1;
  width: 100%;
  max-width: 36px;
  display: flex;
  align-items: flex-end;
  background: var(--bg-surface-container);
  border-radius: 6px;
  overflow: hidden;
}

.hist-bar-fill {
  width: 100%;
  border-radius: 6px;
  transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bar-excellent {
  background: #3B9797;
}

.bar-good {
  background: #2563EB;
}

.bar-regular {
  background: #D97706;
}

.bar-risk {
  background: #BF092F;
}

.hist-bar-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-primary);
}

.hist-bar-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.15;
}

.accent-aqua {
  color: var(--brand-secondary);
}

/* --------------------------------------------------------------------------
   8. COMPARTIR P2P OFFLINE (Android Nearby & Código QR)
   -------------------------------------------------------------------------- */

.nearby-transfer-card {
  background: #FFFFFF;
  border: 1.5px solid rgba(2, 132, 199, 0.25);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.transfer-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.offline-beacon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0284C7;
  background: #E0F2FE;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.offline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #0284C7;
}

.pack-badge {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-surface-container);
  padding: 4px 10px;
  border-radius: 8px;
}

.p2p-simulation-stage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: #F0F9FF;
  border-radius: 16px;
  border: 1px dashed #BAE6FD;
}

.device-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.device-avatar {
  font-size: 2rem;
}

.device-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.device-status {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #0284C7;
}

.device-status-success {
  font-size: 0.6875rem;
  font-weight: 800;
  color: var(--brand-success);
}

.transfer-waves {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.nearby-signal-pulse {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #0284C7;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 6px rgba(2, 132, 199, 0.2);
  animation: nearbyPulse 2s infinite;
}

.nearby-signal-pulse svg {
  width: 24px;
  height: 24px;
}

@keyframes nearbyPulse {
  0% { box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.4); }
  70% { box-shadow: 0 0 0 12px rgba(2, 132, 199, 0); }
  100% { box-shadow: 0 0 0 0 rgba(2, 132, 199, 0); }
}

.transfer-speed {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  color: #0369A1;
}

.pack-contents-box {
  background: #FFFFFF;
  border: 1px solid var(--border-hairline);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pack-subject-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--text-primary);
}

.pack-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   7. GALERÍA DE MATERIAS (SubjectIconMapper)
   -------------------------------------------------------------------------- */

.subjects-gallery-section {
  max-width: 1200px;
  margin: 60px auto 90px;
  padding: 0 24px;
  text-align: center;
}

.subjects-gallery-header {
  max-width: 700px;
  margin: 0 auto 40px;
}

.subjects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: stretch;
}

@media (max-width: 1024px) {
  .subjects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .subjects-grid {
    grid-template-columns: 1fr;
  }
}

.subject-feature-card {
  background: #FFFFFF;
  border: 1.5px solid var(--border-hairline);
  border-radius: 22px;
  padding: 24px 20px;
  text-align: left;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease, border-color 0.28s ease;
  cursor: pointer;
  user-select: none;
}

.subject-feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.07);
}

.subject-feature-card:active {
  transform: scale(0.98);
}

.subject-feature-card.card-calculus-detail { border-color: rgba(37, 99, 235, 0.22); }
.subject-feature-card.card-calculus-detail:hover { border-color: #2563EB; }

.subject-feature-card.card-physics-detail { border-color: rgba(124, 58, 237, 0.22); }
.subject-feature-card.card-physics-detail:hover { border-color: #7C3AED; }

.subject-feature-card.card-literature-detail { border-color: rgba(217, 119, 6, 0.22); }
.subject-feature-card.card-literature-detail:hover { border-color: #D97706; }

.subject-feature-card.card-chemistry-detail { border-color: rgba(5, 150, 105, 0.22); }
.subject-feature-card.card-chemistry-detail:hover { border-color: #059669; }

/* Bento Top Row: Icon + Grade Pill */
.subject-card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.subject-hero-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.subject-hero-icon svg {
  width: 26px;
  height: 26px;
}

.subject-grade-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8125rem;
}

.grade-pill-label {
  font-family: var(--font-sans);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  opacity: 0.75;
  text-transform: uppercase;
}

.grade-pill-val {
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Bento Card Body */
.subject-card-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  margin-bottom: 14px;
}

.subject-title {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.subject-meta-stats {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.subject-description-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 4px;
}

/* Linear Progress Bar */
.subject-progress-block {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed rgba(0, 0, 0, 0.06);
}

.subject-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.subj-progress-ratio {
  font-family: var(--font-mono);
  font-weight: 700;
}

.subj-progress-track {
  width: 100%;
  height: 5px;
  background: var(--bg-canvas-subtle);
  border-radius: 999px;
  overflow: hidden;
}

.subj-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Topic Tags Strip */
.subject-tags-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.subject-tag {
  font-size: 0.6875rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-canvas-subtle);
  padding: 2px 8px;
  border-radius: 6px;
}

/* Responsive adjustments */
@media (max-width: 991px) {
  .dynamic-feature-row {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 50px 20px;
  }
  .row-reverse .feature-visual {
    order: 0;
  }
  .magic-box-showcase {
    padding: 40px 16px;
  }
  .box-stage {
    height: 420px;
  }
}

@media (max-width: 768px) {
  .box-stage {
    height: 440px;
  }
  .hub-app-status-bar {
    display: none;
  }
  .hub-micro-chip {
    display: none;
  }
  .hub-floating-radar {
    bottom: 16px;
    padding: 6px 10px;
    gap: 4px;
    max-width: calc(100vw - 32px);
  }
  .radar-chip span {
    display: none;
  }
  .radar-chip {
    padding: 8px;
    min-height: 44px;
    min-width: 44px;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-floating-radar {
    transition: none !important;
  }
  .section-spotlight-active {
    animation: none !important;
    box-shadow: 0 0 0 3px var(--brand-primary) !important;
  }
  .orbit-packet,
  .notifast-floating-brand,
  .chest-glow-rays,
  .popout-item,
  .hub-micro-chip {
    animation: none !important;
  }
}
