/* ============================================
   Tools: OCD Assessment + Spiral Notebook
   ============================================ */

/* --- Shared Tool Styles --- */
.tool-privacy {
  background: var(--teal-light);
  border: 1px solid var(--teal-mid);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-xl);
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
}

.tool-privacy::before {
  content: '🔒';
  font-size: 1.25rem;
  flex-shrink: 0;
}

.tool-privacy p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

/* ============================================
   OCD Assessment
   ============================================ */
.assessment-container {
  max-width: 640px;
  margin: 0 auto;
}

/* Intro screen */
.assessment-intro {
  text-align: center;
  padding: var(--space-xl) 0;
}

.assessment-intro h2 {
  margin-bottom: var(--space-sm);
}

.assessment-intro p {
  margin-bottom: var(--space-md);
}

/* Progress bar */
.assessment-progress {
  background: var(--border);
  border-radius: 20px;
  height: 8px;
  margin-bottom: var(--space-xl);
  overflow: hidden;
}

.assessment-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--teal-mid));
  border-radius: 20px;
  transition: width 0.4s ease;
}

.assessment-step-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: var(--space-xs);
}

/* Question card */
.assessment-question {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  animation: fadeSlideIn 0.35s ease;
  box-shadow: var(--shadow-sm);
}

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

.assessment-question h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  line-height: 1.4;
}

/* Likert scale */
.likert-scale {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.likert-option {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-white);
}

.likert-option:hover {
  border-color: var(--teal-mid);
  background: var(--teal-light);
}

.likert-option.selected {
  border-color: var(--teal);
  background: var(--teal-light);
}

.likert-option input {
  display: none;
}

.likert-radio {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.2s ease;
}

.likert-option.selected .likert-radio {
  border-color: var(--teal);
}

.likert-option.selected .likert-radio::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  background: var(--teal);
  border-radius: 50%;
}

.likert-label {
  font-size: 0.9375rem;
  color: var(--text-primary);
  line-height: 1.4;
}

/* Navigation buttons */
.assessment-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-lg);
}

.assessment-nav .btn-back {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  padding: var(--space-xs);
  font-family: var(--font-body);
}

.assessment-nav .btn-back:hover {
  color: var(--text-primary);
}

/* Calculating screen */
.assessment-calculating {
  text-align: center;
  padding: var(--space-3xl) 0;
}

.calculating-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  margin: 0 auto var(--space-lg);
  animation: spin 1s linear infinite;
}

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

.assessment-calculating p {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 1.125rem;
  color: var(--text-secondary);
}

/* Result screen */
.assessment-result {
  text-align: center;
  padding: var(--space-xl) 0;
  animation: fadeSlideIn 0.5s ease;
}

.result-tier {
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-xl);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
}

.result-tier-low {
  background: var(--teal-light);
  color: var(--teal-dark);
}

.result-tier-moderate {
  background: #FFF3E0;
  color: #E65100;
}

.result-tier-high {
  background: var(--coral-light);
  color: var(--coral-dark);
}

.assessment-result h2 {
  margin-bottom: var(--space-sm);
}

.assessment-result p {
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.result-detail {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
  text-align: left;
}

.result-detail h4 {
  margin-bottom: var(--space-sm);
}

.result-detail ul {
  list-style: none;
  padding: 0;
}

.result-detail li {
  padding: var(--space-xs) 0;
  padding-left: var(--space-md);
  position: relative;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.result-detail li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--teal);
}

/* ============================================
   Spiral Notebook
   ============================================ */
.notebook-container {
  max-width: 640px;
  margin: 0 auto;
}

/* Notebook styling */
.notebook-paper {
  background: #FFFFF5;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  padding-left: calc(var(--space-lg) + 28px);
  position: relative;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
}

/* Lined paper effect */
.notebook-paper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 48px;
  bottom: 0;
  width: 2px;
  background: var(--coral-mid);
  opacity: 0.3;
}

.notebook-lines {
  background-image: repeating-linear-gradient(
    transparent,
    transparent 31px,
    #C8E0D4 31px,
    #C8E0D4 32px
  );
  min-height: 200px;
}

/* Entry form */
.notebook-entry {
  margin-bottom: var(--space-lg);
}

.notebook-prompt {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 1.125rem;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.notebook-step-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: var(--space-xs);
}

.notebook-textarea {
  width: 100%;
  min-height: 120px;
  padding: var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-primary);
  background: white;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.notebook-textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(29, 158, 117, 0.1);
}

.notebook-textarea::placeholder {
  color: var(--text-muted);
}

/* Emotion picker */
.emotion-picker {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.emotion-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.emotion-btn:hover {
  border-color: var(--teal-mid);
  background: var(--teal-light);
}

.emotion-btn.selected {
  border-color: var(--teal);
  background: var(--teal-light);
  color: var(--teal-dark);
}

.emotion-btn .emotion-icon {
  font-size: 1rem;
}

.emotion-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Trend insight */
.notebook-trend {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  margin-top: var(--space-md);
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Reframe reveal */
.notebook-reframe {
  background: var(--teal-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-top: var(--space-lg);
  animation: fadeSlideIn 0.4s ease;
}

.notebook-reframe h4 {
  color: var(--teal-dark);
  margin-bottom: var(--space-xs);
}

.notebook-reframe p {
  font-size: 0.9375rem;
}

/* Entry list */
.notebook-entries-list {
  margin-top: var(--space-xl);
}

.notebook-entries-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.notebook-entries-header h3 {
  font-size: 1rem;
}

.notebook-clear-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8125rem;
  cursor: pointer;
  font-family: var(--font-body);
  padding: var(--space-xs);
}

.notebook-clear-btn:hover {
  color: var(--coral);
}

.notebook-entry-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
}

.notebook-entry-card .entry-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.notebook-entry-card .entry-thought {
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.notebook-entry-card .entry-emotion {
  display: inline-block;
  font-size: 0.75rem;
  padding: 2px 8px;
  background: var(--teal-light);
  border-radius: 12px;
  color: var(--teal-dark);
  margin-bottom: var(--space-xs);
}

.notebook-entry-card .entry-reframe {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Nudge banner (after 3 entries) */
.notebook-nudge {
  background: var(--coral-light);
  border: 1px solid var(--coral-mid);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  margin-top: var(--space-lg);
  text-align: center;
  animation: fadeSlideIn 0.4s ease;
}

.notebook-nudge h4 {
  color: var(--coral-dark);
  margin-bottom: var(--space-xs);
}

.notebook-nudge p {
  font-size: 0.875rem;
  margin-bottom: var(--space-sm);
}

/* ============================================
   Tools Hub Page
   ============================================ */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.tool-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.tool-card:hover {
  border-color: var(--teal-mid);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.tool-card-coming-soon {
  opacity: 0.6;
  pointer-events: none;
}

.tool-card-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-xl);
  background: var(--teal-icy);
  color: var(--teal-dark);
  margin-bottom: var(--space-sm);
}

.tool-card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
  line-height: 1.3;
}

.tool-card-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex-grow: 1;
  margin-bottom: var(--space-md);
}

.tool-card-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--teal);
  transition: color 0.2s ease;
}

.tool-card:hover .tool-card-link {
  color: var(--teal-dark);
}

/* ============================================
   Reassurance Checker
   ============================================ */
.rc-reflection {
  margin-top: var(--space-md);
}

/* ============================================
   Compulsion Cost Calculator
   ============================================ */
.calculator-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.calculator-sliders {
  flex: 1;
}

.calc-category {
  margin-bottom: var(--space-lg);
}

.calc-category-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
}

.calc-category-header label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.calc-category-detail {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.calc-slider-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.calc-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  outline: none;
  transition: background 0.2s ease;
}

.calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--coral);
  cursor: pointer;
  border: 3px solid var(--bg-white);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: transform 0.15s ease;
}

.calc-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.calc-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--coral);
  cursor: pointer;
  border: 3px solid var(--bg-white);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.calc-slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 4px;
}

.calc-slider::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: var(--border);
}

.calc-value {
  min-width: 52px;
  text-align: right;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

/* Results Panel */
.calculator-results {
  position: sticky;
  top: calc(var(--header-height) + var(--space-md));
}

.calc-results-card {
  background: var(--bg-white);
  border: 2px solid var(--teal-mid);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
}

.calc-results-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.calc-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--border);
}

.calc-result-row:last-of-type {
  border-bottom: none;
}

.calc-result-highlight {
  background: var(--teal-icy);
  margin: var(--space-xs) calc(-1 * var(--space-sm));
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  border-bottom: none;
}

.calc-result-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.calc-result-number {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.calc-context {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.calc-context p {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.calc-cta {
  margin-top: var(--space-lg);
  text-align: center;
  animation: fadeSlideIn 0.4s ease;
}

.calc-cta p {
  font-weight: 600;
  color: var(--text-primary);
}

/* --- Responsive --- */
@media (min-width: 768px) {
  .likert-scale {
    gap: var(--space-xs);
  }

  .assessment-question {
    padding: var(--space-xl) var(--space-3xl);
  }

  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .calculator-layout {
    flex-direction: row;
    gap: var(--space-xl);
  }

  .calculator-sliders {
    flex: 1.2;
  }

  .calculator-results {
    flex: 0.8;
  }
}

@media (min-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================
   Make It Yours - Preferences Panel
   ============================================ */

/* Trigger button */
.bm-prefs-trigger {
  position: fixed;
  bottom: 100px;
  right: 20px;
  z-index: 1050;
  border-radius: 24px;
  border: 2px solid var(--teal-mid);
  background: var(--bg-white);
  color: var(--teal);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px 10px 12px;
  box-shadow: var(--shadow-md), 0 0 12px -2px rgba(61, 189, 176, 0.15);
  transition: all 0.3s ease;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.bm-prefs-trigger::after {
  content: 'Make it yours';
}

/* Pulse animation on first visit */
.bm-prefs-trigger.bm-first-visit {
  animation: prefsPulse 2s ease-in-out 3;
  animation-delay: 2s;
}

@keyframes prefsPulse {
  0%, 100% { box-shadow: var(--shadow-md), 0 0 0 0 rgba(61, 189, 176, 0); }
  50% { box-shadow: var(--shadow-md), 0 0 0 8px rgba(61, 189, 176, 0.15); }
}

.bm-prefs-trigger:hover {
  border-color: var(--teal);
  background: var(--teal);
  color: white;
  box-shadow: var(--shadow-lg), 0 0 20px -2px rgba(61, 189, 176, 0.3);
  transform: translateY(-2px);
}

.bm-prefs-trigger.open {
  border-color: var(--teal);
  background: var(--teal);
  color: white;
}

.bm-prefs-trigger.open::after {
  content: 'Close';
}

.bm-prefs-trigger svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* On mobile, keep it compact */
@media (max-width: 479px) {
  .bm-prefs-trigger::after {
    content: '';
  }
  .bm-prefs-trigger {
    padding: 10px;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    justify-content: center;
  }
}

/* Backdrop */
.bm-prefs-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1060;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.bm-prefs-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Panel */
.bm-prefs-panel {
  position: fixed;
  bottom: 0;
  right: 0;
  z-index: 1070;
  width: 320px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg-white);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  overscroll-behavior: contain;
}

.bm-prefs-panel.open {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .bm-prefs-panel {
    bottom: 20px;
    right: 20px;
    border-radius: var(--radius-lg);
    max-height: 70vh;
    transform: translateY(12px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
  }

  .bm-prefs-panel.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
}

/* Panel header */
.bm-prefs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-white);
  z-index: 1;
}

.bm-prefs-header h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.bm-prefs-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.bm-prefs-close:hover {
  color: var(--text-primary);
}

/* Sections */
.bm-prefs-section {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.bm-prefs-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-sm);
}

.bm-prefs-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Theme swatches */
.bm-prefs-swatches {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xs);
}

.bm-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--space-sm);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.bm-swatch:hover {
  border-color: var(--teal-mid);
}

.bm-swatch.active {
  border-color: var(--teal);
  background: var(--teal-icy);
}

.bm-swatch-colors {
  display: flex;
  gap: 4px;
}

.bm-swatch-colors span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.bm-swatch-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Font buttons */
.bm-prefs-fonts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xs);
}

.bm-font-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-sm);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.bm-font-btn:hover {
  border-color: var(--teal-mid);
}

.bm-font-btn.active {
  border-color: var(--teal);
  background: var(--teal-icy);
}

.bm-font-preview {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-primary);
}

.bm-font-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Corner buttons */
.bm-prefs-corners {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xs);
}

.bm-corner-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--space-sm);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.bm-corner-btn:hover {
  border-color: var(--teal-mid);
}

.bm-corner-btn.active {
  border-color: var(--teal);
  background: var(--teal-icy);
}

.bm-corner-preview {
  width: 32px;
  height: 24px;
  border: 2px solid var(--teal);
  background: var(--teal-icy);
}

.bm-corner-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Toggle switch */
.bm-prefs-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bm-prefs-toggle-row .bm-prefs-label {
  margin-bottom: 0;
}

.bm-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.bm-toggle-track {
  display: block;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--border-strong);
  position: relative;
  transition: background 0.2s ease;
}

.bm-toggle.active .bm-toggle-track {
  background: var(--teal);
}

.bm-toggle-thumb {
  display: block;
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.bm-toggle.active .bm-toggle-thumb {
  transform: translateX(20px);
}

/* Footer */
.bm-prefs-footer {
  padding: var(--space-md) var(--space-lg);
  text-align: center;
}

.bm-prefs-reset {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8125rem;
  cursor: pointer;
  font-family: var(--font-body);
  padding: var(--space-xs) var(--space-sm);
  transition: color 0.2s;
}

.bm-prefs-reset:hover {
  color: var(--coral);
}

/* Reduced motion */
.bm-reduced-motion *,
.bm-reduced-motion *::before,
.bm-reduced-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

/* Night mode overrides */
.bm-night img {
  opacity: 0.92;
}

.bm-night .site-header {
  background: var(--bg-secondary);
  border-bottom-color: var(--border);
}

.bm-night .site-footer {
  background: var(--bg-secondary);
}

.bm-night .notebook-paper {
  background: var(--bg-secondary);
}

.bm-night .notebook-paper::before {
  background: var(--coral);
  opacity: 0.15;
}

.bm-night .notebook-textarea {
  background: var(--bg);
  color: var(--text-primary);
  border-color: var(--border);
}

.bm-night .assessment-question {
  background: var(--bg-secondary);
}

.bm-night .likert-option {
  background: var(--bg);
}

.bm-night .calc-results-card {
  background: var(--bg-secondary);
}

.bm-night .bm-prefs-panel {
  background: var(--bg-secondary);
}

.bm-night .bm-prefs-header {
  background: var(--bg-secondary);
}

.bm-night .bm-swatch,
.bm-night .bm-font-btn,
.bm-night .bm-corner-btn {
  background: var(--bg);
}

/* Smooth theme transition on root */
:root {
  transition: background-color 0.4s ease, color 0.3s ease;
}

body {
  transition: background-color 0.4s ease, color 0.3s ease;
}

/* ============================================
   Cross-Tool Navigation
   ============================================ */

.bm-crossnav {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
}

.bm-crossnav-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-md);
}

.bm-crossnav-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

@media (min-width: 640px) {
  .bm-crossnav-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

.bm-crossnav-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-md);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-white);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.25s ease;
  position: relative;
}

.bm-crossnav-card:hover {
  border-color: var(--teal);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.bm-crossnav-done {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--teal-dark);
  background: var(--teal-icy);
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: 0.03em;
}

.bm-crossnav-name {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  padding-right: 60px;
}

.bm-crossnav-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.bm-crossnav-time {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--teal);
  margin-top: 2px;
}

.bm-crossnav-progress {
  margin-top: var(--space-md);
}

.bm-crossnav-progress-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.bm-crossnav-progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.bm-crossnav-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--teal-bright));
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
