/* ==========================================================================
   Modals (Dark Glass, Hairlines, Pill Actions)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-backdrop.active {
  display: flex;
}

.modal-surface {
  background: #141416;
  border: var(--hairline-border);
  border-radius: var(--radius-card);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.15s var(--ease-apple);
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-surface-wide {
  max-width: 640px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: var(--hairline-divider);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.modal-form {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-dual-row {
  display: flex;
  gap: 12px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.apple-textarea {
  background: #18181b;
  color: var(--text-primary);
  border: var(--hairline-border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
}

.components-config-block {
  background: #18181b;
  border: var(--hairline-border);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.config-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.btn-inline-action {
  background: transparent;
  border: none;
  color: var(--accent-blue);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.config-hint {
  font-size: 11px;
  color: var(--text-tertiary);
}

.components-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.component-edit-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.component-edit-row input[type="text"] { flex: 2; }
.component-edit-row input[type="number"] { flex: 1; min-width: 60px; }

.btn-remove-row {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  transition: color var(--transition-fast);
}

.btn-remove-row:hover {
  color: #ff453a;
}

.weights-sum-bar {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
  border-top: var(--hairline-divider);
  padding-top: 6px;
  color: var(--text-secondary);
}

.modal-actions-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.import-preview-box {
  background: #18181b;
  border: var(--hairline-border);
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
}

.preview-title {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  background: #1c1c1e;
  border: var(--hairline-border);
  border-radius: 10px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  animation: toastIn 0.15s var(--ease-apple);
}

.toast-item.removing {
  animation: toastOut 0.15s var(--ease-apple) forwards;
}

.toast-undo-btn {
  background: transparent;
  border: none;
  color: var(--accent-blue);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 4px;
  margin-left: auto;
  white-space: nowrap;
}

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

.toast-icon.success { background: rgba(48, 209, 88, 0.15); color: #30d158; }
.toast-icon.info { background: var(--accent-blue-subtle); color: var(--accent-blue); }
.toast-icon.warn { background: rgba(255, 214, 10, 0.15); color: #ffd60a; }

/* ==========================================================================
   Liquid glass chrome - DELETE THIS BLOCK to go back to flat.
   Nav, mobile nav, toasts, modals, palette: translucent blur + top highlight.
   Content cards stay flat on purpose (readability + mobile GPU).
   ========================================================================== */
.glass, html .nav-bar, html .mobile-nav, html .toast-item, html .modal-surface, html .cmd-panel {
  background: var(--glass-bg, var(--bg-translucent));
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
}
.modal-surface, .cmd-panel, .toast-item {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), var(--shadow-pop);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
@supports (background: color-mix(in srgb, red 50%, transparent)) {
  .modal-surface, .cmd-panel {
    --glass-bg: color-mix(in srgb, var(--bg-surface) 78%, transparent);
  }
  .toast-item {
    --glass-bg: color-mix(in srgb, var(--bg-surface) 82%, transparent);
  }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}

/* ==========================================================================
   Empty State Illustrations
   ========================================================================== */
.empty-state {
  text-align: center;
  padding: 48px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  color: #6e6e73;
  opacity: 0.6;
}

.empty-state-text {
  font-size: 14px;
  color: var(--text-tertiary);
}

/* ==========================================================================
   Mobile Bottom Navigation Bar
   ========================================================================== */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: rgba(14, 14, 16, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: var(--hairline-border);
  z-index: 500;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (max-width: 768px) {
  .mobile-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
  }
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  background: transparent;
  border: none;
  font-family: inherit;
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 6px 12px;
  transition: color var(--transition-fast);
  position: relative;
}

.mobile-nav-item.active {
  color: var(--accent-blue);
}

.mobile-nav-item .icon-svg {
  width: 18px;
  height: 18px;
}

.mobile-nav-item::after {
  content: '';
  position: absolute;
  top: -1px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-blue);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.mobile-nav-item.active::after {
  opacity: 1;
}

/* ==========================================================================
   Apple-Style Minimalist Footer
   ========================================================================== */
.site-footer {
  padding: 40px 0 60px 0;
  border-top: var(--hairline-divider);
  font-size: 12px;
  color: var(--text-tertiary);
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
}

.footer-sub {
  font-size: 11px;
  color: var(--text-tertiary);
}

.footer-logo {
  font-weight: 700;
  color: var(--text-secondary);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-link-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  transition: color var(--transition-fast);
}

.footer-link-btn:hover {
  color: var(--text-primary);
}

/* Quiet footer - cookie game + year widget hidden, one calm line remains */
.cookie-row,
.footer-year-widget,
.footer-made {
  display: none;
}

/* Responsive Rules */
@media (max-width: 768px) {
  .hero-section {
    padding: 110px 0 70px 0;
  }
  .section-block {
    padding: 64px 0;
  }
  .hero-stats-line {
    flex-wrap: wrap;
  }
  .nav-links {
    display: none;
  }
  .deadlines-action-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-controls, .button-actions-group {
    width: 100%;
    justify-content: space-between;
  }
  .courses-grid {
    grid-template-columns: 1fr;
  }
  .mobile-nav-item {
    padding: 5px 8px;
    font-size: 8.5px;
  }
  .toast-container {
    bottom: 64px;
    right: 12px;
    left: 12px;
  }  body {
    padding-bottom: 52px;
  }
}

@media (max-width: 560px) {
  .pt-indicator {
    display: none;
  }
}

/* Dark amber warning badges on light themes (yellow is unreadable on cream) */
:is([data-theme="light"], [data-theme="colorblind-light"]) .grade-warn,
[data-theme="indie"] .grade-warn,
[data-theme="moss"] .grade-warn {
  color: #9a6b0f;
  background: rgba(154, 107, 15, 0.12);
}

/* ==========================================================================
   Panic Meter
   ========================================================================== */
.panic-widget {
  width: 100%;
  margin-top: 24px;
  border-top: var(--hairline-border);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.panic-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  max-width: 100%;
}

.panic-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
}

.panic-digits {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.panic-title {
  font-size: 14px;
}

.panic-widget.calm .panic-digits { color: var(--accent-blue); }
.panic-widget.warn .panic-digits { color: #ffd60a; }
.panic-widget.danger .panic-digits { color: #ff453a; }

.panic-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
}

/* Hero stat carousel: cutoff → finances → focus */
.hero-slides {
  display: grid;
  width: 100%;
}

.hero-slide {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 220px;
  justify-content: center;
  opacity: 0;
  transform: translateX(14px);
  transition: opacity 0.15s var(--ease-apple), transform 0.15s var(--ease-apple);
  pointer-events: none;
  visibility: hidden;
}

.hero-slide.active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide { transition: none; transform: none; }
}

/* Urgency colors stay on the cutoff slide; finance/focus paint their own */
#panicWidget .hero-slide[data-slide="1"] .panic-digits,
#panicWidget .hero-slide[data-slide="2"] .panic-digits {
  animation: none;
}

#panicWidget .hero-slide[data-slide="1"] .panic-digits { color: var(--text-primary); }
#panicWidget .hero-slide[data-slide="1"] .panic-digits.positive { color: #30d158; }
#panicWidget .hero-slide[data-slide="1"] .panic-digits.negative { color: #ff453a; }
#panicWidget .hero-slide[data-slide="2"] .panic-digits { color: var(--accent-blue); }

.hero-slide-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

.hero-slide .hero-cta-row {
  margin-top: 16px;
}

.hero-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: var(--hairline-border);
  color: var(--text-tertiary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 2px 0;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.hero-arrow:hover {
  color: var(--text-primary);
  border-color: var(--accent-blue);
}

.hero-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--text-tertiary);
  opacity: 0.35;
  cursor: pointer;
  padding: 0;
}

.hero-dot.active {
  opacity: 1;
  background: var(--accent-blue);
}

.grade-insight {
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* ==========================================================================
   Command Palette + Scroll Flash
   ========================================================================== */
.cmd-backdrop {
  align-items: flex-start;
  padding-top: 12vh;
}

.cmd-panel {
  background: var(--bg-surface);
  border: var(--hairline-border);
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  overflow: hidden;
  animation: modalSlideIn 0.15s var(--ease-apple);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.cmd-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: var(--hairline-divider);
  padding: 16px 18px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  outline: none;
}

.cmd-input::placeholder {
  color: var(--text-tertiary);
}

.cmd-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
}

.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.cmd-item.active {
  background: rgba(127, 127, 133, 0.15);
  color: var(--text-primary);
}

.cmd-hint {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.cmd-empty {
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
}

.flash-highlight {
  outline: 2px solid var(--accent-blue) !important;
  outline-offset: 4px;
}

/* ==========================================================================
   Victory easter egg: in-page clip overlay (no tab change, closes on end)
   ========================================================================== */
.victory-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 3000;
}

.victory-backdrop.active {
  display: flex;
}

.victory-surface {
  position: relative;
  width: min(800px, 100%);
  background: #0c0c10;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 40px 16px 12px 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  animation: modalSlideIn 0.15s var(--ease-apple);
}

.victory-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #f5f5f7;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.victory-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.victory-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}

.victory-player iframe,
.victory-player video,
.victory-player #victoryPlayer {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.victory-hint {
  margin: 8px 2px 2px 2px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: #8e8e96;
  text-align: center;
}

.victory-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px 4px 4px 4px;
  text-align: center;
}

.victory-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  background: #000;
  display: block;
}

.victory-fallback-title {
  font-size: 14px;
  font-weight: 600;
  color: #f5f5f7;
}

.victory-fallback .pill-btn {
  text-decoration: none;
}

