/* Page d'un titre, REFONTE 2026-12-02 (proposition A) : trois onglets sans tuiles ni ancres, sur le
   modèle des pages de portefeuille et de liste - en-tête en aplat de la couleur principale du compte,
   phrase d'état, chiffres clés, cartes à sélecteur (.tks-seg / .tks-pane) et « À retenir ».
   Chargée après ticker.css ; les règles de couleur portent :not(#_) pour passer devant les feuilles
   de saison générées. */

/* ── Onglets : un seul groupe de blocs à l'écran ── */
.tks-corps { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tks-onglet, .tks-panneaux, .tks-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tks-panneau { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tks-panneau:empty { display: none; }
.tks-corps:not([data-onglet="essentiel"]) > .tks-onglet[data-tko="essentiel"],
.tks-corps:not([data-onglet="societe"]) > .tks-onglet[data-tko="societe"],
.tks-corps[data-onglet="essentiel"] > .tks-panneaux,
.tks-corps[data-onglet="historique"] > .tks-panneaux > .tki-panel:not([data-tko="historique"]),
.tks-corps[data-onglet="societe"] > .tks-panneaux > .tki-panel:not([data-tko="societe"]) { display: none !important; }
.tks-page .tf-card.tks-carte { margin: 0; }
.tks-pane[hidden] { display: none !important; }

/* ── En-tête en aplat de la couleur principale ── */
html body .tks-page .tkh:not(#_) { background: linear-gradient(110deg, var(--cc-aplat, #2759b3), var(--cc-vive, #3472d8)) !important;
  border-color: transparent !important; color: #fff !important; box-shadow: 0 6px 20px rgba(15, 23, 42, .14); }
html body .tks-page .tkh :is(.tkh-nom, .tkh-price-val, .tkh-price-cur):not(#_) { color: #fff !important; }
html body .tks-page .tkh :is(.tkh-sous, .tkh-sous b, .tkh-sous .tk-fact-sec, .tkh-sep, .tkh-price-meta, .tkh-price-meta > span, .tkh-fav-texte):not(#_) { color: rgba(255, 255, 255, .88) !important; }
html body .tks-page .tkh .tkh-price-meta strong:not(#_) { background: #fff; border-radius: 999px; padding: 1px 8px; color: #334155 !important; }
html body .tks-page .tkh .tkh-price-meta strong.neg:not(#_) { color: #b91c1c !important; }
html body .tks-page .tkh .tkh-price-meta strong.pos:not(#_) { color: #15803d !important; }
html body .tks-page .tkh a.tkh-idx:not(#_) { color: #fff !important; background: rgba(255, 255, 255, .16) !important; border-color: rgba(255, 255, 255, .4) !important; }
html body .tks-page .tkh a.tkh-idx .tkh-idx-tot:not(#_) { color: rgba(255, 255, 255, .75) !important; }
html body .tks-page .tkh :is(.tkh-alerte-btn, .tkh-fav-btn, .tkh-fav-comment):not(#_) { color: #fff !important; background: rgba(255, 255, 255, .16) !important; border-color: transparent !important; }
html body .tks-page .tkh :is(.tkh-alerte-btn, .tkh-fav-btn, .tkh-fav-comment):hover:not(#_) { background: rgba(255, 255, 255, .3) !important; }
html body .tks-page .tkh .capsule-ticker:not(#_) { background: var(--cs, #f97316) !important; color: var(--cs-texte, #fff) !important; }
html body .tks-page .tkh .tkh-bandeau-delisted:not(#_) { background: #fff !important; color: #b91c1c !important; }
/* onglets blancs sur boîte translucide, comme les listes et les portefeuilles */
.tks-page .tkh nav.tks-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
html body .tks-page .tkh .tk-tabs-boite:not(#_) { background: rgba(255, 255, 255, .16) !important; border-color: transparent !important; --seg-pill: #fff; }
html body .tks-page .tkh .tk-tabs-boite .seg-pill:not(#_) { background: #fff !important; box-shadow: none !important; }
html body .tks-page .tkh .tk-tab:not(#_) { color: rgba(255, 255, 255, .92) !important; }
html body .tks-page .tkh .tk-tab:hover:not(.actif):not(#_) { background: rgba(255, 255, 255, .14) !important; color: #fff !important; }
html body .tks-page .tkh .tk-tab.actif:not(#_) { color: var(--cc-aplat, #2759b3) !important; cursor: default; }
.tks-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.tks-action { appearance: none; cursor: pointer; font: inherit; font-size: .84rem; font-weight: 700; color: #fff; height: 33px; padding: 0 14px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .14); white-space: nowrap; }
.tks-action:hover { background: #fff; color: var(--cc-aplat, #2759b3); border-color: #fff; }
.tks-action[hidden] { display: none; }
html:has(.tks-page) .fab { display: none !important; }                 /* les actions sont dans l'en-tête */
.tks-param-lbl { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }

/* ── Phrase d'état ── */
.tks-resume { margin: 0; padding: 14px 20px; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--cs, #f97316);
  border-radius: 12px; font-size: 1rem; line-height: 1.55; color: var(--text-2); }
.tks-resume b { font-weight: 800; color: var(--text); }
.tks-periode { font-weight: 400; margin-left: 8px; }

/* ── Cartes à sélecteur ── */
.tks-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.tks-tete > .tf-card-head { margin: 0; flex: 0 1 auto; }
.tks-carte > .tf-card-head { margin-bottom: 12px; }
.tks-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 999px; background: var(--bg); }
.tks-seg-btn { appearance: none; border: 0; background: none; cursor: pointer; font: inherit; font-size: .78rem; font-weight: 650;
  color: var(--text-3); padding: 5px 13px; border-radius: 999px; white-space: nowrap; }
.tks-seg-btn:hover { color: var(--text); }
html body .tks-page .tks-seg-btn.actif:not(#_) { background: var(--cs, #f59e0b) !important; color: var(--cs-texte, #fff) !important; cursor: default; }
.tks-seg-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.tks-seg:has(.tks-seg-btn:only-child) { display: none; }
.tks-retenir { margin: 14px 0 0; padding-top: 12px; border-top: 1px dashed var(--border); font-size: .86rem; line-height: 1.5; color: var(--text-2); }
.tks-retenir b { color: var(--cc-aplat, var(--blue-dk)); font-weight: 750; }
:root[data-theme="dark"] .tks-retenir b { color: var(--cc-clair, var(--blue)); }
.tks-btns { margin-top: 12px; display: flex; gap: 8px; }
.tks-pane > .tf-kpis, .tks-carte > .tf-kpis { margin-bottom: 12px; }
.tks-pane > .tf-kpis:last-child, .tks-carte > .tf-kpis:last-child { margin-bottom: 0; }
.tks-carte .tki-graph + .scroll-x, .tks-carte .tki-graph + table { margin-top: 12px; }
.tks-fin { position: relative; }

/* ── Chiffres clés ── */
.tks-page .tks-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tks-page .tks-kpis--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tks-page .tks-kpis--3 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tks-page .tks-kpis--6 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.tks-page .tks-kpis .tf-kpi-val { white-space: nowrap; }
html body .tks-page .tks-kpis .tf-kpi-val.pos:not(#_) { color: #15803d !important; }
html body .tks-page .tks-kpis .tf-kpi-val.neg:not(#_) { color: #b91c1c !important; }
:root[data-theme="dark"] body .tks-page .tks-kpis .tf-kpi-val.pos:not(#_) { color: #4ade80 !important; }
:root[data-theme="dark"] body .tks-page .tks-kpis .tf-kpi-val.neg:not(#_) { color: #f87171 !important; }
button.tks-kpi-clic { appearance: none; font: inherit; text-align: left; cursor: pointer; }
button.tks-kpi-clic:hover { border-color: var(--cc-vive, var(--blue)); }

/* ── L'essentiel : deux colonnes ── */
.tks-duo { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tks-duo--egal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tks-duo--egal > :only-child { grid-column: 1 / -1; }
@media (max-width: 1000px) { .tks-duo, .tks-duo--egal { grid-template-columns: minmax(0, 1fr); } }

/* Cours : seul le graphique du cours est affiché ; baisses et volumes sont tracés hors écran
   (make3Charts les exige) et repris dans la fenêtre d'agrandissement à trois graphiques. */
.tks-page #tksCours .charts-section { position: relative; border: 0; box-shadow: none; padding: 0; margin: 0; background: none; }
.tks-page #tksCours .charts-section > #chart-price ~ .tk-clbl { display: none; }
.tks-page #tksCours .charts-section > :is(#chart-recul, #chart-volume) { position: absolute !important; left: -20000px; top: 0; width: 700px; visibility: hidden; pointer-events: none; }
.tks-page #tksCours .tf-card-hint { font-weight: 400; margin-left: 8px; }

/* En bref : sept lignes à point coloré */
.tks-bref { list-style: none; margin: 0; padding: 0; }
.tks-bref li + li { border-top: 1px solid var(--border-lt, var(--border)); }
.tks-bref-ligne { appearance: none; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; width: 100%; text-align: left;
  display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 8px 4px; border-radius: 8px; }
.tks-bref-ligne:hover { background: var(--bg); }
.tks-pt { grid-row: 1 / 3; width: 10px; height: 10px; border-radius: 50%; background: #f59e0b; }
.tks-pt.ok { background: #16a34a; } .tks-pt.bas { background: #dc2626; }
.tks-bref-txt { grid-row: 1 / 3; min-width: 0; }
.tks-bref-txt b { display: block; font-size: .9rem; color: var(--text); }
.tks-bref-txt small { font-size: .78rem; color: var(--text-3); }
.tks-bref-ligne strong { font-size: 1rem; text-align: right; color: var(--cc-aplat, var(--blue-dk)); white-space: nowrap; }
:root[data-theme="dark"] .tks-bref-ligne strong { color: var(--cc-clair, var(--blue)); }
.tks-bref-sub { grid-column: 3; text-align: right; font-size: .72rem; color: var(--text-3); white-space: nowrap; }

/* Chez moi */
.tks-chez { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.tks-chez li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 2px; color: var(--text-2); }
.tks-chez li + li { border-top: 1px solid var(--border-lt, var(--border)); }
.tks-chez a { color: var(--text); text-decoration: none; } .tks-chez a:hover { text-decoration: underline; }
.tks-chez small { color: var(--text-3); font-size: .78rem; } .tks-chez .num { text-align: right; white-space: nowrap; }
.tks-chez small.pos { color: #15803d; } .tks-chez small.neg { color: #b91c1c; }

/* Société */
.tks-page #tksSociete .tk-soc-faits { margin-bottom: 14px; }
@media (max-width: 640px) {
  .tks-actions { margin-left: 0; width: 100%; }
  .tks-action { flex: 1 1 auto; }
  .tks-resume { font-size: .94rem; padding: 12px 14px; }
}

/* Chez moi : listes en pastilles, repliées au-delà de quelques-unes */
.tks-chez-listes { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-lt, var(--border)); font-size: .86rem; color: var(--text-2); }
.tks-chez-listes > summary { cursor: pointer; font-weight: 700; color: var(--text); list-style: none; }
.tks-chez-listes > summary::-webkit-details-marker { display: none; }
.tks-chez-listes > summary::after { content: ' ▾'; color: var(--text-3); }
.tks-chez-listes[open] > summary::after { content: ' ▴'; }
.tks-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tks-chips a { display: inline-block; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text-2); font-size: .78rem; text-decoration: none; }
.tks-chips a:hover { border-color: var(--cc-vive, var(--blue)); color: var(--text); }

/* Performance › Tableau : douze mois + l'année */
.tks-perf-table { font-size: .8rem; }
.tks-perf-table th, .tks-perf-table td { padding: 6px 7px; white-space: nowrap; }
.tks-perf-table td.pos { color: #15803d; } .tks-perf-table td.neg { color: #b91c1c; }
:root[data-theme="dark"] .tks-perf-table td.pos { color: #4ade80; } :root[data-theme="dark"] .tks-perf-table td.neg { color: #f87171; }
.tks-perf-table .tks-perf-an { font-weight: 800; border-left: 2px solid var(--border); }
.tks-perf-table td.tks-vide { color: var(--text-3); }
