/* TwoNotes — styles propres à l'application, par-dessus theme.css (le thème de ChartOps / TrackMyFund, préfixe « ht »).
   N'écrire que des var(--ht-…) : tout doit marcher en clair ET en sombre, et avec chaque thème de couleur (themes.css). */

:root {
  --tn-top-h: 3.6rem;
  --tn-side-w: 16rem;
  --tn-pages-w: 17rem;
  --tn-card: var(--ht-emphasis-bg);
  --tn-code-bg: #f6f8fb;
  --tn-code-head: #eef2f8;
  --tn-code-ink: #24292f;
  --co-chart: #1762c4;
  --co-ops: #bf4824;
}
[data-bs-theme="dark"] {
  --tn-code-bg: #0d1520;
  --tn-code-head: #142132;
  --tn-code-ink: #e6edf3;
  --co-chart: #78bcff;
  --co-ops: #ffad80;
}
body { background: var(--ht-body-bg); }
.mono, code, kbd, pre { font-family: var(--ht-font-monospace, ui-monospace, Consolas, monospace); }
kbd { font-size: .7em; padding: .1rem .35rem; border-radius: .25rem; background: rgba(var(--ht-primary-rgb), .12); color: var(--ht-primary); box-shadow: none; }

/* ── l'écran de connexion couvre la page tant que la session n'est pas ouverte ─────────────────── */
.tn-lock { position: fixed; inset: 0; z-index: 3000; overflow-y: auto; background: var(--ht-body-bg); }
.tn-lock.d-none { display: none !important; }
body.tn-locked { overflow: hidden; }
body.tn-locked .tn-shell { visibility: hidden; }

/* ── la marque (de ChartOps) : TWO/NOTES ─────────────────────────────────────────────────────────── */
.ht-logo { width: 2.1rem; height: 2.1rem; border-radius: .65rem; display: inline-grid; place-items: center; flex: none;
  background: var(--ht-gray-100); border: 1px solid var(--ht-border-color); color: var(--co-chart); position: relative; }
.ht-logo svg { width: 1.8rem; height: 1.8rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ht-logo .ops-line { stroke: var(--co-ops); }
.ht-brand { font-family: var(--ht-font-sans-serif); color: var(--co-chart); font-weight: 800; letter-spacing: -.045em; white-space: nowrap; }
.ht-brand span { color: var(--co-ops); }
.ht-brand .co-slash { display: inline-block; margin: 0 .08em; transform: skew(-8deg); color: var(--co-ops); }
.ht-brandlink { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.ht-brandlink .ht-brand { font-size: 1.05rem; }
.ht-ver { align-self: flex-end; margin-left: -.35rem; padding-bottom: .1rem; font-size: .62rem; font-weight: 600; color: var(--ht-gray-600); }

/* ── la coquille : barre du haut, trois colonnes ─────────────────────────────────────────────── */
.tn-shell { display: grid; grid-template-columns: var(--tn-side-w) var(--tn-pages-w) minmax(0, 1fr); grid-template-rows: var(--tn-top-h) minmax(0, 1fr); height: 100vh; height: 100dvh; }
.tn-top { grid-column: 1 / -1; z-index: 1020; height: var(--tn-top-h); padding: 0 1.1rem; border-bottom: 1px solid var(--ht-border-color); }
.tn-top .ht-brandlink { width: calc(var(--tn-side-w) - 1.1rem); }
.tn-back { display: none; }
.tn-side, .tn-pages, .tn-main { min-height: 0; overflow-y: auto; }
.tn-side { padding: .7rem .45rem 2rem; border-right: 1px solid var(--ht-border-color); scrollbar-width: thin; }
.tn-pages { padding: 0; display: flex; flex-direction: column; border-right: 1px solid var(--ht-border-color); background: color-mix(in srgb, var(--tn-card) 55%, transparent); overflow: hidden; }
.tn-main { background: var(--tn-card); scroll-behavior: smooth; }

/* le bouton de la palette, dans la barre du haut */
.tn-palbtn { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .55rem .3rem .65rem; border-radius: .55rem; font-size: .78rem;
  border: 1px solid var(--ht-border-color); background: var(--tn-card); color: var(--ht-gray-600); min-width: 14rem; }
.tn-palbtn:hover { border-color: rgba(var(--ht-primary-rgb), .45); color: var(--ht-gray-800); }
.tn-palbtn em { font-style: normal; flex: 1; text-align: left; }
.tn-palbtn > span { color: var(--ht-primary); font-weight: 700; }

/* le menu du compte (repris de ChartOps) */
.ht-usermenu { min-width: 16rem; border: 1px solid rgba(var(--ht-primary-rgb), .22); box-shadow: 0 .6rem 1.6rem rgba(var(--ht-primary-rgb), .12); }
.ht-usermenu .dropdown-item { display: flex; align-items: center; gap: .55rem; font-size: .84rem; padding-top: .35rem; padding-bottom: .35rem; }
.ht-usermenu .dropdown-item:hover, .ht-usermenu .dropdown-item:focus { background-color: rgba(var(--ht-primary-rgb), .11); color: var(--ht-primary); }
.ht-usermenu .dropdown-item.text-danger:hover { background-color: rgba(var(--ht-danger-rgb), .1); color: var(--ht-danger); }
.ht-um-head { display: flex; align-items: center; gap: .65rem; padding: .35rem .9rem .5rem; }
.ht-um-av { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1rem;
  color: #fff; background: linear-gradient(135deg, var(--ht-primary), color-mix(in srgb, var(--ht-primary) 55%, #000)); }
.ht-um-av.sm { width: 1.35rem; height: 1.35rem; font-size: .7rem; margin-right: .4rem; }
.ht-um-who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; color: var(--ht-heading-color); }
.ht-um-who b { font-size: .92rem; color: var(--ht-heading-color); }
.ht-um-who small { font-size: .7rem; color: var(--ht-gray-600); }
.tn-userbtn { display: inline-flex; align-items: center; }

/* contrôle segmenté (de ChartOps) */
.ht-seg { background: var(--ht-gray-200); border-radius: .45rem; padding: 2px; display: inline-flex; }
.ht-seg .btn { background: transparent; border: 1px solid transparent; box-shadow: none; color: var(--ht-gray-700); font-weight: 500;
  border-radius: .35rem !important; padding: .15rem .6rem; font-size: .74rem; }
.ht-seg .btn:hover { color: var(--ht-gray-900); }
.ht-seg .btn.active { background: var(--tn-card); border-color: var(--ht-border-color); color: var(--ht-gray-900); font-weight: 600; box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .1); }

.tn-iconbtn { border: 0; background: transparent; color: var(--ht-gray-600); border-radius: .4rem; width: 1.6rem; height: 1.6rem; line-height: 1; padding: 0; font-size: .9rem; flex: none; }
.tn-iconbtn:hover { background: rgba(var(--ht-primary-rgb), .1); color: var(--ht-primary); }
.tn-empty-s { color: var(--ht-gray-500); font-size: .8rem; padding: .4rem .7rem; }

/* ── colonne 1 ───────────────────────────────────────────────────────────────────────────────── */
.tn-navs { display: flex; flex-direction: column; gap: .1rem; margin-bottom: .4rem; }
.tn-nav { position: relative; display: flex; align-items: center; gap: .55rem; padding: .3rem .6rem; margin: 0 .2rem; border-radius: .6rem;
  color: var(--ht-gray-900); text-decoration: none; font-weight: 500; font-size: .8125rem; }
.tn-nav:hover { background: rgba(var(--ht-primary-rgb), .06); color: var(--ht-gray-900); }
.tn-nav .ic { width: 1.35rem; height: 1.35rem; border-radius: .4rem; display: grid; place-items: center; background: var(--ht-gray-100); font-size: .72rem; }
.tn-nav.active { background: rgba(var(--ht-primary-rgb), .11); color: var(--ht-primary); font-weight: 600; }
.tn-nav.active .ic { background: var(--ht-primary); box-shadow: 0 .25rem .6rem rgba(var(--ht-primary-rgb), .35); }
.tn-nav .pill { margin-left: auto; font-size: .65rem; font-weight: 700; padding: .05rem .45rem; border-radius: 1rem; background: rgba(var(--ht-primary-rgb), .12); color: var(--ht-primary); }
.tn-sechead { display: flex; align-items: center; justify-content: space-between; padding: .9rem .6rem .25rem .8rem; font-size: .66rem; text-transform: uppercase;
  letter-spacing: .08em; font-weight: 700; color: var(--ht-primary); }
.tn-nb { margin: 0 .2rem .15rem; }
.tn-nbrow { display: flex; align-items: center; gap: .3rem; padding: .25rem .3rem; border-radius: .55rem; cursor: grab; }
.tn-nbrow:hover { background: rgba(var(--ht-primary-rgb), .05); }
.tn-nbrow .tn-more { opacity: 0; }
.tn-nbrow:hover .tn-more, .tn-nbrow .tn-more:focus { opacity: 1; }
.tn-caret { border: 0; background: transparent; color: var(--ht-gray-500); width: 1.1rem; padding: 0; font-size: .7rem; transition: transform .15s; flex: none; }
.tn-caret.none { visibility: hidden; }
.tn-nb.open > .tn-nbrow .tn-caret { transform: rotate(90deg); }
.tn-nbicon { width: 1.5rem; height: 1.5rem; border-radius: .45rem; display: grid; place-items: center; font-size: .85rem; flex: none;
  background: color-mix(in srgb, var(--c) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent); }
.tn-nbname { flex: 1; min-width: 0; font-weight: 600; font-size: .84rem; color: var(--ht-gray-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.tn-secs, .tn-addsec { display: none; }
.tn-nb.open > .tn-secs { display: flex; flex-direction: column; gap: 1px; padding: .1rem 0 .15rem 1.45rem; min-height: .4rem; }
.tn-nb.open > .tn-addsec { display: block; }
.tn-sec { position: relative; display: flex; align-items: center; gap: .4rem; padding: .26rem .5rem .26rem .7rem; border-radius: .5rem; font-size: .8rem;
  color: var(--ht-gray-800); text-decoration: none; }
.tn-sec:hover { background: rgba(var(--ht-primary-rgb), .06); color: var(--ht-gray-900); }
.tn-secbar { position: absolute; left: .15rem; top: .3rem; bottom: .3rem; width: 3px; border-radius: 3px; background: var(--sc); opacity: .75; }
.tn-sec .tx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-sec .n { font-size: .66rem; color: var(--ht-gray-500); }
.tn-sec.active { background: color-mix(in srgb, var(--sc) 14%, transparent); color: var(--ht-gray-1000, var(--ht-gray-900)); font-weight: 600; }
.tn-sec.active .tn-secbar { opacity: 1; }
.tn-addsec { border: 0; background: transparent; color: var(--ht-gray-500); font-size: .72rem; padding: .1rem .5rem .3rem 2.15rem; }
.tn-addsec:hover { color: var(--ht-primary); }
.tn-tags { display: flex; flex-wrap: wrap; gap: .25rem; padding: .2rem .6rem; }
.tn-tag { font-size: .72rem; padding: .1rem .45rem; border-radius: 1rem; background: var(--ht-gray-100); color: var(--ht-gray-700); text-decoration: none; border: 1px solid var(--ht-border-color); }
.tn-tag small { color: var(--ht-gray-500); }
.tn-tag:hover, .tn-tag.on { background: rgba(var(--ht-primary-rgb), .12); color: var(--ht-primary); border-color: rgba(var(--ht-primary-rgb), .3); }
.sortable-ghost { opacity: .4; }
.sortable-chosen { background: rgba(var(--ht-primary-rgb), .08); }

/* ── colonne 2 : les pages ───────────────────────────────────────────────────────────────────── */
.tn-pghead { display: flex; align-items: center; gap: .5rem; padding: .8rem .8rem .5rem 1rem; border-bottom: 3px solid var(--sc, var(--ht-primary)); }
.tn-pgtitle { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.tn-pgtitle small { font-size: .68rem; color: var(--ht-gray-600); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-pgtitle b { font-size: 1rem; color: var(--ht-heading-color); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-pgadd { display: flex; gap: .35rem; padding: .55rem .8rem .35rem; }
.tn-pgadd .btn-primary { flex: 1; }
.tn-pgscroll { flex: 1; overflow-y: auto; padding: .2rem .35rem 2rem; }
.tn-pglist { list-style: none; margin: 0; padding: 0; min-height: 2px; }
.tn-pglist .tn-pglist { padding-left: 1rem; }
.tn-dragging .tn-pglist .tn-pglist:empty { min-height: .7rem; border-left: 2px dashed rgba(var(--ht-primary-rgb), .25); margin-left: .6rem; }
li.closed > .tn-pglist { display: none; }
li.closed > .tn-pg .tn-caret { transform: none; }
.tn-pg .tn-caret { transform: rotate(90deg); }
.tn-pg { display: flex; align-items: center; gap: .35rem; padding: .32rem .45rem .32rem .2rem; margin: 1px 0; border-radius: .5rem; color: var(--ht-gray-800);
  text-decoration: none; font-size: .82rem; }
.tn-pg:hover { background: rgba(var(--ht-primary-rgb), .06); color: var(--ht-gray-900); }
.tn-pg .ic { flex: none; width: 1.2rem; text-align: center; font-size: .85rem; }
.tn-pg .tx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-pg .st { color: var(--ht-warning); font-size: .72rem; }
.tn-pg.active { background: rgba(var(--ht-primary-rgb), .13); color: var(--ht-primary); font-weight: 600; box-shadow: inset 3px 0 0 var(--ht-primary); }
.tn-pg.two { padding-left: .5rem; align-items: flex-start; }
.tn-pg.two .tx { white-space: normal; }
.tn-pg.two small { display: block; font-size: .68rem; color: var(--ht-gray-500); font-weight: 400; }

/* ── le menu ⋯ ───────────────────────────────────────────────────────────────────────────────── */
.tn-menu { position: fixed; z-index: 2000; min-width: 14rem; max-height: 70vh; overflow-y: auto; padding: .3rem; border-radius: .6rem; background: var(--tn-card);
  border: 1px solid rgba(var(--ht-primary-rgb), .22); box-shadow: 0 .8rem 2rem rgba(0, 0, 0, .18); }
.tn-menu button { display: flex; align-items: center; gap: .55rem; width: 100%; border: 0; background: transparent; padding: .36rem .6rem; border-radius: .4rem;
  font-size: .82rem; color: var(--ht-gray-900); text-align: left; }
.tn-menu button:hover { background: rgba(var(--ht-primary-rgb), .1); color: var(--ht-primary); }
.tn-menu button.danger { color: var(--ht-danger); }
.tn-menu button.danger:hover { background: rgba(var(--ht-danger-rgb), .1); }
.tn-menu button .ic { width: 1.2rem; text-align: center; }
.tn-menu button small { margin-left: auto; color: var(--ht-gray-500); font-size: .7rem; }
.tn-menusep { height: 1px; margin: .25rem .3rem; background: var(--ht-border-color); }
.tn-menuhead { padding: .35rem .6rem .15rem; font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--ht-primary); }

/* ── colonne 3 : la page ─────────────────────────────────────────────────────────────────────── */
.tn-page { max-width: 58rem; margin: 0 auto; padding: 1.1rem 2rem 4rem; }
.tn-page.editing { max-width: none; }
.tn-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; font-size: .74rem; color: var(--ht-gray-600); min-height: 1.3rem; }
.tn-crumbs a { color: var(--ht-gray-600); text-decoration: none; }
.tn-crumbs a:hover { color: var(--ht-primary); }
.tn-crumbs i { font-style: normal; color: var(--ht-gray-400); }
.tn-status { margin-left: auto; font-size: .72rem; color: var(--ht-gray-500); }
.tn-status.saving, .tn-status.dirty { color: var(--ht-warning); }
.tn-status.saved { color: var(--ht-success); }
.tn-status.error { color: var(--ht-danger); font-weight: 600; }
.tn-phead { display: flex; align-items: center; gap: .6rem; margin: .5rem 0 .5rem; }
.tn-picon { flex: none; border: 1px dashed transparent; background: transparent; font-size: 2rem; line-height: 1; padding: .15rem; border-radius: .6rem; }
.tn-picon:hover { border-color: var(--ht-border-color); background: var(--ht-gray-100); }
.tn-ptitle { flex: 1; min-width: 0; margin: 0; font-size: 1.75rem; font-weight: 700; color: var(--ht-heading-color); word-break: break-word; }
.tn-ptitle-in { flex: 1; min-width: 0; font-size: 1.6rem; font-weight: 700; border: 0; border-bottom: 2px solid rgba(var(--ht-primary-rgb), .35); background: transparent;
  color: var(--ht-heading-color); padding: .1rem 0; outline: 0; }
.tn-ptitle-in:focus { border-bottom-color: var(--ht-primary); }
.tn-pactions { display: flex; align-items: center; gap: .3rem; flex: none; }
.tn-fav { font-size: 1.15rem; }
.tn-fav.on { color: var(--ht-warning); }
.tn-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-bottom: .9rem; }
.tn-chip { display: inline-flex; align-items: center; gap: .25rem; font-size: .72rem; padding: .1rem .5rem; border-radius: 1rem; text-decoration: none;
  background: var(--ht-gray-100); color: var(--ht-gray-700); border: 1px solid var(--ht-border-color); }
a.tn-chip:hover, .tn-chip.btn-chip:hover, .tn-chip.on { background: rgba(var(--ht-primary-rgb), .12); color: var(--ht-primary); border-color: rgba(var(--ht-primary-rgb), .3); }
.tn-chip.info { background: rgba(var(--ht-info-rgb), .12); color: var(--ht-info); border-color: rgba(var(--ht-info-rgb), .3); }
.tn-chip.ok { background: rgba(var(--ht-success-rgb), .12); color: var(--ht-success); border-color: rgba(var(--ht-success-rgb), .3); }
.tn-chip.warn { background: rgba(var(--ht-warning-rgb), .15); color: var(--ht-warning); border-color: rgba(var(--ht-warning-rgb), .35); font-weight: 600; }
.tn-chip.btn-chip { cursor: pointer; }
.tn-chip small { opacity: .65; }
#pg-verify { opacity: .55; }
#pg-verify:hover { opacity: 1; }
.tn-updated { margin-left: auto; font-size: .7rem; color: var(--ht-gray-500); }
.tn-prereq { margin: 0 0 1rem; padding: .6rem .9rem; border-radius: .6rem; background: rgba(var(--ht-info-rgb), .07); border: 1px solid rgba(var(--ht-info-rgb), .22); font-size: .86rem; }
.tn-prereq > b { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ht-info); }
.tn-prereq p:last-child { margin-bottom: 0; }

/* les variables */
.tn-vars { margin: 0 0 1rem; border: 1px solid rgba(var(--ht-warning-rgb), .35); border-radius: .7rem; background: rgba(var(--ht-warning-rgb), .06); }
.tn-vars > summary { padding: .45rem .8rem; cursor: pointer; font-weight: 600; font-size: .82rem; color: var(--ht-gray-900); }
.tn-vars > summary small { font-weight: 400; color: var(--ht-gray-600); margin-left: .3rem; }
.tn-varsgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .5rem .7rem; padding: 0 .8rem .7rem; }
.tn-varsgrid label { display: flex; flex-direction: column; gap: .15rem; margin: 0; }
.tn-varsgrid label span { font-family: var(--ht-font-monospace); font-size: .7rem; color: var(--ht-warning); font-weight: 700; }
.tn-varsgrid input { font-family: var(--ht-font-monospace); }
.tn-var { background: rgba(var(--ht-warning-rgb), .22); color: inherit; border-radius: .2rem; padding: 0 .1rem; box-shadow: inset 0 -1px 0 rgba(var(--ht-warning-rgb), .6); }
.tn-var.empty { background: rgba(var(--ht-danger-rgb), .14); box-shadow: inset 0 -1px 0 rgba(var(--ht-danger-rgb), .55); font-style: italic; }

/* la progression des étapes */
.tn-progress { display: flex; align-items: center; gap: .7rem; margin: 0 0 1rem; font-size: .76rem; color: var(--ht-gray-700); }
.tn-progress .bar { flex: 1; max-width: 22rem; height: .45rem; border-radius: 1rem; background: var(--ht-gray-200); overflow: hidden; }
.tn-progress .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ht-primary), var(--ht-info)); border-radius: 1rem; transition: width .25s; }
.tn-progress.full .bar i { background: var(--ht-success); }

/* ── le contenu rendu ────────────────────────────────────────────────────────────────────────── */
.tn-content { font-size: .95rem; line-height: 1.7; color: var(--ht-body-color); word-wrap: break-word; }
.tn-content > :first-child { margin-top: 0; }
.tn-content h1, .tn-content h2, .tn-content h3, .tn-content h4 { color: var(--ht-heading-color); font-weight: 700; margin: 1.6rem 0 .6rem; line-height: 1.3; scroll-margin-top: 1rem; }
.tn-content h1 { font-size: 1.55rem; }
.tn-content h2 { font-size: 1.3rem; padding-bottom: .3rem; border-bottom: 1px solid var(--ht-border-color); }
.tn-content h3 { font-size: 1.1rem; }
.tn-content h4 { font-size: 1rem; }
.tn-content a { color: var(--ht-primary); }
.tn-content img { max-width: 100%; border-radius: .5rem; border: 1px solid var(--ht-border-color); }
.tn-content hr { margin: 1.6rem 0; opacity: .15; }
.tn-content table { width: auto; max-width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .88rem; display: block; overflow-x: auto; }
.tn-content th, .tn-content td { border: 1px solid var(--ht-border-color); padding: .35rem .7rem; }
.tn-content th { background: var(--ht-gray-100); color: var(--ht-heading-color); }
.tn-content ul, .tn-content ol { padding-left: 1.5rem; }
.tn-content li + li { margin-top: .15rem; }
.tn-content :not(pre) > code { font-size: .85em; padding: .1rem .35rem; border-radius: .3rem; background: rgba(var(--ht-primary-rgb), .08); color: var(--co-ops); }
.tn-content blockquote { margin: 1rem 0; padding: .6rem 1rem; border-left: 4px solid var(--ht-gray-300); background: var(--ht-gray-100); border-radius: 0 .5rem .5rem 0; color: var(--ht-gray-800); }
.tn-content blockquote > :last-child { margin-bottom: 0; }
.tn-content .tn-task { list-style: none; margin-left: -1.35rem; }
.tn-content .tn-task input { margin-right: .5rem; transform: scale(1.15); accent-color: var(--ht-primary); cursor: pointer; vertical-align: middle; }
.tn-content .tn-task input:disabled { cursor: default; }
.tn-content .tn-task.done { color: var(--ht-gray-500); text-decoration: line-through; text-decoration-color: rgba(var(--ht-gray-500-rgb, 157, 169, 187), .6); }
.tn-wikilink { text-decoration: none; border-bottom: 1px dashed rgba(var(--ht-primary-rgb), .5); }
.tn-wikilink::before { content: '↗ '; font-size: .8em; opacity: .6; }
.tn-wikilink.missing { color: var(--ht-danger) !important; border-bottom-color: rgba(var(--ht-danger-rgb), .5); }
.tn-wikilink.missing::before { content: '＋ '; }

/* les encadrés */
.tn-content .tn-callout { border-left-width: 4px; background: rgba(var(--ht-info-rgb), .07); border-left-color: var(--ht-info); color: var(--ht-body-color); }
.tn-callout-title { font-weight: 700; font-size: .82rem; margin-bottom: .2rem; color: var(--ht-info); }
.tn-content .tn-callout-tip, .tn-content .tn-callout-success { background: rgba(var(--ht-success-rgb), .07); border-left-color: var(--ht-success); }
.tn-callout-tip .tn-callout-title, .tn-callout-success .tn-callout-title { color: var(--ht-success); }
.tn-content .tn-callout-warning, .tn-content .tn-callout-important { background: rgba(var(--ht-warning-rgb), .08); border-left-color: var(--ht-warning); }
.tn-callout-warning .tn-callout-title, .tn-callout-important .tn-callout-title { color: var(--ht-warning); }
.tn-content .tn-callout-danger, .tn-content .tn-callout-caution { background: rgba(var(--ht-danger-rgb), .07); border-left-color: var(--ht-danger); }
.tn-callout-danger .tn-callout-title, .tn-callout-caution .tn-callout-title { color: var(--ht-danger); }
.tn-content .tn-callout-note { background: var(--ht-gray-100); border-left-color: var(--ht-gray-500); }
.tn-callout-note .tn-callout-title { color: var(--ht-gray-700); }

/* les blocs de code */
.tn-code { margin: 1rem 0; border: 1px solid var(--ht-border-color); border-radius: .6rem; overflow: hidden; background: var(--tn-code-bg); }
.tn-codehead { display: flex; align-items: center; gap: .6rem; padding: .3rem .4rem .3rem .8rem; background: var(--tn-code-head); border-bottom: 1px solid var(--ht-border-color);
  font-size: .72rem; min-height: 2rem; }
.tn-codetitle { flex: 1; min-width: 0; font-weight: 600; color: var(--ht-gray-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-codelang { color: var(--ht-gray-500); text-transform: uppercase; letter-spacing: .05em; font-size: .64rem; font-weight: 700; }
.tn-copy { border: 1px solid var(--ht-border-color); background: var(--tn-card); color: var(--ht-gray-700); border-radius: .4rem; padding: .12rem .55rem; font-size: .7rem; font-weight: 600; }
.tn-copy:hover { color: var(--ht-primary); border-color: rgba(var(--ht-primary-rgb), .45); }
.tn-copy.done { color: var(--ht-success); border-color: rgba(var(--ht-success-rgb), .5); }
.tn-code pre { margin: 0; padding: .75rem .9rem; overflow-x: auto; font-size: .82rem; line-height: 1.55; color: var(--tn-code-ink); background: transparent; }
.tn-code pre code { background: transparent; padding: 0; color: inherit; font-size: inherit; }
.tn-code.tn-code-shell pre code { display: block; }
/* la coloration (highlight.js), aux couleurs du thème en clair et en sombre */
.hljs-comment, .hljs-quote { color: #6e7781; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-name, .hljs-tag { color: #cf222e; }
.hljs-string, .hljs-attr, .hljs-symbol, .hljs-bullet, .hljs-addition, .hljs-template-tag { color: #0a3069; }
.hljs-title, .hljs-section, .hljs-function .hljs-title, .hljs-title.function_ { color: #8250df; }
.hljs-variable, .hljs-template-variable, .hljs-params { color: #953800; }
.hljs-number, .hljs-literal, .hljs-type, .hljs-meta { color: #0550ae; }
.hljs-deletion { color: #82071e; background: #ffebe9; }
[data-bs-theme="dark"] .hljs-comment, [data-bs-theme="dark"] .hljs-quote { color: #8b949e; }
[data-bs-theme="dark"] .hljs-keyword, [data-bs-theme="dark"] .hljs-selector-tag, [data-bs-theme="dark"] .hljs-built_in, [data-bs-theme="dark"] .hljs-name, [data-bs-theme="dark"] .hljs-tag { color: #ff7b72; }
[data-bs-theme="dark"] .hljs-string, [data-bs-theme="dark"] .hljs-attr, [data-bs-theme="dark"] .hljs-symbol, [data-bs-theme="dark"] .hljs-bullet, [data-bs-theme="dark"] .hljs-addition { color: #a5d6ff; }
[data-bs-theme="dark"] .hljs-title, [data-bs-theme="dark"] .hljs-section, [data-bs-theme="dark"] .hljs-title.function_ { color: #d2a8ff; }
[data-bs-theme="dark"] .hljs-variable, [data-bs-theme="dark"] .hljs-template-variable, [data-bs-theme="dark"] .hljs-params { color: #ffa657; }
[data-bs-theme="dark"] .hljs-number, [data-bs-theme="dark"] .hljs-literal, [data-bs-theme="dark"] .hljs-type, [data-bs-theme="dark"] .hljs-meta { color: #79c0ff; }

/* les onglets */
.tn-tabs { margin: 1rem 0; border: 1px solid var(--ht-border-color); border-radius: .7rem; overflow: hidden; }
.tn-tabbar { display: flex; flex-wrap: wrap; gap: .2rem; padding: .35rem .4rem 0; background: var(--ht-gray-100); border-bottom: 1px solid var(--ht-border-color); }
.tn-tab { border: 1px solid transparent; border-bottom: 0; background: transparent; padding: .3rem .8rem; border-radius: .45rem .45rem 0 0; font-size: .8rem; font-weight: 600;
  color: var(--ht-gray-600); margin-bottom: -1px; }
.tn-tab:hover { color: var(--ht-primary); }
.tn-tab.on { background: var(--tn-card); border-color: var(--ht-border-color); color: var(--ht-primary); }
.tn-tabpane { display: none; padding: .2rem .9rem; }
.tn-tabpane.on { display: block; }
.tn-tabpane > .tn-code:first-child { margin-top: .7rem; }

.tn-blank { padding: 2rem; text-align: center; color: var(--ht-gray-500); border: 2px dashed var(--ht-border-color); border-radius: .8rem; }
.tn-subpages { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--ht-border-color); display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.tn-subpages b { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ht-gray-600); margin-right: .3rem; }
.tn-subpages a { padding: .3rem .65rem; border: 1px solid var(--ht-border-color); border-radius: .5rem; text-decoration: none; font-size: .82rem; color: var(--ht-gray-800); }
.tn-subpages a:hover { border-color: rgba(var(--ht-primary-rgb), .45); color: var(--ht-primary); }

/* les fichiers joints */
.tn-files { margin-top: 2rem; padding: .7rem .9rem; border: 1px solid var(--ht-border-color); border-radius: .7rem; background: color-mix(in srgb, var(--ht-gray-100) 60%, transparent); }
.tn-fileshead { display: flex; align-items: center; justify-content: space-between; margin-bottom: .3rem; font-size: .84rem; }
.tn-files ul { list-style: none; margin: 0; padding: 0; }
.tn-files li { display: flex; align-items: center; gap: .6rem; padding: .2rem 0; font-size: .82rem; }
.tn-files li a:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-files li small { color: var(--ht-gray-500); }

/* ── l'éditeur ───────────────────────────────────────────────────────────────────────────────── */
.tn-edmeta { margin-bottom: .7rem; font-size: .8rem; }
.tn-edmeta > summary { cursor: pointer; color: var(--ht-gray-600); }
.tn-edmetagrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem .8rem; margin-top: .5rem; }
.tn-edmetagrid label { display: flex; flex-direction: column; gap: .15rem; margin: 0; }
.tn-edmetagrid label > span:first-child { font-size: .68rem; font-weight: 700; color: var(--ht-gray-700); }
.tn-edmetagrid .wide { grid-column: 1 / -1; }
.tn-editor { position: relative; border: 1px solid var(--ht-border-color); border-radius: .7rem; overflow: hidden; background: var(--tn-card); }
.tn-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem; padding: .3rem .4rem; border-bottom: 1px solid var(--ht-border-color); background: var(--ht-gray-100);
  position: sticky; top: 0; z-index: 2; }
.tn-toolbar > button { border: 1px solid transparent; background: transparent; border-radius: .35rem; padding: .15rem .45rem; font-size: .76rem; color: var(--ht-gray-800); white-space: nowrap; }
.tn-toolbar > button:hover { background: var(--tn-card); border-color: var(--ht-border-color); color: var(--ht-primary); }
.tn-toolbar > button code { color: inherit; font-size: .72rem; }
.tn-toolbar .sep { width: 1px; height: 1.1rem; background: var(--ht-border-color); margin: 0 .2rem; }
.tn-split { display: grid; grid-template-columns: 1fr 1fr; height: calc(100vh - var(--tn-top-h) - 15rem); min-height: 22rem; }
.tn-textarea { width: 100%; height: 100%; resize: none; border: 0; outline: 0; padding: .9rem 1rem; font-family: var(--ht-font-monospace); font-size: .85rem; line-height: 1.6;
  background: transparent; color: var(--ht-body-color); tab-size: 2; }
.tn-preview { overflow-y: auto; padding: .9rem 1.2rem; border-left: 1px solid var(--ht-border-color); }
.tn-editor.mode-write .tn-split { grid-template-columns: 1fr; }
.tn-editor.mode-write .tn-preview { display: none; }
.tn-editor.mode-preview .tn-split { grid-template-columns: 1fr; }
.tn-editor.mode-preview .tn-textarea { display: none; }
.tn-editor.mode-preview .tn-preview { border-left: 0; }
.tn-dropzone { display: none; position: absolute; inset: 2.4rem 0 0; place-items: center; font-weight: 700; color: var(--ht-primary);
  background: rgba(var(--ht-primary-rgb), .08); border: 2px dashed var(--ht-primary); border-radius: 0 0 .7rem .7rem; pointer-events: none; }
.tn-editor.drop .tn-dropzone { display: grid; }

/* ── les vues ────────────────────────────────────────────────────────────────────────────────── */
.tn-view { max-width: 58rem; margin: 0 auto; padding: 1.4rem 2rem 4rem; }
.tn-view h2 { font-size: 1.4rem; font-weight: 700; color: var(--ht-heading-color); margin-bottom: 1rem; }
.tn-view h5 { margin-top: 1.4rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ht-gray-600); }
.tn-count { font-size: .76rem; color: var(--ht-gray-600); }
.tn-result { display: block; padding: .7rem .9rem; margin-bottom: .5rem; border: 1px solid var(--ht-border-color); border-radius: .6rem; text-decoration: none; color: var(--ht-body-color); }
.tn-result:hover { border-color: rgba(var(--ht-primary-rgb), .45); background: rgba(var(--ht-primary-rgb), .03); }
.tn-result b { display: block; color: var(--ht-heading-color); }
.tn-result small { display: block; font-size: .7rem; color: var(--ht-gray-500); margin-bottom: .25rem; }
.tn-result span { font-size: .82rem; color: var(--ht-gray-700); }
mark { background: rgba(var(--ht-warning-rgb), .3); color: inherit; padding: 0 .1rem; border-radius: .2rem; }
.tn-langs { display: flex; flex-wrap: wrap; gap: .3rem; }
.tn-snip { margin-bottom: 1rem; }
.tn-sniphead { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .7rem; font-size: .84rem; }
.tn-sniphead b { color: var(--ht-heading-color); }
.tn-sniphead a { font-size: .76rem; text-decoration: none; }
.tn-sniphead small { font-size: .7rem; color: var(--ht-gray-500); }
.tn-snip .tn-code { margin-top: .35rem; }
.tn-trash { list-style: none; padding: 0; margin: 0; }
.tn-trash li { display: flex; align-items: center; gap: .7rem; padding: .5rem .6rem; border-bottom: 1px solid var(--ht-border-color); }
.tn-trash .ic { font-size: 1.1rem; }
.tn-trash .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tn-trash .tx small { font-size: .7rem; color: var(--ht-gray-500); }
.tn-welcome { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem; }
.tn-welcome .big { font-size: 3.5rem; opacity: .5; }

/* l'historique */
.tn-hist { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1rem; min-height: 55vh; }
.tn-histlist { list-style: none; margin: 0; padding: 0; max-height: 65vh; overflow-y: auto; border-right: 1px solid var(--ht-border-color); padding-right: .5rem; }
.tn-histlist button { display: flex; flex-direction: column; width: 100%; text-align: left; border: 0; background: transparent; padding: .4rem .6rem; border-radius: .45rem; font-size: .8rem; color: var(--ht-gray-900); }
.tn-histlist button small { font-size: .68rem; color: var(--ht-gray-500); }
.tn-histlist button:hover { background: rgba(var(--ht-primary-rgb), .06); }
.tn-histlist button.on { background: rgba(var(--ht-primary-rgb), .13); color: var(--ht-primary); }
.tn-histview { min-width: 0; max-height: 65vh; overflow-y: auto; }
.tn-histbar { margin-bottom: .7rem; }
.tn-diff { font-family: var(--ht-font-monospace); font-size: .78rem; white-space: pre-wrap; }
.tn-diff .add { background: rgba(var(--ht-success-rgb), .14); color: var(--ht-success); }
.tn-diff .del { background: rgba(var(--ht-danger-rgb), .12); color: var(--ht-danger); text-decoration: line-through; }
.tn-diff .eq { color: var(--ht-gray-600); }

/* l'icône et la couleur */
.tn-emojis { display: flex; flex-wrap: wrap; gap: 2px; max-height: 5.2rem; overflow-y: auto; }
.tn-emojis button { border: 0; background: transparent; width: 1.8rem; height: 1.8rem; border-radius: .35rem; font-size: 1rem; padding: 0; }
.tn-emojis button:hover { background: rgba(var(--ht-primary-rgb), .12); }
.tn-emoji-in { text-align: center; font-size: 1.2rem; }
.tn-colors { display: flex; flex-wrap: wrap; gap: .35rem; }
.tn-colors button { width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 2px solid var(--ht-border-color); background: var(--c); font-size: .7rem; color: var(--ht-gray-500); padding: 0; }
.tn-colors button.on { box-shadow: 0 0 0 2px var(--tn-card), 0 0 0 4px var(--ht-primary); }
.tn-lklist { display: flex; flex-direction: column; max-height: 50vh; overflow-y: auto; }
.tn-lklist button { text-align: left; border: 0; background: transparent; padding: .35rem .5rem; border-radius: .4rem; font-size: .85rem; color: var(--ht-gray-900); }
.tn-lklist button:hover { background: rgba(var(--ht-primary-rgb), .1); }
.tn-lklist small { color: var(--ht-gray-500); margin-left: .3rem; }

/* ── la palette ──────────────────────────────────────────────────────────────────────────────── */
.tn-paldlg { margin-top: 10vh; }
.tn-palhead { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-bottom: 1px solid var(--ht-border-color); }
.tn-palhead > span { color: var(--ht-primary); font-weight: 700; font-size: 1.1rem; }
.tn-palhead input { border: 0; box-shadow: none !important; font-size: 1.05rem; background: transparent; padding-left: 0; }
.tn-pallist { max-height: 58vh; overflow-y: auto; padding: .3rem; }
.tn-palgroup { padding: .5rem .6rem .2rem; font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--ht-primary); }
.tn-palitem { display: flex; align-items: center; gap: .6rem; width: 100%; border: 0; background: transparent; padding: .4rem .6rem; border-radius: .45rem; text-align: left; color: var(--ht-gray-900); }
.tn-palitem.on { background: rgba(var(--ht-primary-rgb), .12); }
.tn-palitem .ic { width: 1.4rem; text-align: center; flex: none; }
.tn-palitem .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tn-palitem .tx b { font-weight: 600; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-palitem .tx small { font-size: .72rem; color: var(--ht-gray-600); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-palitem em { font-style: normal; font-size: .7rem; color: var(--ht-gray-500); white-space: nowrap; }
.tn-palfoot { display: flex; gap: 1rem; padding: .45rem .9rem; border-top: 1px solid var(--ht-border-color); font-size: .7rem; color: var(--ht-gray-500); }

/* ── notifications ───────────────────────────────────────────────────────────────────────────── */
.tn-toasts { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); z-index: 4000; display: flex; flex-direction: column; align-items: center; gap: .4rem; pointer-events: none; }
.tn-toast { padding: .5rem 1rem; border-radius: .6rem; font-size: .82rem; font-weight: 500; color: var(--ht-body-color); background: var(--tn-card);
  border: 1px solid rgba(var(--ht-success-rgb), .5); box-shadow: 0 .6rem 1.6rem rgba(0, 0, 0, .2); opacity: 0; transform: translateY(.5rem); transition: all .2s ease; max-width: 90vw; }
.tn-toast.err { border-color: rgba(var(--ht-danger-rgb), .6); color: var(--ht-danger); }
.tn-toast.in { opacity: 1; transform: none; }

/* ── la fenêtre des thèmes de couleur (de ChartOps) ──────────────────────────────────────────── */
.htt-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1rem; margin-bottom: .45rem;
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ht-gray-600); }
.htt-calw { font-size: .72rem; font-weight: 400; letter-spacing: 0; text-transform: none; }
.htt-calw summary { cursor: pointer; color: var(--ht-primary); }
.htt-cal { display: grid; grid-template-columns: repeat(4, max-content); gap: .1rem 1rem; margin-top: .3rem; color: var(--ht-gray-700); }
.htt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .4rem; }
.htt-grid.auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.htt-card { display: flex; align-items: center; gap: .5rem; min-width: 0; padding: .4rem .55rem .4rem .6rem; border-radius: .55rem; text-align: left; cursor: pointer;
  border: 1px solid var(--ht-gray-200); border-left: 3px solid var(--tp); color: var(--ht-gray-900);
  background: linear-gradient(90deg, color-mix(in srgb, var(--tp) 10%, var(--ht-emphasis-bg, var(--ht-body-bg))), var(--ht-emphasis-bg, var(--ht-body-bg)) 70%);
  transition: border-color .12s, box-shadow .12s, transform .12s; }
.htt-card:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--tp) 55%, transparent); box-shadow: 0 .25rem .7rem -.3rem var(--tp); }
.htt-card.on { border-color: var(--tp); box-shadow: 0 0 0 2px var(--tp) inset; }
.htt-card.on .htt-name::after { content: ' ✓'; color: var(--tp); }
.htt-emoji { font-size: 1.05rem; line-height: 1; flex: none; }
.htt-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.htt-name { font-weight: 600; font-size: .8rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.htt-sub { font-size: .68rem; color: var(--ht-gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.htt-sw { flex: none; width: .7rem; height: .7rem; border-radius: 50%; display: inline-block; border: 1px solid rgba(0, 0, 0, .08); }
.htt-sw + .htt-sw { margin-left: -.25rem; }
.htt-opts { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; margin-top: .8rem; padding-top: .7rem; border-top: 1px solid var(--ht-gray-200); }

/* ── écrans plus étroits ─────────────────────────────────────────────────────────────────────── */
@media (max-width: 1199.98px) {
  :root { --tn-side-w: 13.5rem; --tn-pages-w: 14.5rem; }
  .tn-split { grid-template-columns: 1fr; }
  .tn-editor.mode-split .tn-preview { display: none; }
  .tn-edmetagrid { grid-template-columns: 1fr 1fr; }
  .tn-palbtn { min-width: 0; }
  .tn-palbtn em { display: none; }
}
/* téléphone et tablette : une colonne à la fois (body[data-pane] : side | pages | main) */
@media (max-width: 899.98px) {
  .tn-shell { grid-template-columns: minmax(0, 1fr); }
  .tn-top { padding: 0 .6rem; }
  .tn-top .ht-brandlink { width: auto; }
  .tn-top .ht-ver, #nav-username { display: none; }
  .tn-back { display: inline-block; }
  .tn-side, .tn-pages, .tn-main { grid-column: 1; grid-row: 2; display: none; }
  body[data-pane="side"] .tn-side, body:not([data-pane]) .tn-side { display: block; }
  body[data-pane="pages"] .tn-pages { display: flex; }
  body[data-pane="main"] .tn-main { display: block; }
  .tn-page, .tn-view { padding: 1rem 1rem 4rem; }
  .tn-ptitle { font-size: 1.35rem; }
  .tn-edmetagrid { grid-template-columns: 1fr; }
  .tn-split { height: 60vh; }
  .tn-hist { grid-template-columns: 1fr; }
  .tn-histlist { max-height: 25vh; border-right: 0; border-bottom: 1px solid var(--ht-border-color); }
  .tn-nbrow .tn-more { opacity: 1; }
  .htt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── v0.04 : le sommaire, les pages qui mènent ici, le script des commandes ─────────────────────── */
.tn-bodywrap.toc-side { display: grid; grid-template-columns: minmax(0, 1fr) 13.5rem; gap: 2rem; }
.tn-page:has(.toc-side) { max-width: 76rem; }
#pg-toc:empty { display: none; }
.tn-bodywrap:not(.toc-side) #pg-toc { margin-bottom: 1rem; }
.tn-bodywrap:not(.toc-side) { display: flex; flex-direction: column; }
.tn-bodywrap:not(.toc-side) #pg-toc { order: -1; }
.toc-side #pg-toc { position: relative; }
.toc-side .tn-toc { position: sticky; top: 1rem; max-height: calc(100vh - var(--tn-top-h) - 2rem); overflow-y: auto; border-left: 2px solid var(--ht-border-color); padding-left: .2rem; }
.tn-toc > summary { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--ht-primary); cursor: pointer; padding: .2rem .6rem; }
.toc-side .tn-toc > summary { pointer-events: none; list-style: none; }
.toc-side .tn-toc > summary::-webkit-details-marker { display: none; }
.tn-bodywrap:not(.toc-side) .tn-toc { border: 1px solid var(--ht-border-color); border-radius: .6rem; padding: .3rem .4rem; background: var(--ht-gray-100); }
.tn-toc ul { list-style: none; margin: .2rem 0 0; padding: 0; }
.tn-toc li a { display: block; padding: .18rem .6rem; font-size: .78rem; color: var(--ht-gray-700); text-decoration: none; border-radius: .35rem; line-height: 1.35; }
.tn-toc li.l3 a { padding-left: 1.3rem; font-size: .74rem; color: var(--ht-gray-600); }
.tn-toc li a:hover { color: var(--ht-primary); background: rgba(var(--ht-primary-rgb), .06); }
.tn-toc li a.on { color: var(--ht-primary); font-weight: 600; box-shadow: inset 2px 0 0 var(--ht-primary); }
.tn-backlinks { margin-top: 1rem; }
.tn-script { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: 1rem; }
.tn-scriptlist { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.tn-scriptlist li { padding: .35rem .4rem; border-bottom: 1px solid var(--ht-border-color); font-size: .8rem; }
.tn-scriptlist small { display: block; color: var(--ht-gray-500); font-family: var(--ht-font-monospace); font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-scriptout { font-size: .78rem; height: 52vh; }
@media (max-width: 899.98px) { .tn-script { grid-template-columns: 1fr; } }

/* ── v0.05 : variables globales, menu « / » ──────────────────────────────────────────────────────── */
.tn-varsgrid label span em { font-style: normal; font-weight: 600; font-size: .62rem; color: var(--ht-info); margin-left: .25rem; text-transform: uppercase; }
.tn-vars > summary .btn-link { font-size: .74rem; font-weight: 500; vertical-align: baseline; }
.tn-gvrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: .4rem; margin-bottom: .35rem; align-items: center; }
.tn-slash { min-width: 15rem; max-height: 18rem; }
.tn-slash button.on { background: rgba(var(--ht-primary-rgb), .12); color: var(--ht-primary); }
.tn-slash .ic { font-size: .78rem; font-weight: 700; color: var(--ht-gray-600); }

/* ── v0.06 : carnets partagés ──────────────────────────────────────────────────────────────────── */
.tn-nbshare { flex: none; font-size: .64rem; color: var(--ht-gray-600); background: var(--ht-gray-100); border: 1px solid var(--ht-border-color);
  border-radius: 1rem; padding: 0 .4rem; max-width: 6rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-nb.shared-in > .tn-nbrow { cursor: default; }
.tn-sharelist { list-style: none; margin: 0; padding: 0; }
.tn-sharelist li { display: flex; align-items: center; gap: .55rem; padding: .4rem 0; border-bottom: 1px solid var(--ht-border-color); }
.tn-sharelist li b { flex: 1; font-size: .86rem; }
.tn-sharelist select { max-width: 12rem; }
.tn-picon:disabled { cursor: default; opacity: 1; }

/* ── v0.07 : le mode pas à pas ─────────────────────────────────────────────────────────────────── */
.tn-steps { position: fixed; inset: 0; z-index: 2500; display: flex; flex-direction: column; background: var(--tn-card); }
.tn-stepshead { display: flex; align-items: center; gap: .6rem; padding: .7rem 1.2rem; border-bottom: 1px solid var(--ht-border-color); }
.tn-stepshead .ic { font-size: 1.3rem; }
.tn-stepshead b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ht-heading-color); }
.tn-stepcount { font-size: .8rem; color: var(--ht-gray-600); font-variant-numeric: tabular-nums; }
.tn-stepdots { display: flex; gap: .3rem; padding: .6rem 1.2rem; }
.tn-stepdots button { flex: 1; height: .4rem; border: 0; border-radius: 1rem; background: var(--ht-gray-200); padding: 0; }
.tn-stepdots button.done { background: color-mix(in srgb, var(--ht-primary) 45%, var(--ht-gray-200)); }
.tn-stepdots button.on { background: var(--ht-primary); }
.tn-stepbody { flex: 1; overflow-y: auto; }
.tn-stepin { max-width: 52rem; margin: 0 auto; padding: 1.5rem 1.5rem 3rem; }
.tn-stepin h1 { font-size: 1.9rem; font-weight: 700; color: var(--ht-heading-color); margin-bottom: 1rem; }
.tn-stepin .tn-content { font-size: 1.08rem; }
.tn-stepin .tn-code pre { font-size: .95rem; }
.tn-stepfoot { display: flex; align-items: center; gap: 1rem; padding: .8rem 1.2rem; border-top: 1px solid var(--ht-border-color); }
.tn-stephint { flex: 1; text-align: center; font-size: .74rem; color: var(--ht-gray-500); }
@media (max-width: 899.98px) { .tn-stephint { display: none; } .tn-stepfoot { justify-content: space-between; } .tn-stepin h1 { font-size: 1.4rem; } }

/* ── v0.08 : résultat attendu, sections repliables ─────────────────────────────────────────────── */
.tn-code.tn-output { background: transparent; border-style: dashed; }
.tn-code.tn-output .tn-codehead { background: transparent; min-height: 1.7rem; }
.tn-code.tn-output .tn-codetitle { font-weight: 600; color: var(--ht-gray-600); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; }
.tn-code.tn-output .tn-codetitle::before { content: '⎙ '; }
.tn-code.tn-output pre { color: var(--ht-gray-700); font-size: .78rem; }
.tn-tabpane .tn-code + .tn-code.tn-output, .tn-content > .tn-code + .tn-code.tn-output { margin-top: -.6rem; border-top-left-radius: 0; border-top-right-radius: 0; }
.tn-details { margin: 1rem 0; border: 1px solid var(--ht-border-color); border-radius: .6rem; background: color-mix(in srgb, var(--ht-gray-100) 55%, transparent); }
.tn-details > summary { padding: .5rem .9rem; cursor: pointer; font-weight: 600; color: var(--ht-heading-color); }
.tn-details > summary:hover { color: var(--ht-primary); }
.tn-detailsin { padding: 0 .9rem .3rem; }

/* ── v0.09 : les bêtises (fun.js) ─────────────────────────────────────────────────────────────── */
@keyframes tn-shake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  10% { transform: translate(-9px, 4px) rotate(-.6deg); } 20% { transform: translate(8px, -5px) rotate(.5deg); }
  30% { transform: translate(-7px, -3px) rotate(-.4deg); } 40% { transform: translate(6px, 5px) rotate(.4deg); }
  50% { transform: translate(-5px, 2px) rotate(-.3deg); } 60% { transform: translate(4px, -2px); } 80% { transform: translate(-2px, 1px); }
}
body.tn-shake .tn-shell { animation: tn-shake .7s ease-in-out; }
@keyframes tn-redflash { 0% { opacity: 0; } 15% { opacity: .45; } 100% { opacity: 0; } }
.tn-redflash { position: fixed; inset: 0; z-index: 3900; pointer-events: none; background: radial-gradient(circle, rgba(230, 55, 87, .2), rgba(230, 55, 87, .75));
  animation: tn-redflash .9s ease-out forwards; }
.tn-confetti, .tn-matrix { position: fixed; inset: 0; pointer-events: none; }
.tn-confetti { z-index: 3950; }
.tn-matrix { z-index: 0; opacity: .9; }
body.tn-matrix-on { background: #000 !important; }
body.tn-matrix-on .tn-shell { position: relative; z-index: 1; }
body.tn-matrix-on .tn-side, body.tn-matrix-on .tn-pages, body.tn-matrix-on .tn-main, body.tn-matrix-on .tn-top {
  background: rgba(0, 12, 0, .78) !important; color: #00ff66 !important; border-color: rgba(0, 255, 102, .25) !important; font-family: var(--ht-font-monospace); }
body.tn-matrix-on .tn-main *:not(.tn-var) { color: #00ff66 !important; border-color: rgba(0, 255, 102, .25) !important; }
body.tn-matrix-on :is(.tn-main, .tn-top, .tn-pages, .tn-side) :is(input, textarea, .btn, .tn-chip, .tn-copy, .tn-var, .tn-palbtn, .tn-tag, .tn-nbshare, .ic, .tn-nbicon) {
  background: rgba(0, 40, 0, .75) !important; color: #00ff66 !important; border-color: rgba(0, 255, 102, .35) !important; box-shadow: none !important; }
body.tn-matrix-on .tn-progress .bar i { background: #00ff66 !important; }
body.tn-matrix-on .tn-main .tn-code, body.tn-matrix-on .tn-main .tn-codehead, body.tn-matrix-on .tn-callout, body.tn-matrix-on .tn-vars, body.tn-matrix-on .tn-prereq { background: rgba(0, 30, 0, .6) !important; }
@keyframes tn-waddle { from { transform: translateX(-4rem); } to { transform: translateX(calc(100vw + 4rem)); } }
@keyframes tn-wobble { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }
.tn-penguin { position: fixed; bottom: .4rem; left: 0; z-index: 3940; pointer-events: none; display: flex; align-items: flex-end; gap: .2rem;
  animation: tn-waddle 7s linear forwards; }
.tn-penguin span { font-size: 3.6rem; display: inline-block; animation: tn-wobble .35s ease-in-out infinite; }
.tn-penguin small { font-size: .72rem; font-weight: 700; background: var(--tn-card); border: 1px solid var(--ht-border-color); border-radius: .6rem; padding: .1rem .4rem; margin-bottom: 2.2rem; }
@media (prefers-reduced-motion: reduce) { body.tn-shake .tn-shell { animation: none; } }

/* ── v0.11 : liens et images ───────────────────────────────────────────────────────────────────── */
.tn-content a[target="_blank"]:not(.tn-wikilink)::after { content: '↗'; font-size: .72em; margin-left: .12em; opacity: .55; }
.tn-fig { display: inline-block; max-width: 100%; vertical-align: top; }
.tn-fig img { max-width: 100%; height: auto; }
.tn-fig-center { display: block; text-align: center; margin: 1rem auto; }
.tn-fig-right { float: right; margin: .2rem 0 .8rem 1.2rem; max-width: 50%; }
.tn-fig-left { float: left; margin: .2rem 1.2rem .8rem 0; max-width: 50%; }
.tn-fig-border img { padding: .3rem; background: var(--tn-card); box-shadow: 0 .3rem 1rem rgba(0, 0, 0, .12); }
.tn-figcap { display: block; font-size: .78rem; color: var(--ht-gray-600); margin-top: .3rem; text-align: center; font-style: italic; }
.tn-content h2, .tn-content h3 { clear: both; }
img.tn-zoomable { cursor: zoom-in; transition: transform .12s, box-shadow .12s; }
img.tn-zoomable:hover { box-shadow: 0 .4rem 1.2rem rgba(var(--ht-primary-rgb), .25); }
.tn-lightbox { position: fixed; inset: 0; z-index: 3600; background: rgba(5, 10, 18, .92); display: grid; place-items: center; cursor: zoom-out; animation: tn-fadein .15s; }
@keyframes tn-fadein { from { opacity: 0; } }
.tn-lightbox figure { margin: 0; max-width: 94vw; max-height: 92vh; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.tn-lightbox img { max-width: 94vw; max-height: 84vh; object-fit: contain; border-radius: .4rem; box-shadow: 0 1rem 3rem rgba(0, 0, 0, .5); cursor: default; background: #fff; }
.tn-lightbox figcaption { color: #e6edf3; font-size: .85rem; display: flex; gap: 1rem; align-items: center; }
.tn-lightbox figcaption small { opacity: .6; }
.tn-lightbox figcaption a { color: #78bcff; }
.tn-lightbox button { position: absolute; border: 0; background: rgba(255, 255, 255, .1); color: #fff; border-radius: 50%; width: 2.6rem; height: 2.6rem; font-size: 1.5rem; line-height: 1; }
.tn-lightbox button:hover { background: rgba(255, 255, 255, .22); }
.tn-lbclose { top: 1rem; right: 1rem; font-size: 1.1rem !important; }
.tn-lbprev { left: 1rem; top: 50%; }
.tn-lbnext { right: 1rem; top: 50%; }
.tn-thumbs { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 .6rem; }
.tn-thumbs img { width: 6rem; height: 4.2rem; object-fit: cover; border-radius: .4rem; border: 1px solid var(--ht-border-color); }
.tn-thumbs a:hover img { border-color: var(--ht-primary); }
.tn-lklist button.on { background: rgba(var(--ht-primary-rgb), .14); color: var(--ht-primary); }
.tn-impreview img { max-width: 100%; max-height: 12rem; border-radius: .4rem; border: 1px solid var(--ht-border-color); }

.tn-editor.drop .tn-dropzone::after { content: ' (fichier, image ou morceau de page)'; font-weight: 400; }

/* ── v0.13 : les diagrammes Mermaid ────────────────────────────────────────────────────────────── */
.tn-mermaid { margin: 1rem 0; padding: .8rem; border: 1px solid var(--ht-border-color); border-radius: .7rem; background: var(--tn-card); text-align: center; overflow-x: auto; }
.tn-mermaid-title { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ht-gray-600); margin-bottom: .5rem; text-align: left; }
.tn-mermaid-view { cursor: zoom-in; }
.tn-mermaid-view svg { max-width: 100%; height: auto; }
.tn-mermaid-src { display: none; }
.tn-mermaid.err .tn-mermaid-src { display: block; text-align: left; font-size: .78rem; background: var(--tn-code-bg); padding: .6rem; border-radius: .4rem; margin: .5rem 0 0; }
.tn-mermaid-err { color: var(--ht-danger); font-size: .82rem; text-align: left; }
.tn-mermaid-wait { color: var(--ht-gray-500); font-size: .8rem; }
.tn-diagzoom { cursor: default; }
.tn-diagbox { background: var(--tn-card); border-radius: .6rem; padding: 1.5rem; max-width: 94vw; max-height: 90vh; overflow: auto; }
.tn-diagbox svg { width: min(90vw, 1400px) !important; max-width: none !important; height: auto; }

/* ── v0.14 : la carte des liens ; v0.15 : le tableau de bord (palette validée, clair et sombre) ───── */
.tn-viz, .tn-dash { --viz-surface: #fcfcfb; --viz-s1: #2a78d6; --viz-muted: #8f8d86; --viz-edge: #d6d4cc; --viz-edge-on: #2a78d6;
  --viz-ink: #0b0b0b; --viz-ink2: #52514e; --viz-ink3: #898781; --viz-grid: #e1e0d9; --viz-zero: #edece8;
  --viz-q1: #86b6ef; --viz-q2: #3987e5; --viz-q3: #1c5cab; --viz-q4: #0d366b; }
[data-bs-theme="dark"] .tn-viz, [data-bs-theme="dark"] .tn-dash { --viz-surface: #1a1a19; --viz-s1: #3987e5; --viz-muted: #76746e; --viz-edge: #3a3a37; --viz-edge-on: #3987e5;
  --viz-ink: #f0efec; --viz-ink2: #c3c2b7; --viz-ink3: #898781; --viz-grid: #2c2c2a; --viz-zero: #262624;
  --viz-q1: #184f95; --viz-q2: #2a78d6; --viz-q3: #5598e7; --viz-q4: #9ec5f4; }
.tn-graphview { max-width: none; }
.tn-vizfilters { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: .6rem 0 .8rem; }
.tn-vizfilters select { width: auto; }
.tn-viz { position: relative; border: 1px solid var(--ht-border-color); border-radius: .7rem; overflow: hidden; background: var(--viz-surface); }
.tn-viz canvas { display: block; touch-action: none; cursor: grab; }
.tn-vizlegend { position: absolute; top: .6rem; left: .8rem; display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .72rem; color: var(--viz-ink2);
  background: color-mix(in srgb, var(--viz-surface) 85%, transparent); padding: .2rem .5rem; border-radius: .4rem; pointer-events: none; }
.tn-vizlegend .dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--viz-muted); margin-right: .3rem; vertical-align: -1px; }
.tn-vizlegend .dot.on { background: var(--viz-s1); }
.tn-vizlegend .line { display: inline-block; width: 1rem; height: 1px; background: var(--viz-ink3); margin-right: .3rem; vertical-align: 3px; }
.tn-vizhelp { position: absolute; bottom: .5rem; right: .8rem; font-size: .68rem; color: var(--viz-ink3); pointer-events: none; }
.tn-viztip { position: absolute; z-index: 2; pointer-events: none; display: flex; flex-direction: column; gap: .1rem; max-width: 220px; padding: .45rem .6rem;
  border-radius: .5rem; font-size: .74rem; background: var(--tn-card); color: var(--viz-ink2); border: 1px solid var(--ht-border-color); box-shadow: 0 .4rem 1rem rgba(0, 0, 0, .15); }
.tn-viztip b { color: var(--viz-ink); font-size: .8rem; }
.tn-vizempty { position: absolute; inset: 40% 1rem auto; text-align: center; color: var(--viz-ink2); font-size: .85rem; pointer-events: none; }
.tn-viztable { max-height: 70vh; overflow: auto; }
.tn-dash { position: relative; max-width: 70rem; }
.tn-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.tn-tile { display: flex; flex-direction: column; padding: .8rem 1rem; border-radius: .7rem; background: var(--viz-surface); border: 1px solid var(--ht-border-color); }
.tn-tile b { font: 700 1.9rem/1.1 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--viz-ink); letter-spacing: -.02em; }
.tn-tile span { font-size: .8rem; color: var(--viz-ink2); margin-top: .15rem; }
.tn-tile small { font-size: .7rem; color: var(--viz-ink3); }
.tn-card2 { padding: .9rem 1rem 1rem; border-radius: .7rem; background: var(--viz-surface); border: 1px solid var(--ht-border-color); margin-bottom: 1rem; }
.tn-cardhead { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .6rem; }
.tn-cardhead h3 { font-size: .95rem; font-weight: 700; margin: 0; color: var(--viz-ink); }
.tn-cardhead h3 small { font-weight: 400; font-size: .72rem; color: var(--viz-ink3); margin-left: .3rem; }
.tn-dashgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 0 1rem; }
.tn-cal { overflow-x: auto; }
.tn-cal svg { display: block; }
.tn-cal rect.l0, .tn-callegend .l0 { fill: var(--viz-zero); background: var(--viz-zero); }
.tn-cal rect.l1, .tn-callegend .l1 { fill: var(--viz-q1); background: var(--viz-q1); }
.tn-cal rect.l2, .tn-callegend .l2 { fill: var(--viz-q2); background: var(--viz-q2); }
.tn-cal rect.l3, .tn-callegend .l3 { fill: var(--viz-q3); background: var(--viz-q3); }
.tn-cal rect.l4, .tn-callegend .l4 { fill: var(--viz-q4); background: var(--viz-q4); }
.tn-cal rect:hover { stroke: var(--viz-ink); stroke-width: 1.2; }
.tn-calm { font-size: 9px; fill: var(--viz-ink3); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.tn-calfoot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem; margin-top: .5rem; font-size: .74rem; color: var(--viz-ink2); }
.tn-callegend { display: inline-flex; align-items: center; gap: 2px; color: var(--viz-ink3); }
.tn-callegend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; }
.tn-callegend i:first-child { margin-left: .3rem; }
.tn-callegend i:last-child { margin-right: .3rem; }
.tn-bars { display: flex; flex-direction: column; gap: 2px; }
.tn-barrow { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 2.6rem; align-items: center; gap: .6rem; padding: .22rem 0; border-radius: .3rem; }
.tn-barrow:hover { background: color-mix(in srgb, var(--viz-s1) 7%, transparent); }
.tn-barlabel { font-size: .8rem; color: var(--viz-ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-barlabel a { color: inherit; text-decoration: none; }
.tn-barlabel a:hover { color: var(--ht-primary); }
.tn-bartrack { height: 10px; position: relative; }
.tn-bartrack i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--viz-s1); border-radius: 0 4px 4px 0; }
.tn-barval { font-size: .78rem; color: var(--viz-ink); text-align: right; font-variant-numeric: tabular-nums; }
.tn-numtable td:last-child, .tn-numtable th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.tn-dash .tn-viztip { position: absolute; }

/* ── v0.16 : le journal des modifications (repris de ChartOps) ─────────────────────────────────── */
.htc-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding-bottom: .7rem; margin-bottom: .6rem; border-bottom: 1px solid var(--ht-border-color); }
.htc-tools .htc-q { flex: 1 1 14rem; max-width: 22rem; }
.htc-tools .htc-kinds small { opacity: .65; font-size: .68rem; }
.htc-stat { margin-left: auto; font-size: .74rem; color: var(--ht-gray-600); }
.htc-stat b { color: var(--ht-info); }
#changelog-body .htc-list { max-height: 66vh; overflow-y: auto; padding-right: .3rem; }
.htc-day { margin-bottom: 1.1rem; }
.htc-dayh { position: sticky; top: 0; z-index: 1; margin: 0 0 .5rem; padding: .3rem 0; font-size: .7rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ht-primary); background: var(--ht-emphasis-bg); border-bottom: 1px solid rgba(var(--ht-primary-rgb), .25); }
.htc-ver2 { display: grid; grid-template-columns: 6.2rem minmax(0, 1fr); gap: .2rem .8rem; padding: .45rem .5rem; border-radius: .6rem; }
.htc-ver2 + .htc-ver2 { border-top: 1px dashed var(--ht-border-color); border-radius: 0; }
.htc-ver2.fresh { background: rgba(var(--ht-info-rgb), .07); border-radius: .6rem; }
.htc-vh { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; }
.htc-vh b { font-family: var(--ht-font-monospace); font-size: .92rem; color: var(--ht-gray-900); }
.htc-latest, .htc-fresh { font-size: .6rem; font-weight: 800; padding: .05rem .4rem; border-radius: 1rem; white-space: nowrap; }
.htc-latest { background: rgba(var(--ht-success-rgb), .15); color: var(--ht-success); }
.htc-fresh { background: rgba(var(--ht-info-rgb), .16); color: var(--ht-info); }
.htc-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.htc-items li { display: flex; gap: .5rem; align-items: baseline; padding: .2rem .35rem; border-radius: .4rem; cursor: pointer; font-size: .82rem; line-height: 1.5; color: var(--ht-gray-700); }
.htc-items li:hover { background: rgba(var(--ht-primary-rgb), .06); }
.htc-items li .ic { flex: none; width: 1.2rem; text-align: center; font-size: .8rem; }
.htc-items li .tx { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.htc-items li.open .tx { white-space: normal; }
.htc-items li .tx b { color: var(--ht-gray-900); font-weight: 700; }
.htc-items li.k-fix .tx b { color: var(--ht-warning); }
.htc-items li.k-new .tx b { color: var(--ht-success); }
.htc-none { text-align: center; color: var(--ht-gray-500); padding: 2rem 0; }
#nav-user { display: inline-flex; align-items: center; }
#nav-user::after { order: 2; }
#nav-user[data-new]::before { content: attr(data-new); order: 1; margin-left: .45rem; min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem; border-radius: 1rem;
  font-size: .62rem; font-weight: 800; line-height: calc(1.15rem - 2px); text-align: center;
  color: var(--ht-info); background: rgba(var(--ht-info-rgb), .16); border: 1px solid rgba(var(--ht-info-rgb), .55); }
#btn-changelog { display: flex; align-items: center; gap: .35rem; }
#btn-changelog .ht-um-val { margin-left: auto; font-size: .7rem; color: var(--ht-gray-500); }
#btn-changelog[data-new]::after { content: attr(data-new); padding: .05rem .5rem; border-radius: 1rem; font-size: .62rem; font-weight: 800;
  letter-spacing: .02em; color: var(--ht-info); background: rgba(var(--ht-info-rgb), .14); border: 1px solid rgba(var(--ht-info-rgb), .4); }
@media (max-width: 575.98px) { .htc-ver2 { grid-template-columns: 1fr; } .htc-vh { flex-direction: row; } }

/* ── v0.18 : la voix, le QR code ───────────────────────────────────────────────────────────────── */
.tn-toolbar > button.on, .tn-stepshead .tn-iconbtn.on { background: rgba(var(--ht-danger-rgb), .14); color: var(--ht-danger); border-color: rgba(var(--ht-danger-rgb), .35); }
.tn-toolbar > button[data-ed="dictate"].on { animation: tn-pulse 1.2s ease-in-out infinite; }
@keyframes tn-pulse { 50% { box-shadow: 0 0 0 4px rgba(var(--ht-danger-rgb), .18); } }
.tn-stepshead .tn-iconbtn.on { background: rgba(var(--ht-primary-rgb), .14); color: var(--ht-primary); }
.tn-qrs { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.2rem; }
.tn-qrs figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.tn-qrs svg { border-radius: .5rem; border: 1px solid var(--ht-border-color); }
.tn-qrs figcaption { display: flex; flex-direction: column; align-items: center; font-size: .8rem; }
.tn-qrs figcaption span { font-size: .7rem; color: var(--ht-gray-600); }

/* ── v0.19 : hors ligne ────────────────────────────────────────────────────────────────────────── */
.tn-offline { position: fixed; left: 50%; bottom: .8rem; transform: translateX(-50%); z-index: 3800; padding: .45rem 1rem; border-radius: 2rem; font-size: .8rem;
  background: var(--ht-gray-900); color: var(--ht-gray-100); box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .25); max-width: 92vw; text-align: center; }
body.tn-is-offline #pg-edit, body.tn-is-offline #pg-add, body.tn-is-offline #pg-tpl { opacity: .45; }

/* ── v0.20 : la présence, les conflits ─────────────────────────────────────────────────────────── */
.tn-presence { display: inline-flex; gap: .3rem; margin-left: auto; }
.tn-presence:empty { display: none; }
.tn-presence + .tn-status { margin-left: .6rem; }
.tn-who { display: inline-flex; align-items: center; gap: .2rem; font-size: .7rem; padding: .05rem .45rem .05rem .1rem; border-radius: 1rem;
  background: rgba(var(--ht-info-rgb), .1); color: var(--ht-info); border: 1px solid rgba(var(--ht-info-rgb), .3); }
.tn-who .ht-um-av.sm { margin-right: .1rem; width: 1.1rem; height: 1.1rem; font-size: .6rem; }
.tn-who.editing { background: rgba(var(--ht-warning-rgb), .12); color: var(--ht-warning); border-color: rgba(var(--ht-warning-rgb), .35); animation: tn-pulse 1.6s ease-in-out infinite; }
.tn-changed { font-size: .84rem; }
.tn-conflictdiff { max-height: 55vh; overflow: auto; border: 1px solid var(--ht-border-color); border-radius: .5rem; padding: .5rem .7rem; }

/* ── impression (Imprimer / PDF) : la page seule ─────────────────────────────────────────────── */
@media print {
  .tn-top, .tn-side, .tn-pages, .tn-pactions, #pg-toc, .tn-backlinks, .tn-meta button, #pg-verify, .tn-files, .tn-copy, .tn-status, .tn-vars, .tn-progress button, .tn-toasts, .tn-subpages, #pg-icon { display: none !important; }
  .tn-shell { display: block; height: auto; }
  .tn-main { display: block !important; overflow: visible; background: #fff; }
  .tn-page { max-width: none; padding: 0; }
  .tn-tabbar { display: none; }
  .tn-tabpane { display: block !important; }
  .tn-details > .tn-detailsin { display: block !important; }
  .tn-code pre { white-space: pre-wrap; }
  body { background: #fff; }
}

/* ── la page partagée (lien public) ──────────────────────────────────────────────────────────── */
.tn-sharetop { display: flex; align-items: center; gap: .5rem; padding: .6rem 1.1rem; border-bottom: 1px solid var(--ht-border-color); background: var(--ht-body-bg); }
.tn-sharemain { min-height: calc(100vh - 3.4rem); }
@media (max-width: 899.98px) { .tn-palbtn kbd { display: none; } }

/* ── v0.21 : rechercher / remplacer dans l'éditeur, liste des raccourcis ────────────────────────────── */
.tn-findbar { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; padding: .3rem .4rem; border-bottom: 1px solid var(--ht-border-color); background: var(--ht-gray-100); }
.tn-findbar.d-none { display: none !important; }
.tn-findbar .form-control { width: 13rem; flex: 0 1 13rem; font-family: var(--ht-font-monospace); font-size: .76rem; }
.tn-findbar .btn { font-size: .72rem; padding: .15rem .5rem; }
.tn-findbar .tn-iconbtn.on { background: rgba(var(--ht-primary-rgb), .14); color: var(--ht-primary); }
.tn-findcount { min-width: 3.4rem; font-size: .7rem; color: var(--ht-gray-600); text-align: center; }
.tn-keys { width: 100%; font-size: .8rem; margin-bottom: .4rem; }
.tn-keys td { padding: .25rem .4rem; border-bottom: 1px solid var(--ht-border-color); vertical-align: top; }
.tn-keys td:first-child { white-space: nowrap; width: 1%; }
@media (max-width: 899.98px) { .tn-findbar .form-control { width: auto; flex: 1 1 8rem; } }

/* ── v0.22 : secrets, surligné, émojis, minuteurs, « Expliquer », aperçu des liens ─────────────────── */
.tn-secret { position: relative; display: inline-block; cursor: pointer; border-radius: .3rem; padding: 0 .3rem; font-family: var(--ht-font-monospace); font-size: .9em;
  background: rgba(var(--ht-primary-rgb), .1); outline-offset: 1px; }
.tn-secret:not(.on) .tn-secret-v { color: transparent; text-shadow: 0 0 .45em rgba(var(--ht-primary-rgb), .7); user-select: none; }
.tn-secret:not(.on)::before { content: '🔒'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: .75em; }
.tn-secret.copied { background: rgba(var(--ht-success-rgb), .2); }
.tn-secret.copied::after { content: 'copié ✓'; position: absolute; left: 100%; margin-left: .35rem; font-size: .7rem; color: var(--ht-success); white-space: nowrap; font-family: var(--ht-font-sans-serif, inherit); }
.tn-secret.failed { background: rgba(var(--ht-danger-rgb), .2); }
.tn-content mark { background: rgba(255, 213, 0, .45); color: inherit; padding: 0 .15em; border-radius: .2em; }
[data-bs-theme=dark] .tn-content mark { background: rgba(255, 200, 0, .3); }
.tn-emoji { font-style: normal; }
.tn-timer { --tn-timer-p: 0%; display: inline-flex; align-items: center; gap: .25rem; vertical-align: baseline; border: 1px solid rgba(var(--ht-primary-rgb), .4); border-radius: 2rem;
  padding: .05rem .6rem; font-size: .85em; font-weight: 600; color: var(--ht-primary); font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, rgba(var(--ht-primary-rgb), .18) var(--tn-timer-p), var(--tn-card) var(--tn-timer-p)); }
.tn-timer.run .tn-timer-i { display: inline-block; animation: tn-tick 1s steps(2) infinite; }
.tn-timer.done { color: #fff; background: var(--ht-success); border-color: var(--ht-success); animation: tn-pulse 1s ease-in-out 3; }
.tn-timer-l { font-weight: 400; }
@keyframes tn-tick { 50% { transform: rotate(15deg); } }
.tn-explain { border: 1px solid var(--ht-border-color); background: var(--tn-card); color: var(--ht-gray-700); border-radius: .4rem; padding: .12rem .55rem; font-size: .7rem; font-weight: 600; margin-right: .3rem; }
.tn-explain:hover, .tn-explain.on { color: var(--ht-primary); border-color: rgba(var(--ht-primary-rgb), .45); }
.tn-explained { border-top: 1px dashed var(--ht-border-color); padding: .5rem .8rem .3rem; font-size: .8rem; background: rgba(var(--ht-primary-rgb), .03); }
.tn-ex-line + .tn-ex-line { margin-top: .6rem; padding-top: .5rem; border-top: 1px solid var(--ht-border-color); }
.tn-ex-src { margin: 0 0 .3rem; padding: 0; background: none; font-size: .78rem; color: var(--ht-gray-700); white-space: pre-wrap; }
.tn-ex-cmd { margin: .2rem 0 .2rem .2rem; }
.tn-ex-cmd ul { margin: .1rem 0 .2rem; padding-left: 1.2rem; }
.tn-ex-cmd li { margin: .05rem 0; }
.tn-ex-name { font-weight: 700; color: var(--ht-primary); }
.tn-ex-cmd.unknown .tn-ex-name { color: var(--ht-gray-600); }
.tn-ex-op { margin: .15rem 0 .15rem 1rem; color: var(--ht-gray-600); font-size: .76rem; }
.tn-ex-foot { margin: .4rem 0 0; font-size: .7rem; color: var(--ht-gray-500); }
.tn-peek { position: fixed; z-index: 1080; width: min(26rem, calc(100vw - 16px)); max-height: 22rem; display: flex; flex-direction: column; overflow: hidden; pointer-events: none;
  background: var(--tn-card); border: 1px solid var(--ht-border-color); border-radius: .7rem; box-shadow: 0 .8rem 2rem rgba(0, 0, 0, .18); animation: tn-peekin .12s ease-out; }
@keyframes tn-peekin { from { opacity: 0; transform: translateY(-4px); } }
.tn-peekhead { display: flex; gap: .5rem; align-items: center; padding: .55rem .8rem; border-bottom: 1px solid var(--ht-border-color); }
.tn-peekicon { font-size: 1.3rem; }
.tn-peektitle { font-weight: 700; font-size: .9rem; }
.tn-peekcrumbs { font-size: .68rem; color: var(--ht-gray-600); }
.tn-peekbody { padding: .5rem .8rem; font-size: .76rem; overflow: hidden; flex: 1; -webkit-mask-image: linear-gradient(#000 75%, transparent); mask-image: linear-gradient(#000 75%, transparent); }
.tn-peekbody h1, .tn-peekbody h2, .tn-peekbody h3 { font-size: .9rem; margin: .4rem 0 .2rem; }
.tn-peekbody .tn-code { margin: .3rem 0; }
.tn-peekfoot { display: flex; flex-wrap: wrap; gap: .5rem; padding: .35rem .8rem; border-top: 1px solid var(--ht-border-color); font-size: .68rem; color: var(--ht-gray-600); }
@media print { .tn-explain, .tn-timer-i { display: none; } }

/* ── v0.23 : pied de l'éditeur, mode concentration, variables demandées à la copie ───────────────────── */
.tn-edfoot { display: flex; flex-wrap: wrap; gap: .9rem; padding: .25rem .8rem; border-top: 1px solid var(--ht-border-color); background: var(--ht-gray-100);
  font-size: .68rem; color: var(--ht-gray-600); font-variant-numeric: tabular-nums; }
.tn-toolbar > button[data-ed="focus"].on { background: rgba(var(--ht-primary-rgb), .14); color: var(--ht-primary); border-color: rgba(var(--ht-primary-rgb), .35); }
body.tn-focus .tn-top, body.tn-focus .tn-side, body.tn-focus .tn-pages,
body.tn-focus .tn-crumbs, body.tn-focus .tn-edmeta, body.tn-focus #pg-vars, body.tn-focus #pg-progress, body.tn-focus #pg-files { display: none !important; }
body.tn-focus .tn-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
body.tn-focus .tn-main { grid-column: 1 / -1; grid-row: 1 / -1; }
body.tn-focus .tn-page { max-width: 84rem; padding: .8rem 1.5rem 1rem; }
body.tn-focus .tn-phead { margin-bottom: .5rem; }
body.tn-focus .tn-split { height: calc(100dvh - 9.5rem); }
body.tn-focus .tn-textarea { font-size: .95rem; line-height: 1.75; padding: 1.4rem 2rem; }
body.tn-focus .tn-editor.mode-write .tn-textarea { max-width: 52rem; margin: 0 auto; display: block; }
.tn-askvar { display: flex; align-items: center; gap: .6rem; margin: .35rem 0; }
.tn-askvar > span { min-width: 7rem; font-size: .8rem; color: var(--ht-primary); font-weight: 600; }

/* ── le centre d'aide (#/help) ─────────────────────────────────────────────────────────────────────── */
.tn-view.tn-help { max-width: 76rem; padding-top: 0; }
.tn-helphead { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: 1.1rem 0 .8rem;
  background: var(--tn-card); border-bottom: 1px solid var(--ht-border-color); margin-bottom: 1rem; }
.tn-helphead h2 { margin: 0; font-size: 1.35rem; }
.tn-helphead .form-control { flex: 1 1 18rem; max-width: 34rem; }
.tn-helpcount { font-size: .72rem; color: var(--ht-gray-600); }
.tn-helpgrid { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 1.6rem; align-items: start; }
.tn-helptoc { position: sticky; top: 5.2rem; display: flex; flex-direction: column; gap: .1rem; max-height: calc(100dvh - var(--tn-top-h) - 6rem); overflow-y: auto; scrollbar-width: thin; }
.tn-helptoc a { display: flex; align-items: center; gap: .45rem; padding: .3rem .55rem; border-radius: .45rem; font-size: .78rem; color: var(--ht-gray-800); text-decoration: none; }
.tn-helptoc a span { width: 1.2rem; text-align: center; }
.tn-helptoc a small { margin-left: auto; color: var(--ht-gray-500); font-size: .65rem; }
.tn-helptoc a:hover { background: rgba(var(--ht-primary-rgb), .07); }
.tn-helptoc a.on { background: rgba(var(--ht-primary-rgb), .12); color: var(--ht-primary); font-weight: 600; }
.tn-helptoc a.off { opacity: .35; }
.tn-helpsec { scroll-margin-top: 4.7rem; margin-bottom: 2.2rem; }
.tn-helpsec h3 { display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; margin: 0 0 .4rem; padding-bottom: .35rem; border-bottom: 2px solid rgba(var(--ht-primary-rgb), .25); }
.tn-helpintro { font-size: .85rem; color: var(--ht-gray-700); margin-bottom: .6rem; }
.tn-helpintro p { margin: 0; }
.tn-helpitems { display: flex; flex-direction: column; }
.tn-helpitem { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: .5rem; padding: .6rem .3rem; border-bottom: 1px solid var(--ht-border-color); }
.tn-helpitem[hidden] { display: none; }
.tn-helpitem .ic { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .5rem; background: rgba(var(--ht-primary-rgb), .08); font-size: .9rem; font-weight: 700; color: var(--ht-primary); }
.tn-helpitem .tx > b { font-size: .88rem; }
.tn-helpitem .tx .tn-content { font-size: .82rem; }
.tn-helpitem .tx .tn-content p { margin: .1rem 0 0; }
.tn-helpex { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .6rem; margin-top: .45rem; }
.tn-helpex > div { min-width: 0; border: 1px solid var(--ht-border-color); border-radius: .5rem; padding: .4rem .6rem; background: var(--ht-gray-100); }
.tn-helpex > div:last-child { background: var(--tn-card); }
.tn-helpex small { display: block; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ht-gray-500); margin-bottom: .2rem; }
.tn-helpex pre { margin: 0; font-size: .76rem; white-space: pre-wrap; background: none; padding: 0; }
.tn-helpex .tn-content { font-size: .8rem; }
.tn-helpex .tn-content > :last-child { margin-bottom: 0; }
.tn-helpnone { padding: 2rem 0; color: var(--ht-gray-600); }
@media (max-width: 899.98px) {
  .tn-helpgrid { grid-template-columns: minmax(0, 1fr); }
  .tn-helptoc { position: static; flex-direction: row; flex-wrap: wrap; max-height: none; }
  .tn-helptoc a small { display: none; }
  .tn-helpex { grid-template-columns: minmax(0, 1fr); }
}
