/* CSS Design System for ICU Communication App */

/* 1. Global Reset & Variables */
:root {
  /* Dark Theme Colors (Default) */
  --bg-app: #0b0f19;
  --bg-surface: #131b2e;
  --bg-surface-hover: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: rgba(2, 132, 199, 0.15);
  
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: rgba(239, 68, 68, 0.15);
  
  --success: #10b981;
  --success-hover: #059669;
  --success-light: rgba(16, 185, 129, 0.15);

  --warning: #f59e0b;
  
  /* Category Colors (Dark Mode) */
  --cat-urgente: #7f1d1d;
  --cat-urgente-border: #ef4444;
  --cat-dolore: #78350f;
  --cat-dolore-border: #f59e0b;
  --cat-bisogni: #115e59;
  --cat-bisogni-border: #14b8a6;
  --cat-emozioni: #581c87;
  --cat-emozioni-border: #a855f7;
  --cat-persone: #831843;
  --cat-persone-border: #ec4899;
  --cat-tempo: #1e3a8a;
  --cat-tempo-border: #3b82f6;
  --cat-familiari: #881337;
  --cat-familiari-border: #f43f5e;
  --cat-medici: #064e3b;
  --cat-medici-border: #10b981;
  --cat-sino: #334155;
  --cat-sino-border: #64748b;
  
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Light Theme Variables */
body.light-theme {
  --bg-app: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-hover: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
  
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: rgba(2, 132, 199, 0.1);
  
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-light: rgba(220, 38, 38, 0.1);
  
  --success: #16a34a;
  --success-hover: #15803d;
  --success-light: rgba(22, 163, 74, 0.1);

  /* Category Colors (Light Mode - Pastel and calm) */
  --cat-urgente: #fee2e2;
  --cat-urgente-border: #f87171;
  --cat-dolore: #fef3c7;
  --cat-dolore-border: #fbbf24;
  --cat-bisogni: #ccfbf1;
  --cat-bisogni-border: #2dd4bf;
  --cat-emozioni: #f3e8ff;
  --cat-emozioni-border: #c084fc;
  --cat-persone: #fce7f3;
  --cat-persone-border: #f472b6;
  --cat-tempo: #dbeafe;
  --cat-tempo-border: #60a5fa;
  --cat-familiari: #ffe4e6;
  --cat-familiari-border: #fb7185;
  --cat-medici: #d1fae5;
  --cat-medici-border: #34d399;
  --cat-sino: #e2e8f0;
  --cat-sino-border: #94a3b8;
  
  --shadow-lg: 0 10px 20px -5px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  touch-action: manipulation; /* Disable double-tap zoom delay */
  user-select: none; /* Prevent browser text selection highlights during quick taps */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

/* 2. Composer Header (Always Visible Top) */
#composer-header {
  background-color: var(--bg-surface);
  border-bottom: 2px solid var(--border-color);
  padding: 12px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.composer-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* App brand (visible name in header) */
.app-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  line-height: 1;
}

.app-brand-name {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--primary);
}

.app-brand-name .brand-k {
  color: var(--text-main);
}

.app-brand-tagline {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

@media (max-width: 520px) {
  .app-brand-tagline { display: none; }
}

#composed-phrase-display {
  min-height: 70px;
  background-color: var(--bg-app);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 1.4;
  overflow-x: auto;
  white-space: nowrap;
  display: flex;
  align-items: center;
  color: var(--text-main);
  transition: all 0.2s ease;
}

#composed-phrase-display.empty-phrase {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 1.4rem;
  font-style: italic;
  border-style: dotted;
}

/* Word tokens style inside composer */
.phrase-token {
  display: inline-block;
  background: var(--primary-light);
  border: 1.5px solid var(--primary);
  color: var(--text-main);
  padding: 4px 12px;
  border-radius: 20px;
  margin-right: 8px;
  font-size: 1.5rem;
  animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.composer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.action-btn {
  flex: 1;
  min-width: 90px;
  height: 52px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ffffff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease, filter 0.2s ease;
}

.action-btn:active {
  transform: scale(0.96);
}

.action-btn .icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.speak-btn {
  background-color: var(--success);
  flex-grow: 2;
  font-size: 1.2rem;
}
.speak-btn:hover { background-color: var(--success-hover); }

.delete-btn {
  background-color: #64748b;
}
.delete-btn:hover { background-color: #475569; }

.clear-btn {
  background-color: var(--danger);
}
.clear-btn:hover { background-color: var(--danger-hover); }

.giant-btn {
  background-color: var(--primary);
}
.giant-btn:hover { background-color: var(--primary-hover); }

.favorite-btn {
  background-color: #ec4899;
}
.favorite-btn:hover { background-color: #db2777; }

/* 3. Main Content Panel (Screens Container) */
#main-content {
  flex: 1;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.screen-panel {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 16px 20px;
  overflow-y: auto;
  flex-direction: column;
}

.screen-panel.active {
  display: flex;
}

.screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  width: 100%;
}

.screen-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Screen Home: override overflow to allow two-column layout to manage their own scroll */
#screen-home {
  overflow: hidden;
}

/* Screen Categorie: overflow hidden so sidebar+grid each scroll independently */
#screen-categories {
  overflow: hidden;
}





/* Home: Quick Action Grid */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  width: 100%;
}

.quick-tile {
  min-height: 110px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-main);
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.quick-tile:active {
  transform: scale(0.96);
}

/* Glassmorphism accenting colors for quick tiles based on category styles */
.quick-tile.urgent {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: var(--danger);
  color: #fca5a5;
}
body.light-theme .quick-tile.urgent {
  background-color: #fee2e2;
  color: #991b1b;
}

.quick-tile.need {
  background-color: rgba(14, 165, 233, 0.1);
  border-color: var(--primary);
  color: #7dd3fc;
}
body.light-theme .quick-tile.need {
  background-color: #e0f2fe;
  color: #0369a1;
}

.quick-tile.emotions {
  background-color: rgba(168, 85, 247, 0.1);
  border-color: #a855f7;
  color: #d8b4fe;
}
body.light-theme .quick-tile.emotions {
  background-color: #f3e8ff;
  color: #6b21a8;
}

.quick-tile.check {
  background-color: rgba(71, 85, 105, 0.15);
  border-color: #64748b;
  color: #cbd5e1;
}
body.light-theme .quick-tile.check {
  background-color: #e2e8f0;
  color: #334155;
}

.quick-tile.people {
  background-color: rgba(236, 72, 153, 0.1);
  border-color: #ec4899;
  color: #fbcfe8;
}
body.light-theme .quick-tile.people {
  background-color: #fce7f3;
  color: #9d174d;
}

/* Action Tile Shortcut (e.g. Scrittura Libera) */
.quick-tile.action-shortcut-tile {
  background-color: rgba(16, 185, 129, 0.1);
  border-color: var(--success);
  color: #6ee7b7;
}
body.light-theme .quick-tile.action-shortcut-tile {
  background-color: #d1fae5;
  color: #065f46;
}

.tile-icon {
  font-size: 2.2rem;
}

.tile-text {
  line-height: 1.2;
}

/* Fatigue Toggle Switch */
.fatigue-toggle-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.switch-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #475569;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--danger);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--danger);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Fatigue Grid Layout (Ultra-simple, 8 giant buttons) */
.fatigue-grid-layout {
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: minmax(18vh, 1fr);
  gap: 20px;
}

.fatigue-tile {
  font-size: 2.2rem !important;
  font-weight: 800 !important;
  border-width: 4px !important;
  border-radius: 24px !important;
}

.fatigue-tile.ctrl-tile {
  background-color: rgba(245, 158, 11, 0.1) !important;
  border-color: var(--warning) !important;
  color: #fde68a !important;
}
body.light-theme .fatigue-tile.ctrl-tile {
  background-color: #fef3c7 !important;
  color: #92400e !important;
}

/* 5. Screen 2: Categorie Layout */
.categories-layout {
  display: flex;
  height: 100%;
  gap: 20px;
  overflow: hidden;
}

.categories-sidebar {
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 8px;
  border-right: 1.5px solid var(--border-color);
}

.category-tab-btn {
  min-height: 60px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  background-color: var(--bg-surface);
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.category-tab-btn:hover {
  background-color: var(--bg-surface-hover);
}

.category-tab-btn.active {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--text-main);
  transform: translateX(4px);
}

.category-words-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}




.words-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  grid-auto-rows: minmax(75px, max-content);
  gap: 12px;
  overflow-y: auto;
  padding-bottom: 20px;
  align-content: start;
}

.word-tile {
  min-height: 75px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.3;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease, border-color 0.2s, background-color 0.2s;
  position: relative;
}

.word-tile:active {
  transform: scale(0.96);
}

/* Tile Custom Delete Button */
.word-tile .delete-custom-word-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--danger);
  border: 2.5px solid var(--bg-app);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.4);
  z-index: 5;
}

.word-tile .delete-custom-word-btn:hover {
  background: var(--danger-hover);
}

/* Category Specific Tile Outlines in light/dark mode */
.word-tile.priority-urgente {
  border-color: var(--cat-urgente-border) !important;
  box-shadow: inset 0 0 10px rgba(239, 68, 68, 0.1);
}
.word-tile.priority-importante {
  border-color: var(--cat-dolore-border) !important;
}

/* 6. Screen 3: Tastiera virtuale */
.keyboard-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 15px;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.keyboard-display-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

#keyboard-input-preview {
  flex: 1;
  height: 64px;
  background-color: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 16px;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-main);
}

.kbd-action-btn {
  height: 64px;
  padding: 0 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease;
}

.kbd-action-btn:active {
  transform: scale(0.96);
}

.kbd-action-btn.append-btn {
  background-color: var(--primary);
  color: white;
}
.kbd-action-btn.append-btn:hover {
  background-color: var(--primary-hover);
}

.keyboard-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  flex: 1;
}

.kbd-key {
  border: 1.5px solid var(--border-color);
  background-color: var(--bg-surface);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 1.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease, background-color 0.1s;
}

.kbd-key:active {
  transform: scale(0.94);
  background-color: var(--bg-surface-hover);
}

.kbd-key.space-key {
  grid-column: span 2;
  background-color: var(--primary-light);
  border-color: var(--primary);
}
.kbd-key.space-key:active {
  background-color: var(--primary);
  color: white;
}

.kbd-key.ctrl-key {
  font-size: 1.1rem;
  font-weight: 800;
}

.kbd-key.backspace-key {
  background-color: rgba(245, 158, 11, 0.15);
  border-color: var(--warning);
  color: #fbbf24;
}
body.light-theme .kbd-key.backspace-key {
  background-color: #fef3c7;
  color: #d97706;
}

.kbd-key.clear-key {
  background-color: var(--danger-light);
  border-color: var(--danger);
  color: #f87171;
}
body.light-theme .kbd-key.clear-key {
  background-color: #fee2e2;
  color: #b91c1c;
}

/* 7. Screen 4: Lavagna (Canvas) */
.draw-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 16px;
}

/* Action Bar Superior */
.draw-action-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background-color: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.draw-action-btn {
  height: 52px;
  padding: 0 20px;
  border: 1.5px solid var(--border-color);
  background-color: var(--bg-app);
  color: var(--text-main);
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.draw-action-btn:active {
  transform: scale(0.96);
}

.draw-action-btn .icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.draw-action-btn.primary {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
.draw-action-btn.primary:active {
  background-color: var(--primary);
  color: white;
}

.draw-action-btn.danger {
  border-color: var(--danger);
  color: #f87171;
}
.draw-action-btn.danger:active {
  background-color: var(--danger);
  color: white;
}

.draw-action-btn.success {
  border-color: var(--success);
  color: #34d399;
}
.draw-action-btn.success:active {
  background-color: var(--success);
  color: white;
}

.draw-title-container {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 150px;
}

.draw-active-title-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  background-color: var(--bg-app);
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.draw-actions-right {
  display: flex;
  gap: 16px;
  margin-left: auto;
}

/* Workspace Panels */
.draw-workspace-container {
  flex: 1;
  position: relative;
  height: 100%;
  min-height: 0; /* fixes flex child scroll issues */
}

.draw-workspace-panel {
  display: none;
  width: 100%;
  height: 100%;
  gap: 16px;
}

.draw-workspace-panel.active {
  display: flex;
}

/* Left Sidebar Drawing Tools */
.draw-sidebar {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 16px;
  background-color: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow-y: auto;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* Tools tab selection (Pencil/Eraser) */
.tool-selector-tabs {
  display: flex;
  gap: 8px;
}

.tool-tab {
  flex: 1;
  height: 48px;
  border: 1.5px solid var(--border-color);
  background-color: var(--bg-app);
  color: var(--text-main);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.15s ease;
}

.tool-tab:active {
  transform: scale(0.95);
}

.tool-tab.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
}

.tool-tab .icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Stroke Thickness */
.stroke-selector-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stroke-btn-new {
  height: 40px;
  border: 1.5px solid var(--border-color);
  background-color: var(--bg-app);
  color: var(--text-main);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.stroke-btn-new:active {
  transform: scale(0.95);
}

.stroke-btn-new.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* 20 Color Palette Grid */
.draw-color-palette {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  background-color: var(--bg-app);
  padding: 8px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
}

.color-btn-new {
  aspect-ratio: 1;
  width: 100%;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.color-btn-new:active {
  transform: scale(0.85);
}

.color-btn-new.active {
  border-color: var(--text-main);
  transform: scale(1.15);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.35);
}

/* Canvas Area */
.canvas-container {
  flex: 1;
  position: relative;
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.1);
  min-height: 250px;
}

#draw-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

/* Experimental Handwriting Overlay */
.handwriting-overlay {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(4px);
  z-index: 10;
}

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

.hw-prediction {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

/* Drawings Gallery View */
#draw-gallery-view {
  flex-direction: column;
  padding: 16px;
  background-color: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow-y: auto;
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.gallery-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  width: 100%;
}

.gallery-card {
  background-color: var(--bg-app);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.gallery-thumbnail-container {
  aspect-ratio: 4/3;
  background-color: #ffffff;
  position: relative;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.gallery-thumbnail {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.gallery-card-info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.gallery-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-card-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.gallery-card-actions {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-surface);
}

.gallery-card-btn {
  flex: 1;
  height: 40px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
  background-color: var(--bg-app);
  color: var(--text-main);
}

.gallery-card-btn:active {
  transform: scale(0.95);
}

.gallery-open-btn {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.gallery-open-btn:active {
  background-color: var(--primary);
  color: white;
}

.gallery-delete-btn {
  color: #f87171;
  border-color: var(--border-color);
}

.gallery-delete-btn:active {
  background-color: var(--danger);
  color: white;
  border-color: var(--danger);
}

.gallery-empty-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 1.2rem;
  background-color: var(--bg-app);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-color);
}

/* Responsive sidebar layout for smaller screens */
@media (max-width: 768px) {
  #draw-canvas-view {
    flex-direction: column;
  }
  .draw-sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    height: auto;
    overflow-y: visible;
  }
  .sidebar-section {
    flex: 1;
    min-width: 150px;
  }
  .draw-color-palette {
    grid-template-columns: repeat(10, 1fr);
  }
  .draw-action-bar {
    gap: 8px;
    padding: 8px 12px;
  }
  .draw-action-btn {
    height: 48px;
    padding: 0 14px;
    font-size: 0.95rem;
  }
}

/* 8. Screen 5: Giochi & Tris + Inline Search */
.words-search-row {
  margin: 0 0 14px 0;
  width: 100%;
}

.words-search-container {
  position: relative;
  width: 100%;
}

#words-search-input {
  width: 100%;
  height: 52px;
  background-color: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 46px 0 46px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

#words-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-icon-inline {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-clear-inline-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.search-clear-inline-btn:hover {
  color: var(--text-main);
}

/* Giochi Passatempo screen layout */
.games-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 10px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  overflow: hidden; /* Avoid layout scroll */
}

/* Hub Menu Styles */
.games-hub-active {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

.games-header {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 8px;
}

.games-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
}

.games-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 5px;
}

.game-card-btn {
  background-color: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.game-card-btn:hover {
  border-color: var(--primary);
  background-color: var(--bg-surface-hover);
  transform: translateY(-2px);
}

.game-card-btn:active {
  transform: translateY(0) scale(0.98);
}

.game-card-icon {
  font-size: 2.5rem;
}

.game-card-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}

.game-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Tris specific styles - Compact Layout */
#tris-game {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 auto;
  height: 100%;
  justify-content: space-between;
}

.game-top-bar {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 15px;
  border-bottom: 1.5px solid var(--border-color);
  padding-bottom: 6px;
  margin-bottom: 2px;
}

.tris-back-btn {
  padding: 6px 12px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-main);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.85rem;
}

.tris-back-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--primary);
}

.game-title-inline {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
}

.game-controls-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px;
  width: 100%;
}

.game-mode-selector {
  display: flex;
  gap: 6px;
  width: 100%;
}

.game-mode-btn {
  flex: 1;
  height: 32px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-app);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.game-mode-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.game-score-board {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
}

.score-item {
  flex: 1;
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--text-muted);
}

.score-item strong {
  color: var(--text-main);
  font-size: 0.95rem;
  display: block;
  margin-top: 1px;
}

.game-status-msg {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--warning);
  padding: 2px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.tris-board-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.tris-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1;
}

.tris-cell {
  aspect-ratio: 1;
  background-color: var(--bg-surface);
  border: 2.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 2.2rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}

.tris-cell:hover:not(:disabled) {
  border-color: var(--primary);
  background-color: var(--bg-surface-hover);
}

.tris-cell:disabled {
  cursor: default;
}

.tris-cell.player-x {
  color: #3b82f6;
  border-color: #3b82f6;
  text-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.05);
}

.tris-cell.player-o {
  color: #ec4899;
  border-color: #ec4899;
  text-shadow: 0 0 10px rgba(236, 72, 153, 0.4);
  background: rgba(236, 72, 153, 0.05);
}

.tris-cell.winner {
  background-color: var(--success-light) !important;
  border-color: var(--success) !important;
  color: var(--success) !important;
  text-shadow: 0 0 12px rgba(16, 185, 129, 0.5) !important;
  animation: tris-win-pulse 0.8s infinite alternate;
}

@keyframes tris-win-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.03); }
}

.game-actions-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

.game-actions-row button {
  flex: 1;
  height: 38px;
  font-size: 0.9rem;
}

/* Light theme overrides for Tris */
body.light-theme .tris-cell.player-x {
  color: #1d4ed8;
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

body.light-theme .tris-cell.player-o {
  color: #be185d;
  border-color: #ec4899;
  background: rgba(236, 72, 153, 0.1);
}

body.light-theme .score-item strong {
  color: var(--text-main);
}

body.light-theme .tris-cell.winner {
  background-color: #d1fae5 !important;
  border-color: var(--success) !important;
  color: #065f46 !important;
}

/* Height-based media query for smaller viewports */
@media (max-height: 720px) {
  .tris-board {
    max-width: 185px;
  }
  .tris-cell {
    font-size: 1.8rem;
  }
  .game-status-msg {
    font-size: 1rem;
    min-height: 24px;
  }
  .game-card-icon {
    font-size: 2rem;
  }
  .game-card-btn {
    padding: 12px;
  }
}

/* Solitaire specific styles */
#solitaire-game {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 auto;
  height: 100%;
  justify-content: space-between;
}

.solitaire-board {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  flex: 1;
}

.solitaire-top-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.solitaire-piles-left, .solitaire-piles-right {
  display: flex;
  gap: 6px;
}

.sol-card-pile {
  width: calc(100vw / 8 - 6px);
  max-width: 52px;
  aspect-ratio: 2.5 / 3.5;
  border: 1.5px dashed var(--border-color);
  border-radius: 6px;
  position: relative;
  background-color: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
}

.solitaire-tableau-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  flex: 1;
  min-height: 180px;
  padding-top: 5px;
}

.sol-tableau-col {
  width: calc(100vw / 8 - 6px);
  max-width: 52px;
  min-height: 150px;
  border: 1px dashed rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  position: relative;
  background-color: rgba(255, 255, 255, 0.01);
}

.sol-card {
  width: 100%;
  aspect-ratio: 2.5 / 3.5;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: #0f172a;
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  user-select: none;
  box-sizing: border-box;
}

.sol-card.back {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-color: #0369a1;
  color: transparent !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.sol-card.selected {
  box-shadow: 0 0 0 3px var(--warning);
  transform: translateY(-6px);
  z-index: 1000 !important;
}

.sol-card.red {
  color: #e11d48 !important; /* Rich red */
}

.sol-card.black {
  color: #0f172a !important;
}

.sol-card-suit-large {
  font-size: 1.2rem;
  align-self: center;
  line-height: 1;
  pointer-events: none;
}

.sol-card-value, .sol-card-suit-small {
  line-height: 1;
  pointer-events: none;
}

.sol-card-top-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.stock-pile::after {
  content: "🃏";
  font-size: 1.2rem;
  opacity: 0.2;
}

.stock-pile.empty::after {
  content: "🔄";
  font-size: 1.2rem;
  opacity: 0.5;
  color: var(--text-muted);
}

.foundation-pile::before {
  content: "";
  font-size: 1.3rem;
  opacity: 0.15;
  position: absolute;
}
.foundation-pile[data-f-index="0"]::before { content: "♥"; }
.foundation-pile[data-f-index="1"]::before { content: "♦"; }
.foundation-pile[data-f-index="2"]::before { content: "♣"; }
.foundation-pile[data-f-index="3"]::before { content: "♠"; }

.sol-status-msg {
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  color: var(--warning);
  min-height: 28px;
}

/* Solitaire light theme tweaks */
body.light-theme .sol-card {
  background: #f8fafc;
  border-color: #cbd5e1;
}

body.light-theme .sol-card.back {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-color: #0284c7;
}

/* Height-based adjustments for Solitaire */
@media (max-height: 720px) {
  .sol-card {
    padding: 2px;
    font-size: 0.7rem;
  }
  .sol-card-suit-large {
    font-size: 0.95rem;
  }
}

/* Sudoku specific styles */
#sudoku-game {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 auto;
  height: 100%;
  justify-content: space-between;
}

.sudoku-board-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.sudoku-board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1 / 1;
  border: 3px solid var(--text-main);
  background-color: var(--border-color);
  box-shadow: var(--shadow-lg);
  border-radius: 8px;
  overflow: hidden;
}

.sudoku-cell {
  background-color: var(--bg-surface);
  border: 0.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  padding: 0;
  aspect-ratio: 1 / 1;
  text-align: center;
}

/* 3x3 block borders */
/* Column borders: columns 2 and 5 have thick right borders */
.sudoku-cell.thick-right {
  border-right: 3px solid var(--text-main);
}
/* Row borders: rows 2 and 5 have thick bottom borders */
.sudoku-cell.thick-bottom {
  border-bottom: 3px solid var(--text-main);
}

.sudoku-cell:hover:not(.initial-value) {
  background-color: var(--bg-surface-hover);
}

.sudoku-cell.initial-value {
  color: var(--text-muted);
  background-color: rgba(255, 255, 255, 0.03);
  font-weight: 900;
  cursor: not-allowed;
}

body.light-theme .sudoku-cell.initial-value {
  background-color: rgba(0, 0, 0, 0.03);
}

.sudoku-cell.selected {
  background-color: var(--primary-light) !important;
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.sudoku-cell.highlighted {
  background-color: rgba(2, 132, 199, 0.08);
}

.sudoku-cell.error {
  color: var(--danger) !important;
  background-color: var(--danger-light) !important;
}

.sudoku-keypad-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}

.sudoku-keypad {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 420px;
}

.sudoku-keypad .keypad-btn {
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 1.3rem;
  font-weight: 800;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sudoku-keypad .keypad-btn:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.sudoku-keypad .keypad-btn:active {
  transform: translateY(0);
}

.sudoku-keypad .keypad-btn.danger {
  border-color: var(--danger);
  color: var(--danger);
}

.sudoku-keypad .keypad-btn.danger:hover {
  background-color: var(--danger-light);
}

/* Height and width responsive tweaks for Sudoku */
@media (max-width: 480px) {
  .sudoku-cell {
    font-size: 1.1rem;
  }
  .sudoku-keypad .keypad-btn {
    font-size: 1.1rem;
    height: 40px;
  }
}


/* 9. Screen 6: Strumenti & Impostazioni */
.tools-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  align-content: start;
}

.tools-card {
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.tools-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 8px;
  color: var(--primary);
}

.add-word-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.form-group label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input, .form-group select {
  height: 48px;
  background-color: var(--bg-app);
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: 1rem;
}

.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.tools-btn {
  height: 48px;
  border: none;
  background-color: var(--bg-surface-hover);
  color: var(--text-main);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  width: 100%;
}

.tools-btn:active {
  transform: scale(0.97);
}

.tools-btn.success {
  background-color: var(--success);
  color: white;
}
.tools-btn.success:hover { background-color: var(--success-hover); }

.tools-btn.danger {
  background-color: var(--danger-light);
  border: 1.5px solid var(--danger);
  color: #f87171;
}
body.light-theme .tools-btn.danger {
  background-color: #fee2e2;
  color: #b91c1c;
}
.tools-btn.danger:active {
  background-color: var(--danger);
  color: white;
}

.tools-btn-label {
  display: flex;
}




.fav-list-el {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  gap: 10px;
}

.fav-text-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.3;
}

.fav-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.fav-delete-btn:hover {
  color: var(--danger);
}

.fav-delete-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Settings Options */
.settings-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.theme-buttons {
  display: flex;
  gap: 6px;
  background-color: var(--bg-app);
  padding: 4px;
  border-radius: var(--radius-md);
}

.theme-btn {
  height: 38px;
  padding: 0 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.theme-btn.active {
  background-color: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* Voice Settings Custom Slider and Layout */
.voice-volume-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.voice-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 130px;
  height: 6px;
  border-radius: 3px;
  background-color: var(--border-color);
  outline: none;
  transition: opacity 0.2s;
}

.voice-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s;
}

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

.voice-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--primary);
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s;
}

.voice-slider::-moz-range-thumb:hover {
  transform: scale(1.15);
}

.volume-val {
  font-weight: 700;
  color: var(--text-main);
  min-width: 45px;
  text-align: right;
  font-size: 0.95rem;
}

.backup-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

.backup-buttons h4 {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.app-version {
  font-size: 0.8rem;
  text-align: center;
  color: var(--text-muted);
  margin-top: 10px;
}

/* 10. Navigation Bar (Bottom Persistent) */
#main-nav {
  height: 90px;
  background-color: var(--bg-surface);
  border-top: 2px solid var(--border-color);
  display: flex;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.15);
  z-index: 10;
  width: 100%;
}

.nav-item {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 6px 0;
  border-top: 4px solid transparent;
}

.nav-item:hover {
  color: var(--text-main);
}

.nav-item.active {
  color: var(--primary);
  border-top-color: var(--primary);
  background-color: var(--primary-light);
}

.nav-icon {
  font-size: 1.8rem;
}

.nav-label {
  font-size: 0.95rem;
  font-weight: 700;
}

/* 11. Giant Text Overlay (Full Screen) */
#giant-text-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #0b0f19; /* Always black background for extreme legibility */
  z-index: 9999;
  display: flex;
  flex-direction: column;
  padding: 30px;
  box-sizing: border-box;
}

.close-giant-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 14px 28px;
  font-size: 1.5rem;
  font-weight: 800;
  background-color: var(--danger);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  transition: transform 0.1s;
}

.close-giant-btn:active {
  transform: scale(0.95);
}

#giant-text-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 6vw; /* Scale perfectly with viewport width */
  font-weight: 800;
  color: #fef08a; /* Bright legible yellow */
  line-height: 1.4;
  word-wrap: break-word;
  overflow-y: auto;
  padding: 80px 20px 20px 20px;
}

.giant-actions {
  display: flex;
  justify-content: center;
  padding-bottom: 20px;
}

.giant-action-btn {
  height: 70px;
  padding: 0 40px;
  font-size: 1.6rem;
  font-weight: 700;
  background-color: var(--success);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.1s;
}

.giant-action-btn:active {
  transform: scale(0.95);
}

/* 12. Scrollbar Customization for Slicker UI */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-app);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* 13. Home Page - Two Column Grid */
.home-two-columns {
  display: flex;
  flex: 1;
  gap: 20px;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

.home-left-column {
  flex: 1.8;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-right: 4px;
}

.home-right-column {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.my-phrases-card {
  background-color: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.my-phrases-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 15px;
  color: #ec4899; /* Matches favorites color */
}

/* 14. Words Screen - Category Header & Inline Add Button */
.category-grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-color);
}

.category-grid-header .category-title {
  margin-bottom: 0 !important;
  border-bottom: none !important;
}

.add-word-inline-btn {
  height: 48px;
  padding: 0 20px;
  background-color: var(--primary-light);
  border: 2px solid var(--primary);
  color: var(--text-main);
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.add-word-inline-btn:hover {
  background-color: var(--primary);
  color: white;
}

.add-word-inline-btn:active {
  transform: scale(0.95);
}

/* 15. Inline Add Word Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(11, 15, 25, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.2s ease-out;
}

.modal-content {
  background-color: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  padding: 26px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: modalScaleUp 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-content h3 {
  font-size: 1.4rem;
  font-weight: 700;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
  margin-bottom: 4px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

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

@keyframes modalScaleUp {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Responsive adjustments for two column layout */
@media (max-width: 800px) {
  .home-two-columns {
    flex-direction: column;
    overflow-y: auto;
  }
  .home-left-column {
    flex: none;
    overflow: visible;
  }
  .home-right-column {
    flex: none;
    height: 400px;
    overflow: visible;
  }
}

/* 16. Bottom Toggle Footer for Editing Words */
.words-grid-footer {
  padding-top: 14px;
  margin-top: 14px;
  border-top: 2px solid var(--border-color);
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.words-grid-footer .edit-toggle-container {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.words-grid-footer .switch-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-muted);
}


/* 17. Recipient Grouped Favorites — Accordion (canonical) */
.fav-recipient-group {
  margin-bottom: 8px;
}

.fav-recipient-title {
  width: 100%;
  background: var(--bg-surface-hover);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 700;
  text-align: left;
}

.fav-recipient-title:hover,
.fav-recipient-title.open {
  background-color: var(--primary-light);
  border-color: var(--primary);
}

.fav-group-label { flex: 1; }

.fav-group-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.fav-group-count {
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.85rem;
}

.fav-group-arrow {
  font-size: 0.9rem;
  transition: transform 0.25s ease;
  color: var(--text-muted);
  display: inline-block;
}

.fav-recipient-title.open .fav-group-arrow {
  transform: rotate(90deg);
}

/* Phrases list — accordion, hidden by default */
.fav-phrases-list {
  list-style: none;
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0 4px 0;
}

.fav-phrases-list.open {
  display: flex;
}

/* ===== SAVE PHRASE MODAL — wider for name grid ===== */
.save-phrase-modal-content {
  max-width: 680px !important;
  width: 95% !important;
}

/* ===== RECIPIENT CHIP BUTTONS ===== */
.recipient-preset-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.recipient-chip {
  padding: 10px 20px;
  border-radius: 30px;
  border: 2px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.recipient-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.recipient-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* ===== NAME SELECT GRID (save phrase modal) ===== */
.name-select-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding: 10px;
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-top: 6px;
}

.name-select-btn {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.name-select-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.name-select-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* 18. PWA Install Banner */
.install-banner {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 102px; /* sopra la barra di navigazione (90px) */
  width: calc(100% - 32px);
  max-width: 560px;
  background: var(--bg-surface);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  animation: installSlideUp 0.3s ease-out;
}

@keyframes installSlideUp {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to   { transform: translate(-50%, 0); opacity: 1; }
}

.install-banner-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  flex-shrink: 0;
}

.install-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.install-banner-text strong {
  font-size: 1.05rem;
  color: var(--text-main);
}

.install-banner-text span {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.install-banner-btn {
  flex-shrink: 0;
  height: 44px;
  padding: 0 20px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.2s, transform 0.1s;
}
.install-banner-btn:hover { background: var(--primary-hover); }
.install-banner-btn:active { transform: scale(0.96); }

.install-banner-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
}
.install-banner-close:hover {
  color: var(--text-main);
  background: var(--bg-surface-hover);
}

@media (max-width: 520px) {
  .install-banner { bottom: 98px; padding: 10px 12px; gap: 10px; }
  .install-banner-icon { width: 44px; height: 44px; }
  .install-banner-text span { display: none; } /* compatto su schermi piccoli */
}

/* 19. Tools — Info & Legal card */
.medical-disclaimer {
  background: rgba(245, 158, 11, 0.1);
  border: 1.5px solid var(--warning);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text-main);
}
.medical-disclaimer strong { color: #fbbf24; }

.legal-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

a.tools-btn { text-decoration: none; }

.legal-contact {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}
.legal-contact a { color: var(--primary); }

/* ============================================================
   20. OTTIMIZZAZIONE TABLET / SMARTPHONE + ACCESSIBILITA'
   ============================================================ */

/* Rendering testo e interazione touch */
html { -webkit-text-size-adjust: 100%; }
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* Altezza dinamica del viewport: niente salti con le barre del browser mobile */
@supports (height: 100dvh) {
  body { height: 100dvh; }
}

/* Consenti la selezione del testo nei campi (era bloccata dal reset globale) */
input, textarea, [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

/* Focus ben visibile: tastiera fisica, switch, navigazione assistita */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible,
.quick-tile:focus-visible,
.word-tile:focus-visible,
.kbd-key:focus-visible,
.nav-item:focus-visible,
.category-tab-btn:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Aree tattili piu' generose per i comandi piccoli */
.color-btn { width: 34px; height: 34px; }

/* Rispetta la preferenza di sistema "riduci movimento" */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Tipografia fluida: scala con continuita' fra tablet e smartphone */
#composed-phrase-display { font-size: clamp(1.4rem, 3.2vw, 2rem); }
.phrase-token { font-size: clamp(1.2rem, 2.6vw, 1.6rem); }
.screen-header h2 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); }

/* Safe-area (notch / home indicator) quando installata come app */
@supports (padding: max(0px)) {
  #composer-header {
    padding-top: max(12px, env(safe-area-inset-top));
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
  .screen-panel {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
  #main-nav {
    height: calc(90px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
  }
  .install-banner { bottom: calc(100px + env(safe-area-inset-bottom)); }
}

/* ---- Tablet in verticale e schermi medi ---- */
@media (max-width: 900px) {
  .categories-sidebar { width: 210px; }
  .quick-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .words-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ---- Smartphone ---- */
@media (max-width: 600px) {
  #composer-header { padding: 10px 14px; }
  .composer-container { gap: 8px; }
  .screen-panel { padding: 12px 14px; }
  .screen-header { flex-direction: column; align-items: flex-start; gap: 10px; }

  /* Compositore: pulsanti su griglia, "Leggi" a tutta larghezza */
  .composer-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .action-btn { min-width: 0; height: 48px; font-size: 0.9rem; gap: 5px; }
  .speak-btn { grid-column: 1 / -1; font-size: 1.05rem; }

  /* Richieste rapide a 2 colonne */
  .quick-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .quick-tile { min-height: 92px; font-size: 1.05rem; }
  .tile-icon { font-size: 1.9rem; }

  /* Categorie: la barra laterale diventa una striscia orizzontale scorrevole */
  .categories-layout { flex-direction: column; gap: 12px; }
  .categories-sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: none;
    border-bottom: 1.5px solid var(--border-color);
    padding: 0 0 8px 0;
    -webkit-overflow-scrolling: touch;
  }
  .category-tab-btn { flex: 0 0 auto; min-height: 46px; white-space: nowrap; }
  .category-tab-btn.active { transform: none; }
  .words-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }

  /* Tastiera */
  .kbd-key { font-size: 1.5rem; }
  .kbd-key.ctrl-key { font-size: 1rem; }

  /* Strumenti: una colonna */
  .tools-layout { grid-template-columns: 1fr; }

  /* Navigazione inferiore piu' compatta */
  #main-nav { height: calc(78px + env(safe-area-inset-bottom)); }
  .nav-icon { font-size: 1.5rem; }
  .nav-label { font-size: 0.78rem; }

  /* Banner installazione sopra la nav ridotta */
  .install-banner { bottom: calc(88px + env(safe-area-inset-bottom)); }
}

/* ---- Smartphone molto stretti ---- */
@media (max-width: 380px) {
  .quick-tile { min-height: 84px; font-size: 0.98rem; }
  .words-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
}

/* ============================================================
   21. TASTIERA: riga comandi e modalita' (lettere/numeri/punteggiatura)
   ============================================================ */
.keyboard-controls {
  display: grid;
  grid-template-columns: 1fr 2.2fr 1fr 1.6fr 1fr;
  gap: 10px;
}
.keyboard-controls .kbd-key {
  height: 64px;
  min-width: 0;
  font-size: 1.2rem;
  font-weight: 800;
}
/* Annulla lo span ereditato dalla vecchia tastiera: qui ogni tasto = 1 colonna */
.keyboard-controls .space-key { grid-column: auto; }

/* Pulsanti che cambiano modalita' (123 / ABC / punteggiatura) */
.mode-key {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--text-main);
}
.mode-key:active { transform: scale(0.94); }
.mode-key.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.punct-key { font-size: 1.35rem; letter-spacing: 1px; }

@media (max-width: 600px) {
  .keyboard-controls { gap: 6px; }
  .keyboard-controls .kbd-key { height: 56px; font-size: 1rem; }
  .punct-key { font-size: 1.1rem; }
}

/* ============================================================
   22. SALVA FRASE: nome personalizzato + tasti nome accessibili
   ============================================================ */
.custom-name-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.custom-name-row input {
  flex: 1;
  height: 48px;
  background-color: var(--bg-app);
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-md);
  padding: 0 14px;
  font-size: 1rem;
}
.custom-name-row input:focus {
  outline: none;
  border-color: var(--primary);
}
.custom-name-row .tools-btn {
  width: auto;
  flex: 0 0 auto;
  padding: 0 18px;
}

/* Tasti nome piu' grandi e toccabili (accessibilita') */
.name-select-grid { max-height: 220px; }
.name-select-btn {
  min-height: 44px;
  padding: 10px 16px;
  font-size: 1rem;
}

/* ============================================================
   23. PREFERITI: cuoricino sulle parole + sezione home
   ============================================================ */
.fav-heart-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-app);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
  z-index: 5;
}
.fav-heart-btn.active { border-color: #ec4899; }
.fav-heart-btn:active { transform: scale(0.88); }

.favorites-words-section { margin-top: 22px; }

.section-subtitle {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border-color);
}

.fav-word-tile { position: relative; }

.favorites-empty-msg {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.45;
  background: var(--bg-surface);
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

/* ============================================================
   24. GIOCHI: accessibilita' visiva e usabilita'
   ============================================================ */
/* Tris: tabellone e simboli piu' grandi, comandi piu' toccabili */
.tris-board { max-width: 380px; gap: 12px; }
.tris-cell { font-size: 3.4rem; border-width: 3px; }
.game-status-msg { font-size: 1.3rem; font-weight: 800; }
.game-actions-row button { height: 54px; font-size: 1.05rem; }
.game-mode-btn { min-height: 50px; font-size: 1.02rem; }
.tris-back-btn { min-height: 46px; font-size: 1rem; padding: 8px 16px; }
.game-card-btn { min-height: 160px; }
.game-card-title { font-size: 1.4rem; }

@media (max-height: 720px) {
  .tris-board { max-width: 300px; }
  .tris-cell { font-size: 2.6rem; }
}

/* Solitario: carte e testo piu' grandi e leggibili (soprattutto su tablet) */
#solitaire-game { max-width: 760px; }
.sol-card-pile { max-width: 92px; }
.sol-tableau-col { max-width: 92px; min-height: 200px; }
.sol-card { font-size: 1.05rem; padding: 5px; }
.sol-card-suit-large { font-size: 1.8rem; }
.sol-card-value { font-size: 1.15rem; }
.sol-card-suit-small { font-size: 1rem; }
.sol-card.selected { box-shadow: 0 0 0 4px var(--warning); }
.solitaire-piles-left, .solitaire-piles-right { gap: 8px; }
#solitaire-status { font-size: 1.2rem; font-weight: 800; }
.stock-pile::after, .stock-pile.empty::after { font-size: 1.6rem; }
.foundation-pile::before { font-size: 1.8rem; }

/* ============================================================
   25. INDICATORE STATO OFFLINE (schermata Strumenti)
   ============================================================ */
.offline-status {
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border: 1.5px solid var(--border-color);
  line-height: 1.35;
}
.offline-status.checking {
  color: var(--text-muted);
  background: var(--bg-app);
}
.offline-status.ready {
  color: var(--success);
  background: var(--success-light);
  border-color: var(--success);
}
.offline-status.not-ready {
  color: var(--warning);
  background: rgba(245, 158, 11, 0.12);
  border-color: var(--warning);
}
