:root {
  --bg: #071426;
  --gold: #d5b779;
  --text: #f3e9d5;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  color: var(--text);
  font-family: Arial, sans-serif;
  text-align: center;
  line-height: 1.6;
}
.decoration {
  position: absolute;
  inset: 12px 0 auto;
  pointer-events: none;
  opacity: .28;
  overflow: hidden;
}
.main-svg {
  display: block;
  width: min(96vw, 850px);
  height: auto;
  margin: auto;
}
#app {
  position: relative;
  width: min(100%, 580px);
  min-height: 85vh;
  margin: auto;
  padding: 56px 24px 32px;
}
header { margin-bottom: 36px; }
h1 {
  font-family: 'Colonna MT', Georgia, serif;
  font-size: clamp(2.8rem, 12vw, 4.5rem);
  color: var(--gold);
  letter-spacing: .12em;
  line-height: 1.15;
  margin: 0;
}
h2, h3 { color: var(--gold); line-height: 1.35; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
.slogan { color: var(--gold); }
section { margin: 24px 0; }
.actions, form { display: grid; gap: 16px; }
.actions { margin: 24px 0; }
button, input, textarea, select { font: inherit; }
button {
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border: 2px solid var(--gold);
  border-radius: 28px;
  background: var(--gold);
  color: var(--bg);
  font-weight: 700;
  cursor: pointer;
}
button.secondary { background: var(--bg); color: var(--gold); }
button:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 3px solid white; outline-offset: 4px; }
label { display: block; text-align: left; }
input:not([type=checkbox]), textarea, select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
}
textarea { resize: vertical; overflow-wrap: anywhere; font-family: monospace; }
.check { display: flex; align-items: flex-start; gap: 12px; }
.check input { flex: none; width: 22px; height: 22px; }
.helper { font-size: .9rem; }
.card {
  padding: 20px;
  border: 1px solid var(--gold);
  border-radius: 18px;
  background: var(--bg);
}
.counters { display: grid; gap: 12px; margin: 28px 0; }
.counters div { display: flex; justify-content: space-between; gap: 16px; }
dt { text-align: left; }
dd { margin: 0; font-weight: bold; color: var(--gold); }
.balance { font-size: 1.15rem; }
#personal-qr { margin: 24px auto; width: fit-content; max-width: 100%; }
#personal-qr canvas, #personal-qr img {
  display: block;
  max-width: 100%;
  height: auto;
}
a { color: var(--gold); overflow-wrap: anywhere; }
#app-status { min-height: 1.6em; overflow-wrap: anywhere; }
footer { position: relative; padding: 24px 16px 40px; color: var(--gold); font-size: .85rem; }
@media (max-width: 380px) {
  #app { padding: 40px 16px 24px; }
  .card { padding: 16px; }
}

/* M3RCI : textes longs sur mobile */
#support-status,
#support-requests,
#scan-context,
#venue-details,
#sharing-status,
.card {
  overflow-wrap: anywhere;
}

.actions, form, .card,
button, .counters div {
  min-width: 0;
}

button {
  overflow-wrap: anywhere;
}

/* M3RCI : récupération code + grille */
#restore-modern, #restore-legacy {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.recovery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(100%, 220px);
  margin: 20px auto;
}
.recovery-grid button, .recovery-grid span {
  display: grid;
  place-items: center;
  min-height: 56px;
  padding: 6px;
  border: 1px solid var(--gold);
  border-radius: 10px;
  background: var(--bg);
  color: var(--gold);
}
.recovery-grid button[aria-pressed="true"],
.recovery-grid span.selected {
  background: var(--gold);
  color: var(--bg);
}
.recovery-grid button[aria-pressed="true"]:disabled { opacity: 1; }
.recovery-code-display {
  font-family: monospace;
  font-size: 1.3rem;
  color: var(--gold);
  overflow-wrap: anywhere;
}
#recovery-panel p, #restore-progress { overflow-wrap: anywhere; }


/* M3RCI : symbole vectoriel du bouton de gratitude */
#send-thanks.thanks-logo-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(100%, 340px);
  margin: 20px auto 32px;
  padding: 12px;
  border: 2px solid transparent;
  border-radius: 24px;
  background: transparent;
  color: var(--gold);
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

#send-thanks .thanks-emblem {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  transition: transform 160ms ease;
}

#thanks-label {
  display: block;
  margin-top: 10px;
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

#send-thanks:not(:disabled):active .thanks-emblem {
  transform: scale(.97);
}

#send-thanks:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 4px;
}

#send-thanks:disabled {
  opacity: .65;
}

@media (hover: hover) {
  #send-thanks:not(:disabled):hover {
    background: rgba(213, 183, 121, .045);
  }
}

@media (prefers-reduced-motion: reduce) {
  #send-thanks .thanks-emblem {
    transition: none;
  }
}

/* Le symbole devient le point central, sans décor superposé. */
.decoration {
  display: none;
}


/* M3RCI : écran gratitude épuré */
#app[data-screen="scan-panel"] {
  padding-top: 30px;
}

#app[data-screen="scan-panel"] > header {
  margin-bottom: 24px;
}

#app[data-screen="scan-panel"] > header h1 {
  font-family: Arial, sans-serif;
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: .18em;
}

#app[data-screen="scan-panel"] .slogan {
  display: none;
}

/* Le titre reste accessible aux lecteurs d'écran.
   Le focus clavier des boutons conserve son contour visible. */
#app[data-screen="scan-panel"] #scan-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

#app[data-screen="scan-panel"] #scan-title:focus {
  outline: none;
}

#app[data-screen="scan-panel"] #app-status {
  min-height: 3.2em;
  max-width: 30ch;
  margin: 0 auto 12px;
}

#app[data-screen="scan-panel"] #scan-panel {
  margin-top: 12px;
}

#app[data-screen="scan-panel"] #scan-context {
  margin: 8px auto 16px;
  max-width: 32ch;
}

#app[data-screen="scan-panel"] #send-thanks {
  margin-top: 8px;
  margin-bottom: 28px;
}

/* Un merci confirmé reste lumineux, mais le bouton reste désactivé. */
#send-thanks.thanks-logo-button.thanks-sent:disabled {
  opacity: 1;
  cursor: default;
}

#send-thanks.thanks-sent #thanks-label {
  color: var(--text);
}

#app[data-screen="scan-panel"] #scan-home {
  max-width: 300px;
  margin: 0 auto;
}


/* M3RCI : espace personnel épuré */
#app[data-screen="account-panel"] {
  width: min(100%, 620px);
  padding-top: 30px;
}

#app[data-screen="account-panel"] > header {
  margin-bottom: 20px;
}

#app[data-screen="account-panel"] > header h1 {
  font-family: Arial, sans-serif;
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: .18em;
}

#app[data-screen="account-panel"] .slogan {
  display: none;
}

#account-title {
  font-size: 1.55rem;
  margin-bottom: 4px;
}

#account-title:focus {
  outline: none;
}

.account-intro {
  margin-top: 0;
  color: var(--text);
}

#personal-qr {
  margin: 22px auto 16px;
  padding: 14px;
  border: 1px solid var(--gold);
  border-radius: 18px;
  background: #fffdf6;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
}

#personal-qr canvas,
#personal-qr img {
  width: min(58vw, 220px);
  max-width: 220px;
  background: #fffdf6;
}

#personal-link {
  display: inline-block;
  margin: 0 auto 26px;
  font-size: .9rem;
}

#account-panel .counters {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 22px 0;
}

#account-panel .counters div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  padding: 10px 6px;
  border: 1px solid rgba(213, 183, 121, .7);
  border-radius: 16px;
}

#account-panel .counters dt {
  min-height: 2.8em;
  font-size: .78rem;
  line-height: 1.35;
  text-align: center;
}

#account-panel .counters dd {
  margin-top: 6px;
  font-size: 1.25rem;
}

#account-panel .balance {
  margin: 18px 0 26px;
  padding: 14px;
  border-top: 1px solid rgba(213, 183, 121, .45);
  border-bottom: 1px solid rgba(213, 183, 121, .45);
}

.space-details {
  margin: 14px 0;
  border: 1px solid var(--gold);
  border-radius: 18px;
  background: var(--bg);
  overflow: hidden;
  text-align: left;
}

.space-details summary {
  position: relative;
  min-height: 52px;
  padding: 13px 48px 13px 18px;
  color: var(--gold);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.space-details summary::-webkit-details-marker {
  display: none;
}

.space-details summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  translate: 0 -50%;
  font-size: 1.4rem;
  font-weight: 400;
}

.space-details[open] > summary::after {
  content: "−";
}

.space-details summary:focus-visible {
  outline: 3px solid white;
  outline-offset: -5px;
  border-radius: 16px;
}

.space-details-content {
  padding: 4px 18px 20px;
  text-align: center;
}

.space-details-content .card {
  margin-left: 0;
  margin-right: 0;
}

#account-panel > #logout {
  max-width: 300px;
  margin: 28px auto 0;
}

@media (max-width: 350px) {
  #account-panel .counters {
    gap: 6px;
  }

  #account-panel .counters div {
    padding: 8px 4px;
  }

  #account-panel .counters dt {
    font-size: .72rem;
  }
}


/* M3RCI : accueil et sauvegarde harmonises */
#app[data-screen="home-panel"],
#app[data-screen="restore-panel"],
#app[data-screen="recovery-panel"] {
  padding-top: 30px;
}

#app[data-screen="home-panel"] > header,
#app[data-screen="restore-panel"] > header,
#app[data-screen="recovery-panel"] > header {
  margin-bottom: 24px;
}

#app[data-screen="home-panel"] > header h1,
#app[data-screen="restore-panel"] > header h1,
#app[data-screen="recovery-panel"] > header h1 {
  font-family: Arial, sans-serif;
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: .18em;
}

#app[data-screen="home-panel"] .slogan,
#app[data-screen="restore-panel"] .slogan,
#app[data-screen="recovery-panel"] .slogan {
  display: none;
}

#home-panel,
#restore-panel,
#recovery-panel {
  width: 100%;
  max-width: 400px;
  margin: 28px auto;
}

#home-panel {
  padding-top: 32px;
}

#home-panel h2,
#restore-title,
#recovery-title {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

#home-panel > p {
  max-width: 29ch;
  margin: 0 auto;
}

#home-panel .actions {
  max-width: 320px;
  margin: 36px auto;
  gap: 18px;
}

#restore-form {
  gap: 18px;
}

#restore-modern,
#restore-legacy {
  gap: 12px;
}

#restore-panel label,
#recovery-panel label {
  line-height: 1.5;
}

#restore-panel .helper,
#recovery-panel .helper {
  line-height: 1.6;
  margin: 8px 0 16px;
}

#restore-code,
#restore-sequence {
  font-family: monospace;
  letter-spacing: .06em;
}

#restore-sequence {
  text-align: center;
}

#restore-panel .recovery-grid,
#recovery-panel .recovery-grid {
  width: min(100%, 230px);
  gap: 12px;
  margin: 20px auto;
}

#restore-panel .recovery-grid button,
#recovery-panel .recovery-grid span {
  min-height: 64px;
  border-radius: 14px;
  font-size: 1.1rem;
  font-weight: 700;
}

#restore-progress {
  min-height: 3em;
  margin: 0;
  font-size: .95rem;
}

#restore-clear {
  width: auto;
  min-width: 0;
  justify-self: center;
  padding: 10px 20px;
  font-size: .9rem;
}

#recovery-code-display {
  padding: 18px 14px;
  margin: 24px 0;
  border: 1px solid var(--gold);
  border-radius: 16px;
  font-size: 1.15rem;
  line-height: 1.8;
  background: rgba(213, 183, 121, .04);
  overflow-wrap: anywhere;
}

#recovery-pattern-description {
  font-size: .95rem;
  line-height: 1.6;
}

#recovery-secret {
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.6;
}

#recovery-panel .check {
  padding: 16px;
  border: 1px solid rgba(213, 183, 121, .65);
  border-radius: 14px;
}

#restore-panel .actions,
#recovery-panel .actions {
  gap: 18px;
}

@media (max-width: 350px) {
  #home-panel {
    padding-top: 16px;
  }

  #home-panel h2,
  #restore-title,
  #recovery-title {
    font-size: 1.3rem;
  }

  #recovery-code-display {
    padding: 16px 10px;
    font-size: 1.05rem;
  }
}


/* M3RCI : récupération compacte et cases stables */
#restore-panel,
#recovery-panel {
  margin-top: 18px;
}

#restore-form {
  gap: 12px;
}

#restore-modern,
#restore-legacy {
  gap: 8px;
}

#restore-modern > p {
  margin: 6px 0;
}

#restore-panel .helper,
#recovery-panel .helper {
  margin: 6px 0 12px;
}

#restore-panel .recovery-grid,
#recovery-panel .recovery-grid {
  gap: 8px;
  margin: 12px auto;
}

#restore-panel .recovery-grid button,
#recovery-panel .recovery-grid > span {
  min-height: 64px;
  align-content: center;
  gap: 2px;
}

.recovery-grid .recovery-step {
  display: block;
  font-family: Arial, sans-serif;
  font-size: .7rem;
  line-height: 1.3;
  font-weight: 400;
}

#restore-progress {
  min-height: 1.6em;
  font-size: .9rem;
}

#recovery-code-display {
  margin: 16px 0;
  padding: 12px;
}

#recovery-pattern-description {
  margin: 12px 0;
}

#restore-panel .actions,
#recovery-panel .actions {
  margin: 16px 0;
  gap: 12px;
}

.recovery-alternative {
  margin: 8px 0;
  text-align: left;
  border-top: 1px solid rgba(213, 183, 121, .45);
  border-bottom: 1px solid rgba(213, 183, 121, .45);
}

.recovery-alternative summary {
  padding: 12px 0;
  color: var(--gold);
  cursor: pointer;
  font-size: .9rem;
  line-height: 1.5;
}

.recovery-alternative-content {
  display: grid;
  gap: 10px;
  padding: 8px 0 12px;
}


/* M3RCI : présentation du partage finalisée */
#sharing-refresh,
#sharing-close,
#support-refresh {
  display: block;
  margin: 12px 0;
}

#sharing-status {
  margin: 18px 0;
  line-height: 1.6;
}

#venue-panel .venue-support-details {
  margin-top: 24px;
  border-top: 1px solid rgba(213, 183, 121, .5);
  text-align: left;
}

#venue-panel .venue-support-details > summary {
  padding-left: 0;
  padding-right: 32px;
  font-size: 1rem;
}

#venue-panel .venue-support-details > summary::after {
  right: 4px;
}

#venue-panel .venue-support-details:not([open]) > summary::after {
  content: "+";
}

#venue-panel .venue-support-details[open] > summary::after {
  content: "−";
}

.venue-support-content {
  padding: 0 0 8px;
  text-align: center;
}

#support-requests .card {
  padding: 16px 12px;
  margin-top: 16px;
}

#support-requests .card > p {
  margin: 12px 0;
}

#circulation-description {
  line-height: 1.6;
}


/* M3RCI : splash logo valide */
#splash-v2 {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--gold);
  overflow: hidden;
  animation: m3rci-logo-splash 1.4s linear forwards;
}
#splash-v2 > svg {
  display: block;
  width: min(76vw, 340px, 76vh);
  height: auto;
  margin: 0;
  pointer-events: none;
}
@keyframes m3rci-logo-splash {
  0%, 80% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  #splash-v2 { display: none; animation: none; }
}


/* M3RCI : accueil logo et cadre deco */
#app > header .brand-logo {
  margin: 0;
  line-height: 1;
  color: var(--gold);
}
#app > header .brand-logo svg {
  display: block;
  width: min(42vw, 156px);
  height: auto;
  margin: 0 auto;
}
#app[data-screen="home-panel"] > header {
  margin-bottom: 22px;
}
#home-panel {
  padding-top: 0;
  margin-top: 20px;
}
#home-panel > h2 {
  position: relative;
  padding: 22px 18px;
  margin: 0 0 24px;
  border: 1px solid var(--gold);
  font-size: clamp(1.25rem, 5vw, 1.5rem);
  line-height: 1.4;
}
#home-panel > h2::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(213, 183, 121, .5);
  pointer-events: none;
}
#home-panel > h2::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  left: calc(50% - 5px);
  top: -6px;
  border: 1px solid var(--gold);
  background: var(--bg);
  transform: rotate(45deg);
  pointer-events: none;
}
#home-panel > h2:focus {
  outline: none;
}
#home-panel > p {
  max-width: 30ch;
  margin: 0 auto;
  line-height: 1.6;
}
#home-panel .actions {
  margin: 28px auto;
}


/* M3RCI : proportions accueil */
#app[data-screen="home-panel"] > header .brand-logo svg {
  width: min(52vw, 196px);
}
#app[data-screen="home-panel"] > header {
  margin-bottom: 16px;
}
#home-panel > h2 {
  width: 94%;
  margin: 0 auto 20px;
  padding: 14px 12px;
  font-size: clamp(1.05rem, 4.2vw, 1.2rem);
  font-weight: 600;
  line-height: 1.4;
}
#home-panel > p {
  max-width: 29ch;
  font-size: .95rem;
  line-height: 1.55;
}
#home-panel .actions {
  margin-top: 24px;
}


/* M3RCI : sauvegarde harmonisee */
#app[data-screen="recovery-panel"] > header {
  margin-bottom: 18px;
}

#app[data-screen="recovery-panel"] > header .brand-logo svg {
  width: min(38vw, 140px);
}

#recovery-panel {
  margin: 18px auto 24px;
}

#recovery-panel > #recovery-title {
  position: relative;
  width: 94%;
  margin: 0 auto 20px;
  padding: 14px 12px;
  border: 1px solid var(--gold);
  font-size: clamp(1.05rem, 4.2vw, 1.2rem);
  font-weight: 600;
  line-height: 1.4;
}

#recovery-title::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(213, 183, 121, .5);
  pointer-events: none;
}

#recovery-title::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  left: calc(50% - 5px);
  top: -6px;
  border: 1px solid var(--gold);
  background: var(--bg);
  transform: rotate(45deg);
  pointer-events: none;
}

#recovery-panel .recovery-intro {
  max-width: 30ch;
  margin: 0 auto 18px;
  font-size: .95rem;
  line-height: 1.55;
}

#recovery-panel .helper {
  font-size: .85rem;
  line-height: 1.5;
  margin: 10px 0 14px;
}

#recovery-panel label[for="recovery-secret"] {
  font-size: .9rem;
  margin-top: 16px;
}

#recovery-panel #recovery-secret {
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.45;
  padding: 12px;
}

#recovery-panel .actions {
  margin: 16px 0;
  gap: 12px;
}

#recovery-panel .check {
  padding: 12px;
  font-size: .9rem;
  line-height: 1.5;
}


/* M3RCI : espace personnel bleu et or */
#app[data-screen="account-panel"] > header {
  margin-bottom: 16px;
}

#app[data-screen="account-panel"] > header .brand-logo svg {
  width: min(32vw, 120px);
}

#account-panel {
  margin-top: 16px;
}

#account-panel > #account-title {
  position: relative;
  width: 94%;
  margin: 0 auto 16px;
  padding: 14px 12px;
  border: 1px solid var(--gold);
  font-size: clamp(1.05rem, 4.2vw, 1.2rem);
  font-weight: 600;
  line-height: 1.4;
}

#account-title::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(213, 183, 121, .5);
  pointer-events: none;
}

#account-title::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  left: calc(50% - 5px);
  top: -6px;
  border: 1px solid var(--gold);
  background: var(--bg);
  transform: rotate(45deg);
  pointer-events: none;
}

#account-panel .account-intro {
  margin: 0 auto 16px;
  font-size: .95rem;
  line-height: 1.5;
}

#account-panel #personal-qr {
  margin: 18px auto 12px;
  padding: 28px;
  border: 1px solid var(--gold);
  border-radius: 16px;
  background: var(--gold);
  box-shadow: none;
}

#account-panel #personal-qr canvas,
#account-panel #personal-qr img {
  width: min(56vw, 220px);
  max-width: 100%;
  height: auto;
  background: var(--gold);
}

#account-panel #personal-link {
  margin: 0 auto 16px;
  font-size: .9rem;
}

#account-panel .counters {
  gap: 8px;
  margin: 16px 0;
}

#account-panel .counters div {
  min-height: 72px;
  padding: 10px 4px;
  border-radius: 12px;
}

#account-panel .counters dt {
  min-height: 2.7em;
  font-size: .72rem;
  line-height: 1.35;
}

#account-panel .counters dd {
  margin-top: 4px;
  font-size: 1.15rem;
}

#account-panel .balance {
  margin: 16px 0 18px;
  padding: 12px 4px;
  font-size: 1rem;
}

#account-panel > .space-details {
  margin: 12px 0;
  border-radius: 14px;
}

#account-panel > .space-details > summary {
  font-size: .95rem;
}

#account-panel > #logout {
  display: block;
  width: auto;
  max-width: 100%;
  min-height: 44px;
  margin: 22px auto 0;
  padding: 8px 20px;
  border-width: 1px;
  font-size: .85rem;
  font-weight: 400;
}


/* M3RCI : un seul logo sur le merci */
#app[data-screen="scan-panel"] > header {
  display: none;
}

#app[data-screen="scan-panel"] {
  padding-top: 28px;
}

#app[data-screen="scan-panel"] #app-status {
  margin-top: 0;
}

#app[data-screen="scan-panel"] #send-thanks {
  width: min(86vw, 360px);
  margin-top: 18px;
}


/* M3RCI : Mon lieu allégé */
#venue-panel > .space-details-content {
  padding: 0 16px 16px;
  text-align: left;
  font-size: .95rem;
  line-height: 1.5;
}

#venue-panel #venue-details {
  margin: 8px 0 4px;
  font-weight: 600;
}

#venue-panel #venue-membership {
  margin: 0 0 18px;
  font-size: .85rem;
}

#venue-panel #sharing-form {
  gap: 8px;
  margin: 12px 0;
}

#venue-panel #sharing-form label {
  font-size: .85rem;
}

#venue-panel label[for="sharing-destination"] {
  margin-top: 8px;
}

#venue-panel select {
  min-height: 46px;
  padding: 10px 12px;
  font-size: 16px;
  border-radius: 10px;
}

#venue-panel #sharing-open {
  margin-top: 8px;
  min-height: 48px;
  padding: 10px 14px;
  font-size: .95rem;
}

#venue-panel #sharing-status {
  margin: 14px 0 8px;
  font-size: .9rem;
  line-height: 1.6;
  white-space: pre-line;
}

#venue-panel #sharing-refresh,
#venue-panel #support-refresh {
  display: block;
  width: auto;
  max-width: 100%;
  min-height: 44px;
  margin: 4px 0 10px;
  padding: 8px 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--gold);
  font-size: .85rem;
  font-weight: 400;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#venue-panel #sharing-close {
  width: auto;
  max-width: 100%;
  min-height: 44px;
  margin: 6px 0 12px;
  padding: 8px 16px;
  border-width: 1px;
  font-size: .85rem;
  font-weight: 400;
}

#venue-panel .venue-support-details {
  margin-top: 16px;
}

#venue-panel .venue-support-details > summary {
  min-height: 48px;
  padding-top: 12px;
  padding-bottom: 12px;
  font-size: .9rem;
}

#venue-panel .venue-support-content {
  padding-bottom: 0;
  text-align: left;
}

#venue-panel .venue-support-content > .helper {
  margin: 4px 0 8px;
  font-size: .85rem;
  line-height: 1.5;
}

#venue-panel #support-requests .card {
  padding: 14px 12px;
  margin-top: 12px;
  border-color: rgba(213, 183, 121, .55);
  border-radius: 12px;
}

#venue-panel #support-requests .card > p {
  margin: 0 0 10px;
  font-size: .85rem;
  line-height: 1.5;
}

#venue-panel #support-requests .support-reference {
  white-space: pre-line;
  overflow-wrap: anywhere;
  color: var(--gold);
  font-size: .8rem;
  user-select: text;
}

#venue-panel #support-requests .support-date {
  font-size: .8rem;
}

#venue-panel #support-requests button {
  min-height: 48px;
  padding: 10px 12px;
  margin-top: 4px;
  font-size: .9rem;
}

#venue-panel #support-requests > p {
  margin: 8px 0;
  font-size: .9rem;
}

/* Préserver la visibilité pilotée par l’application. */
#venue-panel [hidden] {
  display: none !important;
}


/* M3RCI : manifeste et cadre Art déco */
#about-open {
  display: block;
  width: auto;
  min-height: 44px;
  margin: 6px auto 0;
  padding: 8px 16px;
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: .85rem;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 4px;
}

html.m3rci-about-open,
html.m3rci-about-open body {
  overflow: hidden;
}

#about-dialog {
  width: min(680px, calc(100% - 16px));
  max-width: none;
  max-height: 92vh;
  max-height: 92dvh;
  margin: auto;
  padding: 0 12px 20px;
  border: 0;
  background: var(--bg);
  color: var(--text);
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: center;
}

#about-dialog::backdrop {
  background: rgba(7, 20, 38, .85);
}

#about-dialog .about-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  margin: 0;
  padding: 4px 0;
  background: var(--bg);
}

#about-dialog .about-close {
  width: auto;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--gold);
  font-size: .9rem;
  font-weight: 400;
}

#about-dialog .about-frame {
  position: relative;
  isolation: isolate;
  margin: 16px 0 24px;
  padding: 38px clamp(22px, 5vw, 48px) 42px;
  border: 1px solid var(--gold);
}

#about-dialog .about-frame::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(213, 183, 121, .55);
  pointer-events: none;
  z-index: -1;
}

#about-dialog .about-corner {
  position: absolute;
  width: 46px;
  height: 46px;
  color: var(--gold);
  background: var(--bg);
  pointer-events: none;
}
#about-dialog .about-tl { top: -1px; left: -1px; }
#about-dialog .about-tr {
  top: -1px; right: -1px; transform: rotate(90deg);
}
#about-dialog .about-br {
  bottom: -1px; right: -1px; transform: rotate(180deg);
}
#about-dialog .about-bl {
  bottom: -1px; left: -1px; transform: rotate(270deg);
}

#about-dialog .about-diamond {
  position: absolute;
  left: 50%;
  width: 15px;
  height: 15px;
  border: 1px solid var(--gold);
  background: var(--bg);
  transform: translateX(-50%) rotate(45deg);
  pointer-events: none;
}
#about-dialog .about-top { top: -8px; }
#about-dialog .about-bottom { bottom: -8px; }

#about-dialog .about-logo {
  color: var(--gold);
  margin: 0 auto 24px;
  width: min(40vw, 148px);
}
#about-dialog .about-logo svg {
  display: block;
  width: 100%;
  height: auto;
}

#about-dialog #about-title {
  margin: 0 0 32px;
  font-size: clamp(1.4rem, 5.5vw, 1.9rem);
  line-height: 1.4;
  font-weight: 500;
  color: var(--gold);
}
#about-dialog #about-title:focus { outline: none; }

#about-dialog .about-text {
  max-width: 44ch;
  margin: auto;
  font-size: 1rem;
  line-height: 1.8;
  overflow-wrap: break-word;
}
#about-dialog .about-text p { margin: 0 0 24px; }
#about-dialog .about-emphasis { color: var(--gold); }
#about-dialog .about-text .about-ending {
  margin: 32px 0 0;
  color: var(--gold);
  font-size: 1.15rem;
}

#about-dialog .about-return {
  display: block;
  margin: 0;
}
#about-dialog .about-return button {
  width: auto;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 22px;
  border-width: 1px;
  font-size: .9rem;
  font-weight: 400;
}

/* M3RCI : signature du manifeste */
#about-dialog .about-signature-name {
  display: block;
  margin-bottom: 10px;
  color: var(--gold);
  font-size: .85rem;
  font-weight: 400;
  letter-spacing: .12em;
  line-height: 1.6;
}

/* M3RCI : activation du lieu par code et grille */
#activation-panel .space-details-content {
  padding: 0 16px 16px;
}
#activation-panel .helper {
  font-size: .85rem;
  line-height: 1.5;
}
#activation-panel form { gap: 12px; }
#activation-panel .recovery-grid {
  margin: 0 auto;
  gap: 8px;
  width: min(100%, 230px);
}
#activation-panel .recovery-grid button { min-height: 60px; }
#activation-code {
  font-size: 16px;
  font-family: monospace;
}
#activation-progress, #activation-status {
  overflow-wrap: anywhere;
  font-size: .9rem;
  margin: 8px 0;
}
#activation-clear {
  width: auto;
  justify-self: center;
  min-height: 44px;
  padding: 8px 16px;
  font-size: .85rem;
  border-width: 1px;
}


/* M3RCI : lecture privée des numéros */
#numbering-list {
  text-align: left;
  padding-left: 1.3rem;
  margin: 1rem 0;
}
#numbering-list:empty {
  display: none;
}
#numbering-list li {
  margin: .4rem 0;
  overflow-wrap: anywhere;
}
#numbering-status {
  overflow-wrap: anywhere;
}


/* Registre public M3RCI */
html.m3rci-register-open { overflow: hidden; }
#public-register-dialog {
  box-sizing: border-box;
  width: calc(100% - 24px);
  max-width: 680px;
  max-height: 90vh;
  max-height: 90dvh;
  padding: 0;
  overflow: auto;
  color: #f3e9d5;
  background: #071426;
  border: 1px solid #d5b779;
  border-radius: 20px;
}
#public-register-dialog::backdrop { background: rgba(7, 20, 38, .8); }
#public-register-dialog .public-register-content {
  padding: clamp(16px, 4vw, 32px);
  text-align: left;
  overflow-wrap: anywhere;
}
#public-register-dialog h2,
#public-register-dialog h3,
#public-register-dialog h4 { color: #d5b779; }
#public-register-dialog section { margin: 1.8rem 0; }
#public-register-dialog button,
#public-register-dialog input {
  box-sizing: border-box;
  max-width: 100%;
  width: 100%;
}
#public-register-dialog button {
  white-space: normal;
  min-height: 44px;
}
#public-register-dialog input { margin: .5rem 0 1rem; }
#public-register-dialog .public-register-totals { margin: 1rem 0; }
#public-register-dialog .public-register-totals > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .4rem 1rem;
  padding: .65rem 0;
  border-bottom: 1px solid rgba(213, 183, 121, .3);
}
#public-register-dialog dd { margin: 0; font-weight: bold; }
#public-register-events { padding-left: 1.5rem; }
#public-register-events li { margin: .8rem 0; }
#public-register-events:empty { display: none; }
#public-register-dialog [hidden] { display: none !important; }


/* M3RCI : eclat discret du merci */
/* Le filtre éclaire les traits du SVG sans déplacer la mise en page. */
#send-thanks.thanks-welcome-glow .thanks-emblem {
  animation: m3rci-thanks-welcome 1200ms ease-in-out 1;
}
#send-thanks.thanks-confirmed-glow .thanks-emblem {
  animation: m3rci-thanks-confirmed 900ms ease-out 1;
}

@keyframes m3rci-thanks-welcome {
  0%, 100% {
    filter: brightness(1) drop-shadow(0 0 0 rgba(213, 183, 121,0));
  }
  45% {
    filter: brightness(1.22) drop-shadow(0 0 5px rgba(213, 183, 121,.25));
  }
}

@keyframes m3rci-thanks-confirmed {
  0%, 100% {
    filter: brightness(1) drop-shadow(0 0 0 rgba(213, 183, 121,0));
  }
  35% {
    filter: brightness(1.3) drop-shadow(0 0 7px rgba(213, 183, 121,.32));
  }
}

/* En mode mouvement réduit, le logo reste entièrement statique. */
@media (prefers-reduced-motion: reduce) {
  #send-thanks.thanks-logo-button .thanks-emblem {
    animation: none !important;
    transition: none !important;
    filter: none !important;
    transform: none !important;
  }
}

/* Social Club : le halo reste à l’extérieur des cases du QR. */
#account-panel #personal-qr.club-is-open {
  box-shadow: 0 0 0 3px rgba(213,183,121,.5),
              0 0 28px 8px rgba(213,183,121,.32);
}
#club-open-status {
  text-align: center;
  color: var(--gold);
  margin: 8px 0 16px;
}
.moment-entry {
  padding: 16px 0;
  border-bottom: 1px solid rgba(213,183,121,.3);
  overflow-wrap: anywhere;
}
.moment-entry h3 { margin: 0 0 8px; }
#moment-title, #moment-place { width: 100%; box-sizing: border-box; }
#moments-panel [hidden], #club-open-status[hidden] { display: none !important; }

/* Indicateurs propres aux volets du bilan. */
.moment-entry details:not([open]) > summary::after {
  content: "+";
}
.moment-entry details[open] > summary::after {
  content: "−";
}
