/* ── Page layout ── */
.session-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-body);
  display: flex;
  flex-direction: column;
}

.session-topbar {
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.session-topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.session-topbar-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.session-topbar-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.session-topbar-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.session-topbar-piece {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.session-topbar-section {
  font-size: 17px;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.session-topbar-zone {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--accent-light);
  color: var(--accent);
  flex-shrink: 0;
}

.session-topbar-zone[data-zone="exploration"] {
  background: var(--accent-light);
  color: var(--accent);
}

.session-topbar-zone[data-zone="consolidation"] {
  background: var(--warning-light);
  color: #92400e;
}

.session-topbar-zone[data-zone="mastery"] {
  background: var(--success-light);
  color: #047857;
}

.session-topbar-zone[data-zone="maintenance"] {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success, #047857);
}

.session-topbar-zone[data-zone="tracking"] {
  background: var(--stats-only-light);
  color: var(--stats-only);
}

.session-topbar-zone[data-zone="free"] {
  background: var(--accent-2-light);
  color: var(--accent-2);
}

.session-topbar-zone[data-zone="analysis"] {
  background: var(--warning-light);
  color: #92400e;
}

.session-topbar .nav-today-time {
  margin-left: auto;
}

/* ── Two-column layout ── */
.session-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  padding: 16px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ── Left column ── */
.session-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Right column ── */
.session-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Panel component ── */
.session-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.panel-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.panel-header-row .panel-title {
  margin-bottom: 0;
}

.btn-analysis-compact {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  font-size: 11px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
}

.btn-analysis-compact:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-analysis-compact:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

/* ── Timer ── */
.timer-display {
  font-size: 52px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-align: center;
  font-family: var(--font-mono);
  cursor: text;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: border-color 0.15s;
  line-height: 1;
  margin: 8px 0 4px;
  padding: 8px 4px;
}

.timer-display:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--accent-light);
}

.timer-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.timer-info-box {
  text-align: center;
  margin-top: 6px;
  padding: 6px 12px;
  background: var(--success-light);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: #065f46;
  line-height: 1.5;
}

.timer-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 6px;
  margin-top: 12px;
}

.timer-btn {
  padding: 9px 4px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s,
              box-shadow 0.15s;
  color: white;
}

.timer-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.timer-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.timer-btn.start {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}
.timer-btn.free {
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  font-size: 11px;
}
.timer-btn.pause {
  background: linear-gradient(135deg, #fb923c, #f97316);
}
.timer-btn.stop {
  background: linear-gradient(135deg, #f87171, #ef4444);
}

.session-notes-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.session-notes-panel .panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.btn-mic {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.btn-mic:hover {
  background: var(--surface);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

.btn-mic.listening {
  background: #fee2e2;
  border-color: #ef4444;
  animation: mic-pulse 1.4s ease-in-out infinite;
}

@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.session-notes-panel .notes-area {
  flex: 1;
  min-height: 220px;
}

/* ── Counters ── */
.counter-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.counter-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}

.counter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: help;
}

.counter-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.counter-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.counter-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.counter-btn.reset-btn {
  border-radius: var(--radius-sm);
  width: auto;
  margin-left: 14px;
  padding: 6px 10px;
  font-size: 13px;
  background: var(--warning-light);
  border-color: var(--warning);
  color: #92400e;
}

.counter-btn.reset-btn:hover {
  background: var(--warning);
  color: white;
}

.counter-value {
  font-size: 22px;
  font-weight: 500;
  min-width: 40px;
  text-align: center;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.counter-value.danger {
  color: var(--danger);
}

.counter-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ── Gebrian toggle ── */
.gebrian-toggle-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: center;
  gap: 8px;
}

.toggle-switch-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-track {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(18px);
}

.intensity-btns {
  display: flex;
  gap: 4px;
}

.intensity-btn {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.intensity-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ── FrustrationGuard banner ── */
.frustration-banner {
  display: none;
  padding: 10px 14px;
  background: #eff6ff;
  border: 1px solid #93c5fd;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-primary);
  margin-top: 8px;
}

.frustration-banner.active {
  display: block;
}

.frustration-banner-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* ── Tempo section ── */
.tempo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tempo-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.tempo-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  font-family: var(--font-mono);
  background: var(--surface);
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tempo-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30,110,181,0.12);
}

.tempo-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  margin-top: 8px;
  padding: 9px 12px;
  background: var(--accent-light);
  border: 1px solid rgba(30, 110, 181, 0.28);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}

.tempo-info-row #tempoInfoText .tempo-info-try {
  color: var(--accent);
  font-weight: 700;
}

/* ── Metronome ── */
/* Block styling lives in css/metronome.css (shared with Interleave). */
.metronome-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ── Energy section ── */
.energy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.energy-btn {
  padding: 8px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.energy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.energy-btn.selected {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.energy-btn.selected.low {
  background: var(--warning-light);
  border-color: var(--warning);
  color: #92400e;
}

/* ── Notes ── */
.notes-area {
  width: 100%;
  min-height: 100px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-sans);
  background: var(--surface);
  color: var(--text-primary);
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.5;
}

.notes-area:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30,110,181,0.12);
}

.prev-notes {
  max-height: 100px;
  overflow-y: auto;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Action buttons ── */
.session-actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 8px;
  margin-top: auto;
}

/* ── Micro-break toast ── */
.micro-break-toast {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success-light);
  color: #047857;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: var(--shadow-sm);
  z-index: 9999;
  max-width: min(360px, calc(100% - 32px));
  width: max-content;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
  line-height: 1.35;
  animation: microBreakIn 0.25s ease-out;
}

.micro-break-toast.visible {
  display: block;
}

@keyframes microBreakIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ── Evaluation modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

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

.modal-box {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: min(720px, 100%);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUpModal 0.25s ease;
}

@keyframes slideUpModal {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  text-align: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 4px;
  color: var(--text-primary);
}

.modal-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.session-summary-panel {
  display: none;
  padding: 14px 16px;
  background: var(--success-light);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-primary);
}

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

/* ── Free Practice badge on session card ── */
.session-page.free-practice-active .session-body {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
  border-radius: var(--radius-sm);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .session-body {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .timer-display { font-size: 40px; }
}

/* ── Hard Stop Modal ── */
.hard-stop-box {
  max-width: 480px;
  text-align: center;
}

.hard-stop-icon {
  font-size: 48px;
  margin-bottom: 12px;
  animation: none;
}

.modal-overlay.active .hard-stop-icon {
  animation: pulse-stop 1.5s ease-in-out infinite;
}

@keyframes pulse-stop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.hard-stop-science {
  background: var(--warning-light);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  color: #92400e;
  line-height: 1.5;
  margin: 16px 0;
  text-align: left;
}

.hard-stop-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.hard-stop-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.hard-stop-option:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

#btnHardStopArchive {
  border-color: rgba(245,158,11,0.4);
  background: var(--warning-light);
}

#btnHardStopArchive:hover {
  border-color: var(--warning);
  background: #fde68a;
}

#btnHardStopSave {
  background: var(--surface-2);
}

.hard-stop-option-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.hard-stop-option-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.hard-stop-option-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.hard-stop-option-desc strong {
  color: var(--accent-2);
}
