/* components.css — every reusable visual component. Tokens only from
 * theme.css; no hardcoded colors. Design language adapted from ostnoctua:
 * rounded surfaces, a soft accent glow on the active/focused state, small
 * uppercase section labels, monospace for numeric/technical values, subtle
 * transitions on interactive state changes (no continuous/decorative
 * animation beyond a busy spinner and a slow status pulse, mirroring what
 * ostnoctua itself does for "busy"/"slewing" states). */

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text); padding: 6px 12px; border-radius: var(--radius-sm);
  cursor: pointer; font: inherit; font-size: 12.5px;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { border-color: var(--accent-dim); color: var(--text); background: var(--bg-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn .material-icons { font-size: 16px; }
.btn-primary { background: var(--accent-subtle); border-color: var(--accent-dim); color: var(--accent-strong); font-weight: 600; }
.btn-primary:hover { background: var(--accent-subtle); border-color: var(--accent); box-shadow: var(--shadow-glow); }
.btn-danger { border-color: rgba(var(--error-rgb), 0.35); color: var(--btn-danger); }
.btn-danger:hover { background: rgba(var(--error-rgb), 0.12); border-color: var(--btn-danger); }
.btn-sm { padding: 3px 9px; font-size: 11.5px; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid transparent; color: var(--text-muted);
  cursor: pointer; transition: all 0.15s ease; flex-shrink: 0;
}
.btn-icon:hover { color: var(--accent); background: var(--bg-hover); border-color: var(--border-subtle); }
/* Small flag buttons replacing the language <select> - one click, no
 * dropdown. Deliberately smaller than .btn-icon (22px vs 28px). */
.lang-flag-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid transparent;
  cursor: pointer; font-size: 14px; line-height: 1; padding: 0;
  transition: all 0.15s ease; flex-shrink: 0; opacity: 0.55;
}
.lang-flag-btn:hover { opacity: 0.85; background: var(--bg-hover); }
.lang-flag-btn.active { opacity: 1; border-color: var(--accent-dim); background: var(--accent-subtle); }
/* A free-typed directedit field's status icon - invisible at rest, yellow
 * while a pending edit differs from the server's value, green right after
 * it's sent (committed on focusout, see render.js). Space is reserved
 * (opacity, not display:none) so typing doesn't shift the row. */
.field-edit-icon { opacity: 0; transition: opacity 0.15s ease, color 0.15s ease; }
.field-edit-icon .material-icons { font-size: 16px; }
.field-edit-icon.editing { opacity: 1; color: var(--warn); }
.field-edit-icon.sent { opacity: 1; color: var(--ok); }
/* Cancels a pending edit instead of committing it - hidden until dirty,
 * same reserved-space idiom as above. */
.field-cancel-btn { opacity: 0; pointer-events: none; color: var(--btn-danger); }
.field-cancel-btn.visible { opacity: 1; pointer-events: auto; }
.field-cancel-btn.visible:hover { color: var(--btn-danger); background: rgba(var(--error-rgb), 0.12); }
.toggle-btn { min-width: 52px; justify-content: center; }
.toggle-btn.active { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent-strong); box-shadow: 0 0 10px var(--accent-faint); }

/* mountcontrolpanel.js's own N/S/E/W compass cross - a 3x3 grid, directions
   on the four edge cells, a plain icon (no click handler) in the center. */
.mount-controls-basic { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.mount-nsew { display: grid; grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(3, 48px); gap: 4px; justify-content: center; }
/* .btn/.toggle-btn/.btn-danger all bring their own min-width/padding,
   bigger than this grid's own cells - overridden here so N/S/E/W and the
   center Abort button come out as four identical, tightly-packed squares
   instead of each keeping its own natural (and inconsistent) size. */
.mount-nsew button.btn { width: 48px; height: 48px; min-width: 0; padding: 0; margin: 0; }
.mount-nsew-n { grid-column: 2; grid-row: 1; }
.mount-nsew-w { grid-column: 1; grid-row: 2; }
.mount-nsew-center { grid-column: 2; grid-row: 2; justify-content: center; }
.mount-nsew-e { grid-column: 3; grid-row: 2; }
.mount-nsew-s { grid-column: 2; grid-row: 3; }
.mount-controls-track { display: flex; align-items: center; gap: var(--space-2); }
.mount-controls-track-label { color: var(--text-muted); font-size: 12.5px; }

/* focuscontrolpanel.js's own +/- step control - same "identical squares"
   sizing idea as mountcontrolpanel.js's cross buttons, just in a row
   instead of a grid. */
.focus-step { display: flex; align-items: center; justify-content: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.focus-step-btn { width: 40px; height: 40px; min-width: 0; padding: 0; justify-content: center; font-size: 18px; }
.focus-step-btn-x10 { width: 48px; font-size: 12px; }

/* -------------------------------------------------------------- inputs */
.field-input {
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 5px 8px; font: inherit; font-size: 12.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field-input:focus { outline: none; border-color: var(--accent-dim); box-shadow: 0 0 0 3px var(--accent-faint); }
.field-input.small { width: 120px; }
.field-input.tiny { width: 48px; }
.compound-input { display: inline-flex; gap: 3px; }
.form-row { display: flex; align-items: center; gap: var(--space-2); margin: 6px 0; flex-wrap: wrap; }
.form-row label { color: var(--text-muted); font-size: 12px; }

.slider-wrap { display: inline-flex; align-items: center; gap: 8px; min-width: 160px; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; flex: 1; height: 4px;
  background: var(--accent-subtle); border-radius: 2px; outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg-panel); box-shadow: 0 0 0 1px var(--accent-dim);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: var(--accent);
  border: 2px solid var(--bg-panel); box-shadow: 0 0 0 1px var(--accent-dim); cursor: pointer;
}
/* Editable sibling of the slider itself (SliderAndValue) - small enough to
 * sit next to the range input, not a full-width .field-input. */
.slider-val-input {
  width: 4.5em; text-align: right; color: var(--accent); font-family: var(--font-mono); font-size: 12px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 2px 4px;
}
.slider-val-input:focus { outline: none; border-color: var(--accent-dim); }

/* --------------------------------------------------------------- pills */
/* Connection status itself now lives in panels.css's #conn-widget
   (.conn-dot/.conn-toggle) — this keyframe is shared with it. */
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.grant-pill { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }

/* --------------------------------------------------------- settings dialog
 * Active backends - same .home-card look as the Home dashboard (reuses
 * .home-grid/.home-card/.home-card-header/-title/-body/-row directly),
 * just narrower cards since the dialog itself is narrower than the full
 * canvas. No hover affordance here (cards aren't clickable, unlike Home's
 * own module cards) - color swatch, status and the remove icon are each
 * their own click target instead. */
.settings-backend-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.settings-backend-grid .home-card { cursor: default; }
.settings-backend-grid .home-card:hover { border-color: var(--border); box-shadow: var(--shadow-panel); }
.settings-backend-status { font-size: 12px; }
/* Recent servers as quick-fill chips for the form right below them
 * (Gilles, 2026-11-05) instead of a standalone vertical list - wraps
 * into as many rows as needed. */
.settings-chip-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.settings-chip-group { display: inline-flex; align-items: center; gap: 2px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding-left: var(--space-2); }

/* Sidebar nav rules removed 2026-09-25: UI3 now uses the horizontal module
   bar in panels.css (.mod-btn etc.) instead of a vertical sidebar — see
   panels.css's header comment. */

/* ---------------------------------------------------------------- cards */
.panel {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4); box-shadow: var(--shadow-panel);
}
.panel > h3:first-child, .panel > h2:first-child { margin-top: 0; }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-3); }

/* ------------------------------------------------------------- home view
 * One read-only card per loaded module (views.js's renderHome()) — same
 * "icon over/with label, click to act" register as .mod-btn, scaled up to
 * card size since each one also carries a few key figures. */
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-3); }
.home-card {
  position: relative;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--space-3); cursor: pointer; box-shadow: var(--shadow-panel);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.home-card:hover { border-color: var(--accent-dim); box-shadow: var(--shadow-glow); }
/* Backend color (issue #256) - views.js's tintHeader() sets background
   directly (an arbitrary per-backend color, not a theme value, so no
   CSS variable for it), at 50% opacity. Bled out to the card's own
   edges (negative margin matching .home-card's own padding) with its
   own padding/top radius instead of sitting inset inside it, so it
   reads as a real title bar rather than a smudge floating inside the
   card. */
.home-card-header {
  display: flex; align-items: center; gap: var(--space-2);
  margin: calc(-1 * var(--space-3)) calc(-1 * var(--space-3)) var(--space-2) calc(-1 * var(--space-3));
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius) var(--radius) 0 0;
}
.home-card-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-card-body { display: flex; flex-direction: column; gap: 2px; }
.home-card-row { display: flex; justify-content: space-between; gap: var(--space-2); font-size: 13px; }
/* Gilles, 2026-10-05: "fais plutot des presentations en mode horizontal pour
   guider et focus / Focus: values/curve / Guide: rms/guidegraph/drift" -
   focus/guider cards (views.js's HOME_HORIZONTAL_BUILDERS) lay their
   figures/charts out as side-by-side columns instead of the plain metric
   row every other card gets, in a card wide enough to fit them (2 columns
   for focus, 3 for guider — home-card-cols-N picks the span/min-width). */
.home-card-big { min-width: 420px; }
.home-card-cols-2 { grid-column: span 2; }
.home-card-cols-3 { grid-column: span 3; min-width: 680px; }
.home-card-columns { display: flex; gap: var(--space-3); align-items: flex-start; }
.home-card-column { flex: 1 1 0; min-width: 0; }
/* The chart's own gd-chart component, scaled down from its full-panel
   height (280px, components.css above) to column size. Gilles, 2026-10-06:
   "diminue de 1/3 la hauteur du graphe de focus sur la vignette" -
   160px to ~107px; shared by guider's own guidegraph column too, which
   wants roughly the same height. */
.home-card-column.gd-chart { height: 107px; }
.home-card-column.value-row { margin-bottom: 0; }
/* The drift chart is square (Chart.js maintainAspectRatio:true,
   aspectRatio:1) - it sets its own canvas height from ITS OWN WIDTH via an
   inline style, written asynchronously (Chart.js's own responsive resize,
   not necessarily in the same synchronous layout pass the browser used to
   size this flex column) - a flex-basis alone gives the grid/flex layout
   nothing to reserve height for UNTIL that later resize lands, so the
   card's own box was still only as tall as its shortest column when
   measured, with the canvas quietly overflowing past its bottom into the
   row below (caught live again: same overflow class as the original
   160px-equal-share bug, just at a bigger size this time - both width AND
   height need to be pinned up front, not just width). Gilles, 2026-10-06:
   "fait prendre plus de place au graphe de drift ... en faisant occupe 3
   zones a la vignette" gave it its own full column, then: "il est
   toujours trop haut ce graphe de drift: il faut que son cote corresponde
   a la hauteur du graphe de guidage" - square, side matching the
   guidegraph column's own height (.gd-chart above) instead of an
   independent, taller size. */
.home-card-column.gd-chart-square { flex: 0 0 107px; height: 107px; }
/* Gilles, 2026-10-06: "tu lui fais occuper 3 zones, passe a deux en
   mettant le RMS sous cette forme: en haut RMS total / en bas en plus
   petit RMS RA et DEC" - a narrow compact-RMS column (buildCompactRms,
   templates/guider.js), unaffected by the 2-vs-3-column back and forth
   since on both the charts next to it just get their own column(s). */
.home-card-column.rms-compact { flex: 0 0 130px; }
.rms-compact { display: flex; flex-direction: column; gap: var(--space-2); }
.rms-compact-sub { display: flex; gap: var(--space-3); }
.rms-compact-item { display: flex; flex-direction: column; gap: 2px; }
/* Gilles, 2026-10-06: "sur la vignette du focus garde le HFR tel quel,
   mais diminue l'importance du 'focus final position', mets le en tout
   petit en dessous de HFR, et donne la place gagnee au graphique" - a
   narrow fixed-width column (same idea as rms-compact above) so the
   curve chart's own column (default flex:1) picks up the freed-up width. */
.home-card-column.focus-compact-result { flex: 0 0 110px; }
.focus-compact-result { display: flex; flex-direction: column; gap: var(--space-2); }
/* Gilles, 2026-10-06: "ajoute la possibilite de deplacer les vignettes +
   position remanente" - a small drag handle in the header (views.js's
   buildHomeCard), not the whole card, so a plain click elsewhere still
   opens the module; dragging dims the card being moved. */
.home-card-handle { cursor: grab; color: var(--text-dim); touch-action: none; }
.home-card-handle:active { cursor: grabbing; }
/* Follows the cursor in real time while dragging (views.js's own
   transform: translate(), same visible-feedback idea as panels.js's
   startDrag() moving a floating panel with the mouse) - z-index so it
   visibly lifts above whichever card it's currently passing over, no
   transition on transform itself so it tracks the pointer immediately. */
.home-card.dragging { z-index: 50; cursor: grabbing; box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45); transition: none; }
/* Which side of the card currently under the pointer the dragged card
   would land on (views.js's startCardDrag) - a plain colored edge, same
   accent already used for the active modbar/quicknav button. */
.home-card.drop-before { box-shadow: inset 3px 0 0 var(--accent); }
.home-card.drop-after { box-shadow: inset -3px 0 0 var(--accent); }
/* Gilles, 2026-10-06: "ajoute une vignette 'en dur' (qui ne correspond pas
   a un module) avec les donnees systeme ('server load') et fais un truc
   joli avec des spinners" - a fixed, non-draggable, non-clickable (no
   module to open) card, always first (views.js's renderHome()), not part
   of the reorderable set at all. */
.home-card-system { cursor: default; }
.home-card-system:hover { border-color: var(--border); box-shadow: var(--shadow-panel); }
.home-system-body { display: flex; flex-direction: column; gap: var(--space-2); }
.home-ring-row { display: flex; gap: var(--space-3); align-items: center; }
/* Compact row list (buildSystemCard's USB and network sections) - tighter
   gap/font than the plain .home-card-row list above it, so a handful of
   entries doesn't turn this card into the tallest thing on the page. */
.home-compact-list { display: flex; flex-direction: column; gap: 2px; }
.home-compact-list .home-card-row { font-size: 12px; }
.home-compact-list .home-card-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-ring-object { font-weight: 600; font-size: 14px; }
/* planner's Home card: two columns, name+RA/DEC on the left, the ring on
   the right, vertically centered against that two-line block (Gilles,
   2026-10-06: "separe en deux parties: a gauche nom objet puis RA/DEC en
   dessous, a droite spinner sur deux lignes"). */
.home-planner-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.home-planner-left { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.home-ring-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.home-ring-caption { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
/* Gilles, 2026-10-06, sequencer's Home card: "ajoute le 'remaining time'
   et un progress bar pour l'exposition en cours" - the shared prg-bar-*
   component (above) defaults to a fixed 160px, sized for an inline table
   cell; full width reads better in a card. */
.home-bar-full { width: 100%; margin-top: 2px; }
.home-exposure-bar { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
/* Gilles, 2026-10-06: "ajoute une 'toute petite' vignette de la derniere
   image prise (apres/a droite du spinner de 'global progress'), pas plus
   haut)", then: "ajuste la hauteur de l'image avec la hauteur du 'global
   progress', mais sa largeur doit etre naturelle (sans stretch)" - a
   fixed width alongside the fixed height forced object-fit:cover to crop
   every frame into a square regardless of its real aspect ratio; height
   alone, width left auto, scales it proportionally instead. */
.home-seq-thumb { height: 56px; width: auto; border-radius: var(--radius-sm); cursor: zoom-in; flex-shrink: 0; border: 1px solid var(--border); }

/* --------------------------------------------------------- status dots */
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 2px; flex-shrink: 0; box-shadow: 0 0 0 3px transparent; transition: box-shadow 0.2s ease; }
.status-dot.status-standby { background: var(--standby); }
.status-dot.status-ok { background: var(--ok); box-shadow: 0 0 8px rgba(var(--ok-rgb), 0.5); }
.status-dot.status-busy { background: var(--busy); box-shadow: 0 0 8px rgba(var(--busy-rgb), 0.5); animation: pulse-dot 1s ease-in-out infinite; }
.status-dot.status-error { background: var(--error); box-shadow: 0 0 8px rgba(var(--error-rgb), 0.5); }

.badge-star { color: var(--warn); margin-left: 4px; }

/* Per-backend color (issue #256) - a plain dot (switch panel rows,
   views.js) or a clickable button that opens a palette row of the same
   dots underneath it (the active-backends list, app.js's
   renderActiveBackends()/buildPaletteRow()). background is set inline
   per use (an arbitrary per-backend color, not a theme value). */
.color-swatch { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 50%; }
.color-swatch-btn {
  flex: none; width: 18px; height: 18px; border-radius: 50%; padding: 0;
  border: 1px solid var(--border); cursor: pointer;
}
.color-swatch-btn:hover { border-color: var(--text); }
.color-palette-row { display: flex; gap: 6px; padding: var(--space-2) 0 0 0; flex-wrap: wrap; }
.color-palette-row .color-swatch-btn { width: 20px; height: 20px; }
.color-palette-row .color-swatch-btn:hover { transform: scale(1.15); }

/* -------------------------------------------------------- module screen */
.module-header { margin-bottom: var(--space-4); padding-bottom: var(--space-3); border-bottom: 1px solid var(--border); }
.module-header h2 { display: flex; align-items: center; gap: 8px; }
.profile-bar { display: flex; align-items: center; gap: 8px; margin-top: var(--space-2); flex-wrap: wrap; }
.profile-name { font-weight: 600; color: var(--accent); }
.profile-name.changed::after { content: " •"; color: var(--warn); }
/* Dev-mode "disable templates" checkbox (render.js's renderProfileBar()) -
 * Gilles, 2026-10-03: "un petit toggle discret a droite du bouton save" -
 * a bit of extra left margin sets it apart from the Save/Load/Save-as
 * button group it otherwise just flows after, muted/small text keeps it
 * low-key. */
.profile-bar-dev-toggle { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; }

.tab-bar { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: var(--space-4); flex-wrap: wrap; }
.tab-btn {
  background: none; border: none; color: var(--text-muted); padding: 9px 16px; cursor: pointer;
  border-bottom: 2px solid transparent; font: inherit; font-size: 12.5px; transition: color 0.15s ease, border-color 0.15s ease;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-panel.hidden { display: none; }

.prop-group { margin: var(--space-3) 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-panel); overflow: hidden; }
.prop-group summary {
  cursor: pointer; padding: var(--space-2) var(--space-3); font-weight: 600; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); background: var(--bg-elevated);
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.prop-group summary::-webkit-details-marker { display: none; }
.prop-group summary::before { content: "\25BE"; font-size: 10px; color: var(--accent); transition: transform 0.15s ease; }
.prop-group:not([open]) summary::before { transform: rotate(-90deg); }
.prop-group > .property { margin: var(--space-2); }
.prop-group-body { padding: var(--space-2) var(--space-3); }
.prop-group-body ul { margin: 0 0 var(--space-2); }
.prop-group-body ul:last-child { margin-bottom: 0; }

.property {
  border: 1px solid var(--border); background: var(--bg-panel-solid); border-radius: var(--radius);
  margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-4);
  transition: border-color 0.15s ease;
}
.property:hover { border-color: var(--border-strong); }
.property.hidden { display: none; }
/* render.js's renderProperty({ framed: false }) - Gilles, 2026-10-03: "les
 * elements de la propriete restent tout de meme entoures par un cadre, ca
 * mange de la place pour rien" (the actions window: its own window chrome
 * already frames the property, a second border/background/padding box
 * around its elements wastes space for nothing). Two classes (specificity
 * matches/beats `.prop-group > .property` above, and this rule comes
 * after it in source order either way) so it reliably wins over the
 * plain .property box styling. */
.property.property-bare { border: 0; background: none; margin: 0; padding: 0; }
.prop-header { display: flex; align-items: center; gap: 8px; margin-bottom: var(--space-2); }
.prop-label { font-weight: 600; }
.icon-slots { display: inline-flex; gap: 2px; }

/* Chart.js canvases (templates/guider.js's own drift/guiding charts —
   panels.css's .panel-float-body already scrolls/pads the rest). */
.gd-chart { position: relative; width: 100%; height: 280px; }
.gd-chart-square { height: auto; }
.gd-chart.hidden { display: none; }

/* templates/guider.js's fuller image stats+histogram panel. */
.stat-sec { margin: 10px 0 4px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); }
.stat-sec:first-child { margin-top: 0; }
/* imagelayer.js's statSecLine() - a stat-sec title with its own (already-
 * merged) value inline, instead of stacked on its own line above it. */
.stat-sec-line { display: flex; align-items: baseline; gap: var(--space-2); margin: 10px 0 4px; }
.stat-sec-line:first-child { margin-top: 0; }
.stat-sec-inline { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); flex-shrink: 0; }
/* imagelayer.js's labeledPairsRow() - Stars/SNR, same small/dim/uppercase
 * label font as .stat-sec-inline above (Gilles: "garde la meme police sur
 * 'Stars' que pour 'FOCUS'"), left-aligned with a gap instead of
 * .stat-row's space-between (several label:value pairs on one row, not
 * just one). */
.stat-inline-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); padding: 3px 0; border-top: 1px solid var(--border-subtle); }
.stat-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); padding: 3px 0; border-top: 1px solid var(--border-subtle); }
.stat-row:first-of-type { border-top: 0; }
.stat-label { color: var(--text-muted); }
.stat-value { font-weight: 600; }
.img-stats-table { width: 100%; border-collapse: collapse; margin-top: 4px; font-size: 12px; }
.img-stats-table th, .img-stats-table td { padding: 4px 6px; text-align: center; }
.img-stats-table th:first-child, .img-stats-table td:first-child { text-align: left; color: var(--text-muted); }
.img-stats-table thead th { border-bottom: 1px solid var(--border); font-size: 10px; color: var(--text-dim); }
.img-stats-table tbody tr { border-top: 1px solid var(--border-subtle); }

/* imagelayer.js's buildImageAlternatesPanel() - a small strip of "alternate"
 * crops for one image element (the focus module's own tilt quadrants -
 * Gilles, 2026-10-03: "sur rooster on affiche 4 image supplementaires, de
 * tilt"), same 2-per-row wrapping grid Rooster's own alternates-strip uses,
 * clickable into the shared fullscreen viewer (.img-viewer above). */
.img-alternates { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-2); }
.img-alternate-thumb { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); cursor: zoom-in; display: block; }
.img-alternate-thumb:hover { border-color: var(--accent-dim); }

/* imagelayer.js's buildImageGridPanel() - one panel for N separate image
 * properties (inspector's own HFR/shape/collimation/corners maps) instead
 * of N tiny floating ones - each tile a bit bigger than .img-alternates'
 * own (these carry real diagnostic detail, not just a quick visual
 * cross-check). */
.img-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); min-width: 320px; }
.img-grid-tile { display: flex; flex-direction: column; gap: var(--space-1); }
.img-grid-thumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); cursor: zoom-in; display: block; background: var(--bg-elevated); }
.img-grid-thumb:hover { border-color: var(--accent-dim); }
.img-grid-tile-empty .img-grid-thumb { cursor: default; }
.img-grid-label { font-size: 11px; color: var(--text-muted); text-align: center; }
/* Gilles, 2026-10-06: "sur inspector ajoute les 4 images de controle en
   vignettes toutes petites (2x2 qui doivent tenir dans la zone actuelle,
   sans stretch)" - the same .img-grid component (views.js's buildHomeCard,
   template === "inspector"), shrunk to fit a plain Home card instead of
   its own wide floating panel: no forced min-width, a tighter gap, and no
   per-tile label (redundant with the card's own header, and there's no
   room for it at this size) - the thumbnail itself keeps object-fit:cover
   (crops to a fixed ratio, never stretches/distorts either way). */
.home-img-grid { min-width: 0; gap: 4px; }
.home-img-grid .img-grid-label { display: none; }
/* Gilles, 2026-10-06: "la vignette home du monitor avec le graphe
   'session graph' sans les labels de serie" - a chart embedded directly
   in a plain card's body (not via the focus/guider multi-column path, see
   .home-card-column.gd-chart above), same compact height. */
.home-embedded-chart { height: 107px; }

.elt-table { width: 100%; border-collapse: collapse; }
.elt-row td { padding: 6px 4px; vertical-align: middle; border-top: 1px solid var(--border-subtle); }
.elt-row:first-child td { border-top: none; }
.elt-label { color: var(--text-muted); white-space: nowrap; width: 1%; padding-right: var(--space-3); font-size: 12px; }
.elt-value { width: 99%; }
/* The Actions panel stacks several folded-in properties' own bare
 * element tables one after another (renderActionsPanel()'s own
 * extra.node) - .elt-row's default row padding/divider above is sized
 * for a property filling its own standalone panel, too roomy once
 * several of them are crammed into the same one (Gilles, 2026-10-22:
 * "des interlignes inutiles de partout"). Spacing BETWEEN each folded
 * property's own block still shows, just as one deliberate gap per
 * boundary (the rule right below) rather than one per element row. */
.panel-float[data-panel="actions"] .elt-row td { padding: 1px 4px; border-top: none; }
.panel-float[data-panel="actions"] .property-bare + .property-bare { margin-top: var(--space-2); }
/* A run of consecutive self-descriptive buttons (render.js's own
 * renderPropertyBody(), the "actions" property above all) - Gilles,
 * 2026-10-03: "si on a une suite de boutons il sont affiches les uns au
 * dessus des autres verticalement ... c'est moche" - flows them left to
 * right instead, wrapping to a new line once they run out of room. */
.elt-button-row { display: flex; flex-wrap: wrap; gap: 6px; }
.readonly-val { font-family: var(--font-mono); color: var(--text-secondary); }

/* ------------------------------------------------------------------ grid */
.grid-section { margin-top: var(--space-2); }
.grid-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.grid-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.grid-table th, .grid-table td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--border-subtle); white-space: nowrap; }
.grid-table th { background: var(--bg-elevated); color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.04em; position: sticky; top: 0; }
.grid-row { cursor: pointer; transition: background 0.1s ease; }
.grid-row:hover { background: var(--bg-hover); }
.grid-row:last-child td { border-bottom: none; }
.grid-actions { white-space: nowrap; display: flex; gap: 2px; }
.grid-toolbar { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-2) 0 var(--space-3); }
.graph-canvas { width: 100%; max-width: 720px; height: 240px; background: var(--bg-elevated); border-radius: var(--radius-sm); display: block; border: 1px solid var(--border); }

/* -------------------------------------------------------------- prg/img */
.prg-bar-outer { width: 160px; height: 8px; background: var(--bg-elevated); border-radius: 5px; overflow: hidden; display: inline-block; vertical-align: middle; border: 1px solid var(--border); }
.prg-bar-inner { height: 100%; background: linear-gradient(90deg, var(--accent-dim), var(--accent)); transition: width 0.25s ease; }
.prg-label { margin-left: 8px; color: var(--text-muted); font-size: 12px; }

/* prgtype:"spinner" - a real determinate ring (value 0-100, same contract
 * as the "bar" variant - structure.en.md's own prg table), not an
 * indeterminate always-spinning circle. OstErix/Rooster's own
 * property.component.html renders this exact case as a
 * mat-progress-spinner mode="determinate" - Gilles, 2026-10-03, on the
 * CSS-spin version this used to be: "ils s'affichent tous en 'indetermine'
 * et 'ronds' ... regarde comment c'est fait sur rooster et fais pareil".
 * Built as a conic-gradient ring with a radial-gradient mask cutting the
 * donut hole (real transparency, not an occluding background color, so it
 * never needs to match whatever's behind it - a table row, a panel, a
 * dialog, ...) rather than an SVG circle (document.createElement() isn't
 * namespace-aware, so dom.js's own el() can't build real SVG nodes). */
.prg-ring-wrap { position: relative; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; flex-shrink: 0; }
.prg-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--pct, 0) * 1%), var(--border) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
  transition: background 0.25s ease;
}
.prg-ring-value { position: relative; font-size: 8.5px; font-weight: 600; font-family: var(--font-mono); color: var(--text-muted); }
/* Bigger size modifier for the Home dashboard's system card (views.js's
   ringGauge()) - same ring, just scaled up to read as a dashboard gauge
   rather than an inline per-row indicator. */
.prg-ring-wrap.home-ring { width: 56px; height: 56px; }
.home-ring .prg-ring-value { font-size: 14px; }

.img-elt .preview-img { max-width: 340px; max-height: 250px; border-radius: var(--radius-sm); display: block; border: 1px solid var(--border); }
.preview-video { max-width: 340px; border-radius: var(--radius-sm); }
.img-stats-row { margin-top: 6px; display: flex; align-items: center; gap: var(--space-2); }
.img-stats { font-size: 11.5px; }

/* ---------------------------------------------------------------- dialog */
.dialog-overlay { position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 50; }
.dialog { background: var(--bg-panel-solid); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); min-width: 340px; max-width: 90vw; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-pop); }
.dialog h3 { margin-top: 0; text-transform: none; font-size: 15px; color: var(--text); letter-spacing: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-4); }
/* The Parameters modal (app.js's openParamsDialog) can hold a lot — several
   tabs of properties — so it gets a roomier default width than a small
   confirm/edit dialog, still capped by .dialog's own max-width:90vw. */
.dialog.params-dialog { width: 680px; }
/* Generic dialog "title + close button" shape - was scoped to
   .params-dialog only, which silently left every OTHER .dialog-header
   (search catalogs, mosaic assistant...) unstyled - title and close
   button just fell into normal block flow with no spacing. */
.dialog-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.dialog-header h3 { margin: 0; }
.form-table td { padding: 5px 6px; }

/* The setup wizard (js/wizard.js, issue #238) - same roomier-than-default
   width reasoning as .params-dialog above (several steps' worth of
   controls, not a small confirm/edit form). */
.dialog.wizard-dialog { width: 560px; }
/* Fullscreen toggle (issue #238) - step 4's checklist (module + "set
   slaves" + equipment/optics pickers per row) outgrows the default size.
   overflow switches from the dialog itself (default .dialog behavior) to
   .wizard-body alone, so the header/stepper/actions stay pinned while
   only the step content scrolls. */
.dialog.wizard-dialog.fullscreen { width: 95vw; max-width: 95vw; height: 90vh; max-height: 90vh; display: flex; flex-direction: column; overflow-y: hidden; }
.wizard-dialog.fullscreen .wizard-body { flex: 1 1 auto; overflow-y: auto; min-height: 0; }

/* Credits dialog (js/credits.js) - wider than a plain confirm dialog for
   its source list, with its own explicit max-height/overflow-y (on top of
   .dialog's own) now that the front/backend build info below the licence
   list can push it past the viewport too. */
.dialog.credits-dialog { width: 480px; max-height: 85vh; overflow-y: auto; }
.credits-list { list-style: none; padding: 0; margin: var(--space-3) 0; }
.credits-list li { padding: 6px 0; border-bottom: 1px solid var(--border-subtle); }
.credits-list li:last-child { border-bottom: none; }

/* File select dialog (js/fileselectdialog.js) - same two-column browser as
   the file export panel below, sized bigger by default (a folder tree
   wants more room than a confirm dialog) and user-resizable (native CSS
   resize - no custom drag handle like the floating panels have). The
   column flex layout lets the folder/file lists grow with the dialog
   instead of staying capped at the file-export panel's own fixed
   max-height. */
.dialog.file-select-dialog {
  width: 640px; height: 520px; min-width: 420px; min-height: 320px;
  resize: both; overflow: auto;
  display: flex; flex-direction: column;
}
.file-select-dialog .file-export-browser { flex: 1 1 auto; min-height: 0; }
.file-select-dialog .file-export-folders, .file-select-dialog .file-export-files { height: 100%; max-height: none; }

/* Folder tree (filetree.js's buildFolderTree(), shared by fileexport.js's
   and fileselectdialog.js's own row renderers) - a flat list of rows,
   indentation done with inline padding-left rather than nested <ul>.
   fileexport.js's own rows add a selection checkbox between the toggle and
   the label; fileselectdialog.js's don't. The spacer keeps a leaf folder's
   label aligned under an expandable sibling's, same width as the toggle
   button it stands in for. */
.file-tree-row { display: flex; align-items: center; gap: 4px; padding: 1px 0; }
.file-tree-toggle, .file-tree-toggle-spacer { width: 18px; height: 18px; flex: 0 0 18px; }
.file-tree-toggle { display: flex; align-items: center; justify-content: center; padding: 0; border: none; background: none; cursor: pointer; color: var(--text-muted); }
.file-tree-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-tree-label.active { color: var(--accent); font-weight: 600; }

/* File export panel (js/fileexport.js, controller.en.md#file-export),
   embedded as a GlobalDatastore settings section (see gds-* rules
   further down) - two scrollable columns (folder tree / selected
   folder's files) side by side, a selection summary bar, then the zip
   job list below. */
.file-export-browser { display: flex; gap: var(--space-3); }
.file-export-folders, .file-export-files { flex: 1 1 50%; min-width: 0; max-height: 320px; overflow-y: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: var(--space-2); }
.file-export-row { display: flex; align-items: center; gap: var(--space-2); padding: 2px 0; }
.file-export-row span, .file-export-row .btn-link { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-export-selection-bar { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-3); }
.file-export-jobs { margin-top: var(--space-4); }
.file-export-jobs h4 { margin: 0 0 var(--space-2); font-size: 12.5px; text-transform: none; color: var(--text); }
.file-export-jobs-list { display: flex; flex-direction: column; gap: 4px; max-height: 160px; overflow-y: auto; }
.file-export-job-row { display: flex; align-items: center; gap: var(--space-2); }
/* Plain-text button/link look, reused here for a folder's "browse into it"
   action and a finished job's download link - no border/background, just
   the accent colour a real link would get. */
.btn-link { background: none; border: none; padding: 0; color: var(--accent-strong); cursor: pointer; font-size: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.btn-link:hover { text-decoration: underline; }

/* GlobalDatastore settings screen (templates/globaldatastore.js) -
   sidebar nav + content side by side, replacing a numbered tab row that
   kept wrapping as sections were added and read as a step sequence it
   never was. */
.gds-shell { display: flex; gap: var(--space-4); align-items: flex-start; }
.gds-sidebar { flex: 0 0 190px; display: flex; flex-direction: column; gap: 1px; }
.gds-nav-btn {
  display: block; width: 100%; text-align: left; background: none; border: none; color: var(--text-muted);
  padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; font: inherit; font-size: 13px;
  transition: background 0.15s ease, color 0.15s ease;
}
.gds-nav-btn:hover { color: var(--text); }
.gds-nav-btn.active { background: var(--accent-subtle); color: var(--accent); font-weight: 600; }
.gds-nav-group-label { margin: var(--space-3) 0 2px; padding: 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim); }
.gds-nav-sep { height: 1px; background: var(--border); margin: var(--space-2) 10px; }
.gds-content { flex: 1 1 auto; min-width: 0; }
@media (max-width: 760px) {
  .gds-shell { flex-direction: column; }
  .gds-sidebar { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .gds-nav-group-label, .gds-nav-sep { display: none; }
}

.wizard-header { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.wizard-header h3 { margin: 0; flex: 1 1 auto; }
.wizard-stepper { display: flex; gap: 4px; margin-bottom: var(--space-4); flex-wrap: wrap; }
.wizard-step-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  font: inherit; font-size: 11.5px; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.wizard-step-btn:disabled { cursor: default; opacity: 0.5; }
.wizard-step-btn.active { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-subtle); font-weight: 600; }
.wizard-step-btn.done { border-color: var(--border-strong); color: var(--text-secondary); }
.wizard-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--border-strong); color: var(--bg-panel-solid); font-size: 10px; font-weight: 600; flex-shrink: 0;
}
.wizard-step-btn.active .wizard-step-num { background: var(--accent); }
.wizard-body { min-height: 180px; }
/* Step 4's module/equipment/optics table (issue #238, Gilles: "organise
   plutot le panneau 4 en tableau avec des entetes module/equipment/
   optics"). */
.wizard-module-table { width: 100%; margin: var(--space-2) 0; border-collapse: collapse; }
.wizard-module-table th { text-align: left; font-size: 11px; color: var(--text-muted); font-weight: 600; padding: 2px 6px 4px 0; border-bottom: 1px solid var(--border); }
.wizard-module-table td { padding: 3px 6px 3px 0; vertical-align: middle; }
.wizard-module-table td select { font-size: 11px; padding: 2px 4px; width: 100%; }
/* The global equipment/optics pickers next to the prefix field (issue
   #238, Gilles: "a droite de la zone prefix ... quand on les change ca
   met a jour les lignes de tous les modules selectionnes") - a bulk-apply
   shortcut, not a persistent extra row. */
.wizard-module-picker { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.wizard-module-picker select { font-size: 11px; padding: 2px 4px; }
.wizard-module-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; cursor: pointer; }
/* "set slaves" (issue #238) - its own table column (4th), slightly muted
   (it's a secondary/optional refinement of the module checkbox, not an
   equally-weighted choice). */
.wizard-module-setslaves { display: flex; align-items: center; gap: 4px; color: var(--text-muted); font-size: 11px; white-space: nowrap; }
/* Steps 2/3/4's own "pick the one to use" radio (issue #238, Gilles,
   2026-10-14: "je veux pouvoir faire une selection ... dont il faut tenir
   compte au 5") - same row shape as .wizard-module-check above. */
.wizard-select-list { list-style: none; padding: 0; margin: 0; }
.wizard-select-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; cursor: pointer; }

/* Last log line under a module's own "actions" button row (render.js's
   renderLastLogLine(), issue cosmetic request Gilles 2026-10-14). Panels
   are narrow, so this truncates instead of wrapping over several lines. */
.actions-last-log { margin-top: var(--space-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* A panel's own <h3> title plus one action button, side by side (e.g.
   GlobalDatastore's "Loaded modules" header + its "Kill all" button) -
   same flex/space-between shape as .params-dialog .dialog-header above,
   generalized since this one isn't scoped to a dialog. */
.panel-header-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.panel-header-row h3 { margin: 0; }

/* ---------------------------------------------------------------- panel lists
 * Shared by docked `.panel` boxes and floating `.panel-float-body` ones -
 * same list look either way regardless of which one a given screen uses. */
.panel h3, .panel-float-body h3 { margin-top: 0; }
.panel ul, .panel-float-body ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
/* flex-wrap: wrap, same as .form-row above - a generic safety net on a
   narrow column for any list row with more than one button. */
.panel li, .panel-float-body li { display: flex; align-items: center; gap: var(--space-2); padding: 4px 0; flex-wrap: wrap; }
/* The INDI panel's active drivers list (Connect/Disconnect/Reload/Stop):
   label truncates instead of pushing the buttons off the row. */
.indi-driver-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.icon-btn-row { display: flex; gap: var(--space-2); }


/* ----------------------------------------------------------------- logs */
.log-toolbar { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }

/* --------------------------------------------------------- log sections
 * Shared by the per-module floating panel (views.js's
 * buildModuleLogsBody(), one per module like Values/Tilt - app.js's own
 * Panels.make() call) and GlobalDatastore's own embedded backend-wide
 * Logs section (buildLogsPanel()) - same colour-by-level convention as
 * .log-table above, compact rows instead of a table (ostnoctua's
 * web/log.js's own .w-log-row shape). .log-source-filter only exists in
 * the latter - the per-module panel has no emitter picker, it's always
 * exactly the one module that owns it. */
.log-panel-body { display: flex; flex-direction: column; gap: var(--space-2); }
.log-panel-body .log-toolbar { margin-bottom: 0; }
/* One toggle-btn per emitter (views.js's buildLogsPanel()), plus All/None
 * - a wrapping row rather than a single-choice dropdown, so several
 * emitters can be watched at once. */
.log-source-filter { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: var(--space-2); }
.log-source-filter .toggle-btn { display: inline-flex; align-items: center; gap: 5px; }
/* Each emitter's own worst level, same three colours as every other
 * level-warning/error/critical dot - dim/neutral rather than hidden
 * below that so the row of chips doesn't resize itself as entries come
 * and go. */
.log-source-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: var(--text-dim); }
.log-source-dot.level-warning { background: var(--warn); box-shadow: 0 0 6px rgba(var(--busy-rgb), 0.5); }
.log-source-dot.level-error { background: var(--orange); box-shadow: 0 0 6px rgba(var(--orange-rgb), 0.5); }
.log-source-dot.level-critical { background: var(--error); box-shadow: 0 0 6px rgba(var(--error-rgb), 0.5); }
.log-panel-list { display: flex; flex-direction: column; overflow-y: auto; max-height: 50vh; font-size: 12px; font-family: var(--font-mono); }
.log-panel-row { display: flex; gap: 8px; padding: 2px 4px; border-bottom: 1px solid var(--border-subtle); }
.log-panel-row:hover { background: var(--bg-hover); }
.log-panel-time { color: var(--text-dim); flex-shrink: 0; }
.log-panel-src { color: var(--text-muted); flex-shrink: 0; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-panel-msg { flex: 1 1 auto; min-width: 0; color: var(--text-secondary); }
.log-panel-row.log-warning .log-panel-msg { color: var(--warn); }
.log-panel-row.log-error .log-panel-msg { color: var(--orange); }
.log-panel-row.log-critical .log-panel-msg { color: var(--error); }
/* Trash button's own popup (views.js's openPurgeLogsDialog()) - a plain
 * checkbox per emitter, scrollable once there are many. */
.dialog.log-purge-dialog { width: 320px; }
.log-purge-list { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow-y: auto; margin: var(--space-2) 0; }
.log-purge-row { display: flex; align-items: center; gap: var(--space-2); padding: 3px 0; cursor: pointer; }

/* -------------------------------------------------------------- connect */

/* -------------------------------------------------------------- system */
.metric-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 12px; border-bottom: 1px solid var(--border-subtle); }
.metric-row:last-child { border-bottom: none; }
.metric-row .label { color: var(--text-muted); }
.metric-row .value { font-family: var(--font-mono); color: var(--text-secondary); }
.metric-row-group { margin-top: var(--space-2); }
.banner { background: var(--accent-faint); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-3); font-size: 12.5px; }

/* Selection panel's own merged day/night + time-scrub + "ce soir"
 * visibility-arc canvas (Gilles, 2026-10-02, after astro2001's own
 * day/night-gradient widgets; originally two separate canvases, merged
 * into one 2026-10-22 - see buildSelectionPanel()'s own doc comment) -
 * same framed-canvas look as .graph-canvas above, fixed intrinsic size
 * (no resize observer on this, unlike the sky dome itself - matches
 * .graph-canvas's own existing tradeoff). cursor:ew-resize - draggable
 * horizontally to scrub time, regardless of whether anything is selected. */
.altitude-chart { display: block; width: 100%; max-width: 280px; height: auto; aspect-ratio: 280 / 90; border-radius: var(--radius-sm); border: 1px solid var(--border); cursor: ew-resize; margin-top: var(--space-2); }
.timenav-readout { flex: 1 1 auto; }

/* Polar module's azimuth/altitude error arrows, folded into the Actions
 * panel below its "states" buttons - same fixed-intrinsic-size framed-
 * canvas look as .altitude-chart above, just square and centred rather
 * than full-width (it has no horizontal interaction to stretch for). */
.polar-error-canvas { display: block; width: 160px; height: 160px; margin: var(--space-2) auto 0; border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* Bordered/accented "value box" look, born on guider's own "values" panel
 * (Gilles, 2026-10-03: "rends-la plus graphique") for its RMS figures
 * (matches OstErix/Rooster's own guider.component.css, green left-border
 * accent, read directly rather than guessed) - generic enough (just
 * .value-row/.value-box, not RMS-specific) that focus.js's own "Final
 * result" panel reuses it too (Gilles, 2026-10-03: "inspire toi de
 * l'affichage des valeurs RMS du guider pour afficher ... HFR et
 * position"), same class names both places rather than two near-duplicate
 * CSS blocks. */
.value-row { display: flex; gap: var(--space-2); margin-bottom: var(--space-3); }
.value-box { flex: 1; padding: var(--space-2); border-radius: var(--radius-sm); border-left: 3px solid var(--ok); background: rgba(var(--ok-rgb), 0.08); }
.value-box-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); }
.value-box-number { font-size: 15px; font-weight: 600; font-family: var(--font-mono); margin-top: 2px; }
.pulse-axis { display: flex; align-items: center; gap: var(--space-1); margin-top: var(--space-2); }
.pulse-axis-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); width: 24px; flex-shrink: 0; }
.pulse-dir-label { font-size: 10px; color: var(--text-muted); flex-shrink: 0; }
.pulse-bar { position: relative; flex: 1; height: 18px; border-radius: var(--radius-sm); background: var(--bg-elevated); border: 1px solid var(--border); overflow: hidden; }
.pulse-bar-center { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--border-strong); }
.pulse-bar-fill { position: absolute; top: 0; bottom: 0; background: var(--accent); }
.pulse-bar-value { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--text); text-shadow: 0 0 3px var(--bg), 0 0 3px var(--bg), 0 0 3px var(--bg); pointer-events: none; }
/* Dot + label row, born on guider's own calibration-quality line
 * (renamed from .cal-quality-row once polar's own azimuth/altitude/total
 * error rows wanted the same look - same "rename once a second module
 * wants it" pattern as .value-row/.value-box above). */
.status-row { display: flex; align-items: center; gap: var(--space-1); margin-top: var(--space-3); }
.status-row + .status-row { margin-top: var(--space-1); }

/* OST server discovery (Android app only, js/zeroconf.js) - #discover-row
 * is hidden by default (app.js only shows it once zeroconf.isAvailable()
 * confirms this is the real native app). */
.discover-results { display: flex; flex-wrap: wrap; gap: var(--space-1); margin: 0 0 var(--space-2); }
.discover-results:empty { margin: 0; }
