:root {
  --bg: #f3efe7;
  --panel: #fffdf8;
  --panel-strong: #f8f3ea;
  --text: #22313a;
  --muted: #66757f;
  --line: #d8ddd8;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: #dceeea;
  --danger: #b5473a;
  --shadow: 0 18px 45px rgba(34, 49, 58, 0.08);
}

body {
  margin: 0;
  padding: 32px 20px 48px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.08), transparent 28%),
    linear-gradient(180deg, #f8f4ec 0%, var(--bg) 100%);
}

search-bar > div {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px;
  border: 1px solid rgba(17, 94, 89, 0.08);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.app-shell {
  max-width: 1180px;
  margin: 0 auto;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto 18px;
  padding: 14px 18px;
  border: 1px solid rgba(17, 94, 89, 0.08);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.app-topbar-left {
  display: flex;
  align-items: center;
}

.app-topbar-label {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.app-topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.app-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.app-link.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: rgba(15, 118, 110, 0.18);
}

.app-link-static {
  cursor: default;
  pointer-events: none;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-back-button {
  padding: 10px 14px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-strong);
}

.route-panel {
  margin: 0 auto;
  padding: 28px;
  border: 1px solid rgba(17, 94, 89, 0.08);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

h3,
h4 {
  margin: 0;
  color: var(--text);
}

h3 {
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.search-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.intro-text {
  max-width: 720px;
  margin: 12px 0 0;
  line-height: 1.6;
}

form {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

input {
  flex: 1 1 320px;
  min-width: 260px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.18);
  border-color: var(--accent);
}

button {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

p {
  color: var(--muted);
}

.empty-state {
  margin-top: 22px;
  padding: 22px;
  border: 1px dashed rgba(15, 118, 110, 0.24);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.85)),
    var(--panel-strong);
}

.empty-copy h4 {
  margin-bottom: 8px;
}

.empty-copy p {
  margin: 0;
  max-width: 760px;
  line-height: 1.6;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.ghost-button {
  padding: 10px 14px;
  border: 1px solid rgba(15, 118, 110, 0.2);
  background: rgba(255, 255, 255, 0.85);
  color: var(--accent-strong);
}

.ghost-button:hover {
  background: rgba(15, 118, 110, 0.1);
}

.map-section {
  margin-top: 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-strong);
}

.map-container {
  margin-top: 14px;
  height: 420px;
  border: 1px solid rgba(17, 94, 89, 0.1);
  border-radius: 16px;
  overflow: hidden;
}

.table-container {
  margin-top: 24px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter', sans-serif;
  background: transparent;
}

thead {
  background: var(--accent-soft);
}

th {
  text-align: left;
  padding: 14px 16px;
  font-weight: 700;
  color: var(--accent-strong);
  cursor: pointer;
}

td {
  padding: 14px 16px;
  border-top: 1px solid #edf0eb;
}

tr:hover {
  background: rgba(15, 118, 110, 0.05);
}

tr.clickable {
  cursor: pointer;
}

.error-message {
  margin-top: 14px;
  color: var(--danger);
  font-weight: 600;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.pagination span {
  font-weight: 600;
  color: var(--text);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.name {
  font-weight: 700;
  color: var(--text);
}

.selectivite {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bar {
  width: 110px;
  height: 9px;
  background: #d9dfdb;
  border-radius: 999px;
  overflow: hidden;
}

.fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

@media (max-width: 720px) {
  body {
    padding: 20px 14px 36px;
  }

  .app-topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    border-radius: 18px;
  }

  .app-topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .app-nav {
    justify-content: flex-start;
  }

  search-bar > div {
    padding: 20px;
    border-radius: 20px;
  }

  h3 {
    font-size: 1.7rem;
  }

  .map-container {
    height: 320px;
  }

  .pagination {
    flex-wrap: wrap;
  }
}
.formation-detail {
  background: white;
  padding: 20px;
  margin-top: 20px;
  border-radius: 8px;
}

.title {
  color: #3b5bff;
  font-weight: bold;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

th {
  background: #f5f5f5;
  padding: 10px;
}

td {
  padding: 10px;
  border: 1px solid #ddd;
}

.total {
  font-weight: bold;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.chart-card {
  background: #fff;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.chart-card h4 {
  margin-bottom: 10px;
}

.charts-css.column td {
  background-color: #20c997;
}


/* ───────────────────────────────────────────
   FORMATION DETAILS VIEW
   À ajouter à la fin de style.css
─────────────────────────────────────────── */

.fdv-loading,
.fdv-notfound {
  padding: 3rem;
  text-align: center;
  color: var(--muted);
}

/* ── Wrapper ── */
.fdv-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px;
  border: 1px solid rgba(17, 94, 89, 0.08);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

/* ── Header ── */
.fdv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.fdv-breadcrumb {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.fdv-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.75rem;
  line-height: 1.35;
}

.fdv-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 2;
}

.fdv-meta strong {
  color: var(--text);
}

/* ── Timeline remplissage ── */
.fdv-remplissage {
  flex-shrink: 0;
  min-width: 170px;
}

.fdv-remplissage h4 {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: right;
  margin: 0 0 0.75rem;
}

.fdv-timeline {
  list-style: none;
  padding: 0 0 0 1rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  border-left: 2px solid var(--line);
}

.fdv-timeline li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  position: relative;
}

.fdv-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  position: absolute;
  left: -1.35rem;
}

.fdv-tl-text {
  display: flex;
  flex-direction: column;
  font-size: 0.82rem;
}

.fdv-tl-label { color: var(--muted); }
.fdv-tl-pct   { font-weight: 700; color: var(--text); }

/* ── Sections ── */
.fdv-section {
  margin-bottom: 2.5rem;
}

.fdv-section h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--line);
  color: var(--text);
}

/* ── Tables ── */
.fdv-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.fdv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}

.fdv-table thead {
  background: var(--accent-soft);
}

.fdv-table th {
  text-align: left;
  padding: 0.6rem 1rem;
  font-weight: 700;
  color: var(--accent-strong);
  cursor: default;
  border-bottom: none;
}

.fdv-table td {
  padding: 0.5rem 1rem;
  border-top: 1px solid #edf0eb;
  color: var(--text);
}

.fdv-table tr:hover {
  background: rgba(15, 118, 110, 0.04);
}

.fdv-total-row td {
  background: var(--panel-strong);
  font-weight: 600;
}

/* ── Grille graphiques ── */
.fdv-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.fdv-chart-card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1rem 0.75rem;
}

.fdv-chart-card h4 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.75rem;
}

/* ── Barres verticales ── */
.fdv-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 110px;
}

.fdv-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
}

.fdv-bar-track {
  width: 100%;
  height: 75px;
  display: flex;
  align-items: flex-end;
}

.fdv-bar-fill {
  width: 100%;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height 0.4s ease;
}

.fdv-bar-pct {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 3px;
  line-height: 1;
}

.fdv-bar-lbl {
  font-size: 0.63rem;
  color: var(--muted);
  text-align: center;
  margin-top: 2px;
  white-space: nowrap;
}

/* ── Progress bars sélectivité ── */
.fdv-progress-block {
  margin-bottom: 1.1rem;
}

.fdv-progress-label {
  display: flex;
  gap: 0.4rem;
  font-size: 0.86rem;
  margin-bottom: 0.35rem;
  color: var(--muted);
}

.fdv-progress-label strong {
  color: var(--text);
}

.fdv-progress-track {
  width: 100%;
  height: 10px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.fdv-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

.fdv-fill-yellow { background: #f4c430; }
.fdv-fill-teal   { background: var(--accent); }

/* ── Bouton retour ── */
.fdv-back-btn {
  margin-top: 0.5rem;
  padding: 10px 18px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.fdv-back-btn:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

@media (max-width: 580px) {
  .fdv-charts-grid { grid-template-columns: 1fr; }
  .fdv-header       { flex-direction: column; }
  .fdv-wrap         { padding: 20px; border-radius: 20px; }
}

.charts-css td {
  transition: all 0.3s ease;
}

/* ───────────────────────────────────────────
   ESTIMATOR VIEW
   À ajouter à la fin de style.css
─────────────────────────────────────────── */

.est-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px;
  border: 1px solid rgba(17, 94, 89, 0.08);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

/* ── Header ── */
.est-header {
  margin-bottom: 2rem;
}

.est-eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.est-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 10px;
}

.est-subtitle {
  max-width: 620px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

/* ── Formulaire ── */
.est-form {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  max-width: 600px;
}

.est-field {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.est-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Radios série ── */
.est-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.est-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  background: var(--panel-strong);
  transition: border-color 140ms ease, background 140ms ease;
}

.est-radio:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.est-radio input[type="radio"] {
  display: none;
}

.est-radio-box {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 140ms ease;
  flex-shrink: 0;
}

.est-radio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transition: opacity 140ms ease;
}

.est-radio input[type="radio"]:checked ~ .est-radio-box {
  border-color: var(--accent);
}

.est-radio input[type="radio"]:checked ~ .est-radio-box .est-radio-dot {
  opacity: 1;
}

.est-radio input[type="radio"]:checked ~ .est-radio-label {
  color: var(--accent-strong);
  font-weight: 700;
}

.est-radio-label {
  font-size: 0.88rem;
  color: var(--text);
  transition: color 140ms ease;
}

/* ── Slider moyenne ── */
.est-moyenne-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
}

.est-slider-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.est-slider-bound {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 20px;
  text-align: center;
}

.est-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  outline: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.est-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.35);
  transition: transform 120ms ease;
}

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

.est-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.35);
}

/* ── Badge mention ── */
.est-mention-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  width: fit-content;
  transition: background 200ms ease, color 200ms ease;
}

.est-mention-badge.class-tbf { background: #d1fae5; color: #065f46; }
.est-mention-badge.class-tb  { background: #dcfce7; color: #166534; }
.est-mention-badge.class-b   { background: #fef9c3; color: #854d0e; }
.est-mention-badge.class-ab  { background: #ffedd5; color: #9a3412; }
.est-mention-badge.class-p   { background: #fee2e2; color: #991b1b; }
.est-mention-badge.class-insuf { background: #f1f5f9; color: var(--muted); }

/* ── Bouton estimer ── */
.est-btn {
  align-self: flex-start;
  padding: 14px 28px;
  font-size: 0.95rem;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.est-btn:hover:not(:disabled) {
  background: var(--accent-strong);
  transform: translateY(-2px);
}

.est-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.est-no-formation {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}

/* ── Résultat ── */
.est-result {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 2px solid var(--line);
  animation: est-fadein 0.4s ease;
}

@keyframes est-fadein {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.est-result-header {
  margin-bottom: 1.25rem;
}

.est-result-formation {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-strong);
  background: var(--accent-soft);
  padding: 5px 12px;
  border-radius: 8px;
}

/* ── Jauge SVG ── */
.est-gauge-wrap {
  display: flex;
  justify-content: center;
  margin: 0.5rem 0 1.5rem;
}

.est-gauge-svg {
  width: 220px;
  height: 120px;
  overflow: visible;
}

.est-gauge-arc {
  transition: stroke-dasharray 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
              stroke 0.4s ease;
}

.est-gauge-pct {
  font-size: 28px;
  font-weight: 800;
  fill: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
}

.est-gauge-lbl {
  font-size: 10px;
  font-weight: 600;
  fill: var(--muted);
  font-family: 'Segoe UI', system-ui, sans-serif;
}

/* ── Cartes détail ── */
.est-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.est-detail-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.est-detail-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}

.est-detail-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 3px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.est-detail-val {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.est-disclaimer {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.6;
  padding: 12px 16px;
  background: var(--panel-strong);
  border-radius: 10px;
  border-left: 3px solid var(--line);
  margin: 0;
}

@media (max-width: 580px) {
  .est-wrap  { padding: 20px; border-radius: 20px; }
  .est-title { font-size: 1.6rem; }
  .est-radio-group { flex-direction: column; }
  .est-btn   { width: 100%; text-align: center; }
}

.cp-section {
  margin-top: 1.5rem;
}

.cp-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.cp-card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
}

.cp-card h4 {
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.cp-empty {
  margin: 0;
}

.cp-chart {
  margin: 0;
  --color: #20c5b3;
}

.cp-chart tbody th {
  font-weight: 700;
}

.cp-mentions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
  align-items: end;
}

.cp-mention-column {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.cp-mention-stack {
  height: 240px;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  background: #f7f3ea;
}

.cp-mention-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  color: #35525b;
  font-size: 0.85rem;
  font-weight: 700;
}

.cp-passable { background: #f56a6a; }
.cp-ab { background: #ffca72; }
.cp-b { background: #ffe58a; }
.cp-tb { background: #8edb78; }
.cp-tbf { background: #79bfff; }

.cp-year {
  text-align: center;
  font-weight: 700;
  color: var(--text);
}

.cp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.cp-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.cp-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.compare-wrap {
  padding: 14px 16px 24px;
}

.compare-head {
  margin-bottom: 8px;
}

.compare-head h3 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.02em;
}

.compare-controls {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.compare-control {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
}

.compare-control input[type="number"] {
  width: 90px;
  min-width: auto;
  padding: 8px 12px;
  border-radius: 8px;
}

.compare-control select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
}

.compare-series label {
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.compare-series input[type="radio"] {
  width: auto;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
  outline: none;
  flex: none;
  cursor: pointer;
  transform: none;
}

.compare-count {
  margin: 0 0 0 auto;
  color: #2e4b5a;
  font-weight: 700;
}

.compare-empty {
  margin-top: 8px;
}

.compare-group {
  margin-top: 20px;
}

.compare-group-title {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 0;
  background: #66c6ed;
  color: #18343d;
  font-size: 1.45rem;
}

.compare-subgroup h5 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 12px;
  font-size: 1.2rem;
}

.compare-badge {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #66c6ed;
  color: #0f5065;
  font-size: 0.8rem;
  font-weight: 700;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.compare-card {
  position: relative;
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  background: #eef5f3;
  padding: 14px 12px 12px;
}

.compare-remove {
  position: absolute;
  top: 7px;
  left: 7px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: #7f8a8f;
  color: #fff;
  font-weight: 700;
  line-height: 20px;
  font-size: 0.8rem;
}

.compare-remove:hover {
  background: #5e686d;
  transform: none;
}

.compare-name {
  display: inline-block;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  margin: 4px 0 10px 24px;
  font-size: 1.04rem;
  font-weight: 800;
  color: #2b3f47;
  text-decoration: underline;
  text-align: left;
  line-height: 1.25;
}

.compare-name:hover {
  background: transparent;
  color: #18343d;
  transform: none;
}

.compare-card ul {
  margin: 0;
  padding: 0 0 0 24px;
  list-style: none;
  color: #1e6365;
  font-weight: 700;
  line-height: 1.4;
  font-size: 1.02rem;
}

.compare-estimation {
  margin: 12px 0 0 24px;
  color: #18343d;
  font-size: 1rem;
}

.compare-card-low {
  border-left-color: #f43f5e;
  background: #fdecef;
  color: #b11c43;
}

.compare-card-low ul {
  color: #c7284f;
}

.compare-card-mid {
  border-left-color: #f4c430;
  background: #fff9db;
}

.compare-card-high {
  border-left-color: #198754;
  background: #eef8f2;
}
