:root {
  --ink: #071018;
  --ink-soft: #0e1a24;
  --panel: rgba(14, 28, 38, 0.72);
  --line: rgba(180, 220, 230, 0.12);
  --text: #e8f2f6;
  --muted: #8aa3b0;
  --accent: #3fd0c9;
  --accent-deep: #1a9e97;
  --warn: #ff8a5c;
  --danger: #ff5c6c;
  --ok: #6ee7a8;
  --radius: 18px;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 600px at 8% -10%, rgba(63, 208, 201, 0.22), transparent 55%),
    radial-gradient(900px 500px at 92% 8%, rgba(255, 138, 92, 0.16), transparent 50%),
    radial-gradient(700px 480px at 50% 110%, rgba(26, 158, 151, 0.18), transparent 55%),
    linear-gradient(165deg, #071018 0%, #0c1924 45%, #0a141c 100%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  opacity: 0.35;
  pointer-events: none;
  mix-blend-mode: soft-light;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1.25rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  background: rgba(7, 16, 24, 0.45);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  box-shadow: 0 0 0 1px rgba(63, 208, 201, 0.25), 0 10px 28px rgba(63, 208, 201, 0.2);
  animation: pulse-glow 4.5s ease-in-out infinite;
}

.brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
  color: var(--muted);
}

.status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--muted);
}

.status-pill[data-state="online"] {
  color: var(--ok);
  border-color: rgba(110, 231, 168, 0.28);
}

.status-pill[data-state="online"] .status-dot {
  background: var(--ok);
  box-shadow: 0 0 12px rgba(110, 231, 168, 0.7);
  animation: blink 2s ease-in-out infinite;
}

.status-pill[data-state="offline"] .status-dot {
  background: var(--danger);
}

.shell {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 1.5rem 2rem;
  align-items: start;
}

.shell-panel {
  width: min(1220px, calc(100% - 2rem));
  grid-template-columns: 200px minmax(0, 1.5fr) 0.85fr;
}

.panel-nav {
  position: sticky;
  top: 5.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem;
  border-radius: 14px;
  background: rgba(10, 18, 24, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  max-height: calc(100vh - 6.5rem);
  overflow-y: auto;
}

.panel-nav-label {
  margin: 0 0 0.35rem 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-nav-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #c5d5de;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.panel-nav-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.panel-nav-btn.is-active {
  background: rgba(245, 197, 24, 0.14);
  color: #f5c518;
}

.panel-form {
  min-width: 0;
}

.panel-page-head {
  margin: 0 0 1.25rem;
}

.panel-page-head h1 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.panel-page-head p {
  margin: 0;
  color: var(--muted);
}

.panel-page .block {
  margin-bottom: 1.25rem;
}

.profile-buttons-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.profile-button-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 0.5rem;
  align-items: center;
}

.profile-button-row input {
  width: 100%;
}

.mention-role-row {
  grid-template-columns: 1fr auto;
}

.mention-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}

.mention-subnav a {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(245, 197, 24, 0.35);
  background: rgba(245, 197, 24, 0.08);
  color: #f5c518;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.mention-subnav a:hover {
  background: rgba(245, 197, 24, 0.16);
}

.mention-sanctions-block {
  border: 1px solid rgba(245, 197, 24, 0.28);
  box-shadow: 0 0 0 1px rgba(245, 197, 24, 0.06);
}

.mention-tiers-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0.5rem 0;
  padding: 0.75rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  min-height: 3rem;
}

.mention-tier-row {
  display: grid;
  grid-template-columns: 7rem 1fr 7.5rem auto;
  gap: 0.5rem;
  align-items: end;
}

.mention-tier-row label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
}

.mention-tier-row input,
.mention-tier-row select {
  width: 100%;
}

@media (max-width: 720px) {
  .mention-tier-row {
    grid-template-columns: 1fr 1fr;
  }
}

.hero {
  grid-column: 1 / -1;
  animation: rise 0.7s ease both;
}

.hero h1 {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  max-width: 14ch;
}

.lede {
  margin: 0;
  max-width: 42ch;
  color: var(--muted);
  font-size: 1.08rem;
}

.config-form {
  display: grid;
  gap: 1.25rem;
  animation: rise 0.8s ease 0.08s both;
}

.block {
  position: relative;
  z-index: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(16px);
  padding: 1.4rem 1.5rem 1.55rem;
  box-shadow: var(--shadow);
}

.announce-editor .block:has(.channel-picker[data-open="true"]),
.announce-editor .block:has(.at-menu:not([hidden])) {
  z-index: 80;
}

.block-head h2 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.block-head p {
  margin: 0 0 1.15rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-wide {
  grid-column: 1 / -1;
}

.field span {
  font-size: 0.86rem;
  font-weight: 600;
  color: #b7ced8;
}

.field input,
.field select {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 12, 18, 0.65);
  color: var(--text);
  padding: 0.78rem 0.95rem;
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: rgba(63, 208, 201, 0.55);
  box-shadow: 0 0 0 3px rgba(63, 208, 201, 0.15);
  background: rgba(4, 12, 18, 0.85);
}

.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.2rem;
}

.hint {
  color: var(--muted);
  font-size: 0.8rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.78rem 1.15rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #04201e;
  box-shadow: 0 10px 28px rgba(63, 208, 201, 0.25);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(63, 208, 201, 0.4);
  background: rgba(63, 208, 201, 0.08);
}

.btn-danger {
  background: rgba(255, 92, 108, 0.12);
  border-color: rgba(255, 92, 108, 0.35);
  color: #ffb3bb;
}

.btn-danger:hover {
  background: rgba(255, 92, 108, 0.22);
}

.toast {
  margin: 0.4rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  animation: rise 0.35s ease both;
}

.toast[data-kind="ok"] {
  border-color: rgba(110, 231, 168, 0.35);
  color: var(--ok);
}

.toast[data-kind="error"] {
  border-color: rgba(255, 92, 108, 0.4);
  color: #ffb3bb;
}

.live {
  position: sticky;
  top: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(18, 36, 48, 0.85), rgba(10, 20, 28, 0.75));
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow);
  animation: rise 0.85s ease 0.14s both;
}

.live h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.live dl {
  margin: 0;
  display: grid;
  gap: 0.9rem;
}

.live dl > div {
  display: grid;
  gap: 0.15rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.live dl > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.live dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.live dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  word-break: break-all;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 12, 0.72);
  backdrop-filter: blur(6px);
  animation: fade 0.25s ease both;
}

.modal-panel {
  position: relative;
  width: min(440px, 100%);
  border-radius: 20px;
  border: 1px solid rgba(255, 92, 108, 0.28);
  background: linear-gradient(180deg, #152531, #0d1820);
  padding: 1.5rem 1.45rem 1.35rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  animation: rise 0.3s ease both;
}

.modal-panel h2 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.modal-panel p {
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.3rem 0.4rem 0.3rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.user-chip img {
  border-radius: 50%;
  display: block;
}

.user-meta {
  display: grid;
  line-height: 1.15;
  min-width: 0;
}

.user-meta span:first-child {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 10rem;
}

.user-role {
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.btn-small {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 999px;
}

.btn-block {
  width: 100%;
  margin-top: 1rem;
}

.btn-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  width: 100%;
  margin-top: 0.5rem;
}

.login-body {
  min-height: 100vh;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-panel {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  padding: 1.75rem 1.6rem 1.7rem;
  animation: rise 0.7s ease both;
}

.login-brand {
  margin-bottom: 1.4rem;
}

.login-panel h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  letter-spacing: -0.03em;
}

.login-hint {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  word-break: break-all;
}

.whitelist-add {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr auto;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
}

.linked-guild-add {
  grid-template-columns: 1.2fr 1fr auto auto;
}

.linked-guild-item {
  align-items: flex-start;
}

.linked-guild-item .linked-guild-meta {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  flex: 1;
}

.linked-guild-status {
  font-size: 0.75rem;
  color: var(--muted);
}

.linked-guild-status.is-on {
  color: var(--ok, #6ee7a8);
}

.whitelist-item .linked-guild-status.is-on {
  color: var(--ok, #6ee7a8);
}

.linked-guild-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

@media (max-width: 980px) {
  .linked-guild-add {
    grid-template-columns: 1fr;
  }
}

.whitelist-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.whitelist-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(4, 12, 18, 0.45);
  flex-wrap: wrap;
}

.whitelist-item div {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.whitelist-item strong {
  font-size: 0.95rem;
}

.whitelist-item span {
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.whitelist-item em {
  font-style: normal;
  color: var(--accent);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.seed-badge {
  font-size: 0.75rem;
  color: var(--warn);
  border: 1px solid rgba(255, 138, 92, 0.35);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  white-space: nowrap;
}

.page-perms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  width: 100%;
}

.page-perms label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.page-perms-add {
  grid-column: 1 / -1;
  align-items: center;
}

.page-perms-add > span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}

.page-perm-sensitive {
  color: var(--warn) !important;
  border: 1px solid rgba(255, 138, 92, 0.35);
  border-radius: 8px;
  padding: 0.2rem 0.45rem;
}

.entreprises-shell .block {
  margin-bottom: 1.1rem;
}

.ent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.ent-column .block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ent-column .tag,
.ent-grid .tag {
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
}

.ent-list {
  display: grid;
  gap: 0.7rem;
}

.ent-item {
  display: flex;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(4, 12, 18, 0.4);
}

.ent-item.is-hidden {
  opacity: 0.62;
  border-style: dashed;
}

.ent-hidden-tag {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  margin-left: 0.35rem;
}

.ent-left {
  display: flex;
  gap: 0.7rem;
  min-width: 0;
}

.ent-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 0.45rem;
  flex: 0 0 auto;
  background: #33d17a;
  box-shadow: 0 0 0 3px rgba(51, 209, 122, 0.12);
}

.ent-dot.is-free {
  background: #ff4d4d;
  box-shadow: 0 0 0 3px rgba(255, 77, 77, 0.12);
}

.ent-meta {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.ent-meta strong {
  font-size: 0.95rem;
}

.ent-meta span,
.ent-desc {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  margin: 0;
  white-space: pre-wrap;
}

.ent-meta a {
  color: #66b3ff;
  font-size: 0.82rem;
}

.ent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: flex-start;
  flex: 0 0 auto;
}

@media (max-width: 980px) {
  .ent-grid {
    grid-template-columns: 1fr;
  }

  .ent-item {
    flex-direction: column;
  }
}

.live .hint {
  margin: 0.55rem 0 0;
}

.nav-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.nav-tabs a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.nav-tabs a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-tabs a[aria-current="page"] {
  color: var(--accent);
  border-color: rgba(63, 208, 201, 0.35);
  background: rgba(63, 208, 201, 0.08);
}

.announce-shell {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.announce-hero {
  margin-bottom: 1.25rem;
}

.announce-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 1.25rem;
  align-items: start;
}

.announce-editor {
  display: grid;
  gap: 1.1rem;
}

.announce-preview-wrap {
  position: sticky;
  top: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(16px);
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.announce-preview-wrap h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.announce-presets {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.announce-presets .block-head {
  margin-bottom: 0.85rem;
}

.announce-presets .block-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.announce-presets .block-head p {
  margin: 0;
  opacity: 0.75;
  font-size: 0.88rem;
}

.preset-save-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
  margin-bottom: 0.85rem;
}

.preset-save-row .field-grow {
  flex: 1 1 12rem;
  min-width: 0;
}

.preset-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
  max-height: 22rem;
  overflow: auto;
}

.preset-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 88%, #000);
}

.preset-item.is-active {
  border-color: color-mix(in srgb, var(--accent, #3fd0c9) 55%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent, #3fd0c9) 35%, transparent);
}

.preset-item-main {
  flex: 1;
  min-width: 0;
}

.preset-item-name {
  display: block;
  font-weight: 650;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preset-item-meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  opacity: 0.7;
}

.preset-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.slash-input {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 88%, #000 12%);
  padding: 0 0.75rem;
}

.slash-input .slash-prefix {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  opacity: 0.55;
}

.slash-input input {
  border: 0;
  background: transparent;
  width: 100%;
  padding: 0.7rem 0;
  color: inherit;
  font: inherit;
}

.slash-input input:focus {
  outline: none;
}

.preset-item.is-active {
  outline: 1px solid color-mix(in srgb, var(--accent, #3fd0c9) 55%, transparent);
}

#presetEmptyHint[hidden] {
  display: none;
}

.row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

/* Toggle style Apple — adapté au thème teal / dark */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.switch input[type="checkbox"],
.switch-inline > input[type="checkbox"],
.switch-field > input[type="checkbox"],
.field.switch-inline > input[type="checkbox"],
.field.switch-field > input[type="checkbox"],
input.ios-toggle,
.field-inline-cb {
  --toggle-w: 2.7rem;
  --toggle-h: 1.55rem;
  --knob: 1.22rem;
  --pad: 0.16rem;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: var(--toggle-w) !important;
  max-width: var(--toggle-w);
  height: var(--toggle-h);
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px;
  background: rgba(120, 140, 155, 0.38) !important;
  background-image: none !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.22s ease, box-shadow 0.22s ease;
}

.switch input[type="checkbox"]::before,
.switch-inline > input[type="checkbox"]::before,
.switch-field > input[type="checkbox"]::before,
input.ios-toggle::before,
.field-inline-cb::before {
  content: "";
  position: absolute;
  top: 50%;
  left: var(--pad);
  width: var(--knob);
  height: var(--knob);
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.28),
    0 3px 8px rgba(0, 0, 0, 0.18);
  transform: translateY(-50%);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.switch input[type="checkbox"]:checked,
.switch-inline > input[type="checkbox"]:checked,
.switch-field > input[type="checkbox"]:checked,
.field.switch-inline > input[type="checkbox"]:checked,
.field.switch-field > input[type="checkbox"]:checked,
input.ios-toggle:checked,
.field-inline-cb:checked {
  background: linear-gradient(180deg, #4fe0d8 0%, var(--accent-deep) 100%) !important;
  background-image: linear-gradient(180deg, #4fe0d8 0%, var(--accent-deep) 100%) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 0 3px rgba(63, 208, 201, 0.12);
}

.switch input[type="checkbox"]:checked::before,
.switch-inline > input[type="checkbox"]:checked::before,
.switch-field > input[type="checkbox"]:checked::before,
input.ios-toggle:checked::before,
.field-inline-cb:checked::before {
  transform: translate(
    calc(var(--toggle-w) - var(--knob) - var(--pad) * 2),
    -50%
  );
}

.switch input[type="checkbox"]:focus-visible,
.switch-inline > input[type="checkbox"]:focus-visible,
.switch-field > input[type="checkbox"]:focus-visible,
input.ios-toggle:focus-visible,
.field-inline-cb:focus-visible {
  outline: 2px solid rgba(63, 208, 201, 0.65);
  outline-offset: 3px;
}

.switch input[type="checkbox"]:disabled,
.switch-inline > input[type="checkbox"]:disabled,
.switch-field > input[type="checkbox"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.switch span {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.row-head .switch span {
  color: var(--text);
}

.field textarea,
.field input[type="file"],
.field input[type="color"] {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 12, 18, 0.65);
  color: var(--text);
  padding: 0.78rem 0.95rem;
  font: inherit;
}

.field textarea {
  resize: vertical;
  min-height: 6rem;
}

.field input[type="color"] {
  padding: 0.25rem;
  height: 2.6rem;
  cursor: pointer;
}

.color-row {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 0.55rem;
}

.soft-details {
  margin-top: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem 0.85rem 0.85rem;
  background: rgba(4, 12, 18, 0.35);
}

.soft-details summary {
  cursor: pointer;
  font-weight: 600;
  color: #b7ced8;
  padding: 0.35rem 0;
}

.embed-fields.is-disabled,
#fivemPlayersFields.is-disabled,
#voteInfoFields.is-disabled,
#voteAnnounceFields.is-disabled,
#referralFields.is-disabled,
#anonymousFields.is-disabled,
#trouveFields.is-disabled,
#bdaFields.is-disabled,
#bdaDmMessageWrap.is-disabled,
#mentionProtectFields.is-disabled,
#mentionProtectLogFields.is-disabled,
#mentionProtectSanctionsFields.is-disabled,
#clearwarnsFields.is-disabled,
#selfCharacterFields.is-disabled,
#selfCharacterEmbedFields.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.field.switch-inline,
.switch-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-direction: row-reverse;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 12, 18, 0.45);
  cursor: pointer;
}

.switch-inline > span,
.switch-inline > small {
  flex: 1;
  color: var(--text) !important;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.35;
}

.field.switch-field,
.switch-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-direction: row;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 12, 18, 0.45);
  cursor: pointer;
}

/* Checkbox en premier dans le HTML → pastille à droite */
.field.switch-field:has(> input[type="checkbox"]:first-child),
.switch-field:has(> input[type="checkbox"]:first-child) {
  flex-direction: row-reverse;
}

.switch-field > span {
  flex: 1;
  color: var(--text) !important;
  font-weight: 600;
  font-size: 0.9rem;
}

.switch-field > .switch {
  margin-left: auto;
}

.fields-builder {
  margin-top: 1rem;
}

.fields-builder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.fields-builder-head h3 {
  margin: 0;
  font-size: 1rem;
  font-family: var(--font-display);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1.3fr auto auto;
  gap: 0.65rem;
  align-items: end;
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}

.discord-preview {
  border-radius: 12px;
  background: #313338;
  padding: 1rem;
  color: #dbdee1;
  font-size: 0.95rem;
}

.discord-msg {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0.75rem;
}

.discord-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #1e1f22;
}

.discord-meta {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin-bottom: 0.25rem;
}

.discord-meta strong {
  color: #fff;
}

.discord-bot-tag {
  font-size: 0.65rem;
  font-weight: 700;
  background: #5865f2;
  color: #fff;
  border-radius: 4px;
  padding: 0.1rem 0.3rem;
}

.discord-meta time {
  color: #949ba4;
  font-size: 0.75rem;
}

.discord-content {
  white-space: pre-wrap;
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.discord-content code {
  background: #1e1f22;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-size: 0.85em;
}

.discord-embed {
  display: grid;
  grid-template-columns: 4px 1fr;
  background: #2b2d31;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.35rem;
  max-width: 100%;
}

.discord-embed[hidden],
.discord-content[hidden],
.discord-files[hidden],
.discord-embed-author[hidden],
.discord-embed-title[hidden],
.discord-embed-desc[hidden],
.discord-embed-image[hidden],
.discord-embed-thumb[hidden],
.discord-embed-footer[hidden],
.discord-embed-author img[hidden],
.discord-embed-footer img[hidden] {
  display: none !important;
}

.discord-embed-bar {
  background: var(--accent);
}

.discord-embed-inner {
  position: relative;
  padding: 0.7rem 0.85rem 0.75rem;
  padding-right: 5rem;
}

.discord-embed-author {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.discord-embed-author img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.discord-embed-title {
  display: inline-block;
  color: #f2f3f5;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 0.35rem;
  cursor: default;
}

.discord-embed-title.is-link {
  color: #00a8fc;
  cursor: pointer;
}

.discord-embed-title.is-link:hover {
  text-decoration: underline;
}

.discord-embed-desc {
  color: #dbdee1;
  line-height: 1.4;
  margin-bottom: 0.45rem;
  white-space: pre-wrap;
}

.discord-embed-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.discord-embed-field {
  width: 100%;
}

.discord-embed-field.is-inline {
  width: calc(33.33% - 0.35rem);
  min-width: 8rem;
}

.discord-embed-field strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}

.discord-embed-image {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 4px;
  margin-top: 0.5rem;
}

.discord-embed-thumb {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 4px;
}

.discord-embed-footer {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #949ba4;
}

.discord-embed-footer img {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.discord-files {
  margin-top: 0.45rem;
  font-size: 0.8rem;
  color: #949ba4;
}

.channel-picker {
  position: relative;
  z-index: 2;
}

.channel-picker[data-open="true"] {
  z-index: 90;
}

.channel-picker-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 12, 18, 0.65);
  color: var(--text);
  padding: 0.78rem 0.95rem;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.channel-picker-trigger:hover,
.channel-picker[data-open="true"] .channel-picker-trigger {
  border-color: rgba(63, 208, 201, 0.55);
  box-shadow: 0 0 0 3px rgba(63, 208, 201, 0.12);
}

.channel-picker-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.channel-picker-value.is-selected {
  color: var(--text);
  font-weight: 600;
}

.channel-picker-caret {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  flex-shrink: 0;
  margin-bottom: 0.2rem;
  transition: transform 0.15s ease;
}

.channel-picker[data-open="true"] .channel-picker-caret {
  transform: rotate(-135deg);
  margin-bottom: -0.15rem;
}

.channel-picker-menu {
  position: absolute;
  z-index: 100;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0f1c26;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  animation: rise 0.2s ease both;
}

.channel-picker-search {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: rgba(4, 12, 18, 0.85);
  color: var(--text);
  padding: 0.85rem 1rem;
  font: inherit;
}

.channel-picker-search:focus {
  outline: none;
  background: rgba(4, 12, 18, 1);
}

.channel-picker-list {
  max-height: 260px;
  overflow: auto;
  padding: 0.35rem;
}

.channel-picker-group {
  margin: 0.35rem 0 0.15rem;
  padding: 0.35rem 0.65rem 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.channel-picker-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  padding: 0.65rem 0.75rem;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.channel-picker-option:hover,
.channel-picker-option.is-active {
  background: rgba(63, 208, 201, 0.12);
}

.channel-picker-option.is-selected {
  background: rgba(63, 208, 201, 0.18);
  color: var(--accent);
  font-weight: 600;
}

.channel-picker-hash {
  color: var(--muted);
  font-weight: 700;
}

.channel-picker-empty {
  margin: 0;
  padding: 1rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

.mention-toolbar {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.mention-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.mention-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.mention-chip {
  border: 1px solid rgba(88, 101, 242, 0.45);
  background: rgba(88, 101, 242, 0.18);
  color: #c9cdff;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.mention-pill {
  display: inline-block;
  background: rgba(88, 101, 242, 0.35);
  color: #dee0ff;
  border-radius: 4px;
  padding: 0 0.3rem;
  font-weight: 600;
}

.content-composer {
  position: relative;
}

.content-composer textarea {
  margin-top: 0.35rem;
}

.at-menu {
  position: absolute;
  z-index: 100;
  left: 0;
  right: 0;
  bottom: calc(100% + 0.35rem);
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0f1c26;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  padding: 0.35rem;
  animation: rise 0.18s ease both;
}

.at-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  padding: 0.65rem 0.75rem;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.at-menu-item:hover,
.at-menu-item.is-active {
  background: rgba(88, 101, 242, 0.18);
}

.at-menu-swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: #5865f2;
  flex-shrink: 0;
}

.at-menu-name {
  font-weight: 600;
}

.at-menu-meta {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
}

.at-menu-empty {
  margin: 0;
  padding: 0.85rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.15);
  }
}

@media (max-width: 980px) {
  .announce-grid {
    grid-template-columns: 1fr;
  }

  .announce-preview-wrap {
    position: static;
  }

  .field-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .shell-panel {
    grid-template-columns: 1fr;
  }

  .panel-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .live {
    position: static;
    order: -1;
  }

  .fields {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

  .whitelist-add {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}
