/* Design system Netwo/CPE — micro-front client (refonte d'apres la maquette
   « Configuration CPE », approche HYBRIDE : structure + composants de la maquette
   (switches, pills, port-map, rail sticky, collapsibles, modale), mais identite
   Netwo conservee (Inter, primaire #3c50e0). Aucune couleur en dur dans le JS :
   les accents de segment passent par des classes .seg-cN -> variables CSS.
   Conforme .claude/rules/frontend-ux.md : pas de style inline, tokens uniquement. */

:root {
  --primary-main: #3c50e0;
  --primary-dark: #0f21a3;
  --primary-light: #e2e5fb;
  --primary-extra-light: #f6f7ff;
  --bg-page: #f2f4f7;
  --bg-surface: #ffffff;
  --bg-subtle: #fafafd;
  --text-primary: #16175f;
  --text-muted: #696989;
  --border-light: #e0e5ec;
  --border-medium: #c3ccda;
  --accent-100: rgba(234, 103, 29, 1);
  --status-error: #e82543;
  --status-error-bg: #fce8ec;
  --status-error-border: #f4c4cf;
  --status-success: #1d8f52;
  --status-success-bg: #edf8f1;
  --status-success-border: #bfe6cf;
  /* Avertissement (bandeau tri-etat) : repris du langage back-office v2, pas de
     reutilisation de l'orange de marque (--accent-100). Justifie : etat warn. */
  --status-warning: #98520f;
  --status-warning-bg: #fbe9d6;
  --status-warning-border: #f0dcb0;
  --focus-outline: #1884e7;
  --radius: 8px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Palette categorielle des segments LAN (port-map + cartes segment). Decoratif,
     pour distinguer les reseaux. Pas de l'orange de marque. */
  --seg-1: #3c50e0; --seg-1-soft: #e7e9fb;
  --seg-2: #0e9e8e; --seg-2-soft: #d9f1ee;
  --seg-3: #7c5cf6; --seg-3-soft: #ece8fd;
  --seg-4: #d6457a; --seg-4-soft: #fbe5ee;
}

* { box-sizing: border-box; }

/* L'attribut `hidden` doit TOUJOURS cacher, meme sur des conteneurs flex/grid. */
[hidden] { display: none !important; }

html { font-size: 10px; }

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 1.4rem;
  color: var(--text-primary);
  background: var(--bg-page);
  line-height: 1.5;
}

.mono { font-family: var(--font-mono); }
.muted-text { color: var(--text-muted); margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ====================== Coquille / page d'accueil ====================== */
.page { max-width: 880px; margin: 0 auto; padding: 32px 24px 64px; display: grid; gap: 24px; }
.landing-card { max-width: 560px; margin: 64px auto; text-align: center; gap: 16px; }
.landing-card h1 { font-size: 1.9rem; font-weight: 600; margin: 0; }
.wip-badge {
  display: inline-block; align-self: center;
  background: var(--primary-light); color: var(--primary-dark);
  padding: 4px 14px; border-radius: 999px; font-size: 1.1rem; font-weight: 500;
}
.page-loader { text-align: center; padding: 64px; color: var(--text-muted); }

.app-shell { display: flex; flex-direction: column; min-height: 100vh; }

/* ====================== En-tete sticky ====================== */
.cfg-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(242, 244, 247, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  padding: 16px 36px 14px;
}
.cfg-breadcrumb { font-size: 1.2rem; color: var(--text-muted); font-weight: 600; margin-bottom: 10px; }
.cfg-breadcrumb-sep { margin: 0 8px; }
.cfg-breadcrumb-current { color: var(--primary-main); }
.cfg-header-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cfg-title { font-size: 2.2rem; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.cfg-serial {
  font-size: 1.2rem; font-weight: 600; color: var(--text-muted);
  background: var(--bg-page); border: 1px solid var(--border-light);
  padding: 5px 10px; border-radius: var(--radius);
}
.cfg-status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 1.2rem; font-weight: 600; color: var(--status-warning);
  background: var(--status-warning-bg); padding: 5px 12px; border-radius: 999px;
}
.cfg-status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.cfg-status-pill.is-saved { color: var(--status-success); background: var(--status-success-bg); }
.cfg-header-spacer { flex: 1; min-width: 12px; }
.cfg-header-actions { display: flex; gap: 12px; flex-shrink: 0; }
.cfg-check-glyph { font-size: 1.3rem; }

.cfg-content { padding: 22px 36px 72px; }

/* ====================== Grille 2 colonnes + rail ====================== */
.cfg-grid { display: grid; grid-template-columns: minmax(0, 1fr) 312px; gap: 28px; align-items: start; }
.cfg-form-col { display: flex; flex-direction: column; gap: 22px; margin: 0; }
.cfg-rail-sticky { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 14px; }

/* ====================== Cartes ====================== */
.card {
  background: var(--bg-surface); border: 1px solid var(--border-light);
  border-radius: var(--radius-xl); padding: 22px 24px 24px;
  display: grid; gap: 14px;
}
.section-heading h2 { font-size: 1.8rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 10px; }
.switch-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.switch-heading > div { display: grid; gap: 5px; }
.tag-essential {
  font-size: 1rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--primary-main); background: var(--primary-extra-light);
  padding: 4px 9px; border-radius: 7px;
}

/* ====================== WAN lecture seule ====================== */
.wan-card {
  background: var(--primary-extra-light); border: 1px solid var(--border-light);
  border-radius: var(--radius-xl); padding: 22px 24px; display: grid; gap: 10px;
}
.wan-badge-row { display: flex; align-items: center; gap: 10px; }
.netwo-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 1rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted); background: var(--bg-surface);
  border: 1px solid var(--border-light); padding: 4px 9px; border-radius: 7px;
}
.netwo-lock { font-size: 1.1rem; }
.wan-readonly-note { font-size: 1.2rem; }
.wan-title { font-size: 1.6rem; font-weight: 700; margin: 4px 0 0; }
.wan-facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 0; }
.wan-fact {
  background: var(--bg-surface); border: 1px solid var(--border-light);
  border-radius: 11px; padding: 10px 14px; min-width: 140px; flex: 1 1 140px;
}
.wan-fact dt { font-size: 1rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.wan-fact dd { margin: 3px 0 0; font-size: 1.4rem; font-weight: 700; font-family: var(--font-mono); }
.wan-port-note { display: flex; align-items: center; gap: 9px; font-size: 1.2rem; color: var(--text-muted); margin: 8px 0 0; }
.wan-port-chip { font-weight: 700; color: var(--text-primary); background: var(--bg-surface); border: 1px solid var(--border-light); padding: 3px 8px; border-radius: 7px; }

/* ====================== Fil conducteur ====================== */
.cfg-connector { display: flex; flex-direction: column; align-items: center; gap: 0; margin: -6px 0; }
.cfg-connector-line { width: 2px; height: 14px; background: var(--border-medium); }
.cfg-connector-label {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: 999px;
  padding: 5px 14px; font-size: 1.2rem; font-weight: 700; color: var(--text-muted);
}
.cfg-connector-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary-main); }

/* ====================== Port-map ====================== */
.port-map-wrap { background: var(--bg-subtle); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 14px 16px; }
.port-map-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.port-map-title { font-size: 1.2rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.port-map-hint { font-size: 1.1rem; }
.port-map { display: flex; gap: 9px; flex-wrap: wrap; }
.port-tile { flex: 1 1 96px; min-width: 92px; border: 1.5px solid var(--border-light); background: var(--bg-surface); border-radius: 11px; padding: 10px 11px; }
.port-tile-name { font-family: var(--font-mono); font-size: 1.3rem; font-weight: 700; }
.port-tile-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.port-tile-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-medium); flex: 0 0 8px; }
.port-tile-label { font-size: 1.15rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.port-tile-wan { border-color: var(--border-medium); background: var(--bg-page); }
.port-tile-free { opacity: 0.7; }
.port-tile-assigned { border-color: var(--seg); background: var(--seg-soft); }
.port-tile-assigned .port-tile-dot { background: var(--seg); }

/* ====================== Segments LAN ====================== */
.lan-segment {
  border: 1px solid var(--border-light); border-left: 4px solid var(--seg, var(--primary-main));
  border-radius: var(--radius-lg); padding: 18px; background: var(--bg-surface);
  display: grid; gap: 16px;
}
.lan-segment-head { display: flex; align-items: center; gap: 12px; }
.segment-index {
  width: 26px; height: 26px; border-radius: 8px; background: var(--seg-soft, var(--primary-light));
  color: var(--seg, var(--primary-main)); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.2rem; flex: 0 0 26px;
}
.segment-name-input {
  flex: 1; min-width: 120px; border: none; border-bottom: 1.5px solid transparent;
  font-size: 1.6rem; font-weight: 700; color: var(--text-primary); padding: 3px 2px;
  background: transparent; outline: none; font-family: inherit;
}
.segment-name-input:focus { border-bottom-color: var(--primary-main); }
.seg-delete {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--status-error-border);
  background: var(--bg-surface); color: var(--status-error); cursor: pointer; font-size: 1.4rem;
  flex: 0 0 34px;
}
.seg-delete:hover { background: var(--status-error-bg); }

/* segmented Natif / VLAN */
.segmented { display: inline-flex; background: var(--bg-page); border-radius: var(--radius); padding: 3px; gap: 2px; }
.seg-mode-option {
  border: none; background: transparent; cursor: pointer; font: inherit; font-weight: 600;
  font-size: 1.2rem; padding: 6px 12px; border-radius: 6px; color: var(--text-muted);
}
.seg-mode-option[aria-pressed="true"] { background: var(--bg-surface); color: var(--primary-main); box-shadow: 0 1px 2px rgba(22, 23, 95, 0.08); }

/* ====================== Champs ====================== */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 1.15rem; font-weight: 600; color: var(--text-muted); }
.field-half { width: 100%; }

input[type="text"], input[type="password"], select {
  min-height: 40px; padding: 10px 12px; background: var(--bg-surface);
  border: 1px solid var(--border-medium); border-radius: 10px;
  font: inherit; color: var(--text-primary); width: 100%;
}
select { cursor: pointer; }
input::placeholder { color: var(--border-medium); }
input:focus-visible, select:focus-visible { outline: none; border-color: var(--primary-main); box-shadow: 0 0 0 3px var(--primary-extra-light); }
input.invalid { border-color: var(--status-error); }
input.invalid:focus-visible { box-shadow: 0 0 0 3px var(--status-error-bg); }

.field-error { margin: 0; font-size: 1.1rem; color: var(--status-error); }
.field-hint { margin: 0; font-size: 1.1rem; color: var(--text-muted); }

.input-with-toggle { display: flex; gap: 8px; align-items: stretch; }
.input-with-toggle input { flex: 1; }

.conditional-section { display: grid; gap: 14px; }

/* ====================== Switch (checkbox stylise) ====================== */
.switch { display: inline-flex; align-items: center; flex: 0 0 auto; }
.switch-input {
  appearance: none; -webkit-appearance: none; margin: 0;
  width: 42px; height: 24px; border-radius: 999px; background: var(--border-medium);
  position: relative; cursor: pointer; flex: 0 0 42px; transition: background 0.15s;
}
.switch-input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: left 0.15s;
}
.switch-input:checked { background: var(--primary-main); }
.switch-input:checked::after { left: 21px; }
.switch-input:focus-visible { outline: 2px solid var(--focus-outline); outline-offset: 2px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--bg-subtle); border: 1px solid var(--border-light); border-radius: 11px; padding: 12px 16px; }
.switch-row-label { font-size: 1.3rem; font-weight: 600; }

/* ====================== Bloc DHCP ====================== */
.dhcp-block { background: var(--bg-subtle); border: 1px solid var(--border-light); border-radius: 12px; padding: 14px 16px; display: grid; gap: 0; }
.dhcp-block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dhcp-block-title { display: flex; align-items: center; gap: 10px; }
.dhcp-block-title strong { font-size: 1.3rem; font-weight: 700; }
.dhcp-block-hint { font-size: 1.1rem; color: var(--text-muted); }
.dhcp-fields { margin-top: 14px; }

/* ====================== Ports (chips) ====================== */
.port-field-label { font-size: 1.15rem; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; display: block; }
.port-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.port-chip {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  border: 1.5px solid var(--border-medium); border-radius: 9px; padding: 7px 12px; cursor: pointer;
  font-family: var(--font-mono); font-size: 1.2rem; font-weight: 700; color: var(--text-muted);
  background: var(--bg-surface);
}
.port-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.port-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-medium); }
.port-chip:has(input:checked) { border-color: var(--seg, var(--primary-main)); color: var(--text-primary); background: var(--seg-soft, var(--primary-light)); }
.port-chip:has(input:checked) .port-chip-dot { background: var(--seg, var(--primary-main)); }
.port-chip:focus-within { outline: 2px solid var(--focus-outline); outline-offset: 2px; }

/* ====================== Reservations DHCP (sous-bloc) ====================== */
.resv-section { display: grid; gap: 10px; }
.resv-section h4 { margin: 0; font-size: 1.3rem; font-weight: 700; }
.resv-list { display: grid; gap: 10px; }
.resv-empty { font-size: 1.2rem; }

/* ====================== Builders (DNAT / SNAT / FW / route / resv) ====================== */
.builder-row {
  display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap;
  padding: 12px; border: 1px solid var(--border-light); border-radius: var(--radius);
  background: var(--bg-subtle);
}
.builder-row .field { flex: 1; min-width: 110px; }
.btn-remove {
  color: var(--status-error); background: var(--bg-surface); border: 1px solid var(--status-error-border);
  border-radius: 9px; cursor: pointer; font-size: 1.3rem; width: 34px; height: 38px; flex: 0 0 34px;
}
.btn-remove:hover { background: var(--status-error-bg); }

/* ====================== Boutons « ajouter » (pointilles) ====================== */
.add-row-btn {
  width: 100%; min-height: 46px; border-radius: 12px; border: 1.5px dashed var(--border-medium);
  background: var(--bg-subtle); color: var(--primary-main); font: inherit; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
}
.add-row-btn:hover { background: var(--primary-extra-light); border-color: var(--primary-main); }
.add-row-btn-inline { width: auto; min-height: 40px; padding: 0 16px; margin-top: 12px; }
.add-row-plus {
  width: 22px; height: 22px; border-radius: 7px; background: var(--primary-light);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 700;
}

/* ====================== Parametres avances ====================== */
.adv-head { padding: 0 4px; display: grid; gap: 4px; margin-top: 2px; }
.adv-head-title { font-size: 1.2rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.adv-list { display: flex; flex-direction: column; gap: 12px; }

.collapsible { background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); overflow: hidden; }
.collapsible-head { width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: transparent; border: none; cursor: pointer; text-align: left; font: inherit; }
.collapsible-icon {
  width: 36px; height: 36px; border-radius: 10px; background: var(--primary-extra-light);
  color: var(--primary-main); display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; flex: 0 0 36px;
}
.collapsible-icon-text { font-size: 1.2rem; font-weight: 700; }
.collapsible-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.collapsible-name { font-size: 1.45rem; font-weight: 700; color: var(--text-primary); }
.collapsible-summary { font-size: 1.2rem; }
.collapsible-chevron { font-size: 1.2rem; color: var(--text-muted); transition: transform 0.2s; }
.collapsible-head[aria-expanded="true"] .collapsible-chevron { transform: rotate(180deg); }
.collapsible-body { padding: 0 20px 20px; display: grid; gap: 0; }
.dns-help { margin-top: 12px; font-size: 1.2rem; }

/* ====================== Rail (lecture seule + recap) ====================== */
.cfg-rail { min-width: 0; }
.rail-card { background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 16px 18px; }
.rail-card-readonly { background: var(--primary-extra-light); }
.rail-card-head { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; }
.rail-card-head-muted { color: var(--text-muted); }
.rail-facts { margin: 0; display: grid; gap: 0; }
.rail-facts > div { padding: 9px 0; border-top: 1px solid var(--border-light); }
.rail-facts dt { font-size: 1.1rem; font-weight: 700; color: var(--text-muted); }
.rail-facts dd { margin: 2px 0 0; font-size: 1.25rem; font-weight: 600; word-break: break-all; }
.rail-recap { margin: 0; display: grid; gap: 0; }
.rail-recap > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--border-light); }
.rail-recap dt { font-size: 1.25rem; color: var(--text-muted); }
.rail-recap dd { margin: 0; font-size: 1.25rem; font-weight: 700; }

/* ====================== Bandeaux (tri-etat + feedback) ====================== */
#banners { display: grid; gap: 0; }
.banner { display: flex; gap: 14px; padding: 14px 18px; border-radius: var(--radius-lg); margin-bottom: 18px; }
.banner-icon { width: 26px; height: 26px; border-radius: 8px; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 26px; }
.banner-body { min-width: 0; }
.banner-title { font-weight: 700; font-size: 1.3rem; }
.banner-list { margin: 6px 0 0; padding-left: 18px; font-size: 1.2rem; line-height: 1.7; }
.banner-error { background: var(--status-error-bg); border: 1px solid var(--status-error-border); color: var(--status-error); }
.banner-error .banner-icon { background: var(--status-error); }
.banner-warn { background: var(--status-warning-bg); border: 1px solid var(--status-warning-border); color: var(--status-warning); }
.banner-warn .banner-icon { background: var(--status-warning); border-radius: 8px; }
.banner-ok { background: var(--status-success-bg); border: 1px solid var(--status-success-border); color: var(--status-success); align-items: center; }
.banner-ok .banner-icon { background: var(--status-success); border-radius: 50%; }

.inline-feedback { padding: 12px 16px; border-radius: var(--radius-lg); font-weight: 500; margin-bottom: 18px; }
.inline-feedback.success { background: var(--status-success-bg); color: var(--status-success); }
.inline-feedback.error { background: var(--status-error-bg); color: var(--status-error); }

.empty-state { color: var(--text-muted); text-align: center; padding: 20px; border: 1.5px dashed var(--border-light); border-radius: 12px; font-size: 1.25rem; }

/* ====================== Boutons design-system ====================== */
.button {
  height: 38px; padding: 0 18px; border-radius: 11px; font: inherit; font-weight: 700;
  border: 1px solid transparent; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; white-space: nowrap;
}
.button-primary { background: var(--primary-main); color: #fff; box-shadow: 0 6px 16px rgba(60, 80, 224, 0.24); }
.button-primary:hover { background: var(--primary-dark); }
.button-secondary { background: var(--bg-surface); color: var(--text-muted); border-color: var(--border-medium); }
.button-secondary:hover { background: var(--bg-page); }
.button-tertiary { background: none; color: var(--text-muted); }
.button:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn-sm { height: 32px; font-size: 1.2rem; padding: 0 12px; }

/* ====================== Modale recap ====================== */
.modal-overlay { position: fixed; inset: 0; background: rgba(22, 23, 95, 0.42); backdrop-filter: blur(3px); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: var(--bg-surface); border-radius: 20px; width: 100%; max-width: 560px; max-height: 86vh; overflow: auto; box-shadow: 0 30px 80px rgba(22, 23, 95, 0.4); }
.modal-head { padding: 22px 26px 16px; border-bottom: 1px solid var(--border-light); position: sticky; top: 0; background: var(--bg-surface); border-radius: 20px 20px 0 0; }
.modal-eyebrow { font-size: 1.1rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--primary-main); }
.modal-head h3 { margin: 6px 0 0; font-size: 1.9rem; font-weight: 700; }
.modal-close { position: absolute; top: 18px; right: 20px; width: 32px; height: 32px; border-radius: 8px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 1.4rem; }
.modal-close:hover { background: var(--bg-page); }
.modal-body { padding: 18px 26px 4px; }
.modal-error-note { background: var(--status-error-bg); border: 1px solid var(--status-error-border); border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; font-size: 1.2rem; color: var(--status-error); font-weight: 600; }
.modal-foot { padding: 16px 26px 22px; display: flex; gap: 12px; justify-content: flex-end; border-top: 1px solid var(--border-light); position: sticky; bottom: 0; background: var(--bg-surface); }
.recap-group { margin-bottom: 16px; }
.recap-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.recap-group-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary-main); }
.recap-group-title { font-size: 1.2rem; font-weight: 700; }
.recap-row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0 6px 16px; border-bottom: 1px solid var(--border-light); }
.recap-row dt { font-size: 1.2rem; color: var(--text-muted); margin: 0; }
.recap-row dd { font-size: 1.2rem; font-weight: 600; text-align: right; margin: 0; }

/* ====================== Responsive ====================== */
@media (max-width: 1080px) {
  .cfg-grid { grid-template-columns: minmax(0, 1fr); }
  .cfg-rail-sticky { position: static; }
}
@media (max-width: 768px) {
  .cfg-header { padding: 14px 18px 12px; }
  .cfg-content { padding: 18px 18px 56px; }
}
@media (max-width: 640px) {
  .builder-row { flex-direction: column; align-items: stretch; }
  .btn-remove { width: 100%; }
  .cfg-header-actions { width: 100%; }
  .cfg-header-actions .button { flex: 1; }
}
