/* ============================================================================
   Akamako sur le site (30/10/2026) — page /akamako-777, logique dans akamako-desk.js.
   Ordinateur (≥ 1 100 px) : trois colonnes à droite de la barre latérale — rubriques + liste,
   contenu, repères — qui SUIVENT l'écran (clamp), en-têtes clairs, aucun bandeau en dégradé.
   Téléphone : une seule colonne, les repères passent dessous.
   Charte Akamako : #A23BE0 (violet) et #FF2E93 (rose) seulement. Encres mesurées :
     #A23BE0 sur blanc 4,95 · blanc sur #A23BE0 4,95 · #FF2E93 sur #241041 4,95 ·
     #1E1236 sur #FF2E93 5,07. Le rose n'écrit jamais sur fond clair (3,46) : il décore.
   ============================================================================ */

.ak-body {
  --ak-violet: #A23BE0;
  --ak-rose: #FF2E93;
  --ak-ink: #A23BE0;            /* texte d'accent sur carte claire (4,95) */
  --ak-badge-ink: #1E1236;      /* encre sur pastille rose (5,07) */
  --ak-surface: var(--card-bg, #fff);
  background: var(--bg, #F4EEFF);
  color: var(--text, #1E1236);
}
[data-theme="dark"] .ak-body { --ak-ink: #FF2E93; }
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] .ak-body { --ak-ink: #FF2E93; }
}

.ak-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 12px 14px calc(var(--evo-nav-space, 90px) + 12px);
  max-width: 640px;
  margin: 0 auto;
  font-family: var(--font, inherit);
}
.ak-col { min-width: 0; }

/* ─── Colonne 1 : rubrique + onglets ─── */
.ak-head { display: flex; align-items: center; gap: 12px; padding: 4px 4px 12px; }
.ak-head-mark {
  width: 44px; height: 44px; border-radius: 14px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ak-violet); color: #fff; font-size: 19px;
}
.ak-head-name { margin: 0; font-size: 22px; font-weight: 900; letter-spacing: -.01em; color: var(--text); }
.ak-head-sub { margin: 2px 0 0; font-size: 13px; color: var(--text-muted); }

.ak-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--ak-surface); border: 1px solid var(--border); }
.ak-tab {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 0; padding: 10px 8px; border: 0; border-radius: 11px; cursor: pointer;
  background: transparent; color: var(--text-soft, var(--text)); font: 700 14px/1.2 var(--font, inherit);
}
.ak-tab span:not(.ak-badge) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ak-tab i { color: var(--text-muted); }
.ak-tab:hover { background: rgba(128, 128, 128, .12); }
.ak-tab.is-active { background: var(--ak-violet); color: #fff; }
.ak-tab.is-active i { color: #fff; }
.ak-tab:focus-visible, .ak-sub:focus-visible, .ak-conv:focus-visible, .ak-btn:focus-visible, .ak-round:focus-visible, .ak-tile-btn:focus-visible, .ak-link-row:focus-visible {
  outline: 3px solid var(--ak-rose); outline-offset: 2px;
}
.ak-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--ak-rose); color: var(--ak-badge-ink);
  font-size: 11px; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.ak-badge[hidden] { display: none; }

.ak-side-list { margin-top: 12px; }
.ak-side-title { margin: 4px 6px 8px; font-size: 15px; font-weight: 800; color: var(--text); }
.ak-side-note { margin: 10px 6px; font-size: 13px; color: var(--text-muted); }
.ak-subs, .ak-convs, .ak-list, .ak-links, .ak-rules { list-style: none; margin: 0; padding: 0; }
.ak-subs { display: flex; flex-direction: column; gap: 2px; }
.ak-sub {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  border: 0; border-radius: 12px; background: none; cursor: pointer; text-align: left;
  color: var(--text); font: 700 15px/1.2 var(--font, inherit);
}
.ak-sub i { width: 22px; text-align: center; color: var(--text-muted); font-size: 16px; }
.ak-sub:hover { background: rgba(128, 128, 128, .12); }
.ak-sub.is-active { background: var(--ak-surface); box-shadow: inset 3px 0 0 var(--ak-rose); }
.ak-sub.is-active i { color: var(--ak-violet); }
.ak-sub.is-off { cursor: default; color: var(--text-muted); }
.ak-sub.is-off:hover { background: none; }
.ak-sub.is-off small { margin-left: auto; font-size: 12px; font-weight: 600; }

.ak-conv {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 10px;
  border: 0; border-radius: 12px; background: none; cursor: pointer; text-align: left; color: var(--text);
  font-family: var(--font, inherit);
}
.ak-conv:hover { background: rgba(128, 128, 128, .12); }
.ak-conv.is-open { background: var(--ak-surface); box-shadow: inset 3px 0 0 var(--ak-rose); }
.ak-conv-txt, .ak-li-txt { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.ak-conv-txt b, .ak-li-txt b { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ak-conv-txt small, .ak-li-txt small { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ak-conv.is-unread .ak-conv-txt b, .ak-conv.is-unread .ak-conv-txt small { font-weight: 800; color: var(--text); }

.ak-av {
  width: 48px; height: 48px; border-radius: 50%; flex: 0 0 auto; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ak-violet); color: #fff; font-weight: 900; font-size: 18px;
}
.ak-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ak-av-lg { width: 88px; height: 88px; font-size: 32px; }
.ak-av-xl { width: 120px; height: 120px; font-size: 44px; border: 4px solid var(--ak-rose); }
.ak-av-tile { width: 100%; height: auto; aspect-ratio: 1; border-radius: 14px; font-size: 40px; }

/* ─── Colonne 2 : contenu ─── */
.ak-col-main {
  position: relative; min-height: 420px;
  background: var(--ak-surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 20px;
}
.ak-main-title { margin: 0 0 14px; }
.ak-center { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 40px 12px; max-width: 520px; margin: 0 auto; }
.ak-note { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 60px 0; color: var(--text-muted); }
.ak-note-ic, .ak-mark-lg, .ak-lock {
  width: 72px; height: 72px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--ak-violet); background: rgba(162, 59, 224, .12);
}
.ak-mark-lg { width: 88px; height: 88px; font-size: 36px; color: #fff; background: var(--ak-violet); box-shadow: 0 0 0 8px rgba(255, 46, 147, .18); }
.ak-lock { color: #fff; background: var(--ak-violet); }
.ak-h1 { margin: 6px 0 0; font-size: 28px; font-weight: 900; color: var(--text); }
.ak-h2 { margin: 4px 0 0; font-size: 20px; font-weight: 800; color: var(--text); }
.ak-h3 { margin: 0 0 10px; font-size: 15px; font-weight: 800; color: var(--text); }
.ak-p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-soft, var(--text)); }
.ak-p-strong { font-size: 16px; font-weight: 700; color: var(--text); }
.ak-p-left { text-align: left; margin-bottom: 10px; }
.ak-small { margin: 4px 0 0; font-size: 12px; color: var(--text-muted); }
.ak-ink { color: var(--ak-ink); }
.ak-err { min-height: 1.2em; margin: 4px 0 0; font-size: 13px; font-weight: 700; color: #B3261E; }
[data-theme="dark"] .ak-err { color: #FFB4AB; }
.ak-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }

.ak-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 12px; border: 1px solid transparent; cursor: pointer;
  font: 800 14px/1.2 var(--font, inherit); text-decoration: none; white-space: nowrap;
}
.ak-btn:disabled { opacity: .6; cursor: default; }
.ak-btn-primary { background: var(--ak-violet); color: #fff; }
.ak-btn-primary:hover { filter: brightness(.94); }
.ak-btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong, var(--border)); }
.ak-btn-ghost:hover { background: rgba(128, 128, 128, .12); }
.ak-btn-sm { padding: 8px 12px; font-size: 13px; }
.ak-btn-wide { width: 100%; max-width: 340px; padding: 14px 18px; font-size: 15px; }

.ak-rules { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 360px; margin: 10px 0; text-align: left; }
.ak-rules li { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; color: var(--text); }
.ak-rules-sm { gap: 10px; margin: 0; }
.ak-rules-sm li { font-size: 14px; }
.ak-rule-ic {
  width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(162, 59, 224, .12); color: var(--ak-violet); font-size: 14px;
}
[data-theme="dark"] .ak-rule-ic, [data-theme="dark"] .ak-note-ic { color: var(--ak-rose); background: rgba(255, 46, 147, .14); }
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] .ak-rule-ic, [data-theme="auto"] .ak-note-ic { color: var(--ak-rose); background: rgba(255, 46, 147, .14); }
}

.ak-field { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 340px; text-align: left; font-size: 14px; font-weight: 700; color: var(--text); }
.ak-field input {
  padding: 11px 12px; border-radius: 12px; border: 1px solid var(--border-strong, var(--border));
  background: var(--bg, #fff); color: var(--text); font: 600 16px var(--font, inherit);
}
.ak-field small { font-weight: 500; color: var(--text-muted); }

/* Paquet de profils */
.ak-deck { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ak-card {
  width: 100%; max-width: 440px; border-radius: 20px; overflow: hidden;
  background: var(--ak-surface); border: 1px solid var(--border); box-shadow: 0 6px 24px rgba(58, 23, 113, .12);
}
.ak-card-photo { position: relative; aspect-ratio: 4 / 5; max-height: 58vh; width: 100%; background: rgba(162, 59, 224, .14); }
.ak-card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ak-card-initial { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 120px; font-weight: 900; color: var(--ak-violet); }
.ak-chip { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 900; }
.ak-chip-pink { background: var(--ak-rose); color: var(--ak-badge-ink); }
.ak-card-photo .ak-chip { position: absolute; top: 14px; left: 14px; }
.ak-card-body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ak-card-name { margin: 0; font-size: 22px; font-weight: 900; color: var(--text); display: flex; align-items: baseline; gap: 10px; min-width: 0; max-width: 100%; }
.ak-card-age { font-size: 18px; font-weight: 600; color: var(--text-soft, var(--text)); white-space: nowrap; }
.ak-card-where { margin: 0; font-size: 13px; font-weight: 700; color: var(--text-muted); }
.ak-card-note { margin: 0; font-size: 13px; font-weight: 700; color: var(--ak-ink); }
.ak-card-bio { margin: 2px 0 0; font-size: 14px; line-height: 1.5; color: var(--text); }
.ak-deck-actions { display: flex; gap: 22px; align-items: center; }
.ak-round {
  width: 62px; height: 62px; border-radius: 50%; cursor: pointer; font-size: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ak-surface); color: var(--text-soft, var(--text)); border: 2px solid var(--border-strong, var(--border));
  box-shadow: 0 4px 14px rgba(58, 23, 113, .12);
}
.ak-round:hover { transform: translateY(-1px); }
.ak-round-super { width: 50px; height: 50px; font-size: 19px; color: var(--ak-violet); border-color: var(--ak-violet); }
.ak-round-like { background: var(--ak-violet); color: #fff; border-color: var(--ak-violet); }
.ak-keys { text-align: center; }

.ak-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.ak-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 10px 14px;
  border-radius: 16px; border: 1px solid var(--border); background: var(--ak-surface); text-align: center; color: var(--text);
  font-family: var(--font, inherit);
}
.ak-tile b { font-size: 14px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ak-tile small { font-size: 12px; font-weight: 700; }
.ak-tile-btn { cursor: pointer; }
.ak-tile-btn:hover { border-color: var(--ak-violet); }
.ak-list { display: flex; flex-direction: column; gap: 4px; }
.ak-li { display: flex; align-items: center; gap: 12px; padding: 8px 4px; }

/* Discussion dans la colonne (même cadre que /chats) */
.ak-body .ak-col-main:has(.ak-frame) { padding: 0; overflow: hidden; }
.ak-frame { display: block; width: 100%; height: 100%; min-height: 520px; border: 0; background: var(--ak-surface); }
.ak-frame-fail { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: var(--ak-surface); }

/* Mon compte */
.ak-me { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; text-align: center; }
.ak-me b { font-size: 17px; color: var(--text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ak-pill { padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; border: 1px solid var(--border-strong, var(--border)); color: var(--text-muted); }
.ak-pill.is-on { background: var(--ak-violet); border-color: var(--ak-violet); color: #fff; }
.ak-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.ak-stat { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 14px; border: 1px solid var(--border); }
.ak-stat b { font-size: 22px; font-weight: 900; color: var(--text); }
.ak-stat span { font-size: 13px; color: var(--text-muted); }
.ak-card-plain { padding: 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--ak-surface); margin-bottom: 14px; }
.ak-col-main .ak-card-plain .ak-p { margin-bottom: 10px; }
.ak-links { display: flex; flex-direction: column; gap: 4px; }
.ak-link-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 12px; text-decoration: none; color: var(--text); }
.ak-link-row:hover { background: rgba(128, 128, 128, .12); }
.ak-chev { color: var(--text-muted); font-size: 12px; }

/* ─── Colonne 3 : repères ─── */
.ak-unify { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.ak-unify-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ak-unify-txt b { font-size: 15px; color: var(--text); }
.ak-unify-txt small { font-size: 13px; line-height: 1.4; color: var(--text-muted); }
.ak-unify input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ak-switch {
  position: relative; flex: 0 0 auto; width: 46px; height: 26px; border-radius: 999px;
  background: rgba(128, 128, 128, .22); border: 1px solid var(--border-strong, var(--border)); transition: background .15s;
}
.ak-switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s;
}
.ak-unify input:checked + .ak-switch { background: var(--ak-violet); border-color: var(--ak-violet); }
.ak-unify input:checked + .ak-switch::after { transform: translateX(20px); }
.ak-unify input:focus-visible + .ak-switch { outline: 3px solid var(--ak-rose); outline-offset: 2px; }
.ak-unify input:disabled + .ak-switch { opacity: .6; }
.ak-col-aside .ak-h3 { display: flex; align-items: center; gap: 8px; }

/* Match */
.ak-match { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: rgba(20, 8, 38, .72); padding: 20px; }
.ak-match-box { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 420px; padding: 28px 24px; border-radius: 22px; text-align: center; background: var(--ak-surface); border: 1px solid var(--border); }

.ak-status {
  position: fixed; left: 50%; bottom: 28px; z-index: 210; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: min(520px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 12px;
  background: #1E1236; color: #fff; font-size: 14px; font-weight: 600; transition: opacity .2s, transform .2s;
}
.ak-status.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Porte (âge, accueil) : seule la colonne du contenu reste. */
.ak-shell.is-gated .ak-tabs, .ak-shell.is-gated .ak-col-aside { display: none; }

/* ═══════════════════════ TÉLÉPHONE ═══════════════════════
   Onglets icône au-dessus du libellé (un libellé ne se coupe jamais), et pas de colonne vide
   « choisis une discussion » : une discussion s'ouvre en pleine page sur un écran étroit. */
@media (max-width: 1099px) {
  .ak-tab { flex-direction: column; gap: 4px; padding: 8px 4px; font-size: 12.5px; position: relative; }
  .ak-tab i { font-size: 16px; }
  .ak-tab .ak-badge { position: absolute; top: 4px; right: calc(50% - 26px); min-width: 18px; height: 18px; font-size: 10px; }
  .ak-col-main:has(.ak-pane-empty) { display: none; }
  /* Sous-rubriques de Découvrir : une rangée de pastilles qui défile (pastilles entières, jamais coupées). */
  .ak-side-list { margin-top: 10px; }
  .ak-subs { flex-direction: row; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 4px; }
  .ak-subs::-webkit-scrollbar { display: none; }
  .ak-subs li { flex: 0 0 auto; }
  .ak-sub { width: auto; white-space: nowrap; gap: 7px; padding: 8px 13px; font-size: 13.5px; border-radius: 999px; border: 1px solid var(--border); background: var(--ak-surface); }
  .ak-sub i { width: auto; font-size: 13px; }
  .ak-sub.is-active { background: var(--ak-violet); border-color: var(--ak-violet); color: #fff; box-shadow: none; }
  .ak-sub.is-active i { color: #fff; }
  .ak-sub.is-off small { margin-left: 4px; }
  .ak-col-main { padding: 14px; min-height: 0; }
  /* Photo bornée par la hauteur d'écran : les boutons restent au-dessus de la barre du bas. */
  .ak-card-photo { aspect-ratio: auto; height: clamp(200px, calc(100dvh - 560px), 52vh); max-height: none; }
  .ak-card-body { padding: 10px 14px 12px; }
  .ak-keys { display: none; }   /* pas de clavier sur téléphone */
  .ak-card-bio { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}

/* ═══════════════════════ ORDINATEUR ═══════════════════════ */
@media (min-width: 1100px) {
  body.ak-body.has-desktop-shell { --ak-left: clamp(270px, 19vw, 360px); --ak-right: clamp(260px, 19vw, 360px); }
  body.has-desktop-shell .ak-shell {
    max-width: none; margin: 0;
    grid-template-columns: var(--ak-left) minmax(0, 1fr) var(--ak-right);
    gap: clamp(14px, 1.4vw, 24px);
    padding: 18px clamp(14px, 1.6vw, 28px) 24px;
    height: calc(100dvh - var(--ds-top, 0px));
    box-sizing: border-box;
  }
  /* Les trois colonnes défilent chacune ; la page, elle, ne bouge pas (comme /chats). */
  body.has-desktop-shell .ak-col { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
  body.has-desktop-shell .ak-col-nav { display: flex; flex-direction: column; }
  body.has-desktop-shell .ak-tabs { grid-template-columns: 1fr; gap: 2px; padding: 0; background: none; border: 0; }
  body.has-desktop-shell .ak-tab { justify-content: flex-start; gap: 12px; padding: 11px 12px; font-size: 15px; }
  body.has-desktop-shell .ak-tab i { width: 22px; text-align: center; font-size: 17px; }
  body.has-desktop-shell .ak-tab .ak-badge { margin-left: auto; }
  body.has-desktop-shell .ak-side-list { border-top: 1px solid var(--border); padding-top: 12px; }
  body.has-desktop-shell .ak-col-main { min-height: 0; padding: clamp(18px, 1.6vw, 28px); }
  body.has-desktop-shell .ak-col-main:has(.ak-frame) { padding: 0; }
  body.has-desktop-shell .ak-frame { height: 100%; min-height: 0; }
  /* Le paquet tient dans la colonne : photo bornée par la hauteur d'écran, boutons toujours visibles. */
  body.has-desktop-shell .ak-deck { gap: 12px; }
  body.has-desktop-shell .ak-card { max-width: min(440px, calc((100dvh - var(--ds-top, 0px) - 300px) * .8 + 2px)); }
  body.has-desktop-shell .ak-card-photo { max-height: none; }
  body.has-desktop-shell .ak-shell.is-gated { grid-template-columns: var(--ak-left) minmax(0, 1fr); }
  body.has-desktop-shell .ak-shell.is-gated .ak-col-aside { display: none; }
  /* Rubrique sans rail global (desktop-shell.js) : la colonne de droite d'Akamako le remplace. */
  body.has-desktop-shell .ak-status { left: calc(var(--ds-sidebar) + (100vw - var(--ds-sidebar)) / 2); }
  body.has-desktop-shell .ak-match { left: var(--ds-sidebar); top: var(--ds-top, 0px); }
}
