/**
 * Portfolio Tracker — CSS
 * Thème clair aligné sur la charte Nova (tokens --nova-* de nova.css).
 * Les couleurs de données (gains/pertes, badges catégoriels, actions
 * achat/vente/édition, palettes de graphiques) restent en littéraux.
 */

/* ─── Reset spécifique au tracker ─────────────────────────────────────────── */
#pt-root * { box-sizing: border-box; }

/* ─── Tokens de surface — pont vers la charte Nova ────────────────────────────
   Scopé sur toutes les racines de l'îlot : #pt-app-section (ticker + app),
   #pt-root, #pt-bottom-nav, .pt-modal-backdrop et #pt-guide-modal vivent hors
   les uns des autres dans le DOM (bottom nav et modales sont montées sur body).
   ⚠️ Toute nouvelle surface montée sur <body> doit être ajoutée ici, sinon ses
   var(--pt-*) se résolvent à vide (carte transparente — bug Guide rapide). */
#pt-app-section,
#pt-root,
#pt-bottom-nav,
.pt-modal-backdrop,
#pt-guide-modal {
  --pt-bg: var(--nova-bg);
  --pt-surface: var(--nova-surface);
  --pt-surface-soft: var(--nova-surface-soft);
  --pt-text: var(--nova-text);
  --pt-muted: #5f6b63; /* 4,93:1 minimum sur les fonds teintés du tracker */
  --pt-border: var(--nova-border);
  --pt-accent: var(--nova-accent);
  --pt-accent-strong: #2d774b; /* 4,82:1 minimum sur --pt-accent-soft */
  --pt-accent-soft: var(--nova-accent-soft);
  --pt-shadow: var(--nova-shadow);
}

/* ─── Layout principal ─────────────────────────────────────────────────────── */
#pt-root {
  display: flex;
  min-height: 100vh;
  background: var(--pt-bg);
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--pt-text);
  padding-top: 0;
  -webkit-font-smoothing: antialiased;
}

/* ─── Sidebar ──────────────────────────────────────────────────────────────── */
#pt-sidebar {
  width: 224px;
  min-width: 224px;
  background: var(--pt-bg);
  border-right: 1px solid var(--pt-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 70px; /* hauteur navbar fixe du site */
  height: calc(100vh - 70px);
  overflow-y: auto;
  z-index: 10;
  scrollbar-width: none;
}
#pt-sidebar::-webkit-scrollbar { display: none; }

#pt-sidebar-header {
  padding: 0.5rem 1rem 0.4rem;
  border-bottom: 1px solid var(--pt-border);
}

#pt-sidebar-header .pt-back-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--pt-muted);
  font-size: 0.72rem;
  margin-bottom: 0.35rem;
  transition: color 0.2s;
  text-decoration: none;
}
#pt-sidebar-header .pt-back-link:hover { color: var(--pt-accent-strong); }
#pt-sidebar-header .pt-back-link svg { width: 13px; height: 13px; }

#pt-nav {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding-bottom: 0.75rem;
}

.pt-sidebar-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--pt-text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.pt-sidebar-title .pt-icon { font-size: 0.9rem; }

.pt-nav-section {
  padding: 0.2rem 0 0;
}

.pt-nav-section-settings {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  background: linear-gradient(180deg, transparent, var(--pt-bg) 18%, var(--pt-bg) 100%);
  border-top: 1px solid var(--pt-border);
  position: sticky;
  bottom: 0;
}

.pt-nav-section-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pt-muted);
  padding: 0 1rem 0.15rem;
}

.pt-nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.22rem 0.75rem;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1.2;
  color: var(--pt-muted);
  border-radius: 0;
  transition: all 0.15s;
  user-select: none;
  border-left: 2px solid transparent;
  text-decoration: none;
}
.pt-nav-item:hover {
  background: var(--pt-surface-soft);
  color: var(--pt-text);
}
.pt-nav-item.active {
  background: var(--pt-accent-soft);
  color: var(--pt-accent-strong);
  border-left-color: var(--pt-accent-strong);
  font-weight: 500;
}
.pt-nav-item .pt-nav-icon { width: 16px; text-align: center; font-size: 0.78rem; flex-shrink: 0; line-height: 1; }

/* ─── Contenu principal ───────────────────────────────────────────────────── */
#pt-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

#pt-page-content {
  flex: 1;
  padding: 1.5rem;
}

/* ─── En-tête de page ─────────────────────────────────────────────────────── */
.pt-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.pt-page-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--pt-text);
}
.pt-page-subtitle {
  font-size: 0.875rem;
  color: var(--pt-muted);
  margin-top: 0.2rem;
}

.pt-asset-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--pt-surface-soft);
  border: 1px solid var(--pt-border);
  box-shadow: var(--pt-shadow);
}

.pt-asset-logo-fallback {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pt-surface-soft);
  border: 1px solid var(--pt-border);
  box-shadow: var(--pt-shadow);
  color: var(--pt-text);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

/* ─── Cards ───────────────────────────────────────────────────────────────── */
.pt-card {
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  border-radius: 0.75rem;
  padding: 1rem;
}

.pt-chart-card {
  position: relative;
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  border-radius: 1.2rem;
  padding: 1rem 1rem 0.65rem;
  overflow: hidden;
  box-shadow: var(--pt-shadow);
}

.pt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.5rem;
}
.pt-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--pt-text);
}

.pt-chart-header-meta {
  font-size: 0.78rem;
  color: var(--pt-muted);
}

.pt-chart-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pt-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.6rem;
  border-radius: 999px;
  background: var(--pt-surface-soft);
  border: 1px solid var(--pt-border);
  color: var(--pt-muted);
  font-size: 0.72rem;
  line-height: 1;
}

.pt-chart-legend-swatch {
  width: 14px;
  height: 2px;
  border-radius: 999px;
  display: inline-block;
}

.pt-chart-shell {
  margin-top: 0.55rem;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--pt-surface-soft);
  border: 1px solid var(--pt-border);
}

.pt-price-strip {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  box-shadow: var(--pt-shadow);
}

.pt-price-main {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.pt-price-eyebrow {
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pt-muted);
  font-weight: 700;
}

.pt-price-value {
  font-size: clamp(2.15rem, 4vw, 2.85rem);
  font-weight: 800;
  color: var(--pt-text);
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.pt-price-currency {
  font-size: 0.95rem;
  color: var(--pt-muted);
  font-weight: 600;
}

.pt-price-side {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.pt-price-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: var(--pt-surface-soft);
  border: 1px solid var(--pt-border);
  font-size: 0.78rem;
  font-weight: 600;
}

.pt-chart-insights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.pt-chart-insight {
  padding: 0.85rem 0.95rem;
  border-radius: 1rem;
  background: var(--pt-surface-soft);
  border: 1px solid var(--pt-border);
}

.pt-chart-insight-label {
  display: block;
  margin-bottom: 0.42rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pt-muted);
  font-weight: 700;
}

.pt-chart-insight-value {
  display: block;
  font-size: 1rem;
  color: var(--pt-text);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pt-chart-insight-value.positive { color: var(--pt-pos); }
.pt-chart-insight-value.negative { color: var(--pt-neg); }
.pt-chart-insight-value.neutral { color: var(--pt-text); }

.pt-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* ─── KPI Stats ───────────────────────────────────────────────────────────── */
.pt-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.pt-stat-card {
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  border-radius: 0.75rem;
  padding: 1rem;
}
.pt-stat-label {
  font-size: 0.75rem;
  color: var(--pt-muted);
  margin-bottom: 0.25rem;
}
.pt-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pt-text);
  font-variant-numeric: tabular-nums;
}
.pt-stat-value.positive { color: var(--pt-pos); }
.pt-stat-value.negative { color: var(--pt-neg); }
.pt-stat-sub {
  font-size: 0.75rem;
  color: var(--pt-muted);
  margin-top: 0.15rem;
}
.pt-stat-sub.positive { color: var(--pt-pos); }
.pt-stat-sub.negative { color: var(--pt-neg); }
/* Accents de données : mêmes tons pastel que les badges, sans modifier les composants hors tracker. */
.pt-stat-card { position: relative; overflow: hidden; border-left: 4px solid var(--pt-accent-strong); }
.pt-stat-card::before { content: ''; position: absolute; top: 14px; right: 14px; width: 28px; height: 28px; border-radius: 50%; background: var(--pt-accent-soft); }
.pt-stat-card--total, .pt-stat-card--invested { background: var(--pt-accent-soft); }
.pt-stat-card--pnl, .pt-stat-card--best { background: var(--pt-pos-soft); border-left-color: var(--pt-pos); }
.pt-stat-card--pnl::before, .pt-stat-card--best::before { background: color-mix(in srgb, var(--pt-pos) 14%, var(--pt-surface)); }
.pt-stat-card--invested { background: var(--pt-cat-teal-soft); border-left-color: var(--pt-cat-teal); }
.pt-stat-card--invested::before { background: color-mix(in srgb, var(--pt-cat-teal) 14%, var(--pt-surface)); }
.pt-stat-card--positions { background: var(--pt-cat-plum-soft); border-left-color: var(--pt-cat-plum); }
.pt-stat-card--positions::before { background: color-mix(in srgb, var(--pt-cat-plum) 14%, var(--pt-surface)); }
.pt-stat-card--loss { background: var(--pt-neg-soft); border-left-color: var(--pt-neg); }
.pt-stat-card--loss::before { background: color-mix(in srgb, var(--pt-neg) 13%, var(--pt-surface)); }
.pt-benchmark-card { border-left-color: var(--pt-cat-teal); background: var(--pt-cat-teal-soft); }
.pt-benchmark-change { display: inline-block; padding: .2rem .38rem; border-radius: 999px; font-size: .72rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.pt-benchmark-change--up { background: var(--pt-pos-soft); color: var(--pt-pos); }
.pt-benchmark-change--down { background: var(--pt-neg-soft); color: var(--pt-neg); }

/* ─── Tables ──────────────────────────────────────────────────────────────── */
.pt-table-wrapper {
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  border-radius: 0.75rem;
  overflow: hidden;
  overflow-x: auto;
}
.pt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.pt-table th {
  background: transparent;
  color: var(--pt-muted);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.75rem 1rem;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--pt-border);
  user-select: none;
}
.pt-table th:hover { color: var(--pt-text); cursor: pointer; }
.pt-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--pt-border);
  white-space: nowrap;
  color: var(--pt-text);
}
.pt-table tr:last-child td { border-bottom: none; }
.pt-table tbody tr:hover td { background: var(--pt-surface-soft); }
.pt-table .ticker-col {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-weight: 600;
  color: var(--pt-accent-strong);
  font-size: 0.75rem;
  text-transform: uppercase;
}

/* ─── Asset name cell ─────────────────────────────────────────────────────── */
.pt-asset-name {
  font-weight: 500;
  color: var(--pt-text);
  font-size: 0.875rem;
  line-height: 1.3;
}
.pt-asset-ticker {
  font-size: 0.75rem;
  color: var(--pt-muted);
  text-transform: uppercase;
  margin-top: 0.1rem;
}

/* ─── Variations +/- ─────────────────────────────────────────────────────── */
.positive { color: var(--pt-pos); }
.negative { color: var(--pt-neg); }
.neutral  { color: var(--pt-muted); }

/* Chip coloré pour les variations dans les tableaux */
.pct-chip {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.pct-chip.positive { background: var(--pt-pos-soft); color: var(--pt-pos); }
.pct-chip.negative { background: var(--pt-neg-soft); color: var(--pt-neg); }
.pct-chip:not(.positive):not(.negative) { color: var(--pt-muted); }

/* ─── Poids bar ───────────────────────────────────────────────────────────── */
.pt-weight-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}
.pt-weight-bar-track {
  width: 56px;
  height: 4px;
  background: var(--pt-border);
  border-radius: 9999px;
  overflow: hidden;
}
.pt-weight-bar-fill {
  height: 100%;
  background: var(--pt-accent);
  border-radius: 9999px;
  transition: width 0.3s;
}

/* ─── Boutons ─────────────────────────────────────────────────────────────── */
.pt-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  line-height: 1;
}
.pt-btn-primary {
  background: var(--pt-accent-strong);
  color: #fff;
}
.pt-btn-primary:hover { background: var(--pt-accent); }

.pt-btn-secondary {
  background: var(--pt-surface-soft);
  color: var(--pt-text);
  border: 1px solid var(--pt-border);
}
.pt-btn-secondary:hover { background: var(--pt-accent-soft); color: var(--pt-text); }

.pt-btn-danger {
  background: var(--pt-neg-soft);
  color: var(--pt-neg);
  border: 1px solid var(--pt-neg-border);
}
.pt-btn-danger:hover { background: var(--pt-neg-border); }

.pt-btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
.pt-btn-icon {
  padding: 0.375rem;
  min-width: 28px;
  min-height: 28px;
  justify-content: center;
  border-radius: 0.5rem;
}
/* Action icon buttons */
.pt-btn-buy  { background: var(--pt-pos-soft); color: var(--pt-pos); border: none; }
.pt-btn-buy:hover  { background: var(--pt-pos-border); }
.pt-btn-sell { background: var(--pt-neg-soft); color: var(--pt-neg); border: none; }
.pt-btn-sell:hover { background: var(--pt-neg-border); }
.pt-btn-edit { background: var(--pt-cat-teal-soft); color: var(--pt-cat-teal); border: none; }
.pt-btn-edit:hover { background: color-mix(in srgb, var(--pt-cat-teal) 18%, var(--pt-surface)); }
.pt-btn-delete { background: transparent; color: var(--pt-muted); border: none; }
.pt-btn-delete:hover { background: var(--pt-neg-soft); color: var(--pt-neg); }

/* ─── Toolbar ─────────────────────────────────────────────────────────────── */
.pt-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.pt-toolbar-spacer { flex: 1; }

/* ─── Tabs ────────────────────────────────────────────────────────────────── */

/* Container tabs — .pt-tabs et .pt-tabs-container partagent le même style */
.pt-tabs,
.pt-tabs-container {
  display: flex;
  gap: 0.25rem;
  background: var(--pt-surface-soft);
  border: 1px solid var(--pt-border);
  border-radius: 0.75rem;
  padding: 0.25rem;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.pt-tabs .pt-tab,
.pt-tabs-container .pt-tab {
  padding: 0.45rem 0.9rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--pt-muted);
  transition: all 0.15s;
  white-space: nowrap;
}
.pt-tabs .pt-tab:hover,
.pt-tabs-container .pt-tab:hover { color: var(--pt-text); background: var(--pt-surface); }
.pt-tabs .pt-tab.active,
.pt-tabs-container .pt-tab.active {
  background: var(--pt-surface);
  color: var(--pt-text);
}
.pt-tabs-container .pt-tab .pt-tab-sub {
  font-size: 0.625rem;
  opacity: 0.6;
  margin-left: 0.375rem;
}

/* Legacy pill tabs (pt-owner-tabs) */
.pt-owner-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--pt-surface-soft);
  border: 1px solid var(--pt-border);
  border-radius: 0.75rem;
  padding: 0.25rem;
  width: fit-content;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}
.pt-owner-tab {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--pt-muted);
  transition: all 0.15s;
}
.pt-owner-tab:hover { color: var(--pt-text); }
.pt-owner-tab.active {
  background: var(--pt-surface);
  color: var(--pt-text);
}
.pt-owner-tab-add {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  color: var(--pt-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.pt-owner-tab-add:hover { background: var(--pt-surface); color: var(--pt-text); }

/* ─── Portfolio rubric accordion ─────────────────────────────────────────── */
.pt-rubric {
  border: 1px solid var(--pt-border);
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.pt-rubric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--pt-surface);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.pt-rubric-header:hover { background: var(--pt-surface-soft); }
.pt-rubric-header .rubric-name {
  font-weight: 500;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--pt-text);
}
.pt-rubric-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--pt-accent-soft); }
.pt-rubric[data-rkey="compteTitre"] .pt-rubric-icon { background: var(--pt-cat-plum-soft); }
.pt-rubric[data-rkey="crypto"] .pt-rubric-icon { background: var(--pt-cat-ochre-soft); }
.pt-rubric[data-rkey="immobilier"] .pt-rubric-icon { background: var(--pt-pos-soft); }
.pt-rubric[data-rkey="assuranceVie"] .pt-rubric-icon { background: var(--pt-cat-rose-soft); }
.pt-rubric[data-rkey="cash"] .pt-rubric-icon { background: var(--pt-cat-slate-soft); }
.pt-rubric-header .rubric-total {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--pt-accent-strong);
  font-variant-numeric: tabular-nums;
}
.pt-rubric-body {
  background: var(--pt-bg);
  padding: 0;
}
.pt-rubric-chevron {
  transition: transform 0.2s;
  color: var(--pt-muted);
  font-size: 0.75rem;
}
.pt-rubric.open .pt-rubric-chevron { transform: rotate(180deg); }
.pt-rubric-body.collapsed { display: none; }

/* ─── Inputs ──────────────────────────────────────────────────────────────── */
.pt-input {
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  border-radius: 0.5rem;
  color: var(--pt-text);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: border-color 0.15s;
  width: 100%;
}
.pt-input:focus {
  outline: none;
  border-color: var(--pt-accent);
}
.pt-input::placeholder { color: var(--pt-muted); }

.pt-select {
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  border-radius: 0.5rem;
  color: var(--pt-text);
  padding: 0.375rem 2rem 0.375rem 0.75rem;
  font-size: 0.75rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
}
.pt-select:focus {
  outline: none;
  border-color: var(--pt-accent);
}

/* ─── Search bar ──────────────────────────────────────────────────────────── */
.pt-search-bar {
  position: relative;
  max-width: 200px;
}
.pt-search-bar input {
  padding-left: 2rem;
  font-size: 0.8125rem;
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  border-radius: 0.5rem;
  color: var(--pt-text);
  padding-right: 0.75rem;
  width: 100%;
}
.pt-search-bar input:focus {
  outline: none;
  border-color: var(--pt-accent);
}
.pt-search-bar input::placeholder { color: var(--pt-muted); }
.pt-search-bar .pt-search-icon {
  position: absolute;
  left: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--pt-muted);
  pointer-events: none;
  font-size: 0.8rem;
}

/* ─── Badges ──────────────────────────────────────────────────────────────── */
.pt-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
}
.pt-badge-blue   { background: var(--pt-cat-teal-soft);  color: var(--pt-cat-teal); }
.pt-badge-green  { background: var(--pt-pos-soft);       color: var(--pt-pos); }
.pt-badge-orange { background: var(--pt-cat-ochre-soft); color: var(--pt-cat-ochre); }
.pt-badge-red    { background: var(--pt-neg-soft);       color: var(--pt-neg); }
.pt-badge-purple { background: var(--pt-cat-plum-soft);  color: var(--pt-cat-plum); }
.pt-badge-gray   { background: var(--pt-surface-soft); color: var(--pt-muted); }

/* ─── RSI Badge ───────────────────────────────────────────────────────────── */
.rsi-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
}
.rsi-badge.oversold   { background: var(--pt-pos-soft); color: var(--pt-pos); }
.rsi-badge.overbought { background: var(--pt-neg-soft); color: var(--pt-neg); }
.rsi-badge.neutral    { background: var(--pt-surface-soft); color: var(--pt-muted); }

/* ─── Modal / Dialog ──────────────────────────────────────────────────────── */
.pt-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.pt-modal {
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  border-radius: 1rem;
  padding: 1.25rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--pt-shadow);
}
.pt-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.pt-modal-title { font-size: 0.9375rem; font-weight: 700; color: var(--pt-text); }
.pt-modal-close {
  background: none;
  border: none;
  color: var(--pt-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 0.5rem;
  transition: all 0.15s;
}
.pt-modal-close:hover { background: var(--pt-surface-soft); color: var(--pt-text); }
.pt-form-group { margin-bottom: 0.875rem; }
.pt-form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--pt-muted);
  margin-bottom: 0.35rem;
}
.pt-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.pt-modal-footer { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1.25rem; }

/* ─── Info banner (guide rapide) ─────────────────────────────────────────── */
.pt-info-banner {
  background: var(--pt-accent-soft);
  border: 1px solid var(--pt-border);
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.pt-info-banner-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--pt-accent-strong);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.pt-info-banner-text {
  font-size: 0.8rem;
  color: var(--pt-muted);
  line-height: 1.6;
}

/* ─── Live dot ────────────────────────────────────────────────────────────── */
.pt-live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pt-accent-strong);
  flex-shrink: 0;
  animation: pt-pulse-dot 1.5s ease-in-out infinite;
}
@keyframes pt-pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

@keyframes pt-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ─── Loading & Empty states ──────────────────────────────────────────────── */
.pt-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--pt-muted);
  gap: 1rem;
}
.pt-spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--pt-accent-soft);
  border-top-color: var(--pt-accent-strong);
  border-radius: 50%;
  animation: pt-spin 0.8s linear infinite;
}
@keyframes pt-spin { to { transform: rotate(360deg); } }

.empty-state,
.pt-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-height: 190px;
  padding: 2rem;
  text-align: center;
  color: var(--pt-muted);
  background: var(--pt-surface-soft);
  border: 1px solid var(--pt-border);
  border-radius: 20px;
}
.empty-state .pt-empty-icon,
.pt-empty-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin: 0;
  border-radius: 50%;
  background: var(--pt-accent-soft);
  color: var(--pt-accent-strong);
  font-size: 1.4rem;
  line-height: 1;
}
.empty-state .pt-empty-text,
.pt-empty-text { max-width: 460px; font-size: 0.875rem; line-height: 1.6; }
.empty-state__action { margin-top: 0.35rem; }

/* ─── Écran de bienvenue (aucun portefeuille) ────────────────────────────── */
/* Carte posée sur --pt-bg : l'écart de fond seul (#fbfcf8 → #ffffff) est trop
   ténu pour délimiter le bloc, c'est la bordure + l'ombre sage qui font le
   travail. Rayon 16px : palier au-dessus de .pt-card (12px), sous les grandes
   sections du site (--nova-radius, 24px). */
/* La carte tient tout l'écran d'accueil. L'image occupe une bande pleine
   largeur en tête plutôt qu'un rectangle flottant au milieu du texte : elle
   fond dans le blanc de la carte par un dégradé, ce qui évite la césure
   visuelle d'une photo posée sur du vide. */
.pt-welcome-screen {
  max-width: 880px;
  margin: 2.5rem auto;
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  border-radius: 20px;
  box-shadow: var(--pt-shadow);
  overflow: hidden;   /* la bande image épouse les coins arrondis */
}

.pt-welcome-hero {
  margin: 0;
  aspect-ratio: 21 / 8;
  overflow: hidden;
  background: var(--pt-surface-soft);
}
.pt-welcome-hero img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 42%;
  display: block;
}
.pt-welcome-body {
  padding: 2.5rem 2.5rem;
  margin-top: 0;
  text-align: center;
}

.pt-welcome-title {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--pt-text);
  margin: 0 0 0.6rem;
}
.pt-welcome-lead {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--pt-muted);
  max-width: 46ch;
  margin: 0 auto 2rem;
}

/* ── Les trois étapes ──────────────────────────────────────────────────────
   Numérotées et graduées : la teinte sage s'éclaircit de 01 à 03 et la barre
   d'accent perd en intensité. Trois cartes rigoureusement identiques se
   lisaient comme une liste indifférenciée ; là, l'œil suit une progression. */
.pt-welcome-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-bottom: 2rem;
  text-align: left;
}
.pt-welcome-feature {
  position: relative;
  border: 1px solid var(--pt-border);
  border-radius: 14px;
  padding: 1.1rem 1rem 1rem;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.pt-welcome-feature::before {   /* barre d'accent à gauche */
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--pt-accent-strong);
}
.pt-welcome-feature--1 { background: var(--pt-accent-soft); }
.pt-welcome-feature--2 { background: var(--pt-cat-teal-soft); border-color: color-mix(in srgb, var(--pt-cat-teal) 22%, var(--pt-border)); }
.pt-welcome-feature--2::before { background: var(--pt-cat-teal); opacity: 0.78; }
.pt-welcome-feature--3 { background: var(--pt-cat-ochre-soft); border-color: color-mix(in srgb, var(--pt-cat-ochre) 22%, var(--pt-border)); }
.pt-welcome-feature--3::before { background: var(--pt-cat-ochre); opacity: 0.7; }
.empty-state--favorites { background: var(--pt-cat-ochre-soft); border-color: color-mix(in srgb, var(--pt-cat-ochre) 24%, var(--pt-border)); }
.empty-state--favorites .pt-empty-icon { background: color-mix(in srgb, var(--pt-cat-ochre) 18%, var(--pt-surface)); color: var(--pt-cat-ochre); }
.empty-state--analysis { background: var(--pt-cat-teal-soft); border-color: color-mix(in srgb, var(--pt-cat-teal) 24%, var(--pt-border)); }
.empty-state--analysis .pt-empty-icon { background: color-mix(in srgb, var(--pt-cat-teal) 15%, var(--pt-surface)); color: var(--pt-cat-teal); }
.pt-empty-page { max-width: 1040px; margin: 2.5rem auto; padding: 1.5rem; border: 1px solid var(--pt-border); border-radius: 24px; background: var(--pt-surface-soft); }
.pt-empty-page .empty-state { min-height: 220px; background: var(--pt-surface); }
.empty-state__features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.empty-state__features .feature-card { min-height: 0; padding: 20px; border-width: 1px 1px 1px 4px; }
.empty-state__features .feature-card:nth-child(1) { background: var(--pt-accent-soft); border-left-color: var(--pt-accent-strong); }
.empty-state__features .feature-card:nth-child(2) { background: var(--pt-cat-teal-soft); border-left-color: var(--pt-cat-teal); }
.empty-state__features .feature-card:nth-child(3) { background: var(--pt-cat-plum-soft); border-left-color: var(--pt-cat-plum); }
.empty-state__features .feature-card:nth-child(4) { background: var(--pt-cat-ochre-soft); border-left-color: var(--pt-cat-ochre); }
.empty-state__features .feature-card h3 { margin: 0 0 8px; font-size: .98rem; }
.empty-state__features .feature-card p { margin: 0; font-size: .84rem; line-height: 1.55; color: var(--pt-muted); }
.empty-state__suggestions { max-width: 720px; margin: 18px auto 0; padding: 20px; border: 1px solid color-mix(in srgb, var(--pt-cat-ochre) 22%, var(--pt-border)); border-radius: 18px; background: var(--pt-cat-ochre-soft); }
.empty-state__suggestions-head { margin-bottom: 16px; }
.empty-state__suggestions-label { display: block; color: var(--pt-cat-ochre); font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.empty-state__suggestions-head p { max-width: 58ch; margin: 6px 0 0; color: var(--pt-muted); font-size: .83rem; line-height: 1.55; }
.empty-state__suggestions-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid color-mix(in srgb, var(--pt-cat-ochre) 16%, var(--pt-border)); }
.empty-state__suggestions-group > span { min-width: 168px; color: var(--pt-cat-ochre); font-size: .76rem; font-weight: 700; }
.empty-state__suggestion { border: 1px solid color-mix(in srgb, var(--pt-cat-ochre) 28%, var(--pt-border)); background: color-mix(in srgb, var(--pt-cat-ochre) 10%, var(--pt-surface)); color: var(--pt-cat-ochre); cursor: pointer; padding: .38rem .6rem; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.empty-state__suggestion:hover { background: var(--pt-surface); border-color: var(--pt-cat-ochre); transform: translateY(-1px); }

.pt-welcome-feature:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(31, 55, 38, 0.09);
  border-color: var(--pt-accent);
}
.pt-welcome-feature__step {
  position: absolute; top: 0.7rem; right: 0.85rem;
  font-size: 0.7rem; font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--pt-accent-strong);
  opacity: 0.45;
  font-variant-numeric: tabular-nums;
}
.pt-welcome-feature__icon  { font-size: 1.45rem; line-height: 1; margin-bottom: 0.5rem; }
.pt-welcome-feature__title { font-size: 0.83rem; font-weight: 700; color: var(--pt-text); margin-bottom: 0.2rem; }
.pt-welcome-feature__desc  { font-size: 0.74rem; line-height: 1.45; color: var(--pt-muted); }

/* ── Bloc d'action ─────────────────────────────────────────────────────────
   Champ et bouton alignés sur une même ligne : l'action tient en un seul
   geste au lieu d'être coupée par les trois arguments. */
.pt-welcome-action {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  background: var(--pt-surface-soft);
  border: 1px solid var(--pt-border);
  border-radius: 14px;
  padding: 1.1rem 1.15rem;
  text-align: left;
}
.pt-welcome-field { flex: 1; margin-bottom: 0; }
.pt-welcome-field .pt-form-label {
  display: block;
  font-size: 0.8rem; font-weight: 600;
  color: var(--pt-muted);
  margin-bottom: 0.4rem;
}
.pt-welcome-field .pt-input { font-size: 0.95rem; padding: 0.7rem 0.9rem; }
.pt-welcome-cta {
  flex-shrink: 0;
  font-size: 0.95rem;
  padding: 0.7rem 1.6rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pt-welcome-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(63, 143, 91, 0.28); }

.pt-welcome-note {
  font-size: 0.75rem;
  color: var(--pt-muted);
  margin: 1rem 0 0;
}
.pt-onboarding-guide { margin-top: 2.25rem; padding-top: 1.75rem; border-top: 1px solid var(--pt-border); text-align: left; }
.pt-onboarding-guide .eyebrow { margin-bottom: 12px; }
.pt-onboarding-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
.pt-onboarding-steps .step { padding: 16px; border-width: 1px 1px 1px 4px; }
.pt-onboarding-steps .step:nth-child(1) { background: var(--pt-accent-soft); border-left-color: var(--pt-accent-strong); }
.pt-onboarding-steps .step:nth-child(2) { background: var(--pt-cat-teal-soft); border-left-color: var(--pt-cat-teal); }
.pt-onboarding-steps .step:nth-child(3) { background: var(--pt-cat-ochre-soft); border-left-color: var(--pt-cat-ochre); }
.pt-onboarding-steps .step span { width: 30px; height: 30px; margin-bottom: 10px; background: var(--pt-surface); color: var(--pt-accent-strong); font-size: .82rem; }
.pt-onboarding-steps .step:nth-child(2) span { color: var(--pt-cat-teal); }
.pt-onboarding-steps .step:nth-child(3) span { color: var(--pt-cat-ochre); }
.pt-onboarding-steps .step h3 { margin: 0 0 6px; font-size: .9rem; }
.pt-onboarding-steps .step p { margin: 0; color: var(--pt-muted); font-size: .78rem; line-height: 1.5; }

@media (max-width: 768px) {
  /* L'écran est étroit : on rend la bande image moins haute pour ne pas
     repousser le titre sous la ligne de flottaison, et les étapes passent en
     colonne — trois cartes de 100px de large seraient illisibles. */
  .pt-welcome-screen { margin: 1.25rem 0.75rem; border-radius: 16px; }
  .pt-welcome-hero { aspect-ratio: 16 / 9; }
  .pt-welcome-body { padding: 0 1.25rem 1.75rem; }
  .pt-welcome-title { font-size: 1.45rem; }
  .pt-welcome-lead { font-size: 0.92rem; margin-bottom: 1.5rem; }
  .pt-welcome-features { grid-template-columns: 1fr; gap: 0.6rem; }
  .pt-welcome-feature { padding: 0.85rem 0.9rem; }
  .pt-welcome-action { flex-direction: column; align-items: stretch; }
  .pt-welcome-cta { width: 100%; }
  .pt-onboarding-steps, .empty-state__features { grid-template-columns: 1fr; }
  .pt-empty-page { margin: 1.25rem .75rem; padding: 1rem; }
}
.pt-welcome-icon {
  font-size: 4rem;
  margin-bottom: 1.25rem;
  filter: drop-shadow(0 0 24px var(--pt-accent-soft));
}
.pt-welcome-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--pt-text);
  margin: 0 0 0.75rem;
}
.pt-welcome-text {
  font-size: 0.9rem;
  color: var(--pt-muted);
  line-height: 1.7;
  margin: 0 0 2rem;
}
.pt-btn-lg {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  border-radius: 10px;
}

/* ─── Settings page ───────────────────────────────────────────────────────── */
.pt-settings-section { margin-bottom: 2rem; }
.pt-settings-section-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--pt-text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--pt-border);
}
.pt-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.pt-setting-label { font-size: 0.875rem; font-weight: 500; color: var(--pt-text); }
.pt-setting-desc  { font-size: 0.75rem; color: var(--pt-muted); }

/* ─── Toggle switch ───────────────────────────────────────────────────────── */
.pt-toggle { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.pt-toggle input { opacity: 0; width: 0; height: 0; }
.pt-toggle-slider {
  position: absolute; inset: 0;
  background: var(--pt-border);
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.2s;
}
.pt-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; bottom: 3px;
  background: var(--pt-surface);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.pt-toggle input:checked + .pt-toggle-slider { background: var(--pt-accent-soft); }
.pt-toggle input:checked + .pt-toggle-slider::before { transform: translateX(18px); background: var(--pt-accent-strong); }

/* ─── Narrative cards ─────────────────────────────────────────────────────── */
.pt-narrative-card {
  --narrative-color: var(--pt-accent-strong);
  background: color-mix(in srgb, var(--narrative-color) 7%, var(--pt-surface));
  border: 1px solid color-mix(in srgb, var(--narrative-color) 24%, var(--pt-border));
  border-left: 4px solid var(--narrative-color);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.9rem;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.pt-narrative-card:hover { border-color: var(--narrative-color); box-shadow: var(--pt-shadow); transform: translateY(-1px); }
.pt-narrative-card .pt-table-wrapper { border-color: color-mix(in srgb, var(--narrative-color) 22%, var(--pt-border)); }
.pt-narrative-card .pt-table thead { background: color-mix(in srgb, var(--narrative-color) 11%, var(--pt-surface)); }
.pt-narrative-card .pt-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--narrative-color) 4%, var(--pt-surface)); }
.pt-narrative-card .pt-table tbody tr:hover { background: color-mix(in srgb, var(--narrative-color) 11%, var(--pt-surface)); }
.pt-narrative-ticker { cursor: pointer; border-color: color-mix(in srgb, var(--narrative-color) 30%, var(--pt-border)); background: var(--pt-accent-soft); color: var(--pt-accent-strong); }
.pt-narrative-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}
.pt-narrative-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--pt-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pt-narrative-color-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pt-narrative-desc { font-size: 0.8rem; color: var(--pt-muted); margin-bottom: 0.75rem; }

/* ─── Charts ──────────────────────────────────────────────────────────────── */
.pt-chart-container { position: relative; width: 100%; }
.pt-chart-canvas { display: block; max-width: 100%; }
.pt-legend { display: flex; flex-direction: column; gap: 0.4rem; }
.pt-legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; }
.pt-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pt-legend-label { flex: 1; color: var(--pt-muted); }
.pt-legend-pct { font-weight: 600; color: var(--pt-text); }

/* ─── Scrollbar — masqué visuellement, scroll fonctionnel ─────────────────── */
#pt-root ::-webkit-scrollbar { display: none; }
#pt-root * { scrollbar-width: none; }

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .pt-chart-insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pt-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .pt-analysis-grid3 { grid-template-columns: repeat(2, 1fr) !important; }
  .pt-analysis-grid4 { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 768px) {
  #pt-sidebar { width: 200px; min-width: 200px; }
  #pt-page-content { padding: 1rem; }
  .pt-chart-insights { grid-template-columns: 1fr; }
  .pt-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .pt-split-grid { grid-template-columns: 1fr; }
  .pt-price-strip { padding: 0.95rem; }
  .pt-chart-card { padding: 0.9rem 0.9rem 0.55rem; border-radius: 1rem; }
  .pt-form-row { grid-template-columns: 1fr; }
  .pt-analysis-grid3 { grid-template-columns: 1fr !important; }
  .pt-analysis-grid4 { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 600px) {
  #pt-root { flex-direction: column; }
  #pt-sidebar { width: 100%; min-width: 0; height: auto; position: static; flex-direction: row; overflow-x: auto; }
  #pt-sidebar-header { display: none; }
  #pt-nav { min-height: 0; padding-bottom: 0; }
  .pt-nav-section { display: flex; padding: 0.5rem 0; }
  .pt-nav-section-settings { margin-top: 0; padding-top: 0.5rem; border-top: none; position: static; background: transparent; }
  .pt-nav-section-label { display: none; }
  .pt-nav-item { padding: 0.4rem 0.6rem; font-size: 0.8rem; border-left: none; border-bottom: 2px solid transparent; white-space: nowrap; }
  .pt-nav-item.active { border-bottom-color: var(--pt-accent-strong); border-left: none; }
  .pt-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Lexique Bourse ──────────────────────────────────────────────────────── */

.pt-lexique {
  padding: 1.5rem 2rem 3rem;
  max-width: 1100px;
}

.pt-page-subtitle {
  color: var(--pt-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.pt-lex-controls {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin: 1.25rem 0 1.75rem;
}

#pt-lex-search {
  width: 100%;
  max-width: 480px;
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  color: var(--pt-text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
#pt-lex-search::placeholder { color: var(--pt-muted); }
#pt-lex-search:focus { border-color: var(--pt-accent); box-shadow: 0 0 0 3px var(--pt-accent-soft); }

.pt-lex-alphabet {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.pt-lex-alpha-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  border-radius: 6px;
  color: var(--pt-muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s;
}
.pt-lex-alpha-btn:hover {
  background: var(--pt-surface-soft);
  color: var(--pt-accent-strong);
  border-color: var(--pt-accent);
}

.pt-lex-letter-section {
  margin-bottom: 2.5rem;
}
.pt-lex-letter-header {
  font-size: 2rem;
  font-weight: 800;
  color: var(--pt-accent-strong);
  background: linear-gradient(135deg, var(--pt-accent), var(--pt-accent-strong));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--pt-border);
  letter-spacing: -0.02em;
}

.pt-lex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: 1.25rem;
}

.pt-lex-card {
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pt-lex-card:hover {
  border-color: var(--pt-accent);
  box-shadow: var(--pt-shadow);
}

.pt-lex-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}
.pt-lex-icon {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.pt-lex-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.pt-lex-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--pt-text);
  margin: 0;
}
.pt-lex-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  letter-spacing: 0.02em;
  width: fit-content;
}

.pt-lex-definition {
  font-size: 0.875rem;
  color: var(--pt-text);
  line-height: 1.6;
  margin: 0;
}

.pt-lex-formula {
  background: var(--pt-surface-soft);
  border-left: 3px solid var(--pt-accent-strong);
  border-radius: 0 8px 8px 0;
  padding: 0.75rem 1rem;
}
.pt-lex-formula-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--pt-accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}
.pt-lex-formula-body {
  font-size: 0.82rem;
  color: var(--pt-text);
  line-height: 1.65;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.pt-lex-example {
  background: var(--pt-surface-soft);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--pt-border);
}
.pt-lex-example-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--pt-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}
.pt-lex-example-body {
  font-size: 0.82rem;
  color: var(--pt-muted);
  line-height: 1.65;
}
.pt-lex-example-body strong { color: var(--pt-accent-strong); }

.pt-lex-tips {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.pt-lex-tips li {
  font-size: 0.8rem;
  color: var(--pt-muted);
  line-height: 1.5;
}
.pt-lex-tips li strong { color: var(--pt-text); }

@media (max-width: 768px) {
  .pt-lexique { padding: 1rem; }
  .pt-lex-grid { grid-template-columns: 1fr; }
  .pt-lex-letter-header { font-size: 1.5rem; }
  .pt-lex-alphabet { gap: 0.2rem; }
  .pt-lex-alpha-btn { width: 26px; height: 26px; font-size: 0.72rem; }
}

/* ─── Page Détail Actif ──────────────────────────────────────────────────── */

.pt-asset-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--pt-muted);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
}
.pt-asset-back:hover { color: var(--pt-accent-strong); }
.pt-asset-back svg { width: 16px; height: 16px; flex-shrink: 0; }

.pt-row-hover:hover {
  background: var(--pt-accent-soft);
}
.pt-insight-panel { border-left: 4px solid var(--pt-accent-strong); background: var(--pt-surface-soft); }
.pt-insight-panel + .pt-insight-panel { border-left-color: var(--pt-cat-teal); }
.pt-risk-gauge { width: 100%; height: 7px; overflow: hidden; border-radius: 999px; background: var(--pt-border); }
.pt-risk-gauge__fill { height: 100%; border-radius: inherit; transition: width .25s ease; }
.pt-favorite-group { margin-bottom: 1.75rem; }
.pt-favorite-group__title { display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .55rem; margin-bottom: .6rem; border-radius: 999px; background: var(--pt-accent-soft); color: var(--pt-accent-strong); font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pt-favorite-group__title span { font-weight: 600; color: var(--pt-muted); }


/* ═══════════════════════════════════════════════════════════════════════════
   Tableau de marché — lisibilité des indicateurs
   ═══════════════════════════════════════════════════════════════════════════
   Le tracker vient d'un fork thème sombre : ses couleurs d'indicateurs
   (#4ade80, #86efac, #fde68a…) ont été conçues sur fond noir et n'ont jamais
   été migrées avec le reste vers le thème clair Nova. Sur #ffffff elles
   tombent à 1,25–1,74:1 de contraste — la couleur est bien là, mais délavée au
   point d'être illisible, d'où l'impression de tableau « plat ».

   Les teintes ci-dessous sont les équivalents sage / corail de la charte,
   tous ≥ 4,5:1 sur blanc ET sur --pt-surface-soft (fond des lignes paires).
   --pt-pos est un cran plus profond que --pt-accent-strong (#3f8f5b, 3,97:1),
   qui passe sous le seuil AA aux tailles de texte utilisées ici (0,7–0,8rem).
   ─────────────────────────────────────────────────────────────────────────── */
:root {
  --pt-pos: #2d774b;            /* 5,45:1 blanc ; 4,82:1 sur fond positif */
  --pt-pos-soft: #e8f4eb;
  --pt-pos-border: #b9dcc5;
  --pt-neg: #aa4935;            /* 5,65:1 blanc ; 4,99:1 sur fond négatif */
  --pt-neg-soft: #fbeeea;
  --pt-neg-border: #e8c4b9;

  /* Palette catégorielle (étiquettes ETF, action « éditer »). Aucune sémantique
     gain/perte : elle nomme des familles, elle ne juge pas — d'où des teintes
     distinctes du sage et du corail. Mêmes couleurs que les moyennes mobiles du
     graphique, assombries pour le texte : une ligne de 1,5px se contente de
     3:1, un libellé de 0,72rem exige 4,5:1. */
  --pt-cat-teal:  #1f6f8b;  --pt-cat-teal-soft:  #edf3f6;  /* 5,06:1 */
  --pt-cat-ochre: #8f6520;  --pt-cat-ochre-soft: #f6f3ed;  /* 4,68:1 */
  --pt-cat-plum:  #6b5c86;  --pt-cat-plum-soft:  #f3f2f5;  /* 5,38:1 */
  --pt-cat-rose:  #9c4f63;  --pt-cat-rose-soft:  #f5edef;  /* 4,91:1 */
  --pt-cat-slate: #4a5a68;  --pt-cat-slate-soft: #edeef0;  /* 6,12:1 */
  --pt-cat-moss:  #5f6b33;  --pt-cat-moss-soft:  #eff0eb;  /* 5,04:1 */
}

/* ── 1. Variations 24h / 7j ─────────────────────────────────────────────── */
/* Bande neutre sous ±0,05 % : même seuil que pctChip() du bandeau LIVE, pour
   qu'un actif quasi stable ne soit pas peint en vert ou en rouge. */
.pt-chg { font-size: 0.8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.pt-chg--up   { color: var(--pt-pos); }
.pt-chg--down { color: var(--pt-neg); }
.pt-chg--flat { color: var(--pt-muted); }

/* ── 2. RSI : chiffre + mini-jauge ──────────────────────────────────────── */
/* La jauge porte des repères à 30 et 70 : sans eux « 73,8 » n'a de sens que
   pour qui connaît déjà les seuils. */
.pt-rsi { display: flex; flex-direction: column; align-items: flex-end; gap: 0.2rem; }
.pt-rsi__val { font-size: 0.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pt-rsi__val--over  { color: var(--pt-neg); }
.pt-rsi__val--under { color: var(--pt-pos); }
.pt-rsi__val--mid   { color: var(--pt-text); }
.pt-rsi__gauge {
  position: relative;
  width: 44px; height: 5px;
  background: var(--pt-surface-soft);
  border: 1px solid var(--pt-border);
  border-radius: 3px;
  overflow: hidden;
}
/* Repères 30 % et 70 % de la largeur */
.pt-rsi__gauge::before,
.pt-rsi__gauge::after {
  content: ''; position: absolute; top: 0; bottom: 0;
  width: 1px; background: var(--pt-border); z-index: 1;
}
.pt-rsi__gauge::before { left: 30%; }
.pt-rsi__gauge::after  { left: 70%; }
.pt-rsi__fill { height: 100%; border-radius: 2px; }
.pt-rsi__fill--over  { background: var(--pt-neg); }
.pt-rsi__fill--under { background: var(--pt-pos); }
.pt-rsi__fill--mid   { background: var(--pt-muted); }

/* ── 3./4. Pastilles Signal et Croisement ───────────────────────────────── */
/* Motif repris de .chip (nova.css) : pilule, fond teinté, bordure assortie.
   Le libellé texte est toujours présent — la couleur ne porte jamais seule
   l'information (Surachat / Survente / Golden / Death restent écrits). */
.pt-badge {
  display: inline-block;
  font-size: 0.7rem; font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pt-badge--pos     { background: var(--pt-pos-soft); color: var(--pt-pos); border-color: var(--pt-pos-border); }
.pt-badge--neg     { background: var(--pt-neg-soft); color: var(--pt-neg); border-color: var(--pt-neg-border); }
.pt-badge--neutral { background: var(--pt-surface-soft); color: var(--pt-muted); border-color: var(--pt-border); }

/* Le croisement est la colonne la plus rare et la plus actionnable : elle
   mérite d'être plus appuyée que le reste (fond plein plutôt que teinté). */
.pt-cross--golden { background: var(--pt-pos); color: #fff; border-color: var(--pt-pos); }
.pt-cross--death  { background: var(--pt-neg); color: #fff; border-color: var(--pt-neg); }

/* ── 5. Chips MM 50/100/200 ─────────────────────────────────────────────── */
.pt-ma-group { display: flex; gap: 0.25rem; justify-content: center; }
.pt-ma {
  font-size: 0.7rem; font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
}
.pt-ma--up   { background: var(--pt-pos-soft); color: var(--pt-pos); border-color: var(--pt-pos-border); }
.pt-ma--down { background: var(--pt-neg-soft); color: var(--pt-neg); border-color: var(--pt-neg-border); }
.pt-ma--na   { background: var(--pt-surface-soft); color: var(--pt-muted); border-color: var(--pt-border); }

/* ── 6. Densité, alignement, en-tête collant ────────────────────────────── */
.pt-price { font-size: 0.875rem; font-weight: 600; color: var(--pt-text); font-variant-numeric: tabular-nums; }
.pt-price__sub { font-size: 0.72rem; font-weight: 400; color: var(--pt-muted); }
.pt-cell-empty { color: var(--pt-muted); font-size: 0.8rem; }

/* Zébrage très léger : assez pour tenir la ligne sur 1100px de large, assez
   discret pour ne pas trancher avec le reste. Le survol doit rester
   perceptible par-dessus, d'où l'ordre des règles. */
.pt-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--pt-surface-soft) 55%, transparent); }
.pt-table tbody tr:hover td,
.pt-table tbody tr.pt-row-hover:hover td { background: var(--pt-accent-soft); }

/* Tableaux marchés : le contenu suit le défilement naturel de la page.
   Le débordement horizontal reste géré par .pt-table-wrapper, sans panneau
   vertical limité : un indice complet (S&P 500) reste donc accessible. */

/* Légende des moyennes mobiles : trait échantillon reprenant le motif réel
   (plein / tirets / pointillés), pour que la distinction ne repose pas
   uniquement sur la couleur. */
.pt-chart-legend-line {
  width: 18px;
  height: 4px;
  display: inline-block;
  flex-shrink: 0;
  overflow: visible;
}

/* Petits accents hors de #pt-app-section mais propres à la page outil. */
body.nova-outil .eyebrow,
body.nova-outil .nova-nav__arrow { color: #2d774b; }

/* Le dégradé global finit sur #78b88a (2,30:1 avec le libellé blanc). */
body.nova-outil .chat-widget-fab {
  background: linear-gradient(135deg, #2d774b, #3f8f5b);
}

/* Cartes Top hausses / Top baisses : composant partagé de tous les marchés.
   Les surfaces pastel donnent le sens du classement avant même la lecture. */
.pt-mover-card {
  padding: 0.9rem 1rem;
  border: 1px solid var(--pt-border);
  border-left: 4px solid var(--pt-accent);
  border-radius: 0.8rem;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--pt-text) 6%, transparent);
}
.pt-mover-card--up {
  background: var(--pt-pos-soft);
  border-color: var(--pt-pos-border);
  border-left-color: var(--pt-pos);
}
.pt-mover-card--down {
  background: var(--pt-neg-soft);
  border-color: var(--pt-neg-border);
  border-left-color: var(--pt-neg);
}
.pt-mover-card__heading {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
  padding: 0.32rem 0.55rem 0.32rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pt-mover-card--up .pt-mover-card__heading { background: color-mix(in srgb, var(--pt-pos) 13%, var(--pt-surface)); color: var(--pt-pos); }
.pt-mover-card--down .pt-mover-card__heading { background: color-mix(in srgb, var(--pt-neg) 12%, var(--pt-surface)); color: var(--pt-neg); }
.pt-mover-card__heading-icon {
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  color: #fff;
  font-size: 0.84rem;
  line-height: 1;
}
.pt-mover-card--up .pt-mover-card__heading-icon { background: var(--pt-pos); }
.pt-mover-card--down .pt-mover-card__heading-icon { background: var(--pt-neg); }
.pt-mover-card__list { display: grid; gap: 0.18rem; }
.pt-mover-card__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.32rem 0.2rem;
  border-radius: 0.42rem;
}
.pt-mover-card__item:nth-child(even) { background: color-mix(in srgb, var(--pt-surface) 60%, transparent); }
.pt-mover-card__asset { display: flex; min-width: 0; align-items: center; gap: 0.48rem; }
.pt-mover-card__rank {
  display: grid;
  place-items: center;
  width: 1.18rem;
  height: 1.18rem;
  flex: 0 0 1.18rem;
  border-radius: 50%;
  font-size: 0.66rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.pt-mover-card--up .pt-mover-card__rank { background: color-mix(in srgb, var(--pt-pos) 15%, var(--pt-surface)); color: var(--pt-pos); }
.pt-mover-card--down .pt-mover-card__rank { background: color-mix(in srgb, var(--pt-neg) 13%, var(--pt-surface)); color: var(--pt-neg); }
.pt-mover-card__logo {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  flex: 0 0 1.55rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--pt-text) 10%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--pt-surface) 72%, transparent);
}
.pt-mover-card__logo img,
.pt-mover-card__logo .pt-asset-logo-fallback { width: 1rem !important; height: 1rem !important; box-shadow: none; }
.pt-mover-card__name { overflow: hidden; color: var(--pt-text); font-size: 0.85rem; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 768px) {
  .pt-mover-card { padding: 0.8rem 0.85rem; }
}
