/* Portail revendeur (reseller, reseller-api, reseller-terms) : feuille écrite pour le site, chargée après site.css.
 * Grammaire de l'app : fond plat, feuilles #101016, boutons blancs, pastilles verre, un seul repère de focus.
 * États posés par le script de production : active, show, copied, success / error / pending ; éléments qu'il crée :
 * pricing-tier, hist-*, pl-badge, pl-action-btn, m-btn, modal-token, toast. */

.portal-compat, .portal .nav-overlay { display: none !important; }
@keyframes authFadeIn { from { opacity: 0; transform: translateY(6px); } }   /* nom employé par le script */

/* ---------- Commun ---------- */
.portal .seg { display: inline-flex; max-width: 100%; gap: 4px; padding: 4px; border-radius: 999px; background: var(--chip); }
.portal .seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px;
  border: 0; border-radius: 999px; background: transparent; color: var(--text-2);
  font: inherit; font-size: 14.5px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background-color .15s, color .15s;
}
.portal .seg button .ic { width: 18px; height: 18px; }
.portal .seg button:hover { color: #fff; }
.portal .seg button.active { background: #fff; color: var(--ink); }
.portal .seg button:focus-visible { outline: none; box-shadow: inset 0 0 0 2px #fff; }
.portal .seg button.active:focus-visible { box-shadow: inset 0 0 0 2px rgba(11, 11, 15, .55); }

.portal .icon-btn {
  display: grid; place-items: center; flex: none; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%;
  background: var(--chip-2); color: #fff; cursor: pointer; transition: background-color .15s, color .15s;
}
.portal .icon-btn .ic { width: 20px; height: 20px; }
.portal .icon-btn:hover, .portal .icon-btn:focus-visible { background: #fff; color: var(--ink); outline: none; }
[dir="rtl"] .portal .flip { transform: scaleX(-1); }

.portal .field-row { margin-bottom: 14px; }
.portal .pw-field { position: relative; direction: ltr; }   /* mot de passe écrit de gauche à droite : l'œil toujours à droite, même en arabe */
.portal .pw-field input.field { padding-inline-end: 56px; }
.portal .pw-eye { position: absolute; top: 50%; inset-inline-end: 7px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); cursor: pointer; transform: translateY(-50%); transition: background-color .15s, color .15s; }
.portal .pw-eye .ic { width: 20px; height: 20px; }
.portal .pw-eye:hover, .portal .pw-eye:focus-visible { background: #fff; color: var(--ink); outline: none; }
.portal .hint { display: block; margin-top: 7px; font-size: 12.5px; color: var(--text-3); }
.portal .auth-error { display: none; margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: rgba(239, 68, 68, .12); font-size: 14px; line-height: 1.45; color: #fca5a5; }
.portal .btn[disabled] { cursor: wait; }

/* ---------- Connexion, inscription (même mise en page que la page Pro) ---------- */
.portal .auth-intro { gap: 22px; }
.portal .reseller-title .l2 { display: block; color: #69696b; }   /* même gris que « Tous vos écrans. » */
.portal .perks { display: grid; gap: 16px; margin: 6px 0 2px; padding: 0; list-style: none; }
.portal .perks li { display: flex; align-items: center; gap: 14px; }
.portal .perks .ic { box-sizing: content-box; width: 21px; height: 21px; padding: 11.5px; border-radius: 50%; background: var(--chip); color: #fff; }
.portal .perks strong { display: block; font-size: 16px; font-weight: 700; color: #fff; }
.portal .perks span { display: block; margin-top: 2px; font-size: 14.5px; line-height: 1.45; color: var(--text-2); }
.portal .auth-sheet .seg { display: flex; width: 100%; margin-bottom: 22px; }
.portal .auth-sheet .seg button { flex: 1; }
.portal .auth-note { margin: 0 0 18px; font-size: 15px; line-height: 1.5; color: var(--text-2); }
.portal .auth-terms { margin: 4px 0 18px; }
.portal .auth-forgot { margin-top: 16px; font-size: 14px; text-align: center; }
.portal .auth-forgot + .auth-forgot { margin-top: 8px; }
.portal .auth-forgot a { color: var(--text-2); }
.portal .auth-forgot a:hover, .portal .auth-forgot a:focus-visible { color: #fff; text-decoration: underline; text-underline-offset: 3px; outline: none; }

/* ---------- Tableau de bord ---------- */
.portal .dash { display: flex; flex-direction: column; gap: 28px; }
.portal .dash-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; }
.portal .dash-who { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.portal .dash-name { margin: 6px 0 0; font-size: clamp(30px, 4vw, 44px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; overflow-wrap: anywhere; }
.portal .dash-email { font-size: 15px; color: var(--text-2); }
.portal .dash-side { display: flex; align-items: center; gap: 10px; }
.portal .dash-balance { display: flex; align-items: baseline; gap: 8px; height: 46px; padding: 0 20px; border-radius: 999px; background: var(--chip); line-height: 46px; }
.portal .dash-balance b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.portal .dash-balance span { font-size: 14px; font-weight: 600; color: var(--text-2); }
.portal .dash-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 18px 0; }
.portal .dash-stats > div { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 12px; text-align: center; }
.portal .dash-stats > div + div { border-inline-start: 1px solid var(--line); }
.portal .dash-stats b { font-size: clamp(26px, 3vw, 34px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.portal .dash-stats span { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.portal .dash-tabs { align-self: flex-start; overflow-x: auto; scrollbar-width: none; }
.portal .dash-tabs::-webkit-scrollbar { display: none; }
.portal .dash-panel { display: none; }
.portal .dash-panel.active { display: block; animation: authFadeIn .3s ease; }
.portal .panel-head { margin-bottom: 20px; }
.portal .panel-head h2 { margin: 0 0 6px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.portal .panel-head p { max-width: 62ch; margin: 0; font-size: 15px; line-height: 1.55; color: var(--text-2); }
.portal .panel-sheet { padding: clamp(20px, 2.6vw, 28px); }
.portal .buy-grid, .portal .gen-grid, .portal .settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }

/* Crédits : quantité, paliers (lignes des formules du paiement), total */
.portal .qty { position: relative; margin-bottom: 18px; }
.portal .credit-qty { height: 64px; padding-right: 120px; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.portal .credit-qty::-webkit-inner-spin-button, .portal .credit-qty::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.portal .qty-unit { position: absolute; top: 50%; right: 18px; transform: translateY(-50%); font-size: 15px; font-weight: 600; color: var(--text-2); pointer-events: none; }   /* champ en ltr : unité à droite dans toutes les langues */
.portal .tiers { display: grid; gap: 8px; }
.portal .pricing-tier {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; padding: 0 16px;
  border: 1.5px solid transparent; border-radius: 14px; background: rgba(255, 255, 255, .05); font-size: 15px; font-variant-numeric: tabular-nums;
}
.portal .pricing-tier.active { border-color: #fff; background: rgba(255, 255, 255, .09); }
.portal .tier-range { font-weight: 600; color: var(--text-2); direction: ltr; }
.portal .pricing-tier.active .tier-range { color: #fff; }
.portal .pricing-tier > span:last-child { display: inline-flex; align-items: center; gap: 10px; }
.portal .tier-price { font-weight: 800; }
.portal .tier-discount { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; background: rgba(34, 197, 94, .14); color: #4ade80; font-size: 12px; font-weight: 700; direction: ltr; }
.portal .buy-summary { position: sticky; top: calc(var(--nav-h) + 30px); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.portal .buy-summary .label { margin: 0; }
.portal .buy-total { font-size: clamp(40px, 5vw, 56px); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.portal .buy-detail { font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.portal .buy-summary .btn { height: auto; min-height: 52px; margin-top: 18px; padding-block: 12px; white-space: normal; }

/* Générer une clé */
.portal .pl-toggle { position: relative; display: flex; align-items: center; gap: 12px; margin: 4px 0 2px; font-size: 15px; font-weight: 600; cursor: pointer; }
.portal .pl-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.portal .pl-toggle-track { position: relative; flex: none; width: 46px; height: 28px; border-radius: 999px; background: rgba(255, 255, 255, .14); transition: background-color .2s; }
.portal .pl-toggle-track::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s, background-color .2s; }
.portal .pl-toggle input:checked + .pl-toggle-track { background: #fff; }
.portal .pl-toggle input:checked + .pl-toggle-track::after { background: var(--ink); transform: translateX(18px); }
.portal .pl-toggle input:focus-visible + .pl-toggle-track { outline: 2px solid #fff; outline-offset: 3px; }
[dir="rtl"] .portal .pl-toggle-track::after { left: auto; right: 4px; }
[dir="rtl"] .portal .pl-toggle input:checked + .pl-toggle-track::after { transform: translateX(-18px); }
.portal .pl-form { display: none; margin-top: 18px; }
.portal .pl-form.show { display: block; animation: authFadeIn .25s ease; }
.portal .pl-type-pills { margin-bottom: 16px; }
.portal #genTokenBtn { margin-top: 20px; }
.portal .token-result { display: none; }
.portal .token-result.show { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; animation: authFadeIn .3s ease; }
.portal .token-result-header { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.portal .token-result-badge { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 999px; background: rgba(34, 197, 94, .14); color: #4ade80; font-size: 13px; font-weight: 700; }
.portal .token-result-badge .ic { width: 16px; height: 16px; }
.portal .token-result-note { font-size: 14px; color: var(--text-2); }
.portal .token-code, .portal .modal-token { width: 100%; padding: 16px; border-radius: 16px; background: rgba(255, 255, 255, .05); font-size: clamp(20px, 2.4vw, 26px); font-weight: 800; letter-spacing: .12em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.portal .copy-btn.copied { background: #fff; color: var(--ink); }
.portal .token-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.portal .token-actions .btn { white-space: normal; height: auto; min-height: 40px; padding-block: 8px; }
.portal .share-modal { width: 100%; margin-top: 12px; flex: none; }
.portal .key-cell { display: inline-flex; align-items: center; gap: 8px; }

/* Activer une TV */
.portal #actCheckBtn { margin-top: 2px; }
.portal .act-info { margin-top: 18px; }
.portal .act-device { margin-bottom: 0; }
.portal .act-options { margin-top: 18px; }
.portal .act-info + .auth-error { margin: 16px 0 0; }
.portal .act-device b { display: block; font-size: 15.5px; font-weight: 700; }
.portal .act-device small { display: block; margin-top: 2px; font-size: 13.5px; color: var(--text-2); }
.portal .act-reuse { margin: 4px 0 16px; }
.portal #actGoBtn { margin-top: 20px; }
.portal .act-result-text { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-2); }

/* Historique */
.portal .hist-pills { margin-bottom: 20px; }
.portal .hist-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.portal .search { position: relative; flex: 1 1 240px; max-width: 360px; }
.portal .search .ic { position: absolute; top: 50%; inset-inline-start: 16px; width: 18px; height: 18px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.portal .search .field { height: 46px; padding-inline-start: 44px; font-size: 15px; }
.portal .hist-filter button { height: 38px; padding: 0 14px; font-size: 14px; }
.portal .hist-table-wrap { padding: 6px 0; overflow: hidden; }
.portal .hist-scroll { overflow-x: auto; }
.portal .hist-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.portal .hist-table th { padding: 12px 20px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-align: start; white-space: nowrap; color: var(--text-3); }
.portal .hist-table td { padding: 14px 20px; border-top: 1px solid var(--line); white-space: nowrap; color: var(--text-2); }
.portal .hist-table td:first-child { font-variant-numeric: tabular-nums; }
.portal .hist-table td.hist-empty { text-align: center; color: var(--text-3); }
.portal .hist-status { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--chip); font-size: 12px; font-weight: 700; color: var(--text-2); }
.portal .hist-status.success { background: rgba(34, 197, 94, .14); color: #4ade80; }
.portal .hist-status.pending { background: rgba(255, 209, 102, .12); color: var(--gold-1); }
.portal .hist-status.error { background: rgba(239, 68, 68, .14); color: #f87171; }
.portal .pl-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--chip); font-size: 12.5px; font-weight: 600; color: #fff; }
.portal .pl-action-btn { height: 28px; min-width: 28px; padding: 0 10px; border: 0; border-radius: 999px; background: var(--chip-2); color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background-color .15s, color .15s; }
.portal .pl-action-btn:hover, .portal .pl-action-btn:focus-visible { background: #fff; color: var(--ink); outline: none; }
.portal .pl-action-btn.danger:hover, .portal .pl-action-btn.danger:focus-visible { background: #ef4444; color: #fff; }
.portal .hist-table td[data-col="key"] { font-weight: 700; letter-spacing: .06em; color: #fff; font-variant-numeric: tabular-nums; }
.portal .pl-cell { display: inline-flex; align-items: center; gap: 6px; }
.portal .pl-action-btn .ic { width: 15px; height: 15px; }
.portal .pl-action-btn:has(.ic) { display: inline-grid; place-items: center; width: 28px; padding: 0; }
.portal .hist-pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; padding: 10px 0 6px; }
.portal .hist-page-gap { width: 20px; text-align: center; color: var(--text-3); }
.portal .hist-pagination:empty { display: none; }
.portal .hist-page-btn { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.portal .hist-page-btn svg { width: 16px; height: 16px; }
.portal .hist-page-btn:hover, .portal .hist-page-btn:focus-visible { background: var(--chip-2); color: #fff; outline: none; }
.portal .hist-page-btn.active { background: #fff; color: var(--ink); }
.portal .hist-page-btn:disabled { opacity: .35; cursor: default; background: transparent; }
[dir="rtl"] .portal .hist-page-btn svg { transform: scaleX(-1); }

/* Paramètres */
.portal .sheet-title { display: flex; align-items: center; gap: 10px; margin: 0 0 20px; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.portal .sheet-title .ic { width: 20px; height: 20px; }
.portal .api-key-row { display: flex; align-items: center; gap: 8px; }
.portal .api-key-display { flex: 1; min-width: 0; height: 52px; padding: 0 16px; border-radius: 14px; background: rgba(255, 255, 255, .06); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14.5px; line-height: 52px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.portal .api-actions-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.portal .api-doc-link { font-size: 14.5px; font-weight: 600; color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.portal .save-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.portal .profile-save-msg { display: none; font-size: 14px; font-weight: 600; }
.portal .profile-save-msg.success { color: #4ade80; }
.portal .profile-save-msg.error { color: #f87171; }
.portal .settings-foot { display: flex; justify-content: flex-end; margin-top: 24px; }

/* ---------- Fenêtres (paiement Stripe, clé, playlist) : feuilles de l'app ---------- */
.portal .modal-overlay { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(0, 0, 0, .7); }
.portal .modal-overlay.active { display: flex; animation: fade .2s ease; }
.portal .modal-overlay .modal-card { width: min(480px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 26px 26px 22px; border-radius: 24px; background: var(--sheet); animation: pop .3s cubic-bezier(.2, .8, .2, 1); }
.portal .modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.portal .modal-head .icon-btn { width: 40px; height: 40px; background: var(--chip); }
.portal .modal-card h3 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.portal .pay-modal-summary, .portal .modal-text { margin: 0 0 18px; font-size: 15px; line-height: 1.55; color: var(--text-2); }
.portal #paymentElementContainer { margin-bottom: 16px; }
.portal .modal-card.confirm { display: flex; flex-direction: column; align-items: center; text-align: center; }
.portal .modal-icon { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 14px; border-radius: 50%; background: var(--chip); color: #fff; }
.portal .modal-icon svg { width: 28px; height: 28px; }
.portal .modal-icon.success { background: rgba(34, 197, 94, .14); color: #4ade80; }
.portal .modal-icon:empty { display: none; }
.portal .confirm h3 { margin-bottom: 10px; }
.portal .confirm p { margin: 0; font-size: 15.5px; line-height: 1.55; color: var(--text-2); }
.portal .modal-card .modal-actions { display: flex; gap: 10px; width: 100%; margin-top: 22px; }
.portal .m-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 20px; border: 0; border-radius: 999px; font: inherit; font-size: 15.5px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: background-color .18s, color .18s; }
.portal .m-btn-cancel { background: rgba(255, 255, 255, .08); color: #fff; }
.portal .m-btn-cancel:hover, .portal .m-btn-cancel:focus-visible { background: #fff; color: var(--ink); outline: none; }
.portal .m-btn-confirm { background: #fff; color: var(--ink); }
.portal .m-btn-confirm:hover { background: #e7e7ec; }
.portal .m-btn-confirm:focus-visible { outline: none; box-shadow: inset 0 0 0 2px rgba(11, 11, 15, .55); }
.portal .m-btn:disabled { opacity: .5; cursor: wait; }
.portal .modal-key { margin-bottom: 16px; font-size: 16px; font-weight: 800; letter-spacing: .12em; }
.portal .modal-key:empty { display: none; }

/* Notification du portail (texte posé par le script) */
.portal .toast {
  position: fixed; bottom: 24px; left: 50%; z-index: 130; display: flex; align-items: center; gap: 10px;
  max-width: min(440px, calc(100% - 32px)); padding: 14px 18px; border-radius: 16px; background: #1c1c24; box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  font-size: 15px; font-weight: 600; line-height: 1.4; color: #fff; opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity .25s, transform .25s;
}
.portal .toast:empty { display: none; }
.portal .toast::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.portal .toast.success::before { background: #4ade80; }
.portal .toast.error::before { background: #f87171; }
.portal .toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Conditions revendeur et documentation de l'API (mise en page des CGU) ---------- */
.portal .legal .back-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 26px; font-size: 14.5px; font-weight: 600; color: var(--text-2); text-decoration: none; }
.portal .legal .back-link:hover, .portal .legal .back-link:focus-visible { color: #fff; outline: none; }
.portal .legal .back-link svg { width: 18px; height: 18px; }
[dir="rtl"] .portal .legal .back-link svg { transform: scaleX(-1); }
.portal .legal .legal-date { font-size: 14px; color: var(--text-3); }
.portal .api-doc .subtitle { font-size: 17px; }
.portal .api-doc h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; overflow-wrap: anywhere; }
.portal .api-badge { padding: 3px 9px; border-radius: 999px; background: var(--chip-2); font-family: var(--font); font-size: 11.5px; font-weight: 800; letter-spacing: .04em; color: #fff; }
.portal .api-badge.post { background: #fff; color: var(--ink); }
.portal .api-badge.delete { background: rgba(239, 68, 68, .16); color: #fca5a5; }
.portal .api-doc code { padding: 2px 6px; border-radius: 6px; background: rgba(255, 255, 255, .08); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; color: #fff; }
.portal .api-doc .api-code { margin: 0 0 16px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, .05); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.6; white-space: pre; overflow-x: auto; color: #fff; direction: ltr; text-align: left; }
.portal .api-doc .api-note { margin: 0 0 16px; padding: 14px 16px; border-radius: 14px; background: var(--sheet); font-size: 14.5px; }

/* ---------- Tablette et téléphone ---------- */
@media (max-width: 960px) {
  .portal .buy-grid, .portal .gen-grid, .portal .settings-grid { grid-template-columns: 1fr; }
  .portal .buy-summary { position: static; }
}
@media (max-width: 760px) {
  .portal .api-doc .api-table { display: block; max-width: 100%; overflow-x: auto; }
}
@media (max-width: 560px) {
  .portal .dash { gap: 22px; }
  .portal .dash-head { align-items: flex-start; }
  .portal .dash-side { width: 100%; justify-content: space-between; }
  .portal .dash-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-self: stretch; border-radius: 26px; }   /* 2 × 2 : aucun onglet caché */
  .portal .dash-tabs button { min-width: 0; padding: 0 10px; }
  .portal .dash-tabs button span { overflow: hidden; text-overflow: ellipsis; }
  .portal .dash-tabs button:last-child:nth-child(odd) { grid-column: 1 / -1; }   /* 5 onglets : le dernier sur toute la largeur */
  .portal .search { max-width: none; }
  .portal .hist-filter { width: 100%; }
  .portal .hist-filter button { flex: 1 1 auto; padding: 0 10px; }
  /* Historique en cartes : clé ou détail et statut en tête, puis note, playlist et date (libellés des colonnes) */
  .portal .hist-scroll { overflow: visible; }
  .portal .hist-table, .portal .hist-table tbody { display: block; }
  .portal .hist-table thead { display: none; }
  .portal .hist-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
  .portal .hist-table tr:first-child { border-top: 0; }
  .portal .hist-table td { padding: 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
  .portal .hist-table td[data-col="key"], .portal .hist-table td[data-col="detail"] { grid-row: 1; color: #fff; font-weight: 700; }
  .portal .hist-table td[data-col="status"] { grid-row: 1; grid-column: 2; justify-self: end; }
  .portal .hist-table td[data-col="tv"], .portal .hist-table td[data-col="note"], .portal .hist-table td[data-col="playlist"], .portal .hist-table td[data-col="date"] { grid-column: 1 / -1; font-size: 13.5px; }
  .portal .hist-table td[data-col="tv"]::before, .portal .hist-table td[data-col="note"]::before, .portal .hist-table td[data-col="playlist"]::before { content: attr(data-label) " · "; color: var(--text-3); }
  .portal .hist-table td[data-col="date"] { color: var(--text-3); }
  .portal .hist-table td.hist-empty { grid-column: 1 / -1; }
  .portal .hist-table td.is-empty { display: none; }
  .portal .dash-stats { padding: 14px 0; }
  .portal .dash-stats > div { padding: 0 6px; }
  .portal .modal-overlay .modal-card { padding: 22px 20px 18px; }
}
@media (max-width: 400px) {
  .portal .seg button { padding: 0 12px; font-size: 14px; }
  .portal .dash-tabs button .ic { display: none; }   /* place aux libellés longs (russe, turc) */
  .portal .modal-card .modal-actions { flex-direction: column-reverse; }
}
@media (prefers-reduced-motion: reduce) {
  .portal .dash-panel.active, .portal .pl-form.show, .portal .token-result.show { animation: none; }
}
