/* Mise en page propre au tableau de bord « Mon budget » (le reste vient de /ds). */
* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0; min-height: 100vh;
  font-family: var(--font-text); font-size: 1rem; line-height: 1.45;
  background-color: var(--bg); background-image: var(--ambient); background-repeat: no-repeat;
  color: var(--fg);
}
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.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; }

.skip { position: absolute; left: .5rem; top: -100px; z-index: 10; background: var(--accent); color: var(--on-accent); padding: .5rem .75rem; border-radius: 8px; }
.skip:focus { top: .5rem; }

/* En-tête (identique à /partage) */
.site-header { border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 1rem;
  max-width: 1100px; margin: 0 auto;
  padding: 0 max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left));
}
.header-inner.ds-header { margin: 0 auto; padding-top: .5rem; padding-bottom: .5rem; }
.brand { flex: 1 1 0; min-width: 0; color: var(--fg); text-decoration: none; }
.brand .ds-logo { flex: none; }
.brand-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-inner .ds-nav { order: 3; flex: 1 1 100%; }
.header-inner .ds-header__tools { order: 2; }
@media (min-width: 768px) {
  .brand { flex: 0 0 auto; }
  .header-inner .ds-nav { order: 0; flex: 0 1 auto; }
}
.header-inner .ds-nav__item { text-decoration: none; }

.site-main {
  max-width: 1100px; margin: 0 auto; outline: none;
  padding: 1.25rem max(1rem, env(safe-area-inset-right)) max(2.5rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

/* Titre de page */
.page-intro { margin: .25rem 0 1rem; }
.page-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; margin: 0; }
.page-sub { color: var(--muted); font-size: .9rem; margin: .15rem 0 0; }

.stack { display: grid; gap: 12px; }
.stack > *, .dash-grid > *, .calc-result > *, .form-grid > *, .ds-field { min-width: 0; }
.table-scroll { max-width: 100%; }
.dash-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .dash-grid { grid-template-columns: 1.5fr 1fr; align-items: start; }
  .span-2 { grid-column: span 2; }
}
.ds-label { gap: .5rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.card-head .ds-label { flex: 1 1 auto; justify-content: flex-start; }
.card-note { margin: .6rem 0 0; font-family: var(--font-text); font-size: .85rem; }
.ds-num.is-neg { color: var(--neg-text); }
.ds-num.is-pos { color: var(--pos-text); }
.num-caption { margin: .5rem 0 0; color: var(--muted); font-size: .8rem; }
.small { font-size: .85rem; }

.link-row { display: inline-flex; gap: .25rem; flex-wrap: wrap; }
.link-btn {
  background: none; border: 0; padding: 0 .5rem; min-height: var(--tap); min-width: var(--tap);
  font: inherit; color: var(--pos-text); cursor: pointer; border-radius: var(--radius-btn);
}
.link-btn:hover { text-decoration: underline; }
.link-btn:disabled { opacity: .45; cursor: not-allowed; text-decoration: none; }
.link-btn.danger { color: var(--neg-text); }

/* Dépassements */
.overspent { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: 8px; }
.overspent li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; background: var(--neg-soft); color: var(--neg-text); font-weight: 600; font-size: .92rem;
}
.overspent .amt { font-family: var(--font-mono); white-space: nowrap; }
.ds-card .ds-alert { margin-top: .6rem; }

/* Comptes inclus */
.acc-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: .6rem; }
.acc-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card-hi); font-size: .9rem; cursor: pointer;
}
.acc-chip input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.acc-chip:has(input:not(:checked)) { color: var(--muted); }

/* Prochaine paie */
.total-card .ds-label { justify-content: space-between; }
.toolbar { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: .5rem; }
.toolbar .ds-input { flex: 1 1 240px; min-width: 0; }
.table-scroll { overflow-x: auto; }
.pay-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.pay-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: .78rem; padding: 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pay-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.pay-table .num { text-align: right; }
.pay-table td.num { font-family: var(--font-mono); white-space: nowrap; }
.pay-table td.neg { color: var(--neg-text); }
.pay-table td.pos { color: var(--pos-text); }
.pay-table td.nowrap { white-space: nowrap; }
.pay-table td.actions { text-align: right; }
.pay-table .empty { text-align: center; color: var(--muted); padding: 1.25rem; }
.pay-table tr.is-excluded td:not(:first-child) { opacity: .45; }
.ds-meta-cell { color: var(--muted); }
.sort-btn { background: none; border: 0; padding: 0; min-height: 32px; font: inherit; color: inherit; cursor: pointer; }
.sort-btn:hover { color: var(--fg); }
.row-check { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.edit-row td { background: var(--card-hi); }
.edit-form { padding: .5rem 0; }
.edit-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .edit-grid { grid-template-columns: 9rem 1fr 1fr 1fr 8rem; } }
.edit-form .ds-alert { margin-top: .6rem; }
.pay-item { border-bottom: 1px solid var(--line); }
.pay-item:last-child { border-bottom: 0; }
.pay-item .ds-list__row { border-bottom: 0; }
.pay-item.is-excluded .ds-list__main, .pay-item.is-excluded .ds-list__amt { opacity: .45; }
.pay-item__actions { display: flex; justify-content: flex-end; margin-top: -6px; }
.pay-item .edit-form { padding: 0 0 .75rem; }

/* Calculateur */
.seg-row { display: flex; gap: 14px 24px; flex-wrap: wrap; margin-bottom: .75rem; }
.seg-field { display: grid; gap: 6px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; background: var(--well); border-radius: 10px; padding: 3px; }
.seg button {
  border: 0; background: none; font: inherit; font-size: .9rem; color: var(--muted);
  min-height: 40px; padding: 0 12px; border-radius: 8px; cursor: pointer;
}
.seg button.on { background: var(--card); color: var(--fg); box-shadow: var(--shadow); font-weight: 600; }
.form-grid { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: .75rem; }
@media (min-width: 700px) { .form-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
.form-grid:empty { display: none; }
.ds-field { display: grid; gap: 6px; }
.ds-field .ds-label { justify-content: flex-start; }
.readout { min-height: var(--tap); display: flex; align-items: center; padding: 0 12px; border-radius: var(--radius-btn); background: var(--well); font-family: var(--font-mono); }
.app-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: .75rem; }
.app-actions.start { justify-content: flex-start; }
.calc-result { margin-top: 1rem; display: grid; gap: 12px; }
.calc-result:empty { display: none; }
.result-big { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.result-card .result-big { color: var(--pos-text); }
.result-detail { margin-top: .25rem; color: var(--muted); }
.ds-alert .result-detail { color: inherit; }
.schedule summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; font-weight: 600; }
.schedule .table-scroll { max-height: 420px; overflow: auto; }
.schedule td { white-space: nowrap; }
.saved-row { flex-wrap: wrap; }
.saved-row .ds-list__main { flex: 1 1 200px; }
.saved-actions { display: inline-flex; gap: 4px; margin-left: auto; }
.saved-row .ds-list__amt { white-space: nowrap; }
.print-only { display: none; }

/* Boîte de confirmation */
.app-dialog {
  border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--card); color: var(--fg);
  padding: 1.25rem; max-width: min(440px, calc(100vw - 2rem)); box-shadow: var(--shadow);
}
.app-dialog::backdrop { background: rgba(10, 14, 16, .45); }
.app-dialog h2 { margin: 0 0 .5rem; font-size: 1.15rem; }

/* Impression (PDF du calculateur) */
@media print {
  .site-header, .skip, .page-intro, .calc-card > :not(.calc-result), .calc-result .app-actions, .saved-row, section[aria-labelledby="saved-title"] { display: none !important; }
  body { background: #fff; color: #000; }
  .print-only { display: block; }
  .schedule summary { display: none; }
  :root[data-theme="dark"] { --fg: #11181c; --muted: #5d6b73; --pos-text: #0a7358; --neg-text: #b02d45; --card: #ffffff; --line: #e2e7ea; --well: #eef1f3; }
  .print-table th { text-align: left; padding-right: 1rem; }
  .schedule .table-scroll { max-height: none; overflow: visible; }
}

/* Téléphone : les sélecteurs segmentés occupent toute la largeur, libellés sur deux lignes au besoin */
@media (max-width: 640px) {
  .seg-row { display: grid; }
  .seg { display: flex; width: 100%; }
  .seg button { flex: 1 1 0; min-width: 0; padding: 6px 8px; line-height: 1.2; white-space: normal; }
}
.pay-table td.empty-cell { padding: .75rem 0; }

/* Filtre des comptes (Prochaine paie) : bouton icône + pastille quand un compte est décoché */
.filter-btn { position: relative; flex: none; }
.filter-btn.is-filtered { border-color: var(--accent); color: var(--pos-text); }
.filter-badge {
  position: absolute; top: -6px; right: -8px; padding: 1px 6px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font-size: .7rem; font-weight: 700; line-height: 1.4;
}
.acc-dialog { width: min(480px, calc(100vw - 2rem)); }
.acc-dialog .card-head h2 { margin: 0; }
@media (max-width: 640px) {
  .acc-dialog { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: var(--radius-card) var(--radius-card) 0 0; padding-bottom: max(1.25rem, env(safe-area-inset-bottom)); }
}

/* Rapports (tableau de bord) : Dépenses par catégorie, Revenus vs dépenses */
.reports { margin-top: 1.5rem; }
.rep-title { font-family: var(--font-display); font-size: 1.2rem; margin: 0 0 .5rem; }
.rep-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.rep-controls .ds-select { width: auto; min-height: 40px; }
.rep-custom { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: .85rem; }
.rep-custom[hidden] { display: none; }
.rep-custom .ds-input { width: auto; min-height: 40px; }
.rep-range { color: var(--muted); font-size: .85rem; }
.rep-range-err { margin: 0 0 12px; }
.rep-filter { max-height: 85vh; }
.rep-filter h2 { margin: 0 0 .25rem; }
.rep-filter-part { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.rep-filter-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.rep-filter-head h3 { margin: 0; font-size: 1rem; }
.rep-filter-head h4 { margin: 0; font-size: .85rem; color: var(--muted); font-weight: 600; }
.rep-filter-head.is-group { margin-top: 12px; }
.card-soft { background: linear-gradient(180deg, var(--card-a), var(--card-b)); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow), 0 18px 40px -28px rgba(17, 24, 28, .35); }
.rep-breakdown { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 860px) { .rep-breakdown { grid-template-columns: 300px minmax(0, 1fr); } }
.donut-card { padding: 18px; }
.donut { position: relative; width: 248px; height: 248px; margin: 4px auto 0; }
.donut svg { display: block; overflow: visible; filter: drop-shadow(0 8px 14px rgba(17, 24, 28, .16)); }
.donut path.seg { transition: transform .15s; transform-origin: 124px 124px; cursor: pointer; }
.donut path.seg:hover { transform: scale(1.03); }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut-kicker { display: block; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: .66rem; font-weight: 600; }
.donut-center b { display: block; font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 1.3rem; letter-spacing: -.01em; }
.rep-legend { display: grid; gap: 4px; margin-top: 16px; font-size: .86rem; }
.rep-legend > button { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: center; width: 100%; min-height: 36px; padding: 6px 8px; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.rep-legend > button:hover { background: var(--well); }
.rep-legend .lg-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-legend .swatch { width: 12px; height: 12px; border-radius: 4px; box-shadow: 0 2px 6px -2px rgba(0, 0, 0, .35); }
.rep-legend em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.rep-tree { display: grid; gap: 6px; min-width: 0; }
.rep-list { display: grid; gap: 8px; min-width: 0; }
.rep-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 8px; }
.rep-tools .seg button { min-height: 36px; font-size: .82rem; }
.rep-tools .seg:first-child { margin-right: auto; }
.rep-list .rep-tools { margin-bottom: 0; }
.rep-all { min-height: 36px; padding: 0 12px; font-size: .82rem; }
.rep-grp { scroll-margin: 12px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(180deg, var(--card-a), var(--card-b)); box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }
.rep-grp:hover { box-shadow: var(--shadow), 0 14px 30px -22px rgba(17, 24, 28, .4); transform: translateY(-1px); }
.rep-grp[open] { box-shadow: var(--shadow), 0 18px 38px -26px rgba(17, 24, 28, .45); transform: none; }
.rep-grp > summary, .rep-cat > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 14px minmax(0, 1fr) auto 48px; gap: 10px; align-items: center; padding: 10px 12px; min-height: 44px; }
.rep-grp summary::-webkit-details-marker, .rep-flat summary::-webkit-details-marker { display: none; }
.rep-grp summary .chev, .rep-flat summary .chev { transition: transform .15s; color: var(--muted); }
.rep-grp[open] > summary .chev, .rep-cat[open] > summary .chev { transform: rotate(90deg); }
.rep-grp .amt, .rep-flat .amt { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; white-space: nowrap; }
.rep-grp .pct, .rep-flat .pct { color: var(--muted); font-size: .8rem; text-align: right; font-variant-numeric: tabular-nums; }
.grp-name { font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
.grp-name i { flex: none; width: 28px; height: 28px; border-radius: 9px; display: inline-grid; place-items: center; color: #fff; font-style: normal; font-size: .8rem; font-weight: 700; box-shadow: 0 6px 12px -6px rgba(0, 0, 0, .45); }
.rep-cats { padding: 0 8px 8px 22px; display: grid; gap: 2px; }
.cat-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rep-pick { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.rep-picked { position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: min(720px, calc(100% - 24px)); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 14px; background: var(--card-a); box-shadow: var(--shadow), 0 18px 40px -16px rgba(17, 24, 28, .5); }
.rep-breakdown.has-picked { padding-bottom: 96px; }
.rep-tx tr.rep-txrow { cursor: pointer; }
.rep-tx tr.rep-txrow:hover td { background: var(--well); }
.rep-tx tr.is-picked td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.rep-tx td.pick-cell { width: 26px; padding-right: 0; }
.rep-picked[hidden] { display: none; }
.rep-picked b { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.rep-cat > summary { padding: 8px 10px; border-radius: 10px; }
.rep-cat > summary:hover { background: var(--well); }
.rep-bar { height: 6px; border-radius: 999px; background: var(--well); grid-column: 2 / 4; margin-top: -2px; overflow: hidden; }
.rep-bar i { display: block; height: 100%; border-radius: 999px; }
/* « Toutes les catégories » : une carte par catégorie, rang et groupe rappelé sous le nom */
.rep-flat > .rep-cat { scroll-margin: 12px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(180deg, var(--card-a), var(--card-b)); box-shadow: var(--shadow); }
.rep-flat > .rep-cat > summary { padding: 10px 12px; }
.rep-flat .rank { flex: none; min-width: 1.6em; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; text-align: right; }
.flat-name { display: grid; min-width: 0; font-weight: 600; }
.flat-name > span, .flat-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flat-name small { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .76rem; font-weight: 400; }
.flat-name small i { flex: none; width: 8px; height: 8px; border-radius: 3px; }
.rep-tx { padding: 0 6px 8px 34px; overflow-x: auto; }
.rep-tx table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.rep-tx td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rep-tx td.num { text-align: right; font-family: var(--font-display); font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.rep-tx td.pos { color: var(--pos-text); }
.rep-tx td.nowrap { white-space: nowrap; color: var(--muted); }
.rep-tx tr:last-child td { border-bottom: 0; }
.rep-tx .meta { color: var(--muted); font-size: .78rem; }
.rep-more { margin: 6px 4px 0; color: var(--muted); font-size: .8rem; }
.rep-tx tr.rep-mirror td { background: color-mix(in srgb, var(--well) 55%, transparent); }
.rep-partage { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; min-height: 28px; padding: 2px 10px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); background: color-mix(in srgb, var(--accent) 12%, transparent); color: inherit; font-size: .76rem; font-weight: 600; text-decoration: none; }
.rep-partage::after { content: "↗"; color: var(--muted); }
.rep-partage:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.rep-tx tr.rep-hl td { background: color-mix(in srgb, var(--accent) 16%, transparent); transition: background .6s; }
.ie-card { padding: 6px 0 2px; overflow: hidden; background: var(--card); }
.ie-wrap { overflow-x: auto; }
.ie { width: 100%; border-collapse: collapse; font-size: .85rem; }
.ie th, .ie td { padding: 10px 9px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); white-space: nowrap; text-align: right; font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: .9rem; font-weight: 400; }
.ie thead th { font-family: var(--font-text); color: var(--muted); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; background: var(--card); }
.ie tbody tr:hover > * { background: color-mix(in srgb, var(--well) 60%, var(--card)); }
.ie tr > :first-child { text-align: left; font-family: var(--font-text); position: sticky; left: 0; background: var(--card); z-index: 1; padding-left: 12px; min-width: 140px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.ie tr.section > * { padding-top: 16px; border-bottom: 0; background: var(--card); }
.ie tr.section th span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.ie tr.section.inc th span { background: var(--pos-soft); color: var(--pos-text); }
.ie tr.section.exp th span { background: var(--neg-soft); color: var(--neg-text); }
.ie tr.section.inc th span::before { content: "↗"; }
.ie tr.section.exp th span::before { content: "↘"; }
.ie tr.grp > * { font-weight: 600; cursor: pointer; }
.grp-toggle { display: inline-flex; gap: 6px; align-items: center; max-width: 100%; min-height: 28px; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.grp-toggle::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.grp-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.ie tr.cat > :first-child { padding-left: 30px; color: var(--muted); }
.ie tr.net > * { font-weight: 700; background: color-mix(in srgb, var(--well) 50%, var(--card)); }
.ie tr.final > * { font-size: 1rem; border-bottom: 0; }
.ie td.pos { color: var(--pos-text); }
.ie td.neg { color: var(--neg-text); }
.ie tr.final td span { display: inline-block; padding: 3px 9px; border-radius: 999px; }
.ie tr.final td.pos span { background: var(--pos-soft); }
.ie tr.final td.neg span { background: var(--neg-soft); }
.rep-bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 14px; align-items: end; height: 150px; padding: 18px 18px 6px; }
.rep-bars .m { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 6px; min-width: 0; }
.rep-bars .pair { display: flex; gap: 4px; align-items: end; justify-content: center; }
.rep-bars .pair i { width: min(18px, 40%); min-height: 2px; border-radius: 8px 8px 4px 4px; box-shadow: 0 6px 12px -8px rgba(0, 0, 0, .45); }
.rep-bars .pair i.in { background: linear-gradient(180deg, var(--gauge-b), var(--gauge-a)); }
.rep-bars .pair i.out { background: linear-gradient(180deg, var(--gauge2-b), var(--gauge2-a)); }
.rep-bars .lbl { text-align: center; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; overflow: hidden; }
.rep-bars-legend { display: flex; gap: 14px; padding: 0 18px 10px; font-size: .8rem; color: var(--muted); }
.rep-bars-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.rep-bars-legend .in::before { background: var(--gauge-a); }
.rep-bars-legend .out::before { background: var(--gauge2-a); }
.rep-hint { margin: 8px 2px 0; color: var(--muted); font-size: .8rem; }
@media (max-width: 640px) {
  .rep-bars { gap: 6px; padding: 14px 10px 6px; }
  .rep-cats { padding-left: 6px; }
  .rep-tx { padding-left: 8px; }
  .rep-grp > summary, .rep-cat > summary { grid-template-columns: 14px minmax(0, 1fr) auto 40px; gap: 8px; padding: 10px; }
  .ie tr > :first-child { min-width: 120px; max-width: 140px; }
}
