:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --border: #e2e8f2;
  --text: #0f1b33;
  --muted: #5b6b85;
  --brand: #1d4ed8;
  --brand-dark: #1e3a8a;
  --brand-soft: #e8efff;
  --navy: #0b1f3d;
  --elec: #f59e0b;
  --gaz: #0d9488;
  --market: #64748b;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 14px; line-height: 1.45; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 236px; flex-shrink: 0; background: var(--navy); color: #dbe4f3; display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; margin-top: 24px; flex: 1; }
.sidebar nav a { color: #c5d2d9; padding: 9px 12px; border-radius: 8px; font-weight: 500; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.sidebar nav a.active { background: rgba(96,140,255,.22); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.sidebar-foot { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 12px; }
.sidebar-foot .btn-ghost { color: #c5d2d9; justify-content: flex-start; }
.brand { display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: 16px; }
.brand small { display: block; font-weight: 400; font-size: 11.5px; opacity: .7; }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; letter-spacing: -.5px; }
.main { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 28px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.crumbs { color: var(--muted); }
.crumbs a { color: var(--muted); }
.view { padding: 24px 28px 48px; max-width: 1400px; }
.btn.menu-toggle { display: none; }

/* ---------- Composants ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 500; }
.kpi .value { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 13px; font-weight: 500; color: var(--muted); }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.elec { border-top: 3px solid var(--elec); }
.kpi.gaz { border-top: 3px solid var(--gaz); }
.kpi.accent { border-top: 3px solid var(--brand); }
.chart-box { position: relative; height: 300px; }
.chart-box.tall { height: 420px; }
.chart-box.short { height: 220px; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(127,127,127,.12); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }
.btn-danger { color: var(--danger); }
.btn:disabled { opacity: .55; cursor: wait; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2); position: sticky; top: 0; white-space: nowrap; }
th.num { text-align: right; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--brand-soft); }
tfoot td { font-weight: 700; background: var(--surface-2); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: #eef2f6; color: var(--muted); white-space: nowrap; }
.badge.elec { background: #fef3c7; color: #92400e; }
.badge.gaz { background: #ccfbf1; color: #115e59; }
.badge.ok { background: #e3f6e9; color: var(--ok); }
.badge.warn { background: #fdf3e1; color: var(--warn); }
.badge.danger { background: #fde8e8; color: var(--danger); }
.delta-up { color: var(--danger); font-weight: 600; }
.delta-down { color: var(--ok); font-weight: 600; }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(29,78,216,.30); border-color: var(--brand); }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
label[hidden], [data-for][hidden] { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 6px 12px; font: inherit; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--brand-soft); color: var(--brand-dark); }

.acp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.acp-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s, transform .15s; }
.acp-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.acp-card h3 { margin-bottom: 2px; }
.acp-card .bars { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: #eef2f6; margin: 10px 0 8px; }
.acp-card .bars span { display: block; }
.acp-card .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

.info-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.info-list dt { color: var(--muted); font-size: 12.5px; }
.info-list dd { margin: 0; font-weight: 500; }

.notice { padding: 10px 14px; border-radius: 8px; background: #fdf3e1; color: #7a4a06; font-size: 13px; margin-bottom: 16px; }
.notice.info { background: #e6f0fb; color: #1e4471; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* ---------- Dépôt de factures ---------- */
.dropzone { border: 2px dashed #b9c6d0; border-radius: var(--radius); padding: 26px; text-align: center; color: var(--muted); background: var(--surface-2); transition: all .15s; cursor: pointer; }
.dropzone.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.dropzone strong { color: var(--text); display: block; font-size: 15px; margin-bottom: 4px; }
.upload-item { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-top: 12px; background: #fff; }
.upload-item header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.upload-item.saved { border-color: var(--ok); background: #f3fbf6; }

/* ---------- Modale / toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(15, 29, 36, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 14px; padding: 22px; width: min(720px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 60; box-shadow: var(--shadow); }
.toast.error { background: var(--danger); }

/* ---------- Connexion ---------- */
.login-page { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(135deg, #0b1f3d 0%, #1d4ed8 100%); padding: 16px; }
.login-card { background: #fff; border-radius: 16px; padding: 32px; width: min(400px, 100%); box-shadow: 0 30px 60px rgba(0,0,0,.3); }
.login-card form { display: flex; flex-direction: column; gap: 14px; margin: 26px 0 16px; }
.brand-lg { font-size: 19px; }
.error { color: var(--danger); min-height: 1em; margin: 0; font-size: 13px; }

@media (max-width: 1000px) {
  .g-2, .g-3, .g-2-1 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; left: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .btn.menu-toggle { display: inline-flex; }
  .view { padding: 16px; }
  .topbar { padding: 10px 16px; }
}

/* ---------- Conseiller (chat) ---------- */
.chat-fab { position: fixed; right: 20px; bottom: 20px; z-index: 30; background: var(--brand); color: #fff; border: 0; border-radius: 999px; padding: 12px 18px; font: inherit; font-weight: 700; box-shadow: 0 8px 24px rgba(0,0,0,.18); cursor: pointer; }
.chat-fab:hover { background: var(--brand-dark); }
.chat-panel { position: fixed; right: 20px; bottom: 20px; z-index: 35; width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100vh - 40px)); background: #fff; border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,.25); display: flex; flex-direction: column; overflow: hidden; }
.chat-panel[hidden] { display: none; }
.chat-panel header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: var(--navy); color: #fff; }
.chat-panel header .btn-ghost { color: #dbe5ea; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 88%; padding: 9px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--border); }
.chat-msg.user { align-self: flex-end; background: var(--brand-soft); border-color: #c7d7fe; }
.chat-msg.advisor { border-left: 3px solid var(--brand); }
.chat-who { font-size: 11px; color: var(--muted); margin-bottom: 3px; font-weight: 600; }
.chat-text p { margin: 0 0 6px; } .chat-text p:last-child { margin-bottom: 0; }
.chat-text ul, .chat-text ol { margin: 4px 0 6px; padding-left: 20px; }
.chat-sys { align-self: center; font-size: 12px; color: var(--muted); text-align: center; padding: 2px 8px; }
.chat-typing { align-self: flex-start; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 3px; }
.chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: blink 1.2s infinite; }
.chat-typing span:nth-child(2) { animation-delay: .2s; } .chat-typing span:nth-child(3) { animation-delay: .4s; margin-right: 6px; }
@keyframes blink { 0%, 80%, 100% { opacity: .2 } 40% { opacity: 1 } }
.chat-panel form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.chat-panel textarea { flex: 1; resize: none; }
.chat-legal { font-size: 10.5px; color: var(--muted); padding: 0 12px 8px; }
.nav-badge { background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; margin-left: 6px; }
.conv-layout { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); gap: 16px; }
.conv-list { max-height: 70vh; overflow-y: auto; }
.conv-item { padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.conv-item:hover, .conv-item.on { background: var(--brand-soft); }
.conv-thread { height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); padding: 12px; border-radius: 10px; margin-bottom: 10px; }
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-list li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); }
.alert-list li:last-child { border-bottom: 0; }
@media (max-width: 1000px) { .conv-layout { grid-template-columns: minmax(0, 1fr); } }
@media print { .sidebar, .topbar, .chat-fab, .chat-panel { display: none !important; } }

/* ---------- Refonte UX (thème bleu, navigation simplifiée) ---------- */
.sidebar nav a { display: flex; align-items: center; gap: 10px; }
.sidebar nav a[hidden] { display: none; }
.sidebar nav .ico { width: 20px; text-align: center; opacity: .85; font-size: 15px; }
.sidebar nav a.active { background: rgba(96,140,255,.22); color: #fff; box-shadow: inset 3px 0 0 #7aa2ff; }
.brand-mark { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.topbar { gap: 16px; }
.crumbs { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search { position: relative; width: min(440px, 45vw); }
.search input { width: 100%; padding: 9px 36px 9px 14px; border-radius: 999px; background: var(--surface-2); }
.search kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; background: #fff; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(15,27,51,.14); z-index: 20; overflow: hidden; }
.search-results a { display: flex; flex-direction: column; padding: 9px 14px; color: var(--text); border-bottom: 1px solid var(--border); }
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover, .search-results a.sel { background: var(--brand-soft); text-decoration: none; }

.view { max-width: 1280px; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.hero h1 { font-size: 26px; letter-spacing: -.3px; }
.hero p { margin: 4px 0 0; }
.kpi { border-radius: 14px; padding: 16px 18px; border-top-width: 0 !important; position: relative; overflow: hidden; }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--border); }
.kpi.elec::before { background: var(--elec); } .kpi.gaz::before { background: var(--gaz); } .kpi.accent::before { background: var(--brand); }
.kpi .label { text-transform: uppercase; letter-spacing: .4px; font-size: 11px; font-weight: 700; }
.kpi .value { font-size: 24px; }
.kpi .soon { font-size: 18px; color: var(--muted); font-weight: 600; }
.card { border-radius: 14px; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.setup { border-left: 4px solid var(--brand); margin-bottom: 16px; }
.check-list { margin: 0; padding-left: 18px; } .check-list li { margin: 4px 0; }

.acp-list { display: flex; flex-direction: column; max-height: 560px; overflow-y: auto; margin: 0 -8px; }
.acp-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(120px, 1fr) 170px 14px; gap: 14px; align-items: center; padding: 10px 8px; border-radius: 10px; color: var(--text); border-bottom: 1px solid var(--border); }
.acp-row:hover { background: var(--brand-soft); text-decoration: none; }
.acp-main { display: flex; flex-direction: column; min-width: 0; }
.acp-main span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acp-vol .bars { display: flex; height: 7px; border-radius: 4px; overflow: hidden; background: #edf1f7; margin-bottom: 3px; }
.acp-vol .bars span { display: block; }
.acp-tags { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.chev { color: var(--muted); font-size: 20px; }

.alert-list li { align-items: center; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--muted); }
.dot.danger { background: var(--danger); } .dot.warn { background: #f59e0b; } .dot.info { background: var(--brand); }

.back { display: inline-block; margin-bottom: 6px; color: var(--muted); font-weight: 600; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: -4px 0 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.tabs .count { background: #edf1f7; color: var(--muted); border-radius: 999px; font-size: 11px; padding: 1px 7px; margin-left: 4px; }
.intro { color: var(--muted); max-width: 820px; margin: 0 0 16px; }
.contract-list { list-style: none; margin: 0 0 10px; padding: 0; }
.contract-list li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.btn-primary { box-shadow: 0 1px 2px rgba(29,78,216,.3); }

@media (max-width: 760px) {
  .search { width: auto; flex: 1; } .search kbd { display: none; } .crumbs { display: none; }
  .acp-row { grid-template-columns: minmax(0, 1fr) auto 14px; } .acp-vol { display: none; }
  .hero h1 { font-size: 22px; }
}
.search input:focus + kbd, .search input:not(:placeholder-shown) + kbd { display: none; }
@media (max-width: 760px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 14px; } .kpi .value { font-size: 19px; } .kpi .sub { font-size: 11px; }
  .chat-fab { width: 54px; height: 54px; padding: 0; font-size: 0; border-radius: 50%; }
  .chat-fab::before { content: '💬'; font-size: 22px; }
  .acp-box .toolbar, #acp-box .toolbar { flex-direction: column; align-items: stretch; }
  .page-head .actions { width: 100%; } .page-head .actions .btn { flex: 1; justify-content: center; }
}

/* ---------- Planification (À faire, échéancier) ---------- */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.card-head h2 { margin: 0; }
.inline-label { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.inline-label select { width: auto; }
.dot.ok { background: var(--ok); }
.reco-list .dot { margin-top: 6px; }
.reco-list strong { color: var(--text); }

/* Frise des échéances */
.timeline { --tl-label: 210px; }
.tl-row { display: grid; grid-template-columns: var(--tl-label) minmax(0, 1fr); align-items: center; gap: 12px; padding: 6px 0; border-top: 1px solid var(--border); cursor: pointer; }
.tl-row:hover { background: #f6f9ff; }
.tl-axis-row { border-top: 0; cursor: default; padding-bottom: 2px; }
.tl-axis-row:hover { background: none; }
.tl-label { font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.tl-axis, .tl-track { position: relative; height: 26px; }
.tl-axis { height: 18px; }
.tl-tick { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.tl-tick.year { font-weight: 700; color: var(--text); }
.tl-track { background: repeating-linear-gradient(90deg, transparent 0, transparent calc(100% / var(--months, 12) - 1px), #e3e9f3 calc(100% / var(--months, 12) - 1px), #e3e9f3 calc(100% / var(--months, 12))); border-radius: 4px; }
.tl-bar { position: absolute; top: 8px; height: 10px; border-radius: 5px; min-width: 4px; }
.tl-bar.danger { background: #fca5a5; } .tl-bar.warn { background: #fcd34d; } .tl-bar.ok { background: #86efac; }
.tl-decide, .tl-end, .tl-ag { position: absolute; transform: translate(-50%, -50%); top: 50%; }
.tl-decide { width: 12px; height: 12px; background: var(--danger); transform: translate(-50%, -50%) rotate(45deg); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--danger); }
.tl-end { width: 4px; height: 22px; background: var(--text); border-radius: 2px; }
.tl-ag { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--brand); }
.tl-today { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--brand); opacity: .55; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.tl-legend i { display: inline-block; vertical-align: middle; margin-right: 4px; }
.lg-decide { width: 9px; height: 9px; background: var(--danger); transform: rotate(45deg); }
.lg-bar { width: 22px; height: 8px; border-radius: 4px; background: #fcd34d; }
.lg-end { width: 3px; height: 14px; background: var(--text); }
.lg-ag { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.lg-today { width: 2px; height: 14px; background: var(--brand); opacity: .55; }

/* Cartes des échéances */
.dl-list { display: grid; gap: 12px; }
.dl-card { background: var(--surface, #fff); border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.dl-card.danger { border-left-color: var(--danger); } .dl-card.warn { border-left-color: #f59e0b; } .dl-card.ok { border-left-color: var(--ok); }
.dl-card header { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.dl-card h3 { margin: 0; font-size: 16px; }
.dl-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip { display: inline-flex; flex-direction: column; padding: 6px 12px; border-radius: 8px; background: var(--bg); font-weight: 600; font-size: 14px; }
.chip small { font-weight: 500; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.dl-advice { margin: 0; line-height: 1.5; max-width: 90ch; }
.dl-card details { margin-top: 10px; }
.dl-card summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 13px; }
.dl-acps { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 16px; }
.dl-acps li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--border); }
@media (max-width: 700px) {
  .tl-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .tl-axis-row .tl-label { display: none; }
  .tl-tick:not(.year):not(.quarter) { display: none; }
}
