/**
 * styles.css
 * Last modified: v016.217 (2025-12-04)
 * Changes: Removed dead Focus Mode CSS (~345 lines)
 */

/* ============================================
   BDSM Checklist - Stylesheet
   Alle styling voor de applicatie
   ============================================ */

/* === CSS Variables === */
:root{
  /* Typography */
  --font-family: 'Source Sans 3', sans-serif;
  --font: var(--font-family);
  --fs-base: 15px;
  --fs: var(--fs-base);
  --fs-xs: 0.85rem;
  --fs-sm: 0.9rem;
  --fs-md: 0.95rem;
  --fs-lg: 1rem;
  --fs-xl: 1.05rem;
  --fs-2xl: 1.15rem;
  --fs-3xl: 1.25rem;
  --fs-4xl: 1.45rem;
  
  /* Layout */
  --maxw: 980px;
  --scale-w: 490px;
  --bar-h: 68px;
  --topbar-h: 3.6rem;
  
  /* Spacing */
  --pad: 0.35rem;
  --gap-xs: 0.25rem;
  --gap-sm: 0.3rem;
  --gap-md: 0.5rem;
  --gap-lg: 0.6rem;
  --gap-xl: 0.75rem;
  
  /* Colors - Light Mode */
  --color-text: #111;
  --color-text-muted: #555;
  --color-text-light: #666;
  --color-bg: #fff;
  --color-bg-alt: #f9f9fb;
  --color-bg-card: #fff;
  --color-border: #d4d4d8;
  --color-border-light: #e4e4e7;
  --color-border-lighter: #eaeaef;
  
  /* Borders & Radius */
  --radius-sm: 0.4rem;
  --radius-md: 0.55rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  /* Shadows */
  --shadow-sm: 0 2px 6px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.15);
  --shadow-lg: 0 4px 18px rgba(0,0,0,.05);
  --shadow-xl: 0 6px 24px rgba(0,0,0,.08);
  --shadow-2xl: 0 -12px 40px rgba(0,0,0,.18);
  
  /* Scale Colors */
  --color-hardno: #FF6B6B;
  --color-softno: #FFA07A;
  --color-fine: #FFD93D;
  --color-like: #C8E66F;
  --color-love: #6BCF7F;
  --color-curious: #7dd3fc;
  --color-unknown: #a8adb8;
  
  /* Interaction Colors */
  --color-hover: #f2f2f7;
  --color-active: #e0f2fe;
  
  /* Accent Colors */
  --color-accent-blue: #0ea5e9;
  --color-accent-blue-dark: #3b82f6;
  --color-accent-blue-light: #60a5fa;
  --color-accent-purple: #4f46e5;
  --color-accent-purple-dark: #4338ca;
  --color-accent-purple-light: #818cf8;
  --color-accent-green: #10b981;
  --color-accent-green-dark: #059669;
  --color-accent-green-light: #6BCF7F;
  --color-accent-pink: #db2777;
  --color-accent-pink-light: #f9a8d4;
  --color-error: #dc2626;
  
  /* Gray Scale */
  --color-gray-50: #fafafa;
  --color-gray-100: #f4f4f5;
  --color-gray-200: #e4e4e7;
  --color-gray-300: #d1d5db;
  --color-gray-400: #a1a1aa;
  --color-gray-500: #71717a;
  --color-gray-600: #52525b;
  --color-gray-700: #3f3f46;
  --color-gray-800: #27272a;
  --color-gray-900: #18181b;
  
  /* Additional Text Colors */
  --color-text-secondary: #666;
  --color-text-tertiary: #555;
  --color-text-quaternary: #444;
  --color-text-quinary: #333;
  
  /* Additional Border Colors */
  --color-border-subtle: #eee;
  --color-border-dashed: #e5e7eb;
  
  /* === Theme System Variables === */
  /* These are dynamically set by theme-manager.js based on selected theme */
  /* Default values are Charcoal Warm (default theme) - prevents white flash */
  
  /* Theme Backgrounds */
  --theme-bg-primary: #18181b;
  --theme-bg-secondary: #27272a;
  --theme-bg-panel: #3f3f46;
  --theme-bg-hover: #52525b;
  --theme-bg-active: #713f12;
  
  /* Theme Borders */
  --theme-border-primary: #52525b;
  --theme-border-secondary: #71717a;
  --theme-border-hover: #a1a1aa;
  
  /* Theme Text */
  --theme-text-primary: #fbbf24;
  --theme-text-secondary: #c9c9c9;
  --theme-text-muted: #fcd34d;
  --theme-text-title: #fbbf24;
  
  /* Theme Accents */
  --theme-accent-dominant: #f97316;
  --theme-accent-submissive: #ec4899;
  --theme-accent-action: #ea580c;
  --theme-accent-success: #84cc16;
  --theme-accent-error: #dc2626;
  
  /* Theme Shadows */
  --theme-shadow-sm: 0 2px 10px rgba(0,0,0,.4);
  --theme-shadow-md: 0 4px 12px rgba(0,0,0,.6);
  --theme-shadow-lg: 0 6px 24px rgba(0,0,0,.6);
  
  /* Theme Input Backgrounds */
  --theme-input-radio-bg: #ffffff;
  --theme-input-checkbox-bg: #ffffff;
  
  /* Theme Tooltip (defaults match charcoal-warm) */
  --theme-tooltip-bg: #3f3f46;
  --theme-tooltip-text: #fbbf24;
  --theme-tooltip-border: #52525b;
  --theme-tooltip-shadow: rgba(0, 0, 0, 0.5);
  
  /* Theme Scale (defaults match charcoal-warm) */
  --theme-feedback-accent: #fbbf24;
  --theme-scale-bar-bg: rgba(255,255,255,0.1);
  --theme-scale-bar-hover: rgba(255,255,255,0.2);
  --theme-scale-label-dim: rgba(255,255,255,0.5);
  --theme-scale-label-hover: rgba(255,255,255,0.8);
}

/* === GLOBAL === */
*{box-sizing:border-box;}
html,body{margin:0;padding:0;height:100%;overflow-x:hidden;}

/* CRITICAL: Prevent iOS text selection popup on long-press */
body {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Allow text selection only in input fields and textareas */
input,
textarea,
[contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* === Base Styles === */
html, body{height:100%; min-width:0;}
body{margin:0; font-family:var(--font); font-size:var(--fs); color:var(--theme-text-primary); background:var(--theme-bg-primary);}

/* === Button Icon Styling === */
/* Used by theme toggle and other icon buttons */
.btn-icon {
  width: 1.2em;
  height: 1.2em;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  margin-right: 0.3em;
}

.page-header{padding:.6rem 1rem .2rem 1rem; text-align:center;}
.page-header h1{font-size:var(--fs-3xl); margin:.2rem 0 .6rem 0; font-weight:600;}

.file-btn{border:1px solid var(--color-border); background:var(--color-bg); border-radius:var(--radius-sm); padding:.4rem .65rem; cursor:pointer; display:inline-block; font-family:var(--font);}

#app{padding: 0 1rem calc(8rem + env(safe-area-inset-bottom)) 1rem;}
#intro{padding: 0 1rem;} /* Match app padding for consistent side margins */

/* Mobile: reduce horizontal padding by half */
@media (max-width: 768px) {
  #app { padding-left: 0.5rem; padding-right: 0.5rem; }
  #intro { padding-left: 0.5rem; padding-right: 0.5rem; }
}
.loading{max-width:var(--maxw); margin:2rem auto; text-align:center; color:var(--theme-text-secondary);}

/* === Category Headings === */
.category{max-width:var(--maxw); margin: 0 auto 2.2rem auto;}
body .category h2,
body.font-large .category h2,
body.font-xlarge .category h2{
  font-size:2.1rem !important;
  margin:2.2rem 0 1rem 0;
  text-align:center; font-weight:800; letter-spacing:.3px;
  border-bottom:1px solid var(--theme-border-secondary); padding-bottom:.35rem;
  color:var(--theme-text-title);
}

/* Category title in CategoryHeader component */
body .category-title,
body.font-large .category-title,
body.font-xlarge .category-title{
  font-size:2.1rem !important;
  margin:2.2rem 0 1rem 0;
  text-align:center; font-weight:800; letter-spacing:.3px;
  border-bottom:1px solid var(--theme-border-secondary); padding-bottom:.35rem;
  color:var(--theme-text-title);
}
.category h2 .sub{ font-weight:400; font-size:var(--fs-lg); color:var(--theme-text-secondary); margin-left:.4rem }

/* === Item Block === */
.item{margin: 0 auto 1.8rem auto; max-width:var(--scale-w); padding: 0 0.5rem;}

/* Add padding to checkbox/radio/open-text questions to align with scale questions */
.item.checkbox-question,
.item.radio-question,
.item.open-text-question {
  padding: 0 var(--pad); /* Match scale table padding */
}
table.scale{border-collapse:separate; border-spacing:0; width:100%; table-layout:fixed;}
table.scale th, table.scale td{padding:var(--pad); text-align:center; vertical-align:middle; word-wrap:break-word;}
.title-cell{ text-align:left !important; font-weight:600; padding:.5rem var(--pad) .18rem var(--pad);  font-size: calc(var(--fs) + 2pt); color:var(--theme-text-title); }
.desc-cell{ text-align:left !important; padding:.18rem var(--pad) .85rem var(--pad); line-height:1.35; color:var(--theme-text-secondary);  font-size: calc(var(--fs) + 1pt); white-space: pre-line; }

/* Desktop: less space between description and scale */
@media (min-width: 768px) {
  .desc-cell{ padding:.18rem var(--pad) .50rem var(--pad); }
}

/* Emoji header row: geen kleurachtergrond */
.emoji{font-size:var(--fs-xl); line-height:1; background:transparent !important;}

/* Input row */
.cb-cell{position:relative; height:2rem;}
.cb-cell input[type="checkbox"]{
  width:1.1rem; height:1.1rem; margin:0; vertical-align:middle; cursor:pointer;
  background: var(--theme-input-checkbox-bg);
}
.cb-cell input[type="radio"]{
  width:1.1rem; height:1.1rem; margin:0; vertical-align:middle; cursor:pointer;
  background: var(--theme-input-radio-bg);
}
.cb-cell label{display:inline-flex; width:100%; height:100%; align-items:center; justify-content:center; cursor:pointer}

/* Test category radio/checkbox styling */
.test-radio, .test-checkbox{
  width: 1.2rem;
  height: 1.2rem;
  cursor: pointer;
}

/* Question titles for all question types - use theme accent colors */
.open-text-title,
.radio-title,
.checkbox-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: calc(var(--fs) + 1pt);
  color: var(--theme-text-title);
}

/* Test category question descriptions */
.radio-desc, .checkbox-desc{
  color: var(--theme-text-secondary);
  margin-bottom: 0.75rem;
  font-size: var(--fs);
}

/* Option labels for radio and checkbox questions - use secondary text color (same as descriptions) */
.radio-option-label,
.checkbox-option-label {
  font-size: var(--fs);
  color: var(--theme-text-secondary) !important;
}

/* Wrapper labels inherit primary text color */
label[data-radio-option],
label[data-checkbox-option] {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.4rem;
  color: var(--theme-text-primary) !important;
}

/* Also target span inside labels to ensure theme colors apply */
label[data-radio-option] span,
label[data-checkbox-option] span {
  color: var(--theme-text-primary) !important;
}

/* === Matrix View Colors === */
/* Colors are now set dynamically from scales.json via inline styles */
/* See MatrixView.js createScaleRow() method for implementation */

/* === Bottom Navigation (fixed) === */
.bottom-nav{
  position:fixed; left:0; right:0;
  bottom: max(0px, env(safe-area-inset-bottom));
  display:flex; justify-content:center; gap:var(--gap-xl);
  padding:.5rem 1rem; z-index:120;
  pointer-events:none;
}
.bottom-nav .nav-btn{
  pointer-events:auto;
  min-width:56px; height:var(--bar-h);
  border:1px solid var(--theme-border-primary); background:var(--theme-bg-panel); border-radius:var(--radius-xl);
  font-size:1.05rem; cursor:pointer; display:flex; align-items:center; justify-content:center;
  box-shadow:var(--theme-shadow-lg);
  padding: 0 1.1rem; line-height:1;
  font-family:var(--font);
  font-weight:400;
  color:var(--theme-text-primary);
}
.bottom-nav .catalog{min-width:80px}
.bottom-nav .nav-btn[disabled]{opacity:.45; cursor:not-allowed}

/* === Catalog Modal === */
.modal[hidden]{display:none !important;}
.modal{
  position:fixed; inset:0; display:flex; align-items:flex-end; justify-content:center;
  background:rgba(0,0,0,.25); z-index:130;
}
.modal-box{
  width:min(720px, 92vw); 
  max-height:calc(100vh - var(--bar-h) - 20px); 
  overflow:auto;
  background:var(--theme-bg-panel); border:1px solid var(--theme-border-secondary); border-radius:var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow:var(--theme-shadow-lg);
  margin-bottom:var(--bar-h);
  color:var(--theme-text-primary);
}
.modal-head{display:flex; align-items:center; justify-content:space-between; padding:.8rem 1rem; border-bottom:1px solid var(--theme-border-secondary);}
.modal-head h2{margin:0; font-size:var(--fs-xl); color:var(--theme-text-primary);}
.modal-head .close{border:none; background:transparent; font-size:1.4rem; cursor:pointer; color:var(--theme-text-primary);}
.modal-body{padding:.6rem 1rem 1rem 1rem;}
.catalog-list{list-style:none; margin:0; padding:0;}
.catalog-list li{padding:.6rem .25rem; border-bottom:1px dashed var(--theme-border-secondary); display:flex; justify-content:space-between; align-items:center;}
.catalog-list li button{border:1px solid var(--theme-border-primary); background:var(--theme-bg-panel); border-radius:var(--radius-md); padding:.35rem .6rem; cursor:pointer; font-family:var(--font); color:var(--theme-text-primary);}
.catalog-list li button:hover{background:var(--theme-bg-hover);}
.catalog-list li .meta{color:var(--theme-text-secondary); font-size:var(--fs-md)}

/* === Print Styles === */
@media print{
  .bottom-nav, .modal{display:none}
  #app{padding-bottom:0}
  .category h2{page-break-before:always;}
}

/* === Intro Block === */
.intro-card{max-width:var(--maxw); margin:1.5rem auto 2rem auto; background:var(--theme-bg-secondary); border:1px solid var(--theme-border-secondary); border-radius:var(--radius-lg); padding:1.5rem 1.5rem; box-shadow:var(--theme-shadow-lg); color:var(--theme-text-primary);}

/* Intro Tables - for scale explanations */
.intro-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.intro-table td { padding: 0.6rem 0.5rem; vertical-align: top; }
.intro-table td:first-child { width: 36px; text-align: center; vertical-align: top; }
.intro-table td:first-child svg { display: block; margin: 0 auto; }
.intro-table .label { font-weight: 700; }
.intro-table .desc { font-size: 0.9em; color: var(--theme-text-secondary, rgba(255,255,255,0.7)); }
.intro-nav-icon { width: 20px; height: 20px; vertical-align: middle; margin-right: 0.5rem; }
.intro-card h2{font-size:var(--fs-2xl); margin:.25rem 0 .25rem 0; font-weight:800; letter-spacing:.2px}
.intro-card p{margin:.55rem 0}
.intro-steps p{margin:.5rem 0}
.intro-callout{border-left:3px solid var(--theme-accent-action); padding-left:.6rem; margin:.6rem 0; color:var(--theme-text-secondary)}
.scale-intro .item{display:flex; gap:var(--gap-lg); align-items:flex-start; margin:.6rem 0}
.scale-intro .emoji{flex:0 0 auto; font-size:var(--fs-2xl); line-height:1.2}
.scale-intro .body{flex:1 1 auto}
.scale-intro .title{font-weight:700; margin:0 0 .05rem 0}



/* === Language Switcher Dropdown === */
.lang-switcher{ position:relative; }
.lang-select{ 
  display:flex; align-items:center; gap:var(--gap-sm); 
  padding:0 .5rem; 
  height:2.2rem;
  border:1px solid var(--theme-border-primary); 
  background:var(--theme-bg-panel); 
  border-radius:var(--radius-sm); 
  cursor:pointer; 
  font-size:var(--fs-md);
  min-width:auto;
  color:var(--theme-text-primary);
}
.lang-select:hover{ background:var(--theme-bg-hover); }
.lang-flag{ font-size:1.3rem; }
.lang-name{ font-weight:500; }
.lang-arrow{ margin-left:auto; font-size:.8rem; }

/* === View Switcher === */
.view-switcher{ position:relative; }
.view-select{ 
  display:flex; 
  align-items:center; 
  gap:var(--gap-sm); 
  padding:0 .5rem; 
  height:2.2rem;
  border:1px solid var(--theme-border-primary); 
  background:var(--theme-bg-panel); 
  border-radius:var(--radius-sm); 
  cursor:pointer; 
  font-size:var(--fs-md);
  min-width:auto;
  color:var(--theme-text-primary);
}
.view-select:hover{ background:var(--theme-bg-hover); }
.view-icon{ font-size:1.1rem; }
.view-dropdown{ 
  position:absolute; 
  top:100%; 
  left:0; 
  margin-top:var(--gap-sm); 
  background:var(--theme-bg-panel); 
  border:1px solid var(--theme-border-primary); 
  border-radius:var(--radius-sm); 
  box-shadow:var(--theme-shadow-md); 
  min-width:150px; 
  display:none; 
  z-index:1000;
}
.view-dropdown.show{ display:block; }
.view-option{ 
  display:flex; 
  align-items:center; 
  gap:var(--gap-md); 
  padding:.6rem .8rem; 
  cursor:pointer;
  font-size:var(--fs-md);
}
.view-option:hover{ background:var(--theme-bg-hover); }
.view-option.active{ background:var(--theme-bg-active); font-weight:600; }

/* === Font Size Switcher === */
.font-switcher{ position:relative; }
.font-select{ 
  display:flex; align-items:center; gap:.3rem; 
  padding:0 .5rem; 
  height:2.2rem;
  border:1px solid var(--theme-border-primary); 
  background:var(--theme-bg-panel); 
  border-radius:.4rem; 
  cursor:pointer; 
  font-size:.95rem;
  min-width:auto;
  color:var(--theme-text-primary);
}
.font-select:hover{ background:var(--theme-bg-hover); }
.font-icon{ font-size:1.1rem; font-weight:600; }
.font-dropdown{ 
  position:absolute; 
  top:100%; 
  left:0; 
  margin-top:.3rem; 
  background:var(--theme-bg-panel); 
  border:1px solid var(--theme-border-primary); 
  border-radius:.4rem; 
  box-shadow:var(--theme-shadow-md); 
  min-width:160px; 
  display:none; 
  z-index:1000;
}
.font-dropdown.show{ display:block; }
.font-option{ 
  display:flex; 
  align-items:center; 
  gap:.5rem; 
  padding:.6rem .8rem; 
  cursor:pointer;
  font-size:.95rem;
  white-space:nowrap;
}
.font-option:hover{ background:var(--theme-bg-hover); }
.font-option.active{ background:var(--theme-bg-active); font-weight:600; }

/* === Font Family Switcher === */
.fontfamily-switcher{ position:relative; }
.fontfamily-select{ 
  display:flex; align-items:center; gap:.3rem; 
  padding:0 .5rem; 
  height:2.2rem;
  border:1px solid var(--theme-border-primary); 
  background:var(--theme-bg-panel); 
  border-radius:.4rem; 
  cursor:pointer; 
  font-size:.95rem;
  min-width:auto;
  color:var(--theme-text-primary);
}
.fontfamily-select:hover{ background:var(--theme-bg-hover); }
.fontfamily-dropdown{ 
  position:absolute; 
  top:100%; 
  right:0; 
  margin-top:.3rem; 
  background:var(--theme-bg-panel); 
  border:1px solid var(--theme-border-primary); 
  border-radius:.4rem; 
  box-shadow:var(--theme-shadow-md); 
  min-width:200px;
  max-height:500px;
  overflow-y:auto;
  display:none; 
  z-index:1000;
}
/* Scrollbar styling for font dropdown */
.fontfamily-dropdown::-webkit-scrollbar{ width:8px; }
.fontfamily-dropdown::-webkit-scrollbar-track{ background:#f1f1f1; border-radius:.4rem; }
.fontfamily-dropdown::-webkit-scrollbar-thumb{ background:#c1c1c1; border-radius:.4rem; }
.fontfamily-dropdown::-webkit-scrollbar-thumb:hover{ background:#a1a1a1; }
.fontfamily-dropdown.show{ display:block; }
.fontfamily-option{ 
  display:flex; 
  align-items:center; 
  gap:.5rem; 
  padding:.6rem .8rem; 
  cursor:pointer;
  font-size:.95rem;
  white-space:nowrap;
}
.fontfamily-option:hover{ background:var(--theme-bg-hover); }
.fontfamily-option.active{ background:var(--theme-bg-active); font-weight:600; }

/* === Font Preview (single source of truth for font-family assignments) === */
[data-font="Crimson Pro"], [data-menu-font="Crimson Pro"] { font-family: 'Crimson Pro', serif; }
[data-font="Crimson Text"], [data-menu-font="Crimson Text"] { font-family: 'Crimson Text', serif; }
[data-font="EB Garamond"], [data-menu-font="EB Garamond"] { font-family: 'EB Garamond', serif; }
[data-font="Lora"], [data-menu-font="Lora"] { font-family: 'Lora', serif; }
[data-font="Merriweather"], [data-menu-font="Merriweather"] { font-family: 'Merriweather', serif; }
[data-font="Playfair Display"], [data-menu-font="Playfair Display"] { font-family: 'Playfair Display', serif; }
[data-font="DM Sans"], [data-menu-font="DM Sans"] { font-family: 'DM Sans', sans-serif; }
[data-font="Geist"], [data-menu-font="Geist"] { font-family: 'Geist', sans-serif; }
[data-font="IBM Plex Sans Condensed"], [data-menu-font="IBM Plex Sans Condensed"] { font-family: 'IBM Plex Sans Condensed', sans-serif; }
[data-font="Inter"], [data-menu-font="Inter"] { font-family: 'Inter', sans-serif; }
[data-font="Inter Tight"], [data-menu-font="Inter Tight"] { font-family: 'Inter Tight', sans-serif; }
[data-font="Lato"], [data-menu-font="Lato"] { font-family: 'Lato', sans-serif; }
[data-font="Manrope"], [data-menu-font="Manrope"] { font-family: 'Manrope', sans-serif; }
[data-font="Montserrat"], [data-menu-font="Montserrat"] { font-family: 'Montserrat', sans-serif; }
[data-font="Open Sans"], [data-menu-font="Open Sans"] { font-family: 'Open Sans', sans-serif; }
[data-font="Plus Jakarta Sans"], [data-menu-font="Plus Jakarta Sans"] { font-family: 'Plus Jakarta Sans', sans-serif; }
[data-font="Poppins"], [data-menu-font="Poppins"] { font-family: 'Poppins', sans-serif; }
[data-font="Raleway"], [data-menu-font="Raleway"] { font-family: 'Raleway', sans-serif; }
[data-font="Roboto"], [data-menu-font="Roboto"] { font-family: 'Roboto', sans-serif; }
[data-font="Roboto Flex"], [data-menu-font="Roboto Flex"] { font-family: 'Roboto Flex', sans-serif; }
[data-font="Source Sans 3"], [data-menu-font="Source Sans 3"] { font-family: 'Source Sans 3', sans-serif; }
[data-font="Space Grotesk"], [data-menu-font="Space Grotesk"] { font-family: 'Space Grotesk', sans-serif; }
[data-font="Work Sans"], [data-menu-font="Work Sans"] { font-family: 'Work Sans', sans-serif; }

/* === Filter Switcher === */
.filter-switcher{ position:relative; }
.filter-select{ 
  display:flex; align-items:center; gap:.3rem; 
  padding:0 .5rem; 
  height:2.2rem;
  border:1px solid var(--theme-border-primary); 
  background:var(--theme-bg-panel); 
  border-radius:.4rem; 
  cursor:pointer; 
  font-size:.95rem;
  min-width:auto;
  transition: all 0.2s ease;
  color:var(--theme-text-primary);
}
.filter-select:hover{ background:var(--theme-bg-hover); }
.filter-select.active{
  background:var(--theme-bg-active);
  border-color:var(--theme-accent-action);
}
.filter-select.active svg{
  stroke:var(--theme-accent-action);
}
.filter-dropdown{ 
  position:absolute; 
  top:100%; 
  right:0; 
  margin-top:.3rem; 
  background:var(--theme-bg-panel); 
  border:1px solid var(--theme-border-primary); 
  border-radius:.4rem; 
  box-shadow:var(--theme-shadow-md); 
  min-width:180px; 
  width:auto;
  display:none; 
  z-index:1000;
}
.filter-dropdown.show{ display:block; }
.filter-option{ 
  display:flex; 
  align-items:center; 
  gap:.5rem; 
  padding:.6rem .8rem; 
  cursor:pointer;
  font-size:.95rem;
  user-select:none;
  white-space:nowrap;
}
.filter-option:hover{ background:var(--theme-bg-hover); }
.filter-option.active{ background:var(--theme-bg-active); }
.filter-option input[type="checkbox"]{ 
  cursor:pointer; 
  margin:0;
  width:16px;
  height:16px;
  flex-shrink:0;
}
.filter-option-all{
  font-weight:600;
  border-bottom:1px solid var(--color-border-dashed);
  padding-bottom:.7rem;
  margin-bottom:.3rem;
}
.filter-divider{
  height:1px;
  background:var(--color-border-dashed);
  margin:.3rem 0;
}

.lang-dropdown{ 
  position:absolute; 
  top:100%; 
  left:0; 
  margin-top:.3rem;
  background:var(--theme-bg-panel); 
  border:1px solid var(--theme-border-primary); 
  border-radius:.4rem; 
  box-shadow:var(--theme-shadow-md);
  min-width:140px;
  display:none;
  z-index:1000;
}
.lang-dropdown.show{ display:block; }
.lang-option{ 
  display:flex; 
  align-items:center; 
  gap:.5rem; 
  padding:.6rem .8rem; 
  cursor:pointer;
  font-size:.95rem;
}
.lang-option:hover{ background:var(--theme-bg-hover); }
.lang-option.active{ background:var(--theme-bg-active); font-weight:600; }

/* === Scale Tooltip === */
.scale-tooltip{ position:fixed; z-index:9999; background:var(--theme-bg-panel); border:1px solid var(--theme-border-primary); border-radius:.6rem; padding:.8rem 1rem; box-shadow:var(--theme-shadow-md); max-width:280px; pointer-events:none; opacity:0; transition:opacity .2s; color:var(--theme-text-primary); }
.scale-tooltip.show{ opacity:1; }
.scale-tooltip-title{ font-weight:600; font-size:1.05rem; margin-bottom:.4rem; display:flex; align-items:center; gap:.4rem; }
.scale-tooltip-desc{ font-size:.9rem; color:var(--theme-text-secondary); line-height:1.4; }

/* === Page Width Tweaks === */
:root{ --maxw: 820px; }
/* Intro card uses full maxw, same as categories */
.intro-card{ max-width: var(--maxw); }

/* Callout text uses theme variables */
.intro-callout,
.callout{ color:var(--theme-text-primary) !important; }


/* === Comfortable Paragraph Spacing === */
.intro-card p{ margin: .6rem 0; font-size: calc(var(--fs) + 1pt); }
.intro-card p + p{ margin-top: .95rem; }
.intro-card ul, .intro-card li{ font-size: calc(var(--fs) + 1pt); }
.scale-intro .body p{ margin: .55rem 0; font-size: calc(var(--fs) + 1pt); }
.scale-intro .body p + p{ margin-top: .7rem; }

/* === Font Size Variations === */
body { --fs: 17px; }
body.font-large { --fs: 18px; }
body.font-xlarge { --fs: 19px; }

/* Text size scaling for content elements */
body .intro-card p,
body .intro-card ul,
body .intro-card li,
body .desc-cell,
body .title-cell,
body .scale-intro .body p,
body .cat-intro,
body .cat-intro p,
body .feedback-title,
body .feedback-helptext,
body .category-feedback-textarea,
body .open-profile label,
body .open-profile input,
body .open-profile textarea,
body .item-comment,
body .outro-content,
body .outro-content p,
body .menu-title,
body .menu-item-label,
body .menu-subitem,
body .page-header h1{ font-size: calc(var(--fs) + 2pt); }

body .focus-question-description{ font-size: var(--fs); }


body.font-large .intro-card p,
body.font-large .intro-card ul,
body.font-large .intro-card li,
body.font-large .desc-cell,
body.font-large .title-cell,
body.font-large .scale-intro .body p,
body.font-large .cat-intro,
body.font-large .cat-intro p,
body.font-large .feedback-title,
body.font-large .feedback-helptext,
body.font-large .category-feedback-textarea,
body.font-large .open-profile label,
body.font-large .open-profile input,
body.font-large .open-profile textarea,
body.font-large .item-comment,
body.font-large .outro-content,
body.font-large .outro-content p,
body.font-large .menu-title,
body.font-large .menu-item-label,
body.font-large .menu-subitem,
body.font-large .page-header h1,
body.font-large .focus-category-badge,
body.font-large .focus-badge-category,
body.font-large .focus-badge-counter{ font-size: calc(var(--fs) + 5pt); }
body.font-large .focus-question-description{ font-size: calc(var(--fs) + 1pt); }
body.font-large .focus-question-title{ font-size: calc(var(--fs) + 15pt); }

body.font-xlarge .intro-card p,
body.font-xlarge .intro-card ul,
body.font-xlarge .intro-card li,
body.font-xlarge .desc-cell,
body.font-xlarge .title-cell,
body.font-xlarge .scale-intro .body p,
body.font-xlarge .cat-intro,
body.font-xlarge .cat-intro p,
body.font-xlarge .feedback-title,
body.font-xlarge .feedback-helptext,
body.font-xlarge .category-feedback-textarea,
body.font-xlarge .open-profile label,
body.font-xlarge .open-profile input,
body.font-xlarge .open-profile textarea,
body.font-xlarge .item-comment,
body.font-xlarge .outro-content,
body.font-xlarge .outro-content p,
body.font-xlarge .menu-title,
body.font-xlarge .menu-item-label,
body.font-xlarge .menu-subitem,
body.font-xlarge .page-header h1,
body.font-xlarge .focus-category-badge,
body.font-xlarge .focus-badge-category,
body.font-xlarge .focus-badge-counter{ font-size: calc(var(--fs) + 7pt); }
body.font-xlarge .focus-question-description{ font-size: calc(var(--fs) + 2pt); }
body.font-xlarge .focus-question-title{ font-size: calc(var(--fs) + 18pt); }

/* Font/fontfamily/filter dropdowns now use theme variables - work for all themes */


body { padding-top: calc(var(--topbar-h) + env(safe-area-inset-top)); }

/* === Bottom Navigation === */
.bottom-nav .nav-btn:hover{
  background:var(--theme-bg-hover);
}

.catalog-list li{ border-bottom:1px dashed var(--theme-border-secondary); }
.catalog-list .meta{ color:var(--theme-text-secondary); }
.catalog-list .category-name{ color:var(--theme-text-primary); }    

/* === Open-Text Profile Field === */
.open-profile .helptext{ color:var(--theme-text-secondary); margin:.2rem 0 .4rem; font-size:.95rem; }

/* === Category Feedback Field === */
.feedback-title{
  font-weight:600; 
  font-size: calc(var(--fs) + 2pt);
  margin-bottom:.4rem;
  text-align:left;
  color:var(--theme-text-title);
}
.feedback-helptext{
  color:var(--theme-text-secondary);
  font-size:.95rem;
  line-height:1.35;
  margin-bottom:.6rem;
  text-align:left;
}

.category-feedback-textarea{
  width:100%;
  resize:vertical;
  border:1px solid var(--theme-border-primary);
  border-radius:.4rem;
  padding:.55rem .65rem;
  font-family:var(--font);
  font-size:1rem;
  line-height:1.35;
  background:var(--theme-bg-panel);
  color:var(--theme-text-primary);
}
.category-feedback-textarea::placeholder{
  color:var(--theme-text-secondary); /* Brighter for readability */
}
.open-profile textarea{
  width:100%; resize:vertical;
  border:1px solid var(--theme-border-primary); border-radius:.4rem; padding:.55rem .65rem;
  font-family:var(--font); font-size:1rem; line-height:1.35; background:var(--theme-bg-panel); color:var(--theme-text-primary);
}

.open-profile{ max-width: calc(var(--maxw) * .70); margin: .5rem auto 1.25rem auto; }
.open-profile .open-field{ display:flex; gap:.6rem; align-items:center; }
.open-profile label{ font-weight:700; min-width:72px; }
.open-profile input[type="text"],
.open-field input[type="text"]{
  flex:1 1 auto; width:100%;
  border:1px solid var(--theme-border-primary); border-radius:.4rem; padding:.45rem .6rem;
  font-family:var(--font); font-size:1rem;
  background:var(--theme-bg-panel); color:var(--theme-text-primary);
}
.open-field input::placeholder{
  color:var(--theme-text-muted);
}

/* === Open Text Question Input === */
.open-text-input{
  width: 100%;
  max-width: 100%; /* Constrain to parent */
  padding: 0.5rem 0.4rem;
  border: 1px solid var(--theme-border-primary);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: var(--fs);
  background: var(--theme-bg-panel);
  color: var(--theme-text-primary);
  box-sizing: border-box; /* Include padding in width */
}
.open-text-input::placeholder{
  color: var(--theme-text-muted);
}

.json-fallback{max-width:var(--maxw); margin:.25rem auto 0 auto; color:var(--theme-text-secondary);}
.file-btn{border:1px solid var(--theme-border-primary); background:var(--theme-bg-panel); border-radius:.4rem; padding:.4rem .65rem; cursor:pointer; display:inline-block; font-family:var(--font); color:var(--theme-text-primary);}

/* === Per-Item Comment Box === */
.item .comment-row td{ padding-top:.45rem; }
.item-comment{
  width:100%;
  border:1px solid var(--theme-border-primary);
  border-radius:.4rem;
  padding:.45rem .6rem;
  font-family:var(--font);
  font-size:1rem;
  line-height:1.25;
  background:var(--theme-bg-panel); color:var(--theme-text-primary);
}
.item-comment::placeholder{ color:var(--theme-text-muted); }

/* === Matrix View === */
.matrix-sticky-col{ background:var(--theme-bg-primary); color:var(--theme-text-primary); }
.matrix-comment-input{ background:var(--theme-bg-primary); border-color:var(--theme-border-primary); color:var(--theme-text-primary); }
.matrix-comment-input::placeholder{ color:var(--theme-text-muted); }

/* === Category Intro === */
.cat-intro{
  background:var(--theme-bg-secondary);
  border:1px solid var(--theme-border-secondary);
  border-radius:var(--radius-lg);
  padding:1rem 1.25rem;
  box-shadow:var(--theme-shadow-lg);
  max-width: var(--scale-w);
  margin: 2rem auto;
  text-align: center;
  font-style: italic;
  color:var(--theme-text-secondary);
  line-height:1.35;
  white-space: pre-line;
}

/* === Perspective Selection === */
.perspective-selector{
  max-width: var(--maxw);
  margin: 1.5rem auto;
  padding: 0 1.5rem; /* Match intro-card and category padding */
  /* Removed: border, background - keep it clean like intro text */
}
.perspective-selector h3{
  margin: 0 0 .5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
}
.perspective-selector .helptext{
  font-size: .95rem;
  color: var(--theme-text-secondary);
  margin-bottom: 1rem;
}
.perspective-options{
  display: flex;
  gap: 1rem;
  margin-bottom: .5rem;
}
.perspective-option{
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
  background: var(--theme-bg-panel);
  border: 2px solid var(--theme-border-primary);
  border-radius: .5rem;
  cursor: pointer;
  transition: all .2s;
  color: var(--theme-text-primary);
}
.perspective-option:hover{
  border-color: var(--theme-border-hover);
}
.perspective-option input[type="radio"]{
  width: 1.2rem;
  height: 1.2rem;
  cursor: pointer;
  flex-shrink: 0;
  background: var(--theme-input-radio-bg);
}
.perspective-option input[type="checkbox"]{
  width: 1.2rem;
  height: 1.2rem;
  cursor: pointer;
  flex-shrink: 0;
  background: var(--theme-input-checkbox-bg);
}
.perspective-option label{
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.perspective-subtitle{
  font-size: calc(var(--fs) + 1pt);
  color: var(--theme-text-secondary);
  margin-bottom: 1.5rem;
  font-style: italic;
}

/* End page / Outro styling */
.end-page .outro-content{
  margin-bottom: 2rem;
}
.outro-content h2{
  font-size: calc(var(--fs) + 4pt);
  margin-bottom: 1rem;
  text-align: center;
}
.outro-lead{
  font-size: calc(var(--fs) + 1pt);
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--theme-text-primary);
}
.outro-content ul{
  margin: 1rem 0;
  padding-left: 1.5rem;
}
.outro-content li{
  margin: .5rem 0;
}
.outro-closing{
  font-size: calc(var(--fs) + 1pt);
  font-weight: 600;
  margin-top: 1.5rem;
  text-align: center;
  color: var(--theme-accent-dominant);
}

.end-page-actions{
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}
.action-btn{
  flex: 1;
  min-width: 200px;
  max-width: 300px;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  border-radius: .5rem;
  cursor: pointer;
  transition: all .2s;
}
.action-btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.save-btn{
  background: var(--theme-accent-dominant);
  color: white;
}
.save-btn:hover{
  opacity: 0.9;
}
.share-btn{
  background: var(--theme-accent-success);
  color: white;
}
.share-btn:hover{
  opacity: 0.9;
}

.perspective-option.selected{
  border-color: var(--theme-accent-dominant);
  background: var(--theme-bg-active);
}
.perspective-required{
  font-size: .9rem;
  color: var(--color-error);
  margin-top: .5rem;
  display: none;
}
.perspective-required.show{
  display: block;
}
.action-btn-subtle{
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font);
  border: 2px solid var(--theme-border-primary);
  border-radius: 0.75rem;
  background: var(--theme-bg-panel);
  color: var(--theme-text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  min-width: 160px;
  flex: 1;
  max-width: 280px;
}
.action-btn-subtle:hover{
  border-color: var(--theme-border-hover);
  background: var(--theme-bg-hover);
}

/* === Perspective Badge on Items === */
.perspective-badge{
  display: inline-block;
  padding: .25rem .75rem;
  border-radius: 1rem;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .5rem;
}
.perspective-dominant{
  background: var(--theme-bg-secondary);
  color: var(--theme-accent-dominant);
  border: 1px solid var(--theme-border-primary);
}
.perspective-submissive{
  background: var(--theme-bg-secondary);
  color: var(--theme-accent-submissive);
  border: 1px solid var(--theme-border-primary);
}
.perspective-shared{
  background: var(--theme-bg-secondary);
  color: var(--theme-text-secondary);
  border: 1px solid var(--theme-border-primary);
}

/* === Inline Navigation === */
.inline-nav{
  max-width: var(--scale-w);
  margin: 1.25rem auto 0 auto;
  display:flex; justify-content:space-between; gap:.8rem;
}
.inline-nav .nav-btn{
  min-width:120px; height:2.4rem;
  border:1px solid var(--theme-border-primary); background:var(--theme-bg-panel); border-radius:.65rem;
  font-size:1.15rem; cursor:pointer; display:flex; align-items:center; justify-content:center;
  box-shadow:var(--theme-shadow-lg); padding:0 1.1rem;
  font-family:var(--font);
  font-weight:400;
  color:var(--theme-text-primary);
}
.inline-nav .nav-btn[disabled]{ opacity:.5; cursor:not-allowed; }

/* === Perspective Toggle === */
.cat-intro-container{ 
  margin-bottom: 1.5rem;
  border:1px solid var(--theme-border-primary);
  border-radius:.5rem;
  padding:1rem 1.2rem;
  background:var(--theme-bg-secondary);
}
.perspective-toggle{
  display:flex; gap:.5rem; margin-bottom:1rem; justify-content:center;
}
.perspective-btn{
  padding:.5rem 1.2rem; border:1px solid var(--theme-border-primary); background:var(--theme-bg-panel);
  border-radius:.5rem; cursor:pointer; font-family:var(--font);
  font-size:.95rem; transition:all .2s ease;
  color:var(--theme-text-primary);
}
.perspective-btn:hover{ background:var(--theme-bg-hover); }
.perspective-btn.active{
  background:var(--color-love); border-color:var(--color-love); color:#fff; font-weight:600;
}

/* Hide inactive perspectives in toggle mode */
.cat-intro-container .cat-intro{ display:none; }
.cat-intro-container .cat-intro.active{ display:block; }

/* Show single perspective intros (without toggle) - only overrides */
.category > .cat-intro{
  display:block;
  margin-bottom:1.5rem;
  font-size:var(--fs);
  line-height:1.5;
  font-style:normal;
}

/* Category intro content styling */
.cat-intro h2{ 
  font-size:calc(var(--fs) + 3pt); 
  margin:0 0 .8rem 0; 
  font-weight:700; 
  text-align:center;
  font-style:normal;
}
.cat-intro .cat-intro-header{ 
  font-size:calc(var(--fs) + 4pt); 
  font-weight:600; 
  margin-bottom:.8rem; 
  color:var(--theme-text-primary);
  font-style:normal;
}
.cat-intro p{ 
  margin:.6rem 0; 
  font-size:var(--fs);
  color: var(--theme-text-primary);
  font-style:normal;
}
.cat-intro .intro-text{ 
  font-size:calc(var(--fs) + 3pt);
  line-height:1.5;
}
.cat-intro em{ 
  font-style:normal; 
  font-weight:600; 
}
.cat-intro .intro-tip{ 
  background:var(--theme-bg-active); 
  border-left:3px solid var(--theme-accent-action); 
  padding:.7rem .9rem; 
  margin-top:1rem; 
  border-radius:.4rem;
  font-size:var(--fs);
  font-style:normal;
}
.cat-intro .intro-lead{ color:var(--theme-text-primary); }

/* === Pulse Animation for Perspective Selector === */
@keyframes pulse {
  0%, 100% { 
    transform: scale(1); 
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
  }
  50% { 
    transform: scale(1.02); 
    box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);
  }
}

/* === Intro Pagination === */
.intro-paginated {
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.intro-page-content {
  flex: 1;
  padding: 0.5rem 0;
  min-height: 300px;
}

.intro-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0 1rem 0;
  margin-top: auto;
  border-top: 1px solid var(--theme-border-secondary);
}

.intro-nav-btn {
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--theme-border-primary);
  background: var(--theme-bg-panel);
  border-radius: 0.5rem;
  cursor: pointer;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s;
  min-width: 100px;
  color: var(--theme-text-primary);
}

.intro-nav-btn:hover:not(:disabled) {
  background: var(--theme-bg-hover);
  transform: translateY(-1px);
}

.intro-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.intro-page-indicator {
  font-size: 0.9rem;
  color: var(--theme-text-secondary);
  font-weight: 500;
  text-align: center;
  min-width: 60px;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .intro-nav-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
    min-width: 80px;
  }
  
  .intro-page-indicator {
    font-size: 0.85rem;
  }
}

/* === Comparison View === */
.comparison-view {
  padding-top: calc(var(--topbar-h) + 1rem);
}

.comparison-view table {
  background: var(--theme-bg-primary);
  color: var(--theme-text-primary);
}

.comparison-view tr:hover {
  background: var(--theme-bg-hover);
}

/* === Swipe View === */
.swipe-container {
  position: relative;
  height: calc(100vh - var(--topbar-h) - var(--bar-h));
  overflow: hidden;
  background: var(--theme-bg-primary);
}

.swipe-track {
  display: flex;
  width: 300%;
  height: 100%;
  transform: translateX(-33.333%);
  transition: transform 0.1s ease-out;
}

.swipe-card {
  width: 33.333%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 0.5rem calc(var(--bar-h) + 1rem) 0.5rem;
}

/* Prevent unnecessary scrolling when content fits */
.swipe-card::-webkit-scrollbar {
  width: 0px;
  background: transparent;
}

.swipe-content {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
  min-height: min-content;
}

/* Swipe arrows (desktop only) */
.swipe-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--theme-bg-panel);
  border: 1px solid var(--theme-border-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s;
  box-shadow: var(--theme-shadow-sm);
}

.swipe-arrow:hover:not(:disabled) {
  background: var(--theme-bg-hover);
  box-shadow: var(--theme-shadow-md);
  transform: translateY(-50%) scale(1.05);
}

.swipe-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.swipe-arrow-left {
  left: 1.5rem;
}

.swipe-arrow-right {
  right: 1.5rem;
}

.swipe-arrow svg {
  width: 24px;
  height: 24px;
  stroke: var(--theme-text-primary);
}

/* Hide arrows on mobile */
@media (max-width: 768px) {
  .swipe-arrow {
    display: none;
  }
}

/* Intro card */
.swipe-intro {
  max-width: 600px;
}

.swipe-intro-title {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--theme-text-primary);
  font-weight: 600;
  text-align: center;
}

.swipe-intro-body {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--theme-text-secondary);
  text-align: left;
}

.swipe-intro-body h1,
.swipe-intro-body h2,
.swipe-intro-body h3 {
  text-align: center;
}

.swipe-intro-body p {
  margin-bottom: 1rem;
  text-align: left;
}

/* Perspective selector */
.swipe-perspective {
  max-width: 500px;
}

.swipe-perspective-title {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--theme-text-primary);
  font-weight: 600;
}

.swipe-perspective-desc {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--theme-text-secondary);
}

.swipe-perspective-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Category intro */
.swipe-category-intro {
  max-width: 650px;
}

.swipe-category-title {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--theme-text-primary);
  font-weight: 600;
  text-align: center;
}

.swipe-category-intro-text {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--theme-text-secondary);
  white-space: pre-wrap;
  text-align: left;
}

/* Question card */
.swipe-question {
  max-width: var(--maxw);
  width: 100%;
  text-align: left;
}

/* Category title in question card */
.swipe-category-title-label {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--theme-text-secondary);
  margin-bottom: 0.5rem;
  text-align: center;
}

/* Perspective badge in question card (matches category view) */
.swipe-perspective-badge {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Old category label - keep for backwards compatibility */
.swipe-category-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--theme-text-secondary);
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
  display: block;
}

/* Outro card */
.swipe-outro {
  max-width: 600px;
}

.swipe-outro-title {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--theme-text-primary);
  font-weight: 600;
}

.swipe-outro-body {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--theme-text-secondary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .swipe-card {
    padding: 1.5rem 1rem;
  }
  
  .swipe-intro-title,
  .swipe-category-title,
  .swipe-outro-title {
    font-size: 2rem;
  }
}

/* Comparison view legacy selectors removed - uses theme variables */

/* Hide compare view on mobile */
@media (max-width: 768px) {
  .view-option[data-view="compare"] {
    display: none;
  }
}

/* ============================================
   NEW BOTTOM BAR & MENU PANEL (v011.021)
   ============================================ */

/* Remove top padding since topbar is gone */
body {
  padding-top: 0 !important;
}

/* New Bottom Bar - Solid, Mobile-App Style */
.bottom-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: env(safe-area-inset-bottom);
  max-width: var(--scale-w); /* Match step-by-step item width (490px) */
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  background: var(--theme-bg-panel);
  border-top: 1px solid var(--theme-border-primary);
  box-shadow: var(--theme-shadow-lg);
  z-index: 110;
  padding-bottom: env(safe-area-inset-bottom);
  font-family: var(--font);
}

/* On mobile, full width */
@media (max-width: 980px) {
  .bottom-bar {
    left: 0;
    right: 0;
    transform: none;
    max-width: none;
  }
}

.bottom-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem; /* Increased from 0.25rem for more breathing room between icon and label */
  flex: 1;
  padding: 0.5rem;
  border: none;
  background: transparent;
  color: var(--theme-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font);
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.bottom-btn:hover {
  color: var(--theme-text-primary);
  background: var(--theme-bg-hover);
}

.bottom-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Highlighted state when scrolled to bottom */
.bottom-btn.highlighted {
  color: var(--theme-text-primary);
  background: var(--theme-bg-active);
  font-weight: 600;
}

/* Floating progress indicator above bottom bar */
.floating-progress {
  position: fixed;
  bottom: var(--bar-h); /* Directly above bottom bar */
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.floating-progress-bar {
  width: 120px;
  height: 2px;
  background: var(--theme-border-primary);
  border-radius: 1px;
  overflow: hidden;
  position: relative;
}

.floating-progress-bar::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--theme-accent-action);
  border-radius: 1px;
  transition: width 0.3s ease;
  width: var(--progress-width, 0%);
}

.floating-progress-text {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--theme-text-secondary); /* Brighter than muted for readability */
  white-space: nowrap;
  padding: 2px 8px;
  background: var(--theme-bg-primary);
  border-radius: 3px;
  opacity: 0.95;
}

.bottom-btn-icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  pointer-events: none; /* Let touch events pass through to button */
}

.bottom-btn-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  text-transform: capitalize;
  font-family: var(--font);
  color: inherit;
}

/* Menu Overlay */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Menu Panel - Slides up from bottom */
.menu-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 80vh;
  background: var(--theme-bg-panel);
  border-radius: 1rem 1rem 0 0;
  box-shadow: var(--theme-shadow-lg);
  z-index: 1600;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
}

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

.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--theme-border-secondary);
}

.menu-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: var(--theme-text-primary);
}

.menu-close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 2rem;
  line-height: 1;
  color: var(--theme-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.menu-close:hover {
  background: var(--theme-bg-hover);
  color: var(--theme-text-primary);
}

.menu-content {
  overflow-y: auto;
  padding: 0.5rem 0 1rem 0;
}

/* Menu Item */
.menu-item {
  border-bottom: 1px solid var(--theme-border-secondary);
}

.menu-item-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: background 0.2s;
}

.menu-item-main:hover {
  background: var(--theme-bg-hover);
}

.menu-item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  color: var(--theme-text-secondary);
}

.menu-item-label {
  flex: 1;
  font-size: 1rem;
  font-weight: 500;
  color: var(--theme-text-primary);
}

.menu-item-arrow {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: var(--theme-text-muted);
  fill: none;
  stroke-width: 2;
  transition: transform 0.2s;
}

.menu-item.expanded .menu-item-arrow {
  transform: rotate(180deg);
}

/* Menu Sub-items */
.menu-subitems {
  display: none;
  background: var(--theme-bg-secondary);
  padding: 0.5rem 0;
  max-height: 250px; /* ~5 items at 50px each */
  overflow-y: auto;
  overflow-x: hidden;
}

.menu-item.expanded .menu-subitems {
  display: block;
}

/* Toggle Switch */
.menu-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.menu-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.menu-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--theme-border);
  transition: 0.3s;
  border-radius: 26px;
}

.menu-toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.menu-toggle input:checked + .menu-toggle-slider {
  background-color: var(--theme-accent-action);
}

.menu-toggle input:checked + .menu-toggle-slider:before {
  transform: translateX(24px);
}

/* Scrollbar styling for sub-items */
.menu-subitems::-webkit-scrollbar {
  width: 6px;
}

.menu-subitems::-webkit-scrollbar-track {
  background: #e5e7eb;
  border-radius: 3px;
}

.menu-subitems::-webkit-scrollbar-thumb {
  background: #9ca3af;
  border-radius: 3px;
}

.menu-subitems::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

.menu-subitem {
  padding: 0.75rem 1.25rem 0.75rem 1.25rem;
  font-size: 0.95rem;
  color: var(--theme-text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.menu-subitem:hover {
  background: var(--theme-bg-hover);
  color: var(--theme-text-primary);
}

.menu-subitem.active {
  color: var(--theme-accent-action);
  font-weight: 600;
  background: var(--theme-bg-active);
}

/* Menu subitem icon (for View Mode and Text Size) */
.menu-subitem-icon {
  width: 18px;
  height: 18px;
  margin-right: 0.75rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

/* Menu checkbox styling */
.menu-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.menu-checkbox input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}

/* Filter emoticon (before checkbox) */
.filter-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-right: 0.25rem;
}

/* Theme default badge - only show inside menu */
.bottom-menu .theme-default-badge {
  font-size: 0.9rem;
  margin-left: 0.5rem;
  opacity: 0.8;
}

/* Theme notification toast */
.theme-notification {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--theme-bg-panel);
  color: var(--theme-text-primary);
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--theme-border-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  font-size: 0.95rem;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.theme-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Menu Checkbox Items */
.menu-checkbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.menu-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Menu Divider */
.menu-divider {
  height: 1px;
  background: var(--color-gray-200);
  margin: 0.5rem 0;
}

/* Menu Help Text */
.menu-help-text {
  padding: 0.5rem 1.25rem 0.5rem 3.25rem;
  font-size: 0.8rem;
  color: var(--theme-text-muted);
  font-style: italic;
  user-select: none;
}

/* Adjust main content padding for new bottom bar */
#app {
  padding-bottom: 80px; /* Space for bottom bar */
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .bottom-btn-label {
    font-size: 0.75rem;  /* Same size on mobile for consistency */
  }
  
  .bottom-btn-icon {
    width: 22px;
    height: 22px;
  }
}

/* === Comparison View === */
.comparison-view {
  max-width: 100%;
  margin: 0 auto;
}

.comparison-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.5rem 0;
  background: var(--theme-bg-primary);
}

.comparison-table-wrapper {
  overflow-x: auto;
  max-width: 100%;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.comparison-table-header {
  background: var(--theme-bg-secondary);
  color: var(--theme-text-primary);
  position: sticky;
  top: 0;
  z-index: 90;
}

.comparison-category-row {
  background: var(--theme-bg-secondary);
  border-bottom: 2px solid var(--theme-border-primary);
}

.comparison-category-row td {
  background: var(--theme-bg-secondary);
  font-weight: 700;
  white-space: normal;
  word-wrap: break-word;
  color: var(--theme-text-primary);
}

.comparison-category-cell {
  background: var(--theme-bg-secondary) !important;
  color: var(--theme-text-title) !important;
  font-style: italic;
}

.comparison-question-row {
  border-bottom: 1px solid var(--theme-border-secondary);
}

.comparison-question-row:hover {
  background: var(--theme-bg-hover);
}

.comparison-question-cell,
.comparison-answer-cell,
.comparison-match-cell {
  color: var(--theme-text-primary);
}

/* Comparison View - Updated to use theme variables */
.comparison-column-headers {
  background: var(--theme-bg-secondary);
  color: var(--theme-text-primary);
}

.current-category-indicator {
  background: var(--theme-bg-secondary);
  border-bottom: 2px solid var(--theme-border-primary);
  font-style: italic;
  color: var(--theme-text-title);
}

.comparison-load-btn {
  background: var(--theme-bg-panel);
  border-color: var(--theme-border-primary);
  color: var(--theme-text-primary);
}

.comparison-load-btn:hover {
  background: var(--theme-bg-hover);
}

/* === Keyboard Shortcuts Help === */
.shortcuts-modal .modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--theme-bg-panel);
  border: 1px solid var(--theme-border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--theme-shadow-lg);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow: auto;
  z-index: 1001;
}

.shortcuts-modal .modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

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

.shortcuts-modal .modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
}

.shortcuts-modal .modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-muted);
  border-radius: var(--radius-md);
  transition: background-color 0.2s ease;
}

.shortcuts-modal .modal-close:hover {
  background: var(--color-hover);
  color: var(--color-text);
}

.shortcuts-modal .modal-body {
  padding: 1.25rem;
}

.shortcuts-help h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
}

.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.shortcuts-table tr {
  border-bottom: 1px solid var(--color-border-subtle);
}

.shortcuts-table tr:last-child {
  border-bottom: none;
}

.shortcuts-table td {
  padding: 0.75rem 0.5rem;
  vertical-align: middle;
}

.shortcut-key {
  width: 120px;
  font-weight: 500;
}

.shortcut-key kbd {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--theme-text-primary);
  background: var(--theme-bg-secondary);
  border: 1px solid var(--theme-border-primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--theme-shadow-sm);
}

.shortcut-desc {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

.shortcuts-note {
  margin: 1rem 0 0 0;
  padding: 0.75rem;
  background: var(--color-bg-alt);
  border-left: 3px solid var(--color-accent-blue);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* === Focus-Question Mode === */
.focus-question-container {
  position: relative;
  overflow: hidden;
  min-height: 60vh;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem;
}

.category.focus-mode {
  max-width: var(--scale-w);
  margin: 0 auto;
  padding: 0;
  padding-bottom: 180px;
  min-height: 60vh;
}

.focus-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  color: var(--theme-text-secondary);
  background: var(--theme-bg-secondary);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  margin-left: 0;
  max-width: 100%;
  font-weight: 600;
  border: 1px solid var(--theme-border-primary);
}

.focus-badge-category {
  flex: 1;
}

.focus-badge-counter {
  font-size: 0.75rem;
  color: var(--theme-text-secondary);
  font-weight: 600;
  opacity: 0.8;
}

/* Perspective label in Focus View */
.focus-perspective-label {
  font-size: 1rem;
  font-weight: 600;
  margin: 0.5rem 0 1rem 0;
  text-align: left;
}

.focus-question-title {
  font-size: 2.2rem;
  line-height: 1.3;
  margin: 0.5rem 0 1rem 0;
  padding: 0;
  max-width: 100%;
  font-weight: 700;
  color: var(--theme-text-title);
}

.focus-question-description {
  font-size: var(--fs);
  line-height: 1.6;
  color: var(--theme-text-secondary);
  margin-bottom: 2rem;
  padding: 0;
  max-width: 100%;
}

/* Focus View: Open text input styling - taller with brighter placeholder */
.focus-scale-fixed .open-text-input {
  padding: 1rem 0.75rem; /* Increased padding for taller input */
  font-size: calc(var(--fs) + 1pt); /* Slightly larger text */
}

.focus-scale-fixed .open-text-input::placeholder {
  color: var(--theme-text-secondary); /* Brighter than default muted */
}

/* Fixed scale at bottom - stays in same position, full width (NO padding!) */
.focus-scale-fixed {
  position: fixed;
  bottom: calc(var(--bar-h) + 1.75rem); /* Closer to progress indicator (~30% reduction) */
  left: 0;
  width: 100%;
  z-index: 100;
  background: var(--theme-bg-primary); /* Solid background to prevent text showing through */
  padding: 0.5rem 0; /* Reduced vertical padding (~30% reduction) */
  
  /* Subtle shadow to separate from content */
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
  margin: 0;
  display: flex;
  justify-content: center;
}

.focus-scale-fixed::before {
  content: "";
  position: absolute;
  top: -30px;
  left: 0;
  width: 100%;
  height: 30px;
  background: linear-gradient(to bottom, transparent, var(--theme-bg-primary));
  pointer-events: none;
  z-index: 99;
}

/* Fixed height for scale to prevent jumping */
.focus-scale-fixed .item {
  min-height: 70px; /* Reduced from 100px (~30% reduction) */
  margin: 0;
  width: 100%; /* Full width */
  max-width: 100%; /* No constraints! */
  padding: 0 1rem; /* 16px horizontal padding to align with text above */
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: transparent;
}

/* checkbox/radio/open-text questions need padding and spacing for alignment */
.focus-scale-fixed .item.checkbox-question,
.focus-scale-fixed .item.radio-question,
.focus-scale-fixed .item.open-text-question {
  padding: 0.5rem var(--pad) 1.25rem var(--pad); /* Extra bottom padding for progress indicator spacing */
  max-width: var(--scale-w); /* Constrain width like normal */
  margin: 0 auto; /* Center it */
  min-height: auto; /* Don't force 100px height for these */
}

/* Scale table in focus mode - constrain to item width */
.focus-scale-fixed .scale {
  margin: 0 auto; /* Center it */
  width: 100%; /* Full width of container */
  max-width: var(--scale-w); /* Match step-by-step item width (490px) */
  table-layout: fixed; /* Force full width usage */
}

/* Progress indicator - positioned below category badge on LEFT */
.category.focus-mode .focus-progress {
  position: static; /* Not fixed - flows with content */
  display: inline-block;
  margin: 0.5rem 0 1rem 0; /* Below badge, above title */
  font-size: 0.9rem;
  color: var(--theme-text-secondary); /* Increased contrast from muted */
  background: var(--theme-bg-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--theme-border-primary); /* Stronger border for contrast */
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  font-weight: 600; /* Bolder for readability */
}

/* Slide animations */
.focus-question-container[data-animation="slide-left"].animating > * {
  animation: slideOutLeft 0.3s ease-out forwards;
}

.focus-question-container[data-animation="slide-right"].animating > * {
  animation: slideOutRight 0.3s ease-out forwards;
}

@keyframes slideOutLeft {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(-30%);
    opacity: 0;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(30%);
    opacity: 0;
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-30%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(30%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Mobile responsive for Focus Mode */
@media (max-width: 768px) {
  .focus-question-title { font-size: 1.5rem; }
  .focus-question-description { font-size: 1rem; }
  .focus-scale-fixed { width: 100%; padding: 0.35rem 0; bottom: calc(var(--bar-h) + 1rem); }
  .category.focus-mode { padding-bottom: 200px; }
  .focus-question-container { padding: 0.5rem; }
  .intro-card { margin: 1rem auto; padding: 1rem; }
  .focus-container { padding: 1rem; }
  .perspective-selector { padding: 0 1rem; margin: 1rem auto; }
}
