:root {
  color-scheme: dark;
  --background: #09090b;
  --foreground: #fafafa;
  --card: #09090b;
  --card-foreground: #fafafa;
  --secondary: #18181b;
  --muted: #18181b;
  --muted-foreground: #a1a1aa;
  --border: #27272a;
  --input: #27272a;
  --primary: #fafafa;
  --primary-foreground: #18181b;
  --accent: #27272a;
  --radius: .75rem;
  --shadow: 0 1px 3px rgba(0,0,0,.32), 0 1px 2px rgba(0,0,0,.24);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--background); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--background); color: var(--foreground); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, a { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; fill: currentColor; }
[hidden] { display: none !important; }

.skip-link { position: fixed; left: 1rem; top: 1rem; z-index: 1000; transform: translateY(-150%); background: var(--primary); color: var(--primary-foreground); padding: .55rem .8rem; border-radius: .5rem; }
.skip-link:focus { transform: translateY(0); }

.container { width: min(100% - 2rem, 1280px); margin-inline: auto; }
.page-shell { position: relative; min-height: 100vh; display: flex; flex-direction: column; align-items: center; }

.site-header { position: relative; height: 8vh; min-height: 64px; display: flex; align-items: center; justify-content: space-between; border: 0; background: var(--card); color: var(--card-foreground); padding: 0 1.25rem; }
.brand { display: inline-flex; align-items: center; justify-content: center; gap: .15rem; font-size: 1.5rem; line-height: 2rem; font-weight: 900; letter-spacing: -.025em; }
.brand-logo { display: block; width: 2.75rem; height: 2.75rem; object-fit: contain; }
.header-forum-button { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; justify-content: center; padding: .25rem; border: 0; border-radius: 0; background: transparent; color: var(--foreground); font-size: .875rem; line-height: 1.25rem; font-weight: 600; letter-spacing: .01em; transition: opacity .15s ease, transform .15s ease; }
.header-forum-button:hover { background: transparent; opacity: .75; }
.header-forum-button:active { transform: translate(-50%, -50%) scale(.97); }
.header-forum-button:focus-visible { outline: 2px solid var(--foreground); outline-offset: 4px; }
.header-subscriptions-button { margin-left: .75rem; }
.desktop-nav { display: flex; align-items: center; gap: 1rem; }
.nav-button, .mobile-menu-button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 2.25rem; padding: .5rem 1rem; border: 0; border-radius: .375rem; background: transparent; color: var(--foreground); font-size: .875rem; line-height: 1.25rem; font-weight: 500; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.nav-button:hover, .mobile-menu-button:hover { background: var(--accent); }
.nav-button svg { width: 1.5rem; height: 1.5rem; }
.nav-button.discord-only { width: 2.25rem; padding: 0; }
.mobile-menu a.discord-mobile-only { justify-content: center; padding: .7rem; }
.mobile-menu a.discord-mobile-only svg { width: 1.5rem; height: 1.5rem; }
.mobile-menu-button { width: 2.25rem; padding: 0; display: none; }
.mobile-menu-button svg { width: 1.5rem; height: 1.5rem; }
.mobile-menu { position: absolute; z-index: 80; top: calc(8vh + .45rem); right: 1rem; width: min(260px, calc(100vw - 2rem)); padding: .35rem; border: 1px solid var(--border); border-radius: .55rem; background: #0d0d0f; box-shadow: 0 16px 40px rgba(0,0,0,.42); }
.mobile-menu a { display: flex; align-items: center; gap: .55rem; padding: .7rem .75rem; border-radius: .38rem; font-size: .9rem; }
.mobile-menu a:hover { background: var(--accent); }
.mobile-menu svg { width: 1.25rem; height: 1.25rem; }

main { width: 100%; flex: 1; }
.main-area { margin-block: 4rem; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.generator-layout { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 1.25rem; width: min(100% - 2rem, 1280px); margin-inline: auto; }
.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--card-foreground); box-shadow: var(--shadow); }
.generator-card { min-height: 36vh; width: 100%; display: flex; flex-direction: column; justify-content: center; }
.history-card { min-height: 36vh; width: 100%; }
.card-header { display: flex; flex-direction: column; gap: .375rem; padding: 1.5rem; }
.card-header.centered { text-align: center; }
.card-header h1 { margin: 0; font-size: 1.5rem; line-height: 2rem; font-weight: 600; letter-spacing: -.025em; }
.card-header p { margin: 0; color: var(--muted-foreground); font-size: .875rem; line-height: 1.25rem; }
.card-content { padding: 0 1.5rem 1.5rem; }
.compact-bottom { padding-bottom: .75rem; }
.generate-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; }

.select-control { position: relative; width: 100%; }
.select-trigger { width: 100%; height: 2.25rem; display: flex; align-items: center; justify-content: space-between; white-space: nowrap; padding: .5rem .75rem; border: 1px solid var(--input); border-radius: .375rem; background: transparent; color: var(--foreground); box-shadow: 0 1px 2px rgba(0,0,0,.24); font-size: .875rem; cursor: pointer; }
.select-trigger:focus-visible, .primary-button:focus-visible, .nav-button:focus-visible, .mobile-menu-button:focus-visible, .select-popover button:focus-visible, .copy-button:focus-visible { outline: 2px solid var(--foreground); outline-offset: 2px; }
.select-trigger svg { width: 1rem; height: 1rem; opacity: .5; flex: none; }
.select-value { display: flex; align-items: center; gap: .55rem; overflow: hidden; text-overflow: ellipsis; }
.select-popover { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + .35rem); max-height: 310px; overflow-y: auto; padding: .25rem; border: 1px solid var(--border); border-radius: .5rem; background: #09090b; box-shadow: 0 12px 35px rgba(0,0,0,.45); }
.select-popover button { width: 100%; display: flex; align-items: center; gap: .65rem; border: 0; border-radius: .3rem; background: transparent; color: var(--foreground); padding: .55rem .65rem; text-align: left; font-size: .875rem; cursor: pointer; }
.select-popover button:hover, .select-popover button[aria-selected="true"] { background: var(--accent); }
.service-mark { width: 1.7rem; height: 1.7rem; flex: none; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: .42rem; background: var(--secondary); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.02); }
.service-mark svg { width: 100%; height: 100%; display: block; }

.primary-button { width: 100%; min-height: 2.25rem; display: inline-flex; align-items: center; justify-content: center; gap: .25rem; padding: .5rem 1rem; border: 0; border-radius: .375rem; background: var(--primary); color: var(--primary-foreground); box-shadow: 0 1px 2px rgba(0,0,0,.25); font-size: .875rem; line-height: 1.25rem; font-weight: 500; cursor: pointer; transition: opacity .15s ease, background-color .15s ease; }
.primary-button:hover:not(:disabled) { background: #e4e4e7; }
.primary-button:disabled { pointer-events: none; opacity: .5; }
.primary-button svg { width: 1.5rem; height: 1.5rem; }
.spinner { display: none; width: 1rem; height: 1rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 999px; animation: spin .7s linear infinite; }
.primary-button.loading svg, .primary-button.loading #generateLabel { display: none; }
.primary-button.loading .spinner { display: block; }
.generation-limit-message { width: 100%; margin: .65rem 0 0; padding: .65rem .75rem; border: 1px solid #3f3f46; border-radius: .45rem; background: #18181b; color: #e4e4e7; font-size: .78rem; line-height: 1.4; text-align: center; }
@keyframes spin { to { transform: rotate(360deg); } }

.history-title { padding: 1.5rem 2rem .75rem; }
.history-title h2 { margin: 0; display: flex; align-items: center; gap: .5rem; font-size: 1rem; line-height: 1; font-weight: 600; letter-spacing: -.025em; }
.history-title h2 svg { width: 1.75rem; height: 1.75rem; color: var(--primary); margin-bottom: .25rem; }
.history-content { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: .25rem; padding: 0 .5rem 1.5rem; }
.empty-history { margin: 0; align-self: center; color: #737373; padding: 1rem 0; font-size: .72rem; }
.account-list { display: flex; flex-direction: column; gap: .45rem; width: 100%; }
.account-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem; align-items: center; border: 1px solid var(--border); border-radius: .5rem; padding: .65rem .7rem; background: #0d0d0f; }
.account-main { min-width: 0; display: flex; align-items: center; gap: .65rem; }
.account-text { min-width: 0; }
.account-text strong { display: block; margin-bottom: .16rem; font-size: .82rem; font-weight: 600; }
.account-text code { display: block; color: var(--muted-foreground); font: 500 .78rem/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-actions { display: flex; gap: .3rem; }
.copy-button { width: 2rem; height: 2rem; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: .38rem; background: transparent; color: var(--muted-foreground); cursor: pointer; }
.copy-button:hover { background: var(--accent); color: var(--foreground); }
.copy-button svg { width: 1rem; height: 1rem; }

.features-grid { margin-top: 2.5rem; display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center; gap: .75rem; padding-inline: 1rem; }
.feature-card { position: relative; height: auto; width: min(35vh, 100%); min-width: 280px; overflow: hidden; transition: transform .3s ease; }
.feature-card:hover { transform: scale(1.05); cursor: help; }
.corner-icon { position: absolute; right: 0; top: 0; display: grid; place-items: center; padding: .5rem; border-radius: 0 0 0 .5rem; background: var(--primary); color: var(--background); }
.corner-icon svg { width: 1.75rem; height: 1.75rem; }
.feature-heading { padding: 1.5rem; }
.feature-heading h3 { margin: 0; font-size: 1rem; line-height: 1; font-weight: 600; letter-spacing: -.025em; user-select: none; }
.feature-copy { padding: 0 1.5rem 1.5rem; }
.feature-copy p { margin: 0; color: var(--muted-foreground); font-size: .875rem; line-height: 1.25rem; }

.site-footer {
  display: flex;
  width: min(100% - 2rem, 1280px);
  min-height: 4.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-top: 1rem;
  padding: 1.25rem .25rem 2rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.site-footer p { margin: 0; color: #71717a; font-size: .875rem; font-weight: 500; line-height: 1.5; }
.site-footer p span { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8125rem; color: #71717a; }
.site-footer nav { display: flex; align-items: center; justify-content: flex-end; gap: 1.5rem; margin-left: auto; }
.site-footer a { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #a1a1aa; font-size: .8125rem; font-weight: 500; white-space: nowrap; }
.site-footer a:hover { color: #f4f4f5; }


.toast-region { position: fixed; z-index: 300; right: 1rem; top: 1rem; display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
.toast { max-width: 360px; border: 1px solid var(--border); border-radius: .5rem; background: #18181b; color: var(--foreground); padding: .75rem 1rem; box-shadow: 0 12px 30px rgba(0,0,0,.4); font-size: .875rem; animation: toast-in .2s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

.legal-main { width: min(100% - 2rem, 960px); margin: 4rem auto 5rem; }
.legal-card { padding: 2rem; }
.legal-card > header { margin-bottom: 2rem; text-align: center; }
.legal-card > header h1 { margin: 0 0 .5rem; font-size: 2rem; }
.legal-card > header p { margin: 0; color: var(--muted-foreground); }
.legal-card section + section { margin-top: 1.75rem; }
.legal-card h2 { margin: 0 0 .65rem; font-size: 1.15rem; }
.legal-card p, .legal-card li { color: #d4d4d8; line-height: 1.7; }
.legal-card ul { padding-left: 1.25rem; }

.error-main { width: min(100% - 2rem, 680px); margin: 6rem auto; text-align: center; }
.error-main h1 { margin: 0; font-size: clamp(5rem, 15vw, 10rem); line-height: 1; }
.error-main p { color: var(--muted-foreground); }
.error-main .primary-button { width: auto; margin-top: 1rem; }

@media (min-width: 1024px) {
  .site-header { margin-top: 1.25rem; border-radius: .5rem; }
  .main-area { margin-block: 6rem; }
  .generator-layout { flex-direction: row; align-items: stretch; }
  .generator-card { width: auto; min-width: 600px; flex: 0 1 760px; padding-inline: 2.5rem; }
  .history-card { width: auto; min-width: 320px; flex: 1 1 420px; }
  .features-grid { margin-top: 6rem; gap: 1.25rem; }
}

@media (min-width: 640px) {
}

@media (max-width: 1023px) {
  .container { width: 100%; }
  .site-header { padding-inline: .75rem; }
  .brand span { display: inline; }
  .desktop-nav { display: none; }
  .mobile-menu-button { display: inline-flex; }
  .generator-layout { padding-inline: 1rem; width: 100%; }
  .main-area { margin-block: 4rem; }
  .feature-card { width: 100%; }
  .corner-icon { right: .75rem; top: .75rem; border-radius: 1rem; }
}

@media (max-width: 560px) {
  .site-footer {
    justify-content: center;
    gap: .75rem 1.25rem;
    padding-inline: 1rem;
    text-align: center;
  }
  .site-footer p { width: 100%; }
  .site-footer nav { margin-left: 0; justify-content: center; gap: 1.25rem; }
  .brand-logo { width: 2.4rem; height: 2.4rem; }
  .main-area { margin-block: 2.5rem; }
  .generator-layout { gap: 1rem; }
  .card-header { padding: 1.25rem; }
  .card-content { padding-left: 1.25rem; padding-right: 1.25rem; }
  .history-title { padding-left: 1.25rem; padding-right: 1.25rem; }
  .account-row { grid-template-columns: 1fr; }
  .account-actions { justify-content: flex-end; }
  .features-grid { margin-top: 2.5rem; }
  .feature-card:hover { transform: none; }
  .site-footer { padding-inline: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Live inventory */
.select-value { width: 100%; justify-content: space-between; min-width: 0; }
.select-popover button { justify-content: space-between; }
.service-option-main { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.service-option-main > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-stock { margin-left: auto; flex: none; color: var(--muted-foreground); font-size: .78rem; font-weight: 600; white-space: nowrap; }
.selected-stock { padding-right: .35rem; }

.site-announcement {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: var(--secondary);
  color: var(--foreground);
  padding: .75rem 1rem;
  text-align: center;
  font-size: .875rem;
}

.service-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.empty-service-list {
  margin: 0;
  padding: .8rem;
  color: var(--muted-foreground);
  text-align: center;
  font-size: .875rem;
}


.profile-menu { position: relative; }
.profile-trigger { min-height: 2.25rem; display: inline-flex; align-items: center; gap: .55rem; border: 1px solid var(--border); border-radius: .5rem; background: transparent; color: var(--foreground); padding: .25rem .55rem .25rem .3rem; cursor: pointer; }
.profile-trigger:hover, .profile-trigger[aria-expanded="true"] { background: var(--accent); }
.profile-trigger-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; font-weight: 600; }
.profile-avatar-wrap { position: relative; width: 1.75rem; height: 1.75rem; display: grid; place-items: center; flex: none; overflow: hidden; border: 1px solid var(--border); border-radius: 999px; background: var(--secondary); font-size: .75rem; font-weight: 700; }
.profile-avatar-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-large { width: 2.75rem; height: 2.75rem; font-size: 1rem; }
.profile-popover { position: absolute; z-index: 120; top: calc(100% + .55rem); right: 0; width: min(330px, calc(100vw - 2rem)); border: 1px solid var(--border); border-radius: .65rem; background: #0d0d0f; box-shadow: 0 18px 45px rgba(0,0,0,.48); padding: .85rem; }
.profile-popover-head { display: flex; align-items: center; gap: .7rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.profile-popover-head strong, .profile-popover-head span { display: block; overflow-wrap: anywhere; }
.profile-popover-head span { margin-top: .15rem; color: var(--muted-foreground); font-size: .78rem; }
.profile-details { display: grid; gap: .65rem; margin: .8rem 0; }
.profile-details div { min-width: 0; }
.profile-details dt { color: var(--muted-foreground); font-size: .72rem; }
.profile-details dd { margin: .15rem 0 0; font-size: .82rem; overflow-wrap: anywhere; }
.profile-logout { width: 100%; min-height: 2.25rem; border: 1px solid var(--border); border-radius: .4rem; background: transparent; color: var(--foreground); cursor: pointer; }
.profile-logout:hover { background: var(--accent); }
.mobile-profile-trigger { width: 100%; display: flex; align-items: center; gap: .6rem; border: 0; border-radius: .38rem; background: transparent; color: var(--foreground); padding: .6rem .75rem; cursor: pointer; text-align: left; }
.mobile-profile-trigger:hover { background: var(--accent); }
.mobile-profile-details { display: grid; gap: .25rem; margin: .2rem .35rem .55rem; padding: .7rem; border: 1px solid var(--border); border-radius: .45rem; background: var(--secondary); font-size: .78rem; overflow-wrap: anywhere; }
.mobile-profile-details span { color: var(--muted-foreground); }
.mobile-profile-details button { margin-top: .45rem; min-height: 2.1rem; border: 1px solid var(--border); border-radius: .35rem; background: transparent; color: var(--foreground); cursor: pointer; }
.mobile-profile-details button:hover { background: var(--accent); }

.maintenance-main { width: min(100% - 2rem, 560px); margin: 8rem auto; }
.maintenance-card { padding: 2rem; text-align: center; }
.maintenance-card h1 { margin: .8rem 0 .5rem; }
.maintenance-card > p { margin: 0 auto 1.5rem; max-width: 430px; color: var(--muted-foreground); line-height: 1.55; }
.maintenance-icon { width: 3rem; height: 3rem; display: grid; place-items: center; margin: 0 auto; border: 1px solid var(--border); border-radius: 999px; background: var(--secondary); font-size: 1.3rem; font-weight: 700; }
.maintenance-form { display: grid; gap: .7rem; text-align: left; }
.maintenance-form label { font-size: .82rem; font-weight: 600; }
.maintenance-form input { width: 100%; border: 1px solid var(--input); border-radius: .375rem; background: transparent; color: var(--foreground); padding: .7rem .75rem; font: inherit; }
.maintenance-form input:focus-visible { outline: 2px solid var(--foreground); outline-offset: 2px; }

.history-heading-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.history-clear-button { width: 2rem; height: 2rem; display: grid; place-items: center; flex: none; border: 1px solid var(--border); border-radius: .4rem; background: transparent; color: var(--muted-foreground); cursor: pointer; }
.history-clear-button:hover { background: var(--accent); color: var(--foreground); }
.history-clear-button:focus-visible { outline: 2px solid var(--foreground); outline-offset: 2px; }
.history-clear-button svg { width: 1rem; height: 1rem; fill: currentColor; }

/* Historique compact avec actions */
.history-content {
  padding: 0 1.25rem 1.5rem;
}

.account-list {
  gap: .5rem;
}

.account-row {
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: .85rem;
  min-height: 4rem;
  padding: .6rem .7rem;
  border-radius: .7rem;
  background: #0b0b0d;
}

.account-row .service-mark {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: .48rem;
}

.account-text strong {
  margin: 0;
  font-size: .82rem;
  line-height: 1.25;
}

.account-text time {
  display: block;
  margin-top: .15rem;
  color: var(--muted-foreground);
  font-size: .72rem;
  line-height: 1.2;
}

.account-actions {
  align-items: center;
  gap: .45rem;
}

.history-action {
  min-width: 3.6rem;
  min-height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: .65rem;
  padding: .45rem .8rem;
  font-size: .76rem;
  font-weight: 600;
  cursor: pointer;
}

.history-action:focus-visible {
  outline: 2px solid var(--foreground);
  outline-offset: 2px;
}

.history-copy {
  background: #fafafa;
  color: #18181b;
}

.history-copy:hover {
  background: #e4e4e7;
}

.history-view {
  background: #202024;
  color: #fafafa;
}

.history-view:hover {
  background: #2d2d32;
}

.history-remove {
  background: #ef3340;
  color: #fff;
}

.history-remove:hover {
  background: #dc2633;
}


.history-pagination {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .8rem;
  width: min(100%, 19rem);
  margin: 1rem auto 0;
}

.history-pagination[hidden] {
  display: none;
}

.history-page-label {
  color: var(--foreground);
  text-align: center;
  font-size: .78rem;
  white-space: nowrap;
}

.history-page-button {
  min-width: 4.4rem;
  min-height: 2.25rem;
  border: 0;
  border-radius: .55rem;
  padding: .45rem .8rem;
  background: #fafafa;
  color: #18181b;
  font: inherit;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
}

.history-page-button:hover:not(:disabled) {
  background: #e4e4e7;
}

.history-page-button:focus-visible {
  outline: 2px solid var(--foreground);
  outline-offset: 2px;
}

.history-page-button:disabled {
  background: #8a8a8f;
  color: #202024;
  cursor: not-allowed;
  opacity: .8;
}

/* Ouverture du sélecteur uniquement en 2D : opacité + translation verticale. */
.select-popover:not([hidden]) {
  animation: select-panel-2d .16s ease-out both;
  transform-origin: top center;
}

@keyframes select-panel-2d {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Page de consultation d'un compte */
.account-view-main {
  width: min(100% - 2rem, 560px);
  margin: 7rem auto;
}

.account-view-card {
  padding: 2.5rem;
  box-shadow: none;
}

.account-view-title {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.account-view-title .service-mark {
  width: 2rem;
  height: 2rem;
}

.account-view-title h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.account-value {
  width: 100%;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  border: 1px solid var(--input);
  border-radius: .65rem;
  padding: .65rem .8rem;
  overflow-wrap: anywhere;
  font: 500 .86rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.account-view-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
}

.account-view-actions .primary-button,
.account-view-actions .secondary-link {
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: .65rem;
  font-size: .82rem;
}

.secondary-link {
  background: #202024;
  color: #fafafa;
}

.secondary-link:hover {
  background: #2d2d32;
}

.account-view-error {
  margin: 0 0 1.25rem;
  color: var(--muted-foreground);
  text-align: center;
}

/* Présentation du règlement inspirée de la maquette fournie */
.rules-main {
  width: min(100% - 2rem, 980px);
  margin: 3rem auto 5rem;
}

.rules-card {
  overflow: hidden;
  padding: 0;
  box-shadow: none;
}

.rules-hero {
  padding: 1.7rem 2rem;
  background: linear-gradient(105deg, #2f61ee, #a92de7);
  text-align: center;
}

.rules-hero h1 {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.15rem);
}

.rules-hero p {
  margin: .55rem 0 0;
  color: rgba(255,255,255,.9);
  font-size: .86rem;
}

.rules-content {
  padding: 1.5rem 1.75rem 2rem;
}

.rules-section {
  padding: .3rem 0 1.2rem;
  border-bottom: 1px solid var(--border);
}

.rules-section + .rules-section {
  margin-top: 1rem;
}

.rules-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.rules-heading {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: .75rem;
}

.rules-icon {
  width: 1.35rem;
  height: 1.35rem;
  flex: none;
  color: #4e8cff;
}

.rules-section:nth-child(2n) .rules-icon { color: #28d783; }
.rules-section:nth-child(3n) .rules-icon { color: #f3c400; }
.rules-section:nth-child(4n) .rules-icon { color: #ff6a00; }

.rules-heading h2 {
  margin: 0;
  font-size: 1.05rem;
}

.rules-section p,
.rules-section li {
  color: #d4d4d8;
  font-size: .88rem;
  line-height: 1.65;
}

.rules-section p {
  margin: 0;
}

.rules-section p + p {
  margin-top: .7rem;
}

.rules-section ul {
  margin: .55rem 0 0;
  padding-left: 1.25rem;
}

@media (max-width: 680px) {
  .account-row {
    grid-template-columns: 1fr;
  }

  .account-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .history-action {
    width: 100%;
  }

  .account-view-main {
    margin: 3rem auto;
  }

  .account-view-card {
    padding: 1.25rem;
  }

  .account-view-actions {
    grid-template-columns: 1fr;
  }

  .rules-content {
    padding: 1.25rem;
  }
}


/* Interface compacte et plus lisible */
:root {
  --background: #0d0f10;
  --card: #121416;
  --secondary: #191b1e;
  --muted: #1b1e21;
  --muted-foreground: #a7abb1;
  --border: #2b2e32;
  --input: #34383d;
  --accent: #24282c;
  --shadow: 0 10px 30px rgba(0, 0, 0, .18);
}

html,
body {
  background: var(--background);
}

body {
  background-image: radial-gradient(circle at 50% 16%, rgba(255,255,255,.025), transparent 34rem);
}

.site-header,
.card {
  background: var(--card);
}

.main-area {
  margin-block: 3.5rem;
}

.generator-layout {
  max-width: 54rem;
  gap: 1.2rem;
}

.generator-card,
.history-card {
  min-height: 15.25rem;
  box-shadow: none;
}

.generator-card {
  padding-inline: 1.8rem;
}

.card-header {
  padding: 1.25rem 1.35rem;
}

.card-content {
  padding-right: 1.35rem;
  padding-left: 1.35rem;
}

.select-trigger {
  height: 2.3rem;
  border-color: var(--input);
  border-radius: .65rem;
  background: #121416;
  box-shadow: none;
}

.select-popover {
  top: calc(100% + .25rem);
  max-height: 21rem;
  padding: .25rem;
  border-color: var(--border);
  border-radius: .7rem;
  background: #121416;
  box-shadow: 0 18px 38px rgba(0,0,0,.34);
}

.select-popover button {
  min-height: 2.05rem;
  gap: .55rem;
  padding: .36rem .55rem;
  border-radius: .42rem;
}

.select-popover button:hover,
.select-popover button[aria-selected="true"] {
  background: #202327;
}

.select-popover .service-mark,
.select-value .service-mark {
  width: 1.25rem;
  height: 1.25rem;
  border: 0;
  border-radius: .2rem;
  background: transparent;
  box-shadow: none;
}

.features-grid {
  width: min(100% - 2rem, 48.5rem);
  margin: 4rem auto 0;
  gap: 1.15rem;
  padding-inline: 0;
}

.feature-card {
  width: auto;
  min-width: 0;
  flex: 1 1 0;
  min-height: 8.2rem;
  box-shadow: none;
}

.feature-card:hover {
  transform: translateY(-2px);
}

.feature-heading {
  padding: 1.3rem 1.5rem .9rem;
}

.feature-copy {
  padding: 0 1.5rem 1.25rem;
}

@media (min-width: 1024px) {
  .main-area {
    margin-block: 3.25rem;
  }

  .generator-layout {
    width: min(100% - 2rem, 54rem);
  }

  .generator-card {
    width: 29.75rem;
    min-width: 0;
    flex: 0 0 29.75rem;
  }

  .history-card {
    width: 20.5rem;
    min-width: 0;
    flex: 0 0 20.5rem;
  }

  .features-grid {
    margin-top: 4rem;
    gap: 1.15rem;
  }
}

@media (max-width: 1023px) {
  .generator-layout,
  .features-grid {
    width: min(100%, 42rem);
  }

  .feature-card {
    flex-basis: calc(50% - .6rem);
  }
}

@media (max-width: 640px) {
  .main-area {
    margin-block: 2rem;
  }

  .generator-card,
  .history-card {
    min-height: auto;
  }

  .features-grid {
    margin-top: 2.25rem;
    padding-inline: 1rem;
  }

  .feature-card {
    flex-basis: 100%;
  }
}


/* Historique : les actions restent toujours dans la carte. */
.account-row {
  min-width: 0;
  overflow: hidden;
}

.account-main,
.account-text {
  min-width: 0;
}

.account-actions {
  min-width: 0;
  width: 13.25rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .4rem;
}

.history-action {
  width: 100%;
  min-width: 0;
  padding-inline: .55rem;
  white-space: nowrap;
}

@media (min-width: 1024px) {
  .generator-layout.history-expanded {
    width: min(100% - 2rem, 62rem);
    max-width: 62rem;
  }

  .history-card {
    transition: width .2s ease, flex-basis .2s ease;
  }

  .history-card.has-accounts {
    width: 30.5rem;
    flex-basis: 30.5rem;
  }
}

@media (max-width: 760px) {
  .account-row {
    grid-template-columns: 1fr;
  }

  .account-actions {
    width: 100%;
  }
}


