/* ==================================== */
/* TOOLBAR ROW (Undo, Redo, etc.)       */
/* ==================================== */
.toolbar-row {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.btn-sym,
.btn-tool {
  height: 38px;
  border: 1px solid var(--border-medium);
  border-radius: var(--border-radius-pill);
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-sym {
  flex: 1;
  gap: 6px;
  padding: 0 12px;
  position: relative;
  overflow: hidden;
}

.btn-sym .sym-icon {
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.btn-sym .sym-text {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex: 1;
  text-align: left;
}

.btn-sym .sym-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  background: var(--border-medium);
}

.btn-tool {
  width: 38px;
  font-size: 16px;
  color: var(--text-secondary);
}

.btn-sym:hover,
.btn-tool:hover:not(:disabled) {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-sym:hover .sym-icon {
  transform: scale(1.1);
}

/* Dégradés bornés par les jetons (A11Y-04) : base → survol, jamais plus clair au
   bout ; au survol, le jeton de survol seul, dont le contraste avec
   --text-on-accent est garanti dans les deux thèmes */
.btn-sym.active {
  background: linear-gradient(135deg, var(--accent-success) 0%, var(--accent-success-hover) 100%);
  border-color: var(--accent-success);
  color: var(--text-on-accent);
}

.btn-sym.active .sym-status-dot {
  background: white;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.btn-sym.active:hover {
  background: var(--accent-success-hover);
  box-shadow: 0 4px 12px rgba(93, 138, 102, 0.3);
}

.btn-sym.broken {
  background: linear-gradient(135deg, var(--accent-danger) 0%, var(--accent-danger-hover) 100%);
  border-color: var(--accent-danger);
  color: var(--text-on-accent);
  animation: shake 0.5s ease-in-out;
}

.btn-sym.broken .sym-status-dot {
  background: white;
}

.btn-sym.broken:hover {
  background: var(--accent-danger-hover);
  box-shadow: 0 4px 12px rgba(196, 92, 92, 0.3);
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ==================================== */
/* PILL-SHAPED BUTTONS                  */
/* ==================================== */
.btn-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: var(--border-radius-pill);
  background: var(--accent-primary);
  color: var(--text-on-accent);
  transition: all var(--transition-fast);
  margin-bottom: 16px;
}

.btn-pill:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 119, 87, 0.25);
}

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

.btn-pill:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Secondary pill button */
.btn-pill.btn-secondary {
  background: transparent;
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
}

.btn-pill.btn-secondary:hover {
  background: rgba(217, 119, 87, 0.1);
  box-shadow: 0 2px 8px rgba(217, 119, 87, 0.15);
}

.btn-pill.btn-secondary:disabled {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-medium);
}

/* Primary button */
.btn-primary {
  width: 100%;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: var(--border-radius-pill);
  background: var(--accent-primary);
  color: var(--text-on-accent);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 119, 87, 0.25);
}

/* Secondary button */
.btn-secondary {
  width: 100%;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-medium);
  border-radius: var(--border-radius-pill);
  background: var(--bg-input);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  margin-top: 8px;
}

.btn-secondary:hover {
  background: var(--bg-sidebar-hover);
  border-color: var(--accent-secondary);
}

/* Filter buttons */
.btn-filter {
  flex: 1;
  min-width: calc(50% - 3px);
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-medium);
  border-radius: var(--border-radius-pill);
  background: var(--bg-input);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.btn-filter:hover {
  background: var(--bg-sidebar-hover);
  border-color: var(--accent-primary);
}

.btn-filter.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--text-on-accent);
}

/* ==================================== */
/* CONTROL GROUPS                       */
/* ==================================== */
.control-group {
  margin-bottom: 20px;
}

.control-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.control-group label .label-icon {
  font-size: 14px;
  color: var(--accent-secondary);
}

/* Pill-shaped select */
.control-group select {
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--border-radius-pill);
  border: 1px solid var(--border-medium);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235C5C5C' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.control-group select:hover {
  border-color: var(--accent-primary);
}

.control-group select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.15);
}

/* Range slider */
.control-group input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border-medium);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  margin: 8px 0;
}

.control-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all var(--transition-fast);
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 10px rgba(217, 119, 87, 0.3);
}

.control-group input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Focus clavier des curseurs (A11Y-08) : la règle ci-dessus retire l'anneau du
   navigateur ; contour de 5,86 à 6,94:1 sur les fonds clairs. Même anneau pour
   les curseurs hors .control-group (photo, dimensions de tumeur). */
input[type="range"]:focus-visible,
.control-group input[type="range"]:focus-visible {
  outline: 2px solid var(--accent-primary-hover);
  outline-offset: 2px;
}

/* Control hints and values */
.control-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

.control-value {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--border-radius-pill);
  background: var(--accent-primary);
  color: var(--text-on-accent);
  font-size: 11px;
  font-weight: 600;
  margin-top: 0;
}

/* Label row - label and value on same line */
.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.label-row label {
  margin-bottom: 0;
}

.label-row .control-value {
  margin-top: 0;
}

/* Checkbox group */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.checkbox-group label {
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  margin: 0;
  text-transform: none;
  font-weight: 500;
}

/* ==================================== */
/* SECTION CARDS                        */
/* ==================================== */
.anatomy-card,
.section-card {
  /* Voile translucide sur le fond crème ; en thème sombre le token est
     redéfini par dark-theme.css (le blanc à 50 % devient un gris délavé) */
  background: var(--section-card-bg, rgba(255, 255, 255, 0.5));
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-md);
  padding: 10px;
  margin: 0 0 12px 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.anatomy-card legend,
.section-card legend {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  padding: 0 8px;
  margin-left: -4px;
}

.anatomy-card .control-group {
  margin-bottom: 12px;
}

.anatomy-card .control-group:last-child {
  margin-bottom: 0;
}

.anatomy-card .control-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: stretch;
}

.anatomy-card .control-row:last-child {
  margin-bottom: 0;
}

.anatomy-card .control-row .control-group {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.anatomy-card .control-row .control-group label {
  min-height: 20px;
  display: flex;
  align-items: center;
}

.anatomy-card .control-row .control-group select {
  flex: 1;
}

.section-card {
  position: relative;
  overflow: visible;
}

/* Corner add button (+) */
.btn-add-corner {
  position: absolute;
  top: -12px;
  right: -6px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid var(--border-medium);
  border-radius: 50%;
  background: var(--bg-input);
  color: var(--accent-primary);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-add-corner:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--text-on-accent);
  transform: scale(1.1);
}

.btn-add-corner.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--text-on-accent);
}

/* ==================================== */
/* COLOR PICKER POPUP                   */
/* ==================================== */
.color-picker-popup {
  background: var(--bg-canvas);
  border: 1px solid var(--border-medium);
  border-radius: var(--border-radius-md);
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  animation: popup-in 0.2s ease;
}

@keyframes popup-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.color-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.color-picker-popup .color-swatch {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border-light);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
  outline: none;
}

.color-picker-popup .color-swatch:hover {
  transform: scale(1.05);
  border-color: var(--border-medium);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.color-picker-popup .color-swatch.selected {
  border-color: var(--accent-primary);
  border-width: 3px;
  box-shadow: 0 0 0 2px rgba(217, 119, 87, 0.2);
}

.color-picker-popup .color-swatch:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.15);
}

/* ==================================== */
/* ACCORDION ITEM (Generic)             */
/* ==================================== */

/* Generic list container */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Accordion item base */
.accordion-item {
  display: flex;
  flex-direction: column;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-md);
  margin: 0;
  overflow: visible;
  transition: all var(--transition-fast);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.accordion-item:hover {
  border-color: var(--border-medium);
  background: var(--bg-sidebar-hover);
}

.accordion-item.expanded {
  border-color: var(--accent-primary);
  background: rgba(217, 119, 87, 0.08);
}

/* Accordion header */
.accordion-item-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  cursor: pointer;
  background: inherit;
  border-radius: inherit;
  transition: background var(--transition-fast), color var(--transition-fast);
  position: relative;
}

.accordion-item.expanded .accordion-item-header {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.accordion-item-header:hover {
  background: inherit;
}

.accordion-item.expanded .accordion-item-header {
  background: inherit;
}

/* Color dot (for accordion items) */
.item-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.item-color-dot:hover {
  transform: scale(1.2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* Item number */
.accordion-item-number {
  font-size: 11px;
  font-weight: 600;
  min-width: 22px;
  flex-shrink: 0;
}

/* Item label/type (flex to fill space) */
.accordion-item-label {
  flex: 1;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Item badge */
.accordion-item-badge {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-sidebar-hover);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Chevron */
.accordion-item-chevron {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.accordion-item.expanded .accordion-item-chevron {
  transform: rotate(90deg);
}

/* Accordion content */
.accordion-item-content {
  display: none;
  padding: 12px;
  border-top: 1px solid var(--border-light);
  border-bottom-left-radius: calc(var(--border-radius-md) - 1px);
  border-bottom-right-radius: calc(var(--border-radius-md) - 1px);
  background: var(--bg-input);
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

/* Align multi-select toggle font with other edit-row controls */
.accordion-item-content .multi-select-dropdown-toggle {
  font-size: 11px;
  padding: 6px 10px;
}

.accordion-item.expanded .accordion-item-content {
  display: block;
}

/* Accordion content fieldsets */
.accordion-item-content fieldset {
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-md);
  margin: 8px 0;
  padding: 6px 8px;
  background: var(--bg-input);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  min-width: 0;
}

.accordion-item-content legend {
  color: var(--accent-primary);
  font-size: 11px;
  font-weight: 600;
  padding: 0 8px;
  text-transform: uppercase;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Delete button in accordion */
.accordion-item-content .btn-delete {
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  background: var(--bg-input);
  border: 1px solid var(--accent-danger);
  border-radius: var(--border-radius-md);
  color: var(--accent-danger);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.accordion-item-content .btn-delete:hover {
  background: var(--accent-danger);
  color: var(--text-on-accent);
}

/* ==================================== */
/* DELETE BUTTON VARIANTS               */
/* ==================================== */

/* Pill-shaped delete button (inline) */
.btn-delete-pill {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--accent-danger);
  border-radius: var(--border-radius-pill);
  background: transparent;
  color: var(--accent-danger);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-delete-pill:hover {
  background: var(--accent-danger);
  color: var(--text-on-accent);
}

/* Full-width delete button (pill-shaped) */
.btn-delete-full {
  width: 100%;
  padding: 8px 16px;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--accent-danger);
  border-radius: var(--border-radius-pill);
  background: transparent;
  color: var(--accent-danger);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-delete-full:hover {
  background: var(--accent-danger);
  color: var(--text-on-accent);
}

/* Circular icon delete button */
.btn-delete-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.btn-delete-icon:hover {
  background: var(--accent-danger);
  color: var(--text-on-accent);
}

/* Empty list message */
.empty-list-message {
  padding: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* ==================================== */
/* TOAST (QUAL-16)                      */
/* ==================================== */
/* Composant js/components/toast.js, seul toast des apps GoFast. Couleurs par
   jetons du design-system, posées dans deux propriétés du composant que chaque
   variante redéfinit (le Partogramme les remplace par ses couleurs d'alerte,
   css/main.css). Contrastes du texte (AA, 4,5:1) : thème clair, blanc sur
   success 5,43, info (--accent-secondary) 5,05, warning (--accent-primary)
   5,45, caution (--accent-primary-hover) 6,94, danger 5,43 ; thème sombre
   partagé (dark-theme.css), #1a1a1a sur success 7,78, info 6,23, warning 7,52,
   caution 5,57, danger 6,04. En bas au centre : centré par marges
   automatiques entre left: 0 et right: 0, largeur plafonnée à la moitié de
   l'écran comme avec l'ancien left: 50 % + translateX(-50 %) (sans
   `translate`, pour les navigateurs qui l'ignorent) ; l'entrée est animée par
   `transform`. */
.gf-toast {
  --gf-toast-bg: var(--accent-danger);
  --gf-toast-fg: var(--text-on-accent);
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  width: fit-content;
  max-width: 50%;
  margin-inline: auto;
  z-index: 1000;
  padding: 12px 24px;
  border-radius: var(--border-radius-pill);
  background: var(--gf-toast-bg);
  color: var(--gf-toast-fg);
  font-size: 13px;
  font-weight: 500;
  /* Repli sans color-mix() (navigateurs antérieurs à 2023), puis ombre teintée
     par le fond de la variante */
  box-shadow: 0 4px 12px var(--border-light);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--gf-toast-bg) 30%, transparent);
  animation: gf-toast-rise var(--transition-normal);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.gf-toast--success {
  --gf-toast-bg: var(--accent-success);
}

.gf-toast--info {
  --gf-toast-bg: var(--accent-secondary);
}

/* Pas de jeton « avertissement » dans le design-system : teintes de l'accent */
.gf-toast--warning {
  --gf-toast-bg: var(--accent-primary);
}

.gf-toast--caution {
  --gf-toast-bg: var(--accent-primary-hover);
}

.gf-toast--danger {
  --gf-toast-bg: var(--accent-danger);
}

/* En bas à droite, au-dessus du bouton flottant de copie (Colposcopie) */
.gf-toast--bottom-end {
  right: 24px;
  bottom: 96px;
  left: auto;
  width: auto;
  margin-inline: 0;
  z-index: 1100;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  font-size: 14px;
  animation: gf-toast-fade var(--transition-fast);
}

/* En haut à droite (alerte des minuteurs du Partogramme) */
.gf-toast--top-end {
  top: 80px;
  right: 20px;
  bottom: auto;
  left: auto;
  width: auto;
  margin-inline: 0;
  z-index: 400;
  max-width: 320px;
  padding: 14px 20px;
  border-radius: var(--border-radius-md);
  font-size: 14px;
  animation: gf-toast-slide var(--transition-normal);
}

.gf-toast--dismissible {
  padding-right: 40px;
}

.gf-toast__detail {
  margin-top: 4px;
  font-size: 12px;
}

.gf-toast__close {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 0 4px;
  border: none;
  background: none;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.gf-toast--leaving {
  opacity: 0;
}

.gf-toast--top-end.gf-toast--leaving {
  transform: translateX(100px);
}

/* Régions live des toasts : lues par les aides techniques, hors de l'écran */
.gf-toast-region {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes gf-toast-rise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
}

@keyframes gf-toast-fade {
  from {
    opacity: 0;
  }
}

@keyframes gf-toast-slide {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
}

/* ==================================== */
/* HELP SECTION                         */
/* ==================================== */
.help-section {
  position: relative;
  margin: auto 0 12px 0;
}

.help-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  opacity: 0.6;
}

.help-btn:hover {
  opacity: 1;
  color: var(--text-secondary);
}

.help-content {
  padding: 12px;
  font-size: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-md);
  margin-top: 8px;
}

.help-content h4 {
  margin: 0 0 8px 0;
  color: var(--text-primary);
  font-size: 13px;
}

.help-content h4:not(:first-child) {
  margin-top: 16px;
}

.quadrant-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.quadrant-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.q-badge {
  background: var(--accent-primary);
  color: var(--text-on-accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 10px;
  min-width: 32px;
  text-align: center;
}

.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shortcuts-list div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shortcuts-list kbd {
  background: var(--bg-main);
  border: 1px solid var(--border-medium);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: monospace;
  font-size: 11px;
  min-width: 24px;
  text-align: center;
}

/* ==================================== */
/* RESOURCES SECTION                    */
/* ==================================== */
.resources-section {
  display: flex;
  gap: 8px;
  padding: 12px 0;
  margin-top: 8px;
  justify-content: center;
}

.resource-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-md);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.resource-btn:hover {
  background: var(--bg-sidebar-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.resource-btn svg {
  width: 20px;
  height: 20px;
}

/* Visibility in collapsed mode */
.sidebar.collapsed .resources-section {
  flex-direction: column;
  padding: 8px 0;
}

/* ==================================== */
/* VIEW TOGGLE (MOBILE)                 */
/* ==================================== */
.view-toggle {
  display: none;
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 50;
  gap: 4px;
  background: var(--bg-canvas);
  border-radius: var(--border-radius-pill);
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-toggle {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: var(--border-radius-pill);
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.btn-toggle.active {
  background: var(--accent-primary);
  color: var(--text-on-accent);
}

.btn-toggle:hover:not(.active) {
  background: var(--bg-sidebar-hover);
}

/* ==================================== */
/* TOUCH OPTIMIZATION                   */
/* ==================================== */
@media (pointer: coarse) {
  .btn-pill {
    min-height: 48px;
  }

  .btn-primary {
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  /* Larger touch targets */
  .btn-pill {
    padding: 14px 20px;
    min-height: 48px;
  }

  .btn-primary {
    min-height: 44px;
  }

  /* Show view toggle on mobile */
  .view-toggle {
    display: flex;
  }
}

/* ==================================== */
/* CHRONO TABLE                         */
/* ==================================== */
.table-responsive {
  overflow: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-md);
  background: #fff;
}

.chrono-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.chrono-table th,
.chrono-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.chrono-table th {
  background: var(--bg-sidebar);
  font-weight: 600;
  color: var(--text-secondary);
  position: sticky;
  top: 0;
}

.chrono-table tr:hover {
  background: var(--bg-hover);
}

.chrono-table tr.is-highlight {
  background: rgba(217, 119, 87, 0.12);
}

.table-input,
.table-select {
  width: 100%;
  min-width: 70px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: var(--bg-input);
  font-size: 11px;
  box-sizing: border-box;
}

.table-input.is-invalid,
.table-select.is-invalid {
  border-color: var(--accent-danger);
  box-shadow: 0 0 0 2px rgba(196, 92, 92, 0.15);
}

/* ==================================== */
/* DROPDOWN MENU                        */
/* ==================================== */
.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-medium);
  border-radius: var(--border-radius-md);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dropdown-toggle:hover {
  background: var(--border-light);
  border-color: var(--border-dark);
}

.dropdown-toggle-icon {
  font-size: 14px;
}

.dropdown-toggle-arrow {
  font-size: 10px;
  color: var(--text-secondary);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 280px;
  max-height: 320px;
  overflow-y: auto;
  background: white;
  border: 1px solid var(--border-medium);
  border-radius: var(--border-radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.dropdown-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.1s ease;
  border-bottom: 1px solid var(--border-light);
}

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

.dropdown-item:hover {
  background: var(--bg-sidebar);
}

.dropdown-item.is-current {
  background: rgba(217, 119, 87, 0.08);
  cursor: default;
}

.dropdown-item-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.dropdown-item-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-item-date {
  font-size: 11px;
  color: var(--text-secondary);
}

.dropdown-item-delete {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s ease, color 0.1s ease;
  flex-shrink: 0;
}

.dropdown-item-delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}
