/* Base Styles */
:root {
  --primary-color: #667eea;
  --primary-dark: #5a67d8;
  --secondary-color: #764ba2;
  --bg-dark: #1a1a2e;
  --bg-card: #16213e;
  --bg-surface: #0f3460;
  --text-primary: #ffffff;
  --text-secondary: #a0aec0;
  --text-muted: #718096;
  --accent-gold: #ffd700;
  --accent-success: #48bb78;
  --accent-warning: #ed8936;
  --accent-error: #f56565;
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Show Modes ===== */
body.show-mode-performance .main-content {
  overflow: hidden;
}

body.show-mode-performance .header,
body.show-mode-performance .footer,
body.show-mode-performance .connection-status {
  display: none;
}

body.show-mode-performance .content-layer {
  height: 100vh;
}

body.show-mode-performance .main-content {
  padding: 0;
}

body.show-mode-performance #accordions-container {
  display: none;
}


/* ===== Piece Transition Overlay ===== */
.piece-transition {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #080810;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.piece-transition.is-active {
  opacity: 1;
  pointer-events: all;
}

.piece-transition__title {
  position: absolute;
  z-index: 2;
  text-align: center;
  padding: 0 2rem;
  font-size: clamp(1.8rem, 7vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  background: linear-gradient(135deg, #fff 0%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.piece-transition__title.is-visible {
  opacity: 1;
}

.piece-transition__image {
  position: relative;
  z-index: 1;
  max-width: min(82vw, 560px);
  max-height: 65vh;
  width: auto;
  height: auto;
  display: block;
  border: 2px solid #ffffff;
  border-radius: 12px;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.75);
  opacity: 0;
  transition: opacity 0.7s ease;
}

.piece-transition__image.is-visible {
  opacity: 1;
}

.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}
#app {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Layers */
.effect-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.content-layer {
  position: relative;
  z-index: 10;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.toast-layer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: env(safe-area-inset-top, 20px);
  pointer-events: none;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-card) 100%);
  padding: 1rem;
  padding-top: calc(env(safe-area-inset-top, 20px) + 1rem);
  border-bottom: 1px solid var(--border-color);
}

.header-content {
  max-width: 600px;
  margin: 0 auto;
}

.piece-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


/* Main Content */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 80px);
  -webkit-overflow-scrolling: touch;
}

#accordions-container {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

body.show-mode-performance #accordions-container {
  display: none;
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-secondary);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Handbook Cards (non-collapsible) */
.handbook-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1rem 1rem 1.1rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
}

.handbook-card--full {
  grid-column: 1 / -1;
}

.handbook-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.handbook-card__body {
  color: var(--text-secondary);
}

.program-list {
  margin: 0;
  padding-left: 1.5rem;
  list-style: decimal;
  list-style-position: outside;
}

.program-list li {
  padding-left: 0.25rem;
  line-height: 1.7;
}

.program-list li::marker {
  color: var(--text-muted);
  font-weight: 600;
}

.handbook-card--notices {
  border: 1px solid var(--accent-warning);
  background: rgba(237, 137, 54, 0.1);
}

/* Info Grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.info-item label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.info-item span {
  color: var(--text-primary);
}

/* Dancers List */
.dancers-list {
  list-style: none;
}

.dancers-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.dancers-list li:last-child {
  border-bottom: none;
}

.dancer-name {
  color: var(--text-primary);
}

.dancer-role {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Music Info */
.music-info .info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.music-info .info-row:last-child {
  border-bottom: none;
}

/* Visual Design */
.visual-design .design-item {
  margin-bottom: 0.75rem;
}

.visual-design .design-item:last-child {
  margin-bottom: 0;
}

.visual-design label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.visual-design p {
  color: var(--text-primary);
}

/* Images Gallery */
.images-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.images-gallery img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}

.notices-text {
  color: var(--accent-warning);
}

/* Footer */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 1rem);
  background: linear-gradient(to top, var(--bg-dark) 0%, transparent 100%);
  z-index: 100;
}

.fragment-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  border: none;
  border-radius: 30px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.fragment-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.fragment-icon {
  width: 20px;
  height: 20px;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/></svg>') center/contain no-repeat;
}

/* Toast */
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  margin: 0.5rem 1rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  animation: slideIn 0.3s ease;
  max-width: calc(100% - 2rem);
}

@keyframes slideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.toast.exit {
  animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
  to {
    transform: translateY(-20px);
    opacity: 0;
  }
}

.toast-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  font-size: 0.9rem;
}

.toast.info { border-left: 4px solid var(--primary-color); }
.toast.success { border-left: 4px solid var(--accent-success); }
.toast.warning { border-left: 4px solid var(--accent-warning); }
.toast.fragment { border-left: 4px solid var(--accent-gold); }

/* Push Modal */
.push-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.push-modal-content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius);
  max-width: 400px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 2rem;
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from { transform: scale(0.9); }
  to { transform: scale(1); }
}

.push-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 30px;
  height: 30px;
  background: var(--bg-surface);
  border: none;
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#push-content h3 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

#push-content img {
  width: 100%;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

#push-content p {
  color: var(--text-secondary);
}

/* Fragment Modal */
.fragment-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

.fragment-modal-content {
  background: var(--bg-card);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.fragment-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.fragment-modal-header h2 {
  font-size: 1.1rem;
}

.modal-close {
  width: 30px;
  height: 30px;
  background: var(--bg-surface);
  border: none;
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
}

.fragment-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 1rem);
}

.fragment-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.fragment-item.collected {
  border: 1px solid var(--accent-gold);
}

.fragment-item.uncollected {
  opacity: 0.5;
}

.fragment-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fragment-item.collected .fragment-item-icon {
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-warning) 100%);
}

.fragment-item-info {
  flex: 1;
}

.fragment-item-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.fragment-item-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Connection Status */
.connection-status {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 20px) + 80px);
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border-radius: 20px;
  font-size: 0.75rem;
  z-index: 100;
  opacity: 0;
  transition: opacity var(--transition);
}

.connection-status.visible {
  opacity: 1;
}

.connection-status.disconnected {
  opacity: 1;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-success);
}

.connection-status.disconnected .status-dot {
  background: var(--accent-error);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===== Floating View Toggle Button ===== */
.view-toggle-btn {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 20px) + 1.25rem);
  left: 1.25rem;
  z-index: 900;
  padding: 0.5rem 1.1rem;
  background: rgba(22, 33, 62, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background var(--transition), color var(--transition), transform var(--transition);
  letter-spacing: 0.05em;
}

.view-toggle-btn:hover,
.view-toggle-btn:active {
  background: rgba(102, 126, 234, 0.3);
  color: var(--text-primary);
  transform: translateY(-1px);
}


/* ===== Handbook Entries (全場冊模式) ===== */
.handbook-entry {
  grid-column: 1 / -1;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.handbook-entry.is-current {
  border-color: var(--primary-color);
}

.handbook-entry__header {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.85rem 1rem;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  gap: 0.75rem;
  text-align: left;
}

.handbook-entry__header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.handbook-entry__num {
  width: 28px;
  height: 28px;
  background: var(--bg-surface);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

.handbook-entry.is-current .handbook-entry__num {
  background: var(--primary-color);
}

.handbook-entry__title {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
}

.handbook-entry__badge {
  padding: 0.15rem 0.5rem;
  background: var(--primary-color);
  border-radius: 10px;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.handbook-entry__chevron {
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--text-muted);
  transition: transform var(--transition);
}

.handbook-entry__header.is-open .handbook-entry__chevron {
  transform: rotate(180deg);
}

.handbook-entry__body {
  overflow: hidden;
}

.handbook-entry__body.collapsed {
  display: none;
}

.handbook-entry__inner {
  padding: 0.75rem;
  border-top: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
}

/* ===== Handbook Slider Mode ===== */
body.handbook-slider-mode .main-content {
  overflow: hidden;
  padding: 0;
}

body.handbook-slider-mode #accordions-container {
  height: 100%;
  max-width: none;
  display: block;
  position: relative;
  overflow: hidden;
}

/* Slider root */
.hb-slider {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--bg-dark);
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

/* Progress bars (Instagram Stories style) */
.hb-slider-progress {
  position: absolute;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  display: flex;
  gap: 3px;
  padding: 8px 10px 0;
  z-index: 10;
  pointer-events: none;
}

.hb-slider-progress__bar {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  transition: background 0.25s ease;
}

.hb-slider-progress__bar.is-done  { background: rgba(255, 255, 255, 0.75); }
.hb-slider-progress__bar.is-active { background: #fff; }

/* Slide counter */
.hb-slider-counter {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 18px);
  right: 12px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
  z-index: 10;
  pointer-events: none;
}

/* Desktop arrow navigation */
.hb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background var(--transition), opacity var(--transition);
  opacity: 0.55;
}
.hb-nav:hover  { opacity: 1; background: rgba(255,255,255,0.18); }
.hb-nav--prev  { left: 10px; }
.hb-nav--next  { right: 10px; }
.hb-nav:disabled { opacity: 0.15; cursor: default; pointer-events: none; }

@media (pointer: coarse) {
  .hb-nav { display: none; }
}

/* Slides track */
.hb-slider-track {
  display: flex;
  height: 100%;
  will-change: transform;
}

.hb-slider-track.is-animating {
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Individual slide wrapper */
.hb-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: calc(env(safe-area-inset-top, 0px) + 28px) 0 calc(env(safe-area-inset-bottom, 0px) + 8px);
}

/* Piece slide (inside slider) */
.hb-piece-slide {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.hb-piece-slide__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  flex-shrink: 0;
}

.hb-piece-slide__num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.hb-piece-slide.is-current .hb-piece-slide__num {
  background: var(--primary-color);
}

.hb-piece-slide__title {
  flex: 1;
  font-size: 1.2rem;
  font-weight: 700;
}

.hb-piece-slide__badge {
  padding: 0.15rem 0.55rem;
  background: var(--primary-color);
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  flex-shrink: 0;
}

.hb-piece-slide__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0 0.85rem 1rem;
}

.hb-piece-slide__body .handbook-card--full {
  grid-column: unset;
}

/* ===== Handbook — Cover Page ===== */
.hb-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-card) 100%);
  padding: 2rem;
  text-align: center;
}

.hb-cover__title {
  font-size: clamp(1.6rem, 6vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Handbook — Shared helpers ===== */
.hb-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.hb-photo-placeholder {
  width: 100%;
  height: 100%;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
}

.hb-photo-placeholder--wide {
  min-height: 160px;
}

/* ===== Handbook — Single Staff ===== */
.hb-staff-single {
  grid-column: 1 / -1;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  min-height: 100%;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
}

.hb-staff-single__photo {
  flex-shrink: 0;
  width: 90px;
  height: 110px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.hb-staff-single__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hb-staff-single__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.hb-staff-single__role {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hb-staff-single__name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hb-staff-single__bio {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 0.25rem;
}

/* ===== Handbook — Technical Advisors ===== */
.hb-technical {
  grid-column: 1 / -1;
  min-height: 100%;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
}

.hb-technical__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.hb-technical__member {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hb-technical__photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.hb-technical__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hb-technical__specialty {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.hb-technical__name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.hb-technical__bio {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===== Handbook — Teachers Group ===== */
.hb-teachers {
  grid-column: 1 / -1;
  min-height: 100%;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
}

.hb-teachers__photo {
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.hb-teachers__photo img {
  width: 100%;
  height: auto;
  display: block;
}

.hb-teachers__slogan {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  margin-top: 0.5rem;
}

/* ===== Handbook — Pair (stacked) ===== */
.hb-pair {
  grid-column: 1 / -1;
  min-height: 100%;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
}

.hb-pair__stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hb-pair__member {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hb-pair__photo {
  flex-shrink: 0;
  width: 72px;
  height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.hb-pair__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hb-pair__name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ===== Handbook — Crew ===== */
.hb-crew {
  grid-column: 1 / -1;
  min-height: 100%;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
}

.hb-crew__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hb-crew__item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.hb-crew__item:last-child {
  border-bottom: none;
}

.hb-crew__role {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.hb-crew__name {
  color: var(--text-primary);
  font-weight: 500;
}

.hb-crew__empty {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===== Page Nav Modal ===== */
.page-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.page-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition);
}

.page-nav-item:last-child {
  border-bottom: none;
}

.page-nav-item:hover,
.page-nav-item:active {
  background: rgba(255, 255, 255, 0.05);
}

.page-nav-item.is-current {
  background: rgba(102, 126, 234, 0.12);
}

.page-nav-item__num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--text-muted);
}

.page-nav-item.is-current .page-nav-item__num {
  background: var(--primary-color);
  color: #fff;
}

.page-nav-item__label {
  flex: 1;
  font-size: 0.9rem;
}

.page-nav-item__badge {
  padding: 0.1rem 0.45rem;
  background: var(--primary-color);
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  flex-shrink: 0;
}

.page-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-nav-label {
  font-size: 1rem;
  font-weight: 600;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .effect-layer * {
    animation: none !important;
  }
}

/* Safe area padding for notched phones */
@supports (padding: env(safe-area-inset-top)) {
  .header {
    padding-top: calc(env(safe-area-inset-top) + 1rem);
  }
}
