/* ─── Tokens ──────────────────────────────────────────────────────
 * Les variables (--primary, --ink, --bg, --r-lg, --shadow-1, --ui…) sont
 * désormais fournies par le Design System du thème :
 * themes/senego/assets/css/design-system/tokens.css (chargé sur toutes les
 * pages front, AVANT ce fichier ; les anciens noms y sont des alias des tokens
 * --senego-*, valeurs identiques). Plus de :root dupliqué ici.
 */

/* ─── Base (SCOPÉ à .senego-account — ne touche jamais le reste du site) ─── */
.senego-account, .senego-account * { box-sizing: border-box; }
.senego-account {
  font-family: var(--ui);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.5;
}
.senego-account button { font-family: inherit; cursor: pointer; }
.senego-account a { color: inherit; text-decoration: none; }
.senego-account img { display: block; max-width: 100%; }

/* ─── Site chrome (mini-header to give context) ───────────────── */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
}
.site-header .logo {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.site-header .logo .accent { color: var(--primary); }
.site-header nav {
  display: flex;
  gap: 22px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}
.site-header nav a:hover { color: var(--primary); }
.site-header .user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}
.site-header .user-chip .avatar { width: 24px; height: 24px; border-radius: 50%; }

/* ─── Page shell ──────────────────────────────────────────────── */
.shell {
  display: grid;
  grid-template-columns: 264px 1fr;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 28px 80px;
  gap: 28px;
  align-items: start;
}

/* ─── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 84px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 8px;
  box-shadow: var(--shadow-1);
}
.sidebar .group-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--meta-2);
  padding: 14px 14px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  transition: background 120ms, color 120ms;
  position: relative;
}
.nav-item:hover { background: var(--bg-3); color: var(--ink); }
.nav-item .icon {
  width: 18px; height: 18px;
  color: var(--meta);
  flex-shrink: 0;
  transition: color 120ms;
}
.nav-item.active {
  background: var(--bg-3);
  color: var(--ink);
}
.nav-item.active .icon { color: var(--primary); }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--primary);
  border-radius: 2px;
}
.nav-item .count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--meta);
  background: var(--bg-3);
  border-radius: 999px;
  padding: 2px 8px;
}
.nav-item.active .count { background: #fff; color: var(--ink); }

.sidebar .divider { height: 1px; background: var(--line); margin: 8px 6px; }

.sidebar .upgrade {
  margin: 8px;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
}
.sidebar .upgrade .lab {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.sidebar .upgrade .h { font-family: var(--serif); font-size: 15px; line-height: 1.3; font-weight: 600; margin: 6px 0 10px; color: var(--ink); }
.sidebar .upgrade button {
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 8px 12px;
  font-weight: 500;
  font-size: 13px;
  width: 100%;
}

/* ─── Main content ────────────────────────────────────────────── */
.content { min-width: 0; }

/* Section header */
.page-header {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-1);
  margin-bottom: 20px;
}
.page-header .avatar-lg {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, #ffd28a, var(--senego-color-primary));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 22px;
  font-family: var(--serif);
  flex-shrink: 0;
  border: 2px solid #fff;
  box-shadow: var(--shadow-2);
}
.page-header .who h1 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.page-header .who .email { color: var(--meta); font-size: 13px; }
.page-header .badges { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge.gold {
  background: var(--gold-soft);
  color: var(--gold);
  border-color: var(--gold-line);
}
.badge.free {
  background: var(--bg-3);
  color: var(--meta);
  border-color: var(--line);
}
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.active { background: #eaf7ee; color: #2a7a3f; border-color: #cfe9d7; }
.badge.warn { background: #fff4e6; color: #b35c00; border-color: #ffd9a8; }

/* Section title (intra-content) */
.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 24px 4px 12px;
}
.section-title h2 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.005em;
}
.section-title .sub { color: var(--meta); font-size: 13px; }
.section-title .link { color: var(--primary); font-weight: 500; font-size: 13px; }
.section-title .link:hover { color: var(--primary-dark); }

/* Card */
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}

/* Buttons — rattachés au Design System.
   Les classes .btn / .btn-primary / .btn-ghost / .btn-danger / .btn-gold de
   l'espace compte héritent désormais du composant .senego-btn (sélecteurs
   groupés dans design-system/components.css). On ne garde ici que le
   dimensionnement d'icône propre au compte. */
.btn .icon { width: 15px; height: 15px; }

/* ─── Overview: shortcut tiles ────────────────────────────────── */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.tile {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  text-align: left;
  transition: border-color 120ms, transform 120ms, box-shadow 120ms;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 124px;
}
.tile:hover { border-color: #d6d6d6; box-shadow: var(--shadow-2); transform: translateY(-1px); }
.tile .ic {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
}
.tile.gold .ic { background: var(--gold-soft); color: var(--gold); }
.tile h3 { margin: 0; font-size: 14px; font-weight: 600; }
.tile p { margin: 2px 0 0; color: var(--meta); font-size: 12.5px; }
.tile .val { font-family: var(--serif); font-size: 22px; font-weight: 600; margin-top: auto; }
.tile .val .unit { color: var(--meta); font-size: 13px; font-weight: 400; font-family: var(--ui); margin-left: 4px; }

/* Promo banner */
.promo {
  margin-top: 22px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 200% at 100% 0%, rgba(255, 255, 255, 0.18), transparent 50%),
    linear-gradient(135deg, var(--senego-color-primary), var(--senego-color-primary-dark));
  color: #fff;
  padding: 26px 28px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 22px;
  overflow: hidden;
  position: relative;
}
.promo::after {
  content: "";
  position: absolute;
  right: -40px; top: -40px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15), transparent 65%);
  pointer-events: none;
}
.promo .eyebrow {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.9;
}
.promo h3 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  margin: 6px 0 6px;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.promo p { margin: 0; opacity: 0.95; font-size: 14px; max-width: 480px; }
.promo .actions { display: flex; gap: 10px; }
.promo .btn-light {
  background: #fff; color: var(--ink); border-color: #fff;
}
.promo .btn-light:hover { background: rgba(255,255,255,0.92); }
.promo .btn-line {
  background: transparent;
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}
.promo .btn-line:hover { background: rgba(255,255,255,0.12); border-color: #fff; }

/* Activity strip on overview */
.activity {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.activity .card { padding: 18px 20px; }
.activity .card .row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line-2);
}
.activity .card .row:first-of-type { border-top: 0; padding-top: 4px; }
.activity .thumb {
  width: 52px; height: 36px;
  border-radius: 4px;
  background: var(--bg-3);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.activity .row .meta-line {
  font-size: 12px; color: var(--meta);
  margin-top: 2px;
  display: flex; gap: 8px; align-items: center;
}
.activity .row .title {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.activity .row .cat { color: var(--primary); font-weight: 600; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; font-family: var(--ui); }

/* ─── Subscription ───────────────────────────────────────────── */
.sub-hero {
  padding: 24px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  position: relative;
}
.sub-hero.premium {
  background:
    linear-gradient(180deg, #fffaf0 0%, #fff 60%);
  border-color: var(--gold-line);
}
.sub-hero .left { padding-right: 24px; min-width: 0; }
.sub-hero .right {
  min-width: 0;
  border-left: 1px solid var(--line);
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}
.sub-hero.premium .right { border-left-color: var(--gold-line); }
.sub-hero .formula-label {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--meta); font-weight: 600;
}
.sub-hero .formula-name {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  margin: 6px 0 2px;
  letter-spacing: -0.01em;
}
.sub-hero.premium .formula-name { color: var(--gold); }
.sub-hero .price {
  display: flex; align-items: baseline; gap: 4px;
  margin-top: 10px;
}
.sub-hero .price .amount { font-family: var(--serif); font-size: 30px; font-weight: 600; white-space: nowrap; }
.sub-hero .price .per { white-space: nowrap; }
.sub-hero .price .per { color: var(--meta); font-size: 14px; }
.sub-hero .features {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.sub-hero .features li {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
}
.sub-hero .features li .check {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sub-hero .features li.muted { color: var(--meta); }
.sub-hero .features li.muted .check { background: var(--bg-3); color: var(--meta-2); }

.sub-hero .renew {
  background: var(--bg-3);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--meta);
}
.sub-hero .renew strong { color: var(--ink); font-weight: 600; }
.sub-hero.premium .renew { background: var(--gold-soft); }
.sub-hero .cta-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* Payments table */
.table-wrap {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
table.pay {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.pay th, table.pay td {
  text-align: left;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
table.pay th {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--meta);
  font-weight: 600;
  background: var(--bg-2);
  border-bottom-color: var(--line);
}
table.pay tr:last-child td { border-bottom: 0; }
table.pay tr:hover td { background: var(--bg-2); }
table.pay .method {
  display: inline-flex; align-items: center; gap: 8px;
}
table.pay .method-chip {
  width: 28px; height: 20px;
  border-radius: 4px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  font-size: 9px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 0.02em;
}
.method-chip.wave { background: #1dafff; color: #fff; border-color: #1dafff; }
.method-chip.om { background: #ff7900; color: #fff; border-color: #ff7900; }
.method-chip.cb { background: #f5f5f5; color: #333; }
.amount-cell { font-weight: 600; font-family: var(--serif); }
.receipt-btn {
  background: transparent;
  border: 0;
  color: var(--primary);
  font-weight: 500;
  font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 0;
}
.receipt-btn:hover { color: var(--primary-dark); }
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}
.status-pill.paid { background: #eaf7ee; color: #2a7a3f; }
.status-pill.failed { background: #fdecea; color: #b3261e; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ─── Saved articles grid ────────────────────────────────────── */
.saved-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.article-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: transform 120ms, box-shadow 120ms, border-color 120ms;
  display: flex;
  flex-direction: column;
}
.article-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: #dcdcdc; }
.article-card .img {
  aspect-ratio: 16/9;
  background: var(--bg-3);
  position: relative;
  overflow: hidden;
}
.article-card .img::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(125deg,
      rgba(255,255,255,0) 30%,
      rgba(255,255,255,0.45) 50%,
      rgba(255,255,255,0) 70%);
}
.article-card .fav {
  position: absolute;
  top: 10px; right: 10px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  border: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-red);
  box-shadow: var(--shadow-2);
  transition: transform 120ms;
  z-index: 2;
}
.article-card .fav:hover { transform: scale(1.08); }
.article-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.article-card .cat {
  color: var(--primary);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.article-card .title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
  margin: 0;
  color: var(--ink);
  text-wrap: pretty;
}
.article-card .meta {
  margin-top: auto;
  font-size: 12px;
  color: var(--meta);
  display: flex; gap: 8px; align-items: center;
}
.article-card .meta .dot { width: 3px; height: 3px; background: var(--meta-2); border-radius: 50%; }

/* Empty state */
.empty {
  background: var(--bg);
  border: 1px dashed var(--senego-color-border);
  border-radius: var(--r-lg);
  padding: 56px 24px;
  text-align: center;
}
.empty .ic {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-red);
}
.empty h3 { font-family: var(--serif); font-size: 18px; font-weight: 600; margin: 0 0 6px; }
.empty p { color: var(--meta); margin: 0 auto 16px; max-width: 380px; font-size: 13.5px; }

/* ─── History list ───────────────────────────────────────────── */
.history-list {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.history-row {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-2);
  align-items: center;
  transition: background 120ms;
  cursor: pointer;
}
.history-row:hover { background: var(--bg-2); }
.history-row:last-child { border-bottom: 0; }
.history-row .thumb {
  aspect-ratio: 16/9;
  background: var(--bg-3);
  border-radius: 6px;
  overflow: hidden;
}
.history-row .cat {
  color: var(--primary);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.history-row h4 {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  margin: 4px 0 4px;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.history-row .meta {
  font-size: 12px;
  color: var(--meta);
  display: flex; gap: 8px; align-items: center;
}
.history-row .progress {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  font-size: 11px;
  color: var(--meta);
}
.history-row .bar { width: 64px; height: 3px; background: var(--line); border-radius: 999px; overflow: hidden; }
.history-row .bar > i { display: block; height: 100%; background: var(--primary); border-radius: inherit; }

/* History toolbar */
.history-toolbar {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-1);
}
.history-toolbar .stats {
  display: flex; gap: 22px; align-items: baseline;
}
.history-toolbar .stat .v { font-family: var(--serif); font-weight: 600; font-size: 18px; margin-right: 6px; }
.history-toolbar .stat .l { color: var(--meta); font-size: 12px; }

/* ─── Profile form ───────────────────────────────────────────── */
.form-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: 24px;
}
.form-card .photo-row {
  display: flex; align-items: center; gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-2);
  margin-bottom: 20px;
}
.form-card .photo-row .avatar-xl {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd28a, var(--senego-color-primary));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--serif); font-weight: 600; font-size: 28px;
  box-shadow: var(--shadow-2);
  border: 2px solid #fff;
  outline: 1px solid var(--line);
}
.form-card .photo-row .info h4 { margin: 0 0 4px; font-size: 14px; }
.form-card .photo-row .info p { margin: 0; color: var(--meta); font-size: 12.5px; }
.form-card .photo-actions { display: flex; gap: 8px; margin-top: 10px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}
.field .input {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  width: 100%;
  transition: border-color 120ms, background 120ms, box-shadow 120ms;
}
.field .input:focus {
  outline: 0;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.15);
}
.field .input:disabled, .field .input[readonly] {
  background: var(--bg-2);
  color: var(--meta);
  cursor: not-allowed;
}
.field .hint { font-size: 11.5px; color: var(--meta); display: flex; gap: 6px; align-items: center; }
.field .hint .lock { width: 12px; height: 12px; }

.provider-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
}
.provider-tag .dot { width: 7px; height: 7px; background: #2a7a3f; border-radius: 50%; }
.provider-tag .g {
  font-weight: 700;
  background: conic-gradient(from -45deg, #4285f4, #34a853, #fbbc05, #ea4335);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.form-foot {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line-2);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ─── Preferences ────────────────────────────────────────────── */
.pref-card { padding: 4px 0; }
.pref-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-2);
}
.pref-row:last-child { border-bottom: 0; }
.pref-row .pic {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--bg-3);
  color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
}
.pref-row h4 { margin: 0 0 2px; font-size: 14px; font-weight: 500; }
.pref-row p { margin: 0; font-size: 12.5px; color: var(--meta); }

/* Toggle */
.toggle {
  --w: 40px; --h: 22px;
  position: relative;
  width: var(--w); height: var(--h);
  background: var(--senego-color-border-strong);
  border-radius: 999px;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: background 160ms;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: transform 160ms cubic-bezier(.4,.7,.3,1.4);
}
.toggle.on { background: var(--primary); }
.toggle.on::after { transform: translateX(18px); }

/* Language picker */
.lang-picker {
  display: inline-flex;
  background: var(--bg-3);
  border-radius: 999px;
  padding: 3px;
  border: 1px solid var(--line);
}
.lang-picker button {
  background: transparent;
  border: 0;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--meta);
  border-radius: 999px;
  transition: background 120ms, color 120ms;
}
.lang-picker button.on { background: var(--bg); color: var(--ink); box-shadow: var(--shadow-1); }

/* ─── Security ───────────────────────────────────────────────── */
.security-section { display: flex; flex-direction: column; gap: 16px; }
.security-row {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-1);
}
.security-row .lead { display: flex; gap: 14px; align-items: center; }
.security-row .ic {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2);
}
.security-row h4 { margin: 0 0 2px; font-size: 14px; font-weight: 500; }
.security-row p { margin: 0; font-size: 12.5px; color: var(--meta); }

.danger-zone {
  background: #fff;
  border: 1px solid #f0c8be;
  border-radius: var(--r-lg);
  overflow: hidden;
}
.danger-zone .head {
  padding: 14px 22px;
  background: #fff5f2;
  border-bottom: 1px solid #f4d6cc;
  display: flex; align-items: center; gap: 10px;
  color: var(--accent-red);
  font-weight: 600;
  font-size: 13px;
}
.danger-zone .body {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.danger-zone .body h4 { margin: 0 0 4px; font-size: 14px; font-weight: 500; }
.danger-zone .body p { margin: 0; color: var(--meta); font-size: 12.5px; max-width: 540px; }

/* ─── Modal ──────────────────────────────────────────────────── */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(20, 20, 20, 0.45);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  animation: fade 160ms ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff;
  border-radius: var(--r-lg);
  width: min(460px, 92vw);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  animation: pop 200ms cubic-bezier(.2,.7,.3,1.1);
}
@keyframes pop { from { transform: translateY(8px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal .head {
  padding: 22px 24px 0;
  display: flex; align-items: center; gap: 12px;
}
.modal .head .warn-ic {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #fff5f2;
  color: var(--accent-red);
  display: flex; align-items: center; justify-content: center;
}
.modal h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}
.modal .body { padding: 12px 24px 20px; color: var(--meta); font-size: 13.5px; line-height: 1.55; }
.modal .body ul { padding-left: 18px; margin: 8px 0; }
.modal .body li { margin: 4px 0; }
.modal .confirm {
  margin-top: 14px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  width: 100%;
  font-family: inherit;
}
.modal .foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 24px 20px;
  border-top: 1px solid var(--line-2);
  background: var(--bg-2);
}

/* ─── Animations on section change ───────────────────────────── */
.content-anim { animation: slideIn 220ms cubic-bezier(.2,.7,.2,1) both; }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ─── Image placeholders ─────────────────────────────────────── */
.ph-img {
  background:
    repeating-linear-gradient(135deg,
      #efefef 0 10px,
      #f5f5f5 10px 20px);
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--meta-2);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
}
.ph-img.t-1 { background: repeating-linear-gradient(135deg, #f1e3d3 0 10px, #f7eedf 10px 20px); }
.ph-img.t-2 { background: repeating-linear-gradient(135deg, #dde7eb 0 10px, #e6eef2 10px 20px); }
.ph-img.t-3 { background: repeating-linear-gradient(135deg, #e7e0d4 0 10px, #eee7da 10px 20px); }
.ph-img.t-4 { background: repeating-linear-gradient(135deg, #e5dcd2 0 10px, #efe6dc 10px 20px); }
.ph-img.t-5 { background: repeating-linear-gradient(135deg, #d6e2d3 0 10px, #e0ebde 10px 20px); }
.ph-img.t-6 { background: repeating-linear-gradient(135deg, #ebd9da 0 10px, #f1e2e3 10px 20px); }

/* ─── Tablet: collapse two-column hero earlier ────────────── */
@media (max-width: 1100px) and (min-width: 881px) {
  .sub-hero { grid-template-columns: 1fr; }
  .sub-hero .left { padding-right: 0; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
  .sub-hero.premium .left { border-bottom-color: var(--gold-line); }
  .sub-hero .right { border-left: 0; padding-left: 0; padding-top: 20px; }
  .sub-hero.premium .right { border-left: 0; }
  .tile-grid { grid-template-columns: 1fr 1fr; }
  .saved-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; padding: 14px 14px 60px; gap: 14px; }
  .sidebar { position: static; padding: 6px; }
  .sidebar .group-label, .sidebar .upgrade, .sidebar .divider { display: none; }
  .sidebar .nav-scroll {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding: 2px;
    scrollbar-width: none;
  }
  .sidebar .nav-scroll::-webkit-scrollbar { display: none; }
  .nav-item {
    flex-shrink: 0;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--bg-3);
    gap: 8px;
    font-size: 13px;
  }
  .nav-item .icon { width: 15px; height: 15px; }
  .nav-item .count { display: none; }
  .nav-item.active { background: var(--ink); color: #fff; }
  .nav-item.active .icon { color: var(--primary); }
  .nav-item.active::before { display: none; }

  .site-header { padding: 0 14px; height: 50px; }
  .site-header nav { display: none; }

  .tile-grid { grid-template-columns: 1fr 1fr; }
  .activity { grid-template-columns: 1fr; }
  .saved-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .page-header { padding: 16px; gap: 12px; }
  .page-header .avatar-lg { width: 48px; height: 48px; font-size: 18px; }
  .page-header .who h1 { font-size: 18px; }
  .page-header .badges { margin-left: 0; }
  .page-header { flex-wrap: wrap; }

  .sub-hero { grid-template-columns: 1fr; padding: 18px; }
  .sub-hero .right { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 18px; margin-top: 18px; }
  .sub-hero .left { padding-right: 0; }
  .sub-hero.premium .right { border-top-color: var(--gold-line); }

  .promo { grid-template-columns: 1fr; padding: 20px; }
  .promo .actions { flex-direction: column; align-items: stretch; }
  .promo .btn { justify-content: center; }

  table.pay thead { display: none; }
  table.pay, table.pay tbody, table.pay tr, table.pay td { display: block; width: 100%; }
  table.pay tr {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-2);
  }
  table.pay td {
    padding: 3px 0;
    border: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
  }
  table.pay td::before {
    content: attr(data-label);
    color: var(--meta);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
  }

  .history-row { grid-template-columns: 80px 1fr; }
  .history-row .progress { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: flex-start; }
  .history-row .bar { width: 120px; }

  .form-grid { grid-template-columns: 1fr; }
  .danger-zone .body { flex-direction: column; align-items: flex-start; }

  /* Boutons CTA : touch-friendly + pleine largeur quand isolés dans une carte. */
  .senego-account .btn { min-height: 44px; padding: 11px 18px; }
  .senego-account .cta-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .senego-account .cta-row .btn { width: 100%; justify-content: center; }
}

/* ─── Anti-overflow horizontal global (toutes tailles d'écran) ──────── */
.senego-account {
  overflow-x: hidden;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.senego-account img, .senego-account iframe, .senego-account video {
  max-width: 100%; height: auto;
}
/* Tableaux : scroll horizontal interne plutôt que push du body */
.senego-account .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Long mots (emails, URLs, refs transactions) : couper proprement */
.senego-account .email,
.senego-account [data-recap],
.senego-account td time,
.senego-account .ref { word-break: break-all; }

/* Le <select> de navigation mobile est caché par défaut (desktop/tablette). */
.senego-account .nav-select { display: none; }

/* ─── Ultra-mobile (≤520px) : 70-75 % de l'audience Senego ───
 * Un seul élément par ligne, paddings minimaux, boutons pouce-friendly,
 * navigation par <select> natif (les 7 onglets accessibles d'un tap). */
@media (max-width: 520px) {

  /* ─── Navigation : remplacer chips horizontales par un <select> natif ── */
  .senego-account .nav-scroll { display: none; }
  .senego-account .nav-select {
    display: block; width: 100%;
    min-height: 44px; padding: 10px 36px 10px 14px;
    border: 1.5px solid var(--line); border-radius: 8px;
    background-color: #fff; color: var(--ink);
    font-size: 15px; font-weight: 600; font-family: inherit;
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%23666' stroke-width='2'><path d='M1 1.5l5 5 5-5'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
  }
  .senego-account .nav-select:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255,153,0,0.15);
  }
  .senego-account .sidebar { background: transparent; border: 0; padding: 0; box-shadow: none; }
  .senego-account .sidebar .group-label { display: none; }
  .senego-account .sidebar .divider,
  .senego-account .sidebar .upgrade { display: none; }
  .senego-account { font-size: 14px; }
  .shell { padding: 10px 10px 50px; gap: 10px; }
  .sidebar { padding: 4px; }
  .nav-item { padding: 9px 14px; font-size: 12.5px; }
  .nav-item .icon { width: 14px; height: 14px; }

  /* Section titles : plus compact */
  .section-title h2 { font-size: 16px; }
  .section-title .sub { font-size: 12px; }

  /* Hero profil sur 1 colonne */
  .page-header { padding: 14px; gap: 10px; }
  .page-header .avatar-lg { width: 44px; height: 44px; font-size: 16px; }
  .page-header .who h1 { font-size: 17px; }
  .page-header .email { font-size: 12.5px; word-break: break-word; }

  /* Toutes les grilles en 1 colonne */
  .tile-grid { grid-template-columns: 1fr; gap: 10px; }
  .tile { padding: 14px; }
  .saved-grid { grid-template-columns: 1fr; gap: 10px; }
  .saved-card { padding: 12px; }

  /* Section "Mon abonnement" — hero plus aéré, ribbon Actif sur sa propre ligne */
  .sub-hero { padding: 16px; gap: 12px; }
  .sub-hero .formula-name { font-size: 18px; }
  .sub-hero .features li { font-size: 13px; }
  .sub-hero .renew { font-size: 13px; }

  /* Tableau paiements : cartes empilées, plus aérées */
  table.pay tr { padding: 14px 14px; }
  table.pay td { padding: 5px 0; font-size: 13px; }
  table.pay td::before { font-size: 10.5px; min-width: 80px; }
  .receipt-btn { padding: 8px 14px; font-size: 12.5px; }

  /* Historique de lecture : ligne unique au lieu de 2 colonnes */
  .history-row { grid-template-columns: 1fr; gap: 8px; padding: 12px; }
  .history-row .thumb { width: 100%; max-width: 100%; height: 140px; }
  .history-row .progress .bar { flex: 1; }

  /* Form profil & préférences : labels au-dessus, champs grands */
  .field { margin-bottom: 14px; }
  .field .input, .field textarea {
    min-height: 44px; padding: 11px 14px; font-size: 15px;
    -webkit-appearance: none; /* iOS : pas d'arrondi natif qui casserait notre style */
  }
  .field textarea { min-height: 100px; }
  .form-foot { flex-direction: column-reverse; gap: 8px; padding-top: 14px; }
  .form-foot .btn { width: 100%; justify-content: center; }

  /* Préférences : toggles sur 1 ligne, label-description verticales */
  .pref-row { padding: 14px; gap: 10px; }
  .pref-row .lead { gap: 10px; flex: 1; min-width: 0; }
  .pref-row .lead .ic { flex-shrink: 0; }
  .pref-row .lead .meta h4 { font-size: 14px; word-break: break-word; }
  .pref-row .lead .meta p { font-size: 12.5px; }

  /* Sécurité — actions empilées */
  .security-row { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px; }
  .security-row .btn { width: 100%; justify-content: center; }
  .danger-zone { padding: 14px; }
  .danger-zone .btn { width: 100%; justify-content: center; }
}

/* ─── Mobile preview frame (Tweaks: vue mobile) ──────────────── */
.mobile-frame {
  width: 390px;
  max-width: 100%;
  margin: 20px auto;
  border: 12px solid var(--senego-color-text);
  border-radius: 38px;
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0,0,0,0.18);
  height: 800px;
  display: flex;
  flex-direction: column;
}
.mobile-frame .inner {
  flex: 1;
  overflow-y: auto;
}
.mobile-frame .status-bar {
  height: 28px;
  background: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  font-size: 11px; font-weight: 600;
  flex-shrink: 0;
}
