/* ========================================================================== */
/* RYVANGEL — Thème premium v2                                               */
/* Remplace entièrement l'ancien ryvangel-theme-premium.css.                  */
/* Couche visuelle uniquement : aucun JavaScript ou HTML requis.              */
/* ========================================================================== */

:root {
  --bg: #031725;
  --surface: #092b45;
  --surface-2: #0a304c;
  --surface-3: #062641;
  --text: #f7fbff;
  --muted: #a8c1d6;
  --accent: #82dcff;
  --accent-strong: #5d9fff;
  --accent-ink: #061c31;
  --border: rgba(151, 218, 255, .18);
  --border-strong: rgba(138, 218, 255, .48);
  --shadow: 0 12px 28px rgba(0, 0, 0, .20);
  --radius: 18px;
  color-scheme: dark;
}

html {
  background: var(--bg);
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 82% -8%, rgba(55, 141, 211, .15), transparent 31rem),
    radial-gradient(circle at 8% 48%, rgba(48, 195, 218, .05), transparent 27rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(130, 220, 255, .72);
  outline-offset: 2px;
}

/* -------------------------------------------------------------------------- */
/* Cadre global, en-tête et typographie                                       */
/* -------------------------------------------------------------------------- */

.app {
  width: min(100%, 980px);
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  isolation: isolate;
}

.app-header {
  border-bottom: 1px solid rgba(151, 218, 255, .10);
  background: rgba(3, 23, 37, .94);
  box-shadow: none;
  backdrop-filter: blur(14px);
}

.logo {
  border: 1px solid rgba(231, 249, 255, .48);
  border-radius: 13px;
  color: #06233e;
  background: linear-gradient(145deg, #d8f4ff, #7dbaff);
  box-shadow: 0 8px 20px rgba(63, 165, 255, .18), inset 0 1px 0 rgba(255,255,255,.70);
}

.app-title,
.section-title,
.directory-title,
.card-title,
.profile-panel-card h3,
.welcome-shell h2,
.prayer-flow-content h2,
.dialog-body h2,
.home-welcome h2,
.home-companion h2 {
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  text-shadow: none;
}

.app-subtitle,
.section-desc,
.card-text,
.space-meta,
.profile-panel-card p,
.profile-privacy,
.welcome-shell p,
.welcome-features span,
#profile-summary,
.profile-entry .home-question,
.home-companion p {
  color: var(--muted);
}

.eyebrow,
.home-welcome .eyebrow {
  color: var(--accent);
}

.content {
  padding-bottom: calc(100px + env(safe-area-inset-bottom));
}

/* -------------------------------------------------------------------------- */
/* Boutons, champs et composants communs                                      */
/* -------------------------------------------------------------------------- */

.btn-primary,
.home-companion-send,
.daily-prayer-start,
.home-next-action,
.space-action,
.welcome-actions .btn-primary {
  border-color: transparent;
  color: var(--accent-ink);
  background: linear-gradient(135deg, #91e2ff 0%, #75baff 52%, #5d9fff 100%);
  box-shadow: 0 8px 18px rgba(31, 100, 160, .20), inset 0 1px 0 rgba(255,255,255,.45);
}

.btn-primary:hover,
.home-companion-send:hover,
.daily-prayer-start:hover,
.home-next-action:hover,
.space-action:hover,
.welcome-actions .btn-primary:hover {
  filter: brightness(1.06);
}

.btn-outline,
.back-button,
.chat-focus-back,
.home-ai-listen,
.home-ai-clear,
.lesson-ai-listen,
.prayer-toggle,
.home-companion-cancel {
  border: 1px solid var(--border);
  color: #dcecf8;
  background: var(--surface-3);
  box-shadow: none;
}

.field input,
.field textarea,
.home-companion-form input,
.home-ai-form textarea {
  min-width: 0;
  border: 1px solid rgba(151, 218, 255, .22);
  color: var(--text);
  background: #051f34;
  box-shadow: none;
}

.field input:focus,
.field textarea:focus,
.home-companion-form input:focus,
.home-ai-form textarea:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(130, 220, 255, .09);
}

.field input::placeholder,
.field textarea::placeholder,
.home-companion-form input::placeholder,
.home-ai-form textarea::placeholder {
  color: #7f9bb0;
  opacity: 1;
}

.badge,
.card-tag,
.verse-theme,
.quiz-level,
.mode-pill {
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface-3);
}

/* -------------------------------------------------------------------------- */
/* Cartes, leçons, quiz et profil                                             */
/* -------------------------------------------------------------------------- */

.card,
.daily-card,
.home-companion,
.home-assistant,
.home-next-step,
.home-journey,
.install-card,
.profile-panel-card,
.profile-stats div,
.path-quiz-card,
.profile-action,
.space-card,
.quiz-rewards,
.lesson-ai,
.lesson-ai-result {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .16);
}

.card:hover,
.space-card:hover,
.path-quiz-card:hover,
.profile-action:hover {
  border-color: rgba(138, 218, 255, .34);
  box-shadow: var(--shadow);
}

.card { border-radius: 18px; }

.home-next-step,
.home-journey,
.install-card,
.profile-stats div,
.profile-action,
.path-quiz-card,
.space-card {
  background: var(--surface-3);
}

.complete-toggle {
  border-color: rgba(151, 218, 255, .24);
  color: var(--accent);
  background: var(--surface-3);
}

.answer-option {
  border: 1px solid var(--border);
  color: #dcecf8;
  background: var(--surface-3);
  box-shadow: none;
}

.answer-option:hover,
.answer-option:focus-visible,
.answer-option[aria-checked="true"],
.answer-option:has(input:checked) {
  border-color: var(--border-strong);
  background: #123f60;
}

.quiz-rewards {
  border-radius: 20px;
  background: var(--surface);
}

.reward-title,
.question,
.quiz-feedback-shell h3 {
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
}

.profile-avatar-button,
.profile-panel-avatar,
.home-companion-orb,
.home-assistant-avatar {
  overflow: hidden;
  border: 1px solid rgba(151, 218, 255, .28);
  color: transparent;
  background: #092b45 url("assets/ryvangel/avatar-olice.webp") center 35% / cover no-repeat;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .18);
}

.profile-avatar-button > span,
.profile-panel-avatar > span { opacity: 0; }

.profile-avatar-button img,
.profile-panel-avatar img,
.home-assistant-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-action > span:first-child,
.path-quiz-card > span:first-child {
  border: 1px solid rgba(151, 218, 255, .16);
  color: var(--accent);
  background: var(--surface);
}

.profile-privacy,
.community-safety,
#profile-save-reminder {
  border: 0;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  background: var(--surface-3);
}

/* -------------------------------------------------------------------------- */
/* Accueil : menu, compagnon et prière                                        */
/* -------------------------------------------------------------------------- */

.profile-entry {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.home-module-nav {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.home-module-button {
  min-height: 68px;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: #dcecf8;
  background: var(--surface-3);
  box-shadow: none;
}

.home-module-button:hover,
.home-module-button:focus-visible {
  border-color: var(--border-strong);
  filter: none;
}

.home-module-button[aria-pressed="true"] {
  border-color: var(--border-strong);
  color: var(--text);
  background: #0a3a5d;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .16);
}

.home-module-button > span {
  display: block;
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  color: transparent;
  background: #bfeaff;
  filter: none;
  font-size: 0;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.home-module-button:nth-child(1) > span { -webkit-mask-image: url("assets/ryvangel/icon-parler.svg"); mask-image: url("assets/ryvangel/icon-parler.svg"); }
.home-module-button:nth-child(2) > span { -webkit-mask-image: url("assets/ryvangel/icon-prier.svg"); mask-image: url("assets/ryvangel/icon-prier.svg"); }
.home-module-button:nth-child(3) > span { -webkit-mask-image: url("assets/ryvangel/icon-parcours.svg"); mask-image: url("assets/ryvangel/icon-parcours.svg"); }
.home-module-button:nth-child(4) > span { -webkit-mask-image: url("assets/ryvangel/icon-echanges.svg"); mask-image: url("assets/ryvangel/icon-echanges.svg"); }

.home-companion {
  border-radius: 20px;
  background: var(--surface-2);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .18);
}

.home-companion-thread {
  border: 1px solid rgba(151, 218, 255, .12);
  background: #051f34;
}

.home-companion-bubble,
.home-ai-message,
.testimony {
  color: #dcecf8;
  background: var(--surface-3);
  box-shadow: none;
  overflow-wrap: anywhere;
}

.home-companion-bubble.is-user,
.home-ai-message.is-user,
.testimony.is-own {
  border-color: rgba(138, 218, 255, .26);
  color: var(--text);
  background: #0d4166;
}

.home-companion-presence > span,
.home-companion-presence i { color: #75e6cf; }
.home-companion-presence i { background: #75e6cf; box-shadow: none; }

.home-companion-mic {
  border-color: var(--border);
  color: var(--accent);
  background: #041b2c;
  box-shadow: none;
}

.home-needs > summary,
.home-need,
.home-ai-suggestion,
.guided-drawer > summary {
  border-color: var(--border);
  color: var(--muted);
  background: var(--surface-3);
  box-shadow: none;
}

.home-need[aria-pressed="true"] {
  border-color: var(--border-strong);
  color: var(--text);
  background: #123f60;
}

.home-daily-card,
#chat-prayer-context {
  border: 1px solid var(--border);
  background-color: var(--surface);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .16);
}

#chat-prayer-context {
  position: relative;
  overflow: hidden;
  background-image:
    linear-gradient(90deg, #092b45 0 49%, rgba(9, 43, 69, .76) 70%, rgba(9, 43, 69, .22)),
    url("assets/ryvangel/theme-consolation.webp");
  background-position: center, right center;
  background-repeat: no-repeat;
  background-size: cover, auto 100%;
}

#chat-prayer-context > * {
  position: relative;
  z-index: 1;
  max-width: 72%;
}

/* -------------------------------------------------------------------------- */
/* Communauté                                                                 */
/* -------------------------------------------------------------------------- */

.community-shortcuts {
  gap: 8px;
}

.community-shortcut {
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--muted);
  background: var(--surface-3);
  box-shadow: none;
}

.community-shortcut[aria-pressed="true"] {
  border-color: var(--border-strong);
  color: var(--accent);
  background: #123f60;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .14);
}

.tab-icon,
.community-shortcut-icon {
  display: block;
  width: 23px;
  height: 23px;
  color: transparent;
  background: #bfeaff;
  font-size: 0;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.community-shortcut:nth-child(1) .community-shortcut-icon { -webkit-mask-image: url("assets/ryvangel/icon-accueil.svg"); mask-image: url("assets/ryvangel/icon-accueil.svg"); }
.community-shortcut:nth-child(2) .community-shortcut-icon { -webkit-mask-image: url("assets/ryvangel/icon-groupes.svg"); mask-image: url("assets/ryvangel/icon-groupes.svg"); }
.community-shortcut:nth-child(3) .community-shortcut-icon { -webkit-mask-image: url("assets/ryvangel/icon-prive.svg"); mask-image: url("assets/ryvangel/icon-prive.svg"); }
.community-shortcut:nth-child(4) .community-shortcut-icon { -webkit-mask-image: url("assets/ryvangel/icon-rencontres.svg"); mask-image: url("assets/ryvangel/icon-rencontres.svg"); }
.community-shortcut:nth-child(5) .community-shortcut-icon { -webkit-mask-image: url("assets/ryvangel/icon-evenements.svg"); mask-image: url("assets/ryvangel/icon-evenements.svg"); }

.connection-state[data-state="online"] { color: #62e3d6; }

.space-avatar {
  border: 1px solid rgba(151, 218, 255, .18);
  color: var(--accent-ink);
  background: #82dcff;
  box-shadow: none;
}

.empty-state {
  min-height: 170px;
  padding: 112px 18px 20px;
  border: 1px solid rgba(151, 218, 255, .14);
  border-radius: 18px;
  color: var(--muted);
  background: var(--surface-3) url("assets/ryvangel/empty-conversation.webp") center 15px / 88px 88px no-repeat;
}

/* -------------------------------------------------------------------------- */
/* Navigation inférieure                                                      */
/* -------------------------------------------------------------------------- */

.tabs-wrap {
  border: 1px solid rgba(151, 218, 255, .14);
  background: rgba(3, 23, 37, .96);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
  backdrop-filter: blur(14px);
}

.tab {
  border-color: transparent;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
}

.tab[aria-selected="true"] {
  border-color: rgba(138, 218, 255, .28);
  color: var(--text);
  background: #123f60;
}

#tab-prayers .tab-icon { -webkit-mask-image: url("assets/ryvangel/icon-accueil.svg"); mask-image: url("assets/ryvangel/icon-accueil.svg"); }
#tab-lessons .tab-icon { -webkit-mask-image: url("assets/ryvangel/icon-parcours.svg"); mask-image: url("assets/ryvangel/icon-parcours.svg"); }
#tab-community .tab-icon { -webkit-mask-image: url("assets/ryvangel/icon-echanges.svg"); mask-image: url("assets/ryvangel/icon-echanges.svg"); }
#tab-profile .tab-icon { -webkit-mask-image: url("assets/ryvangel/icon-profil.svg"); mask-image: url("assets/ryvangel/icon-profil.svg"); }

/* -------------------------------------------------------------------------- */
/* Onboarding / bienvenue                                                     */
/* -------------------------------------------------------------------------- */

.welcome-dialog,
.prayer-flow-dialog,
.dialog {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg);
  box-shadow: var(--shadow);
}

.welcome-dialog::backdrop,
.dialog::backdrop {
  background: rgba(1, 10, 18, .94);
  backdrop-filter: blur(8px);
}

.welcome-dialog:has([data-welcome-step]:first-of-type:not([hidden])) {
  background-image:
    linear-gradient(90deg, rgba(3, 23, 37, .99) 0 42%, rgba(3, 23, 37, .82) 66%, rgba(3, 23, 37, .38)),
    url("assets/ryvangel/hero-lune-visage.webp");
  background-position: center, right center;
  background-repeat: no-repeat;
  background-size: cover, auto 100%;
}

.welcome-shell {
  position: relative;
  z-index: 1;
}

.welcome-shell [data-welcome-step] { max-width: 560px; }

.welcome-features div,
.tradition-choice,
.welcome-note {
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(6, 38, 65, .90);
  box-shadow: none;
}

.tradition-choice:has(input:checked) {
  border-color: var(--border-strong);
  background: #123f60;
  box-shadow: 0 0 0 1px rgba(138, 218, 255, .16);
}

/* -------------------------------------------------------------------------- */
/* Mobile                                                                      */
/* -------------------------------------------------------------------------- */

@media (max-width: 620px) {
  body { background: var(--bg); }

  .app {
    width: 100%;
    min-height: 100dvh;
    overflow: visible;
    background: var(--bg);
  }

  .app-header {
    position: static;
    min-height: 68px;
    padding: max(18px, env(safe-area-inset-top)) 18px 11px;
    border-bottom: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .content {
    min-height: calc(100dvh - 68px);
    padding: 6px 18px calc(104px + env(safe-area-inset-bottom));
  }

  .home-module-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .home-module-button { min-height: 64px; }

  .home-companion {
    padding: 15px;
    border-radius: 20px;
  }

  .home-companion-form {
    grid-template-columns: minmax(0, 1fr) 44px auto;
    gap: 6px;
  }

  .home-companion-form input {
    width: 100%;
    min-width: 0;
    padding-inline: 10px;
    font-size: 16px;
  }

  .home-companion-mic,
  .home-companion-send {
    min-height: 44px;
    max-height: 44px;
  }

  .home-companion-send {
    min-width: 68px;
    padding-inline: 10px;
  }

  .community-shortcuts { gap: 5px; margin-inline: 0; }
  .community-shortcut { min-height: 60px; font-size: 9px; }

  #chat-prayer-context {
    background-image:
      linear-gradient(90deg, #092b45 0 58%, rgba(9, 43, 69, .62)),
      url("assets/ryvangel/theme-consolation.webp");
    background-size: cover, auto 100%;
  }

  #chat-prayer-context > * { max-width: 78%; }

  .tabs-wrap {
    min-height: 68px;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 20px 20px 0 0;
  }

  .tab { min-height: 52px; }

  .welcome-dialog:has([data-welcome-step]:first-of-type:not([hidden])) {
    background-image:
      linear-gradient(180deg, rgba(3, 23, 37, .48), var(--bg) 42%),
      url("assets/ryvangel/hero-lune-visage.webp");
    background-position: center, right top;
    background-size: cover, auto 52%;
  }

  .welcome-shell [data-welcome-step] { max-width: none; }
  .welcome-features,
  .tradition-choices { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .content { padding-inline: 14px; }
  .home-module-nav { gap: 7px; }
  .home-module-button { min-height: 61px; padding-inline: 3px; font-size: 11px; }

  .home-companion {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    padding: 13px;
  }

  .home-companion-orb { width: 42px; height: 42px; }
  .home-companion-form { grid-template-columns: minmax(0, 1fr) 42px auto; gap: 5px; }
  .home-companion-mic { min-width: 42px; width: 42px; }
  .home-companion-send { min-width: 64px; padding-inline: 8px; font-size: 12px; }
  .community-shortcut { padding-inline: 2px; font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* ========================================================================== */
/* RYVANGEL — finition céleste v3, inspirée des maquettes de septembre        */
/* ========================================================================== */

:root {
  --bg: #020f1d;
  --surface: rgba(7, 35, 59, .86);
  --surface-2: rgba(8, 42, 70, .92);
  --surface-3: rgba(5, 29, 51, .9);
  --text: #fbfcff;
  --muted: #b3c5da;
  --accent: #74d9ff;
  --accent-strong: #327cff;
  --border: rgba(151, 218, 255, .24);
  --border-strong: rgba(128, 218, 255, .68);
  --shadow: 0 24px 60px rgba(0, 7, 18, .44);
}

body {
  background:
    radial-gradient(circle at 18% 12%, rgba(63, 160, 245, .16), transparent 27rem),
    radial-gradient(circle at 88% 36%, rgba(27, 105, 198, .14), transparent 34rem),
    radial-gradient(circle at 68% 90%, rgba(25, 205, 255, .06), transparent 24rem),
    #020f1d;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: .28;
  background-image:
    radial-gradient(circle, rgba(200, 237, 255, .8) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(116, 217, 255, .58) 0 1px, transparent 1.4px);
  background-position: 12px 21px, 71px 93px;
  background-size: 113px 127px, 173px 191px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 72%);
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
}

.app {
  position: relative;
  width: min(100% - 32px, 980px);
  min-height: calc(100dvh - 32px);
  margin: 16px auto;
  border: 1px solid rgba(178, 226, 255, .24);
  border-radius: 32px;
  background:
    radial-gradient(circle at 100% 0, rgba(47, 137, 227, .13), transparent 25rem),
    linear-gradient(180deg, rgba(3, 22, 39, .96), rgba(2, 17, 31, .985));
  box-shadow: 0 34px 90px rgba(0, 5, 15, .62), inset 0 1px 0 rgba(232, 249, 255, .08);
}

.app::before {
  position: absolute;
  z-index: -1;
  inset: 9% -14% auto;
  height: 46%;
  border-radius: 50%;
  pointer-events: none;
  content: "";
  background: rgba(35, 133, 235, .12);
  filter: blur(90px);
}

.app-header {
  min-height: 92px;
  padding: 24px 28px 16px;
}

.brand { gap: 14px; }
.logo {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.64), transparent 42%),
    linear-gradient(145deg, #b7eeff, #4a98ff);
  box-shadow: 0 0 24px rgba(72, 172, 255, .28), inset 0 1px 0 rgba(255,255,255,.9);
}
.app-title { font-size: 21px; letter-spacing: .045em; }
.app-subtitle { margin-top: 3px; font-size: 13px; }

.header-home,
.profile-avatar-button {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(131, 210, 255, .34);
  background-color: rgba(5, 28, 50, .82);
  box-shadow: inset 0 0 20px rgba(61, 147, 239, .09), 0 10px 26px rgba(0, 0, 0, .24);
}
.header-home {
  border-radius: 50%;
  color: transparent;
  font-size: 0;
}
.header-home::before {
  width: 23px;
  height: 23px;
  content: "";
  background: #d8edff;
  -webkit-mask: url("assets/ryvangel/icon-accueil.svg") center / contain no-repeat;
  mask: url("assets/ryvangel/icon-accueil.svg") center / contain no-repeat;
}

.content { padding: 16px 28px 124px; }
.section-title,
.directory-title { font-size: clamp(2rem, 5vw, 2.75rem); line-height: 1.04; }
.section-desc { max-width: 680px; font-size: 16px; }
.eyebrow { letter-spacing: .14em; }

.profile-entry { margin-bottom: 22px; }
.home-welcome h2 { font-size: clamp(2.45rem, 8vw, 3.55rem); letter-spacing: -.035em; }
.profile-entry .home-question { margin-top: 12px; }

.home-module-nav {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.home-module-button {
  position: relative;
  min-height: 96px;
  overflow: hidden;
  border-radius: 18px;
  font-size: 14px;
  background:
    radial-gradient(circle at 50% 5%, rgba(84, 174, 255, .17), transparent 56%),
    linear-gradient(160deg, rgba(8, 42, 72, .92), rgba(3, 24, 44, .98));
}
.home-module-button::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(120deg, transparent 25%, rgba(199, 239, 255, .09), transparent 72%);
  transform: translateX(-115%);
  transition: transform .55s ease;
}
.home-module-button:hover::after { transform: translateX(115%); }
.home-module-button > span { width: 34px; height: 34px; filter: drop-shadow(0 0 10px rgba(116, 217, 255, .42)); }

.home-companion {
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 16px;
  padding: 22px;
  border-color: rgba(131, 210, 255, .31);
  border-radius: 24px;
  background:
    radial-gradient(circle at 4% 4%, rgba(101, 191, 255, .18), transparent 15rem),
    linear-gradient(145deg, rgba(9, 47, 78, .97), rgba(3, 26, 47, .97));
  box-shadow: 0 24px 56px rgba(0, 7, 18, .34), inset 0 1px 0 rgba(235, 250, 255, .08);
}
.home-companion-orb { width: 76px; height: 76px; }
.home-companion h2 { font-size: 24px; }
.home-companion-thread { min-height: 126px; }
.home-companion-form input,
.field input,
.field textarea { min-height: 50px; border-radius: 14px; font-size: 16px; }
.home-companion-send,
.btn-primary { min-height: 48px; border: 1px solid rgba(169, 231, 255, .38); color: #fff; background: linear-gradient(180deg, #2b96ed, #1554bd); box-shadow: inset 0 1px 0 rgba(255,255,255,.32), 0 10px 24px rgba(14, 74, 174, .32); }

.card,
.daily-card,
.profile-panel-card,
.profile-stats div,
.profile-action,
.path-quiz-card,
.space-card {
  border-color: rgba(139, 210, 255, .25);
  background:
    radial-gradient(circle at 100% 0, rgba(68, 157, 250, .09), transparent 13rem),
    linear-gradient(145deg, rgba(8, 43, 72, .91), rgba(4, 27, 49, .96));
  box-shadow: 0 16px 38px rgba(0, 5, 15, .28), inset 0 1px 0 rgba(232, 249, 255, .055);
}
.card { padding: 20px; border-radius: 20px; }
.card-title { font-size: 18px; line-height: 1.22; }
.card-text { font-size: 15px; line-height: 1.55; }
#lesson-list { gap: 14px; }
#lesson-list .card .btn-row { margin-top: 18px; }
#lesson-list .card .btn { width: 100%; }

#chat-prayer-context {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-color: rgba(140, 214, 255, .5);
  border-radius: 24px;
  background-image:
    linear-gradient(90deg, rgba(6, 35, 61, .98) 0 45%, rgba(6, 35, 61, .72) 66%, rgba(4, 25, 47, .12)),
    url("assets/ryvangel/theme-consolation.webp");
  background-size: cover, auto 112%;
  box-shadow: 0 22px 54px rgba(0, 7, 18, .4), inset 0 1px 0 rgba(255,255,255,.09);
}
#chat-prayer-context .verse-text { max-width: 66%; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.8rem, 4.8vw, 2.7rem); line-height: 1.08; }
#chat-prayer-context .verse-theme { max-width: 54%; border: 0; padding: 0; background: transparent; font-size: 16px; line-height: 1.55; }

.community-shortcuts { gap: 12px; margin: 24px 0 20px; }
.community-shortcut { min-height: 104px; border-radius: 20px; font-size: 14px; }
.community-shortcut[aria-pressed="true"] { border-color: #72d7ff; background: linear-gradient(145deg, rgba(34, 118, 211, .88), rgba(9, 53, 111, .96)); box-shadow: 0 0 0 1px rgba(113, 216, 255, .2), 0 0 28px rgba(38, 131, 240, .24), inset 0 1px 0 rgba(255,255,255,.16); }
.community-layout { gap: 18px; }
.community-layout .card { padding: 24px; }
.empty-state { min-height: 260px; padding-top: 158px; background-size: 126px 126px; }

.profile-panel-card { padding: 24px; }
.profile-panel-avatar { width: 92px; height: 92px; box-shadow: 0 0 26px rgba(67, 166, 255, .22); }
.profile-panel-card h3 { font-size: 30px; }
.profile-stats div { padding: 20px 9px; }
.profile-stats strong { color: #fff; font-family: Georgia, "Times New Roman", serif; font-size: 28px; }
.profile-action { min-height: 76px; padding: 16px 18px; }
.profile-action strong { font-family: Georgia, "Times New Roman", serif; font-size: 17px; }

.tabs-wrap {
  bottom: 16px;
  width: min(calc(100% - 48px), 700px);
  padding: 8px;
  border: 1px solid rgba(137, 210, 255, .18);
  border-radius: 24px;
  background: rgba(2, 17, 31, .91);
  box-shadow: 0 20px 50px rgba(0, 4, 14, .46), inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(24px) saturate(135%);
}
.tab { min-height: 62px; border-radius: 18px; font-size: 13px; }
.tab-icon { width: 26px; height: 26px; }
.tab[aria-selected="true"] { border-color: rgba(104, 201, 255, .13); background: linear-gradient(180deg, rgba(20, 82, 145, .48), rgba(6, 42, 79, .58)); box-shadow: inset 0 1px 0 rgba(173, 230, 255, .08); }
.tab[aria-selected="true"] .tab-icon { background: #70d8ff; filter: drop-shadow(0 0 9px rgba(75, 180, 255, .46)); }

@media (min-width: 760px) {
  .app[data-screen="community"] { width: min(100% - 32px, 1180px); }
  .community-layout { grid-template-columns: .9fr 1.1fr; }
}

@media (max-width: 620px) {
  body { background: #020f1d; }
  body::before { opacity: .18; }
  .app { width: 100%; min-height: 100dvh; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  .app-header { min-height: 74px; padding: max(18px, env(safe-area-inset-top)) 18px 10px; }
  .logo { width: 44px; height: 44px; font-size: 24px; }
  .app-title { font-size: 18px; }
  .app-subtitle { max-width: 230px; font-size: 11px; }
  .profile-avatar-button,
  .header-home { width: 44px; height: 44px; }
  .content { padding: 10px 18px calc(104px + env(safe-area-inset-bottom)); }
  .section-title { font-size: 2rem; }
  .home-welcome h2 { font-size: clamp(2.2rem, 10vw, 3rem); }
  .home-module-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .home-module-button { min-height: 86px; padding: 10px 3px; font-size: 12px; }
  .home-module-button > span { width: 31px; height: 31px; }
  .home-companion { grid-template-columns: 62px minmax(0, 1fr); padding: 17px; }
  .home-companion-orb { width: 62px; height: 62px; }
  .home-companion h2 { font-size: 21px; }
  .home-companion-form { grid-template-columns: minmax(0, 1fr) 44px; }
  .home-companion-send,
  .home-companion-cancel { grid-column: 1 / -1; width: 100%; }
  .community-shortcuts { gap: 6px; margin-block: 18px; }
  .community-shortcut { min-height: 78px; padding-inline: 3px; border-radius: 16px; font-size: 11px; }
  #chat-prayer-context { min-height: 218px; background-size: cover, auto 100%; }
  #chat-prayer-context .verse-text { max-width: 72%; font-size: 1.9rem; }
  #chat-prayer-context .verse-theme { max-width: 70%; font-size: 14px; }
  .profile-panel-avatar { width: 82px; height: 82px; }
  .profile-panel-card h3 { font-size: 26px; }
  .tabs-wrap { bottom: 0; width: 100%; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 22px 22px 0 0; }
  .tab { min-height: 58px; font-size: 11px; }
}

@media (max-width: 390px) {
  .content { padding-inline: 14px; }
  .home-module-nav { gap: 6px; }
  .home-module-button { min-height: 78px; font-size: 11px; }
  .home-module-button > span { width: 28px; height: 28px; }
  .home-companion { grid-template-columns: 54px minmax(0, 1fr); padding: 14px; }
  .home-companion-orb { width: 54px; height: 54px; }
  .community-shortcut { min-height: 72px; font-size: 9px; }
}

/* Création d’avatar : activité visible sans figer l’application. */
.avatar-progress {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
  padding: 15px 17px;
  overflow: hidden;
  border: 1px solid rgba(116, 217, 255, .46);
  border-radius: 18px;
  color: var(--text);
  background:
    radial-gradient(circle at 13% 50%, rgba(87, 187, 255, .25), transparent 9rem),
    linear-gradient(145deg, rgba(10, 57, 94, .98), rgba(4, 31, 58, .98));
  box-shadow: 0 0 28px rgba(36, 142, 240, .18), inset 0 1px 0 rgba(255,255,255,.09);
}
.avatar-progress[hidden] { display: none; }
.avatar-progress::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(110deg, transparent 18%, rgba(187, 237, 255, .13), transparent 56%);
  animation: avatar-shimmer 1.7s ease-in-out infinite;
}
.avatar-progress-star {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(166, 228, 255, .5);
  border-radius: 50%;
  color: #dff8ff;
  background: radial-gradient(circle, #4ca8ff, #143e87 62%, #071e45);
  box-shadow: 0 0 18px rgba(97, 201, 255, .62), inset 0 0 12px rgba(232, 250, 255, .24);
  font-size: 27px;
  animation: avatar-star-pulse 1.15s ease-in-out infinite;
}
.avatar-progress strong,
.avatar-progress small { display: block; }
.avatar-progress strong { font-family: Georgia, "Times New Roman", serif; font-size: 18px; }
.avatar-progress small { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.free-prayer-dialog.is-creating-avatar #free-prayer-close { cursor: pointer; }

@keyframes avatar-star-pulse {
  0%, 100% { filter: brightness(.9); transform: scale(.88) rotate(0deg); }
  50% { filter: brightness(1.3); transform: scale(1.08) rotate(18deg); }
}
@keyframes avatar-shimmer {
  from { transform: translateX(-110%); }
  to { transform: translateX(145%); }
}

@media (max-width: 390px) {
  .avatar-progress { grid-template-columns: 46px minmax(0, 1fr); padding: 13px; }
  .avatar-progress-star { width: 46px; height: 46px; font-size: 23px; }
  .avatar-progress strong { font-size: 16px; }
}
