:root {
  /* Déclinaison claire de la DA FafaProduction (rouge #E10600, chrome #C8CCD4) */
  --ink: #0e0e12;
  --muted: #6b6f80;
  --line: rgba(225, 6, 0, 0.16);
  --paper: #f2f2f4;
  --card: #f7f7f9;
  --beige: #e8e8ec;
  --brown: #E10600;
  --brown-2: #9B0000;
  --gold: #C8CCD4;
  --green: #1f8a4c;
  --danger: #c4473a;
  --shadow: 0 12px 30px rgba(6, 6, 15, 0.08);
  --shadow-soft: 0 1px 0 rgba(255, 255, 255, 0.55) inset;
  --serif: "DM Sans", "Segoe UI", sans-serif;
  --sans: "DM Sans", "Segoe UI", sans-serif;
  --radius: 16px;
  --radius-sm: 12px;
  --scroll: rgba(225, 6, 0, 0.35);
  --scroll-hover: rgba(255, 45, 45, 0.7);
  --focus: 0 0 0 3px rgba(225, 6, 0, 0.22);
  --field: #ffffff;
  --field-2: #f0f0f3;
  --chip: rgba(225, 6, 0, 0.08);
  --hover-wash: rgba(225, 6, 0, 0.08);
  --solid: #E10600;
  --solid-text: #ffffff;
  --check-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round' d='M3.6 8.15 6.45 11 12.4 4.85'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html { color-scheme: light; }
html:not([data-theme="light"]) { color-scheme: dark; }

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--scroll);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--scroll-hover); }
*::-webkit-scrollbar-corner { background: transparent; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px 1fr;
  background:
    radial-gradient(820px 380px at 100% 0%, rgba(225, 6, 0, 0.07), transparent 55%),
    radial-gradient(640px 340px at 0% 100%, rgba(28, 32, 48, 0.04), transparent 50%),
    var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

aside {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 20px 16px 18px;
  background: rgba(245, 245, 247, 0.94);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(8px);
}

.back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
  box-shadow: none;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.back:hover {
  background: var(--beige);
  border-color: #c4cada;
}

/* —— Accueil —— */
body.home {
  display: block;
  min-height: 100vh;
  background: var(--paper);
  position: relative;
}
.home-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(980px 460px at 18% -8%, rgba(225, 6, 0, 0.14), transparent 58%),
    radial-gradient(820px 420px at 92% 12%, rgba(139, 132, 212, 0.1), transparent 55%),
    radial-gradient(700px 380px at 70% 100%, rgba(28, 32, 48, 0.05), transparent 52%),
    var(--paper);
}
.home-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: radial-gradient(rgba(28, 32, 48, 0.045) 0.7px, transparent 0.7px);
  background-size: 18px 18px;
  mask-image: linear-gradient(180deg, #000 20%, transparent 90%);
}
.home-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 28px 8px;
}
.home-bar-brand,
.home-session { flex: 0 0 auto; max-width: 100%; }
.home-bar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
}
.home-logo--img {
  object-fit: cover;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.home-logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--brown);
  color: #f4f2ff;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(225, 6, 0, 0.25);
}
.home-session {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}
.server-switch {
  position: relative;
  flex: 0 0 auto;
}
.server-switch[hidden] { display: none !important; }
.server-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 176px;
  max-width: 240px;
  height: 38px;
  padding: 0 12px 0 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}
.server-switch-btn:hover { background: var(--chip); }
.server-switch.open .server-switch-btn {
  border-color: rgba(225, 6, 0, 0.45);
  box-shadow: var(--focus);
}
.server-switch-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 700;
  text-align: left;
}
.server-switch-caret {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.15s ease;
}
.server-switch.open .server-switch-caret {
  transform: rotate(225deg) translateY(-1px);
}
.server-switch-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  width: 260px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.server-switch-panel[hidden] { display: none !important; }
.server-switch-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.server-switch-item:hover {
  background: var(--hover-wash);
  border-color: var(--line);
}
.server-switch-item.on {
  background: rgba(225, 6, 0, 0.14);
  border-color: rgba(225, 6, 0, 0.28);
}
.server-switch-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #3a4154;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.server-switch-mark[data-tone="red"] { background: linear-gradient(160deg, #ff4d3a, #9b0000); }
.server-switch-mark[data-tone="violet"] { background: linear-gradient(160deg, #c084fc, #6d28d9); }
.server-switch-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}
.server-switch-copy strong {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.25;
}
.server-switch-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.home-wrap {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 28px 64px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  animation: rise 0.55s ease both;
}
.home [hidden] { display: none !important; }
.home-hero { display: block; }
.home-hero-copy { min-width: 0; }
.home-mark {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brown-2);
}
.home h1 {
  margin: 0;
  max-width: 16ch;
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.home-lead {
  margin: 12px 0 0;
  max-width: 38ch;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}
.home-resume {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.home-resume small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.home-resume::after {
  content: "→";
  color: var(--brown-2);
  font-size: 16px;
}
.home-resume:hover {
  background: var(--beige);
  border-color: rgba(225, 6, 0, 0.35);
  transform: translateY(-1px);
}
.home-services {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 14px;
  margin-top: 22px;
  padding: 10px 12px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  min-width: 0;
}
.home-services-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}
.home-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.home-services.is-ok {
  width: fit-content;
  grid-template-columns: auto;
  padding-right: 16px;
}
.home-services.is-ok .home-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 138, 76, 0.16);
}
.home-services.is-bad .home-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(196, 71, 58, 0.16);
}
.home-health {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  min-width: 0;
}
.home-pill {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--muted);
}
.home-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: block;
}
.home-pill.ok {
  background: #e3f3ea;
  border-color: #b7d4c2;
  color: #216344;
}
.home-pill.bad {
  background: #fff1f0;
  border-color: #efc2bf;
  color: #8b3a36;
}
.home-section { margin-top: 34px; }
.home-section-head {
  display: grid;
  gap: 4px;
}
.home-section-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brown-2);
}
.home-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.4;
}
.apps {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}
.app {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  flex: 1 1 280px;
  min-width: min(100%, 280px);
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px 14px;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.app:nth-child(1) { animation: rise 0.5s ease 0.05s both; }
.app:nth-child(2) { animation: rise 0.5s ease 0.1s both; }
.app:nth-child(3) { animation: rise 0.5s ease 0.15s both; }
.app:nth-child(4) { animation: rise 0.5s ease 0.2s both; }
.app:hover {
  background: var(--beige);
  border-color: rgba(225, 6, 0, 0.28);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.app:hover .app-go { transform: translateX(3px); color: var(--brown-2); }
.app-ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(225, 6, 0, 0.12);
  color: var(--brown-2);
}
.app-ico svg { width: 22px; height: 22px; }
.app-copy { min-width: 0; }
.app strong {
  display: block;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.app-copy > span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.app-go {
  flex: none;
  color: var(--muted);
  font-size: 18px;
  font-weight: 600;
  transition: transform 0.18s ease, color 0.18s ease;
}
.home-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 28px;
  color: var(--muted);
  font-size: 12.5px;
}
.home-foot-dot { opacity: 0.5; }
@media (max-width: 720px) {
  .home-services.is-bad {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    width: auto;
  }
  .home-services.is-bad .home-health { width: 100%; }
}
@media (max-width: 640px) {
  .home-bar { padding-left: 18px; padding-right: 18px; }
  .home-wrap { padding-left: 18px; padding-right: 18px; }
  .home-session { width: 100%; justify-content: flex-start; }
  .home-foot { flex-direction: column; align-items: flex-start; gap: 4px; }
  .home-foot-dot { display: none; }
}

/* â€”â€” Staff / Discord â€”â€” */
body.staff-page { display: block; }
.board-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
}
.staff-split { margin-top: 18px; }
.staff-split .people,
.staff-split .feed {
  max-height: 280px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.staff-authz { margin-top: 18px; }
.staff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 14px;
}
.staff-col-head h3 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-weight: 550;
  font-size: 22px;
}
.staff-col-head p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.staff-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--beige);
}
.staff-form select,
.staff-form input {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.staff-form .nice-select { min-width: 0; }
.staff-form > .do { grid-column: 1 / -1; }

.staff-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.staff-list > .empty {
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--beige);
}
.staff-row {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.staff-row.open {
  border-color: rgba(225, 6, 0, 0.4);
  background: var(--beige);
}
.staff-row-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 14px;
}
.staff-row-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--d-purple-soft, #d7ebff);
  color: var(--brown-2);
  font-weight: 700;
  font-size: 16px;
}
.staff-row-body { min-width: 0; }
.staff-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.staff-row-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.staff-row-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.staff-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.staff-btn {
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.staff-btn:hover {
  background: var(--field-2);
  border-color: rgba(225, 6, 0, 0.35);
}
.staff-btn.on {
  background: var(--brown);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(225, 6, 0, 0.22);
}
.staff-btn.on:hover {
  background: #9B0000;
}
.staff-btn.soft {
  background: rgba(225, 6, 0, 0.12);
  border-color: transparent;
  color: var(--brown-2);
}
.staff-btn.soft:hover {
  background: rgba(225, 6, 0, 0.2);
}
.staff-btn.danger {
  color: #ff8f7a;
  background: rgba(255, 107, 107, 0.12);
  border-color: transparent;
}
.staff-btn.danger:hover {
  background: rgba(255, 107, 107, 0.22);
}
.staff-row .rights-editor {
  border-top: 1px solid var(--line);
  background: var(--beige);
}
@media (max-width: 720px) {
  .staff-row-card {
    grid-template-columns: auto 1fr;
  }
  .staff-row-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }
  .staff-row-actions .staff-btn { flex: 1; }
}

.rule-list, .people, .feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  overflow: hidden;
}
.rule, .person, .feed-line, .guild {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  transition: background 0.15s ease;
  min-width: 0;
}
.rule:last-child, .person:last-child, .feed-line:last-child, .guild:last-child {
  border-bottom: 0;
}
.rule:hover, .person:hover, .feed-line:hover, .guild:hover {
  background: var(--hover-wash);
}
.rule-avatar, .person-fallback {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--chip);
  color: var(--brown-2);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 550;
  letter-spacing: -0.02em;
}
.rule-body, .person-body, .feed-body {
  flex: 1 1 auto;
  min-width: 0;
}
.rule-top, .person-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rule-title, .person b, .feed-line b, .guild b, .rule b {
  display: block;
  margin: 0;
  font-weight: 650;
  font-size: 14px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rule-meta, .person small, .feed-line small, .guild small, .rule small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pack-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid #d0d4e0;
  background: #e2e5ef;
  color: var(--brown-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.pack-chip.owner { background: #d7ebff; border-color: #9ec9ef; color: #9B0000; }
.pack-chip.admin { background: #d9e4f5; border-color: #b7c8e4; color: #3d5a8a; }
.pack-chip.modo { background: #dce9e1; border-color: #bdd2c4; color: #2a6b42; }
.pack-chip.member { background: #e2e5ef; border-color: #c9cede; color: #5a6174; }
.rule-actions {
  margin-left: auto;
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
}
.rule button, .rule-actions button {
  margin-left: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 12px;
  background: transparent;
  color: var(--brown);
  font-size: 12px;
  font-weight: 700;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.rule button:hover, .rule-actions button:hover {
  background: var(--hover-wash);
  border-color: rgba(225, 6, 0, 0.35);
}
.person img, .guild img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--beige);
}
.feed-line small:first-child {
  flex: 0 0 78px;
  min-width: 78px;
  margin-top: 0;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 157, 87, 0.15);
  flex: 0 0 auto;
}
.person-actions {
  flex: 0 0 auto;
  margin-left: auto;
}
.person-actions .staff-btn {
  padding: 6px 11px;
  font-size: 11px;
}
.pack-note {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--beige);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}
.empty {
  margin: 0;
  padding: 16px 8px;
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
  line-height: 1.45;
  border: 0;
  background: transparent;
}
.rule-list > .empty,
.people > .empty,
.feed > .empty,
.staff-list > .empty {
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 22px 16px;
}
.rule-card {
  border-bottom: 1px solid var(--line);
}
.rule-card:last-child { border-bottom: 0; }
.rule-card .rule { border-bottom: 0; }
.rule-card.open {
  background: linear-gradient(180deg, #e9ebf3, #e2e5ef);
}
.rights-editor {
  padding: 12px 12px 14px;
  border-top: 1px solid var(--line);
  background: #e2e5ef;
}
.rights-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  justify-content: space-between;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.rights-toolbar .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}
.rights-toolbar .field span {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.rights-toolbar select {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #e9ebf3;
}
.rights-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rights-toolbar-actions .staff-btn {
  min-height: 34px;
}
.rights-group {
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.rights-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.rights-group-head h4 {
  margin: 0;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 650;
}
.rights-group-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
}
.rights-count {
  flex: 0 0 auto;
  min-width: 38px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #dde1ec;
  color: var(--brown-2);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.rights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 6px;
}
.rights-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 5px;
}
.rights-check {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--field);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
  min-width: 0;
}
.rights-check:hover {
  background: var(--field-2);
}
.rights-check.on {
  background: rgba(225, 6, 0, 0.16);
  border-color: rgba(225, 6, 0, 0.28);
}
.rights-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.rights-mark {
  position: relative;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  border-radius: 5px;
  border: 1.5px solid rgba(148, 163, 184, 0.45);
  background: var(--beige);
}
.rights-check.on .rights-mark {
  border-color: var(--brown-2);
  background: var(--brown-2);
}
.rights-check.on .rights-mark::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 3.5px;
  height: 7px;
  border: solid #f4f2ff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.rights-check-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}
.rights-check-text strong {
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rights-check-text small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
}
.rights-check.nested {
  background: #d8dce8;
}
.rights-check.nested.on {
  background: rgba(225, 6, 0, 0.14);
}
.scope-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 8px;
}
.scope-col {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #e7e9f1;
}
.scope-col h5 {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.scope-tree-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.scope-node {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.scope-children {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 4px;
  margin-left: 10px;
  padding-left: 10px;
  border-left: 2px solid #c9cfde;
}
.scope-mod-groups {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.scope-mod-title {
  margin: 0 0 4px 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.rights-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.rights-actions .do {
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(225, 6, 0, 0.22);
}
.rights-readonly {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}
@media (max-width: 980px) {
  .scope-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .rights-grid,
  .rights-grid.compact {
    grid-template-columns: 1fr 1fr;
  }
}

body.discord-page .aside-mark {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 550;
}
.guild-pick {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.guild-pick > span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.guild-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.guild-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.guild-option:hover {
  background: #e9ebf3;
  border-color: #c4cada;
  transform: translateY(-1px);
}
.guild-option.on {
  background: #d7ebff;
  border-color: #9ec9ef;
}
.guild-option img,
.guild-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  flex: 0 0 auto;
}
.guild-mark {
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #d7ebff, #c5e4fa);
  color: var(--brown-2);
  font-family: var(--serif);
  font-weight: 550;
}
.guild-option-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}
.guild-option-text strong {
  font-size: 13.5px;
  font-weight: 700;
  overflow: visible;
  white-space: normal;
  word-break: break-word;
  line-height: 1.25;
}
.guild-option-text small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.guild-empty {
  margin: 0;
  padding: 12px;
  border: 1px dashed #ddd2c2;
  border-radius: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.guild-empty p { margin: 0; }
.guild-invite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--brown-2);
  color: #e9ebf3;
  font-weight: 700;
  font-size: 12.5px;
  text-decoration: none;
}
.guild-invite:hover { filter: brightness(1.05); }
.disc-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 280px);
  overflow: auto;
  padding-right: 2px;
}
.disc-group { display: flex; flex-direction: column; gap: 4px; }
.disc-group-title {
  margin: 0 0 2px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.save-msg {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
}
.save-msg.ok { background: #eaf5ee; color: #2f6b42; }
.save-msg.bad { background: #f8ece8; color: #8a4b35; }
.disc-form .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.disc-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.disc-form .field.full { grid-column: 1 / -1; }
.disc-form .field span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.disc-form input,
.disc-form select,
.disc-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  resize: vertical;
}

/* —— Formulaires : champs / selects / checkbox / radio / fichiers —— */
input:not([type]),
input[type="text"],
input[type="number"],
input[type="search"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  padding: 11px 13px;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
input:not([type]):hover,
input[type="text"]:hover,
input[type="number"]:hover,
input[type="search"]:hover,
input[type="password"]:hover,
input[type="email"]:hover,
input[type="url"]:hover,
input[type="tel"]:hover,
input[type="date"]:hover,
input[type="time"]:hover,
input[type="datetime-local"]:hover,
textarea:hover {
  border-color: rgba(225, 6, 0, 0.35);
}
input:not([type]):focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
textarea:focus {
  outline: none;
  border-color: rgba(225, 6, 0, 0.55);
  background: var(--field-2);
  box-shadow: var(--focus);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  font-weight: 500;
  opacity: 0.9;
}
input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

select:not(.nice-select-native) {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background-color: var(--field);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--brown-2) 50%),
    linear-gradient(135deg, var(--brown-2) 50%, transparent 50%),
    linear-gradient(180deg, transparent, transparent);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px),
    0 0;
  background-size: 5px 5px, 5px 5px, auto;
  background-repeat: no-repeat;
  padding: 10px 36px 10px 13px;
  font-weight: 650;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
select:not(.nice-select-native):hover {
  border-color: rgba(225, 6, 0, 0.4);
  background-color: var(--field-2);
}
select:not(.nice-select-native):focus {
  outline: none;
  border-color: rgba(225, 6, 0, 0.55);
  box-shadow: var(--focus);
}
select:not(.nice-select-native) option {
  background: var(--field);
  color: var(--ink);
}

input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 16px;
  border: 1.5px solid rgba(92, 99, 128, 0.42);
  background-color: var(--field);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
  box-shadow: none;
  vertical-align: middle;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="checkbox"] { border-radius: 4px; }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:hover,
input[type="radio"]:hover {
  border-color: var(--brown);
}
input[type="checkbox"]:checked,
input[type="radio"]:checked {
  border-color: var(--brown);
  background-color: var(--brown);
}
input[type="checkbox"]:checked {
  background-image: var(--check-icon);
}
input[type="radio"]:checked {
  background-image: radial-gradient(circle at center, #ffffff 0 2.5px, transparent 2.75px);
}
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

input[type="file"] {
  width: 100%;
  border: 1px dashed rgba(225, 6, 0, 0.35);
  border-radius: 12px;
  background:
    linear-gradient(180deg, var(--chip), transparent 70%),
    var(--field);
  color: var(--muted);
  padding: 12px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
input[type="file"]:hover {
  border-color: var(--brown);
  border-style: solid;
  color: var(--ink);
  background: var(--chip);
}
input[type="file"]:focus {
  outline: none;
  box-shadow: var(--focus);
  border-color: rgba(225, 6, 0, 0.55);
}
input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
  margin-right: 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--solid);
  color: var(--solid-text);
  padding: 8px 12px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
input[type="file"]::file-selector-button:hover,
input[type="file"]::-webkit-file-upload-button:hover {
  background: var(--brown-2);
  border-color: transparent;
}

label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  cursor: pointer;
  font-weight: 650;
  color: var(--ink);
}

/* Custom select lists */
.nice-select {
  position: relative;
  width: 100%;
  min-width: 0;
}
.nice-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip: rect(0, 0, 0, 0);
}
.nice-select-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  font-weight: 650;
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.nice-select-trigger:hover {
  background: var(--chip);
  border-color: var(--line);
}
.nice-select.open .nice-select-trigger {
  border-color: #9ec9ef;
  background: #d7ebff;
  box-shadow: var(--focus);
}
.nice-select-trigger-mark {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #d7ebff, #c5e4fa);
  color: var(--brown-2);
  font-size: 12px;
  font-weight: 700;
}
.nice-select-trigger.empty .nice-select-label {
  color: var(--muted);
  font-weight: 600;
}
.nice-select-label {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.nice-select-caret {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid var(--brown-2);
  border-bottom: 2px solid var(--brown-2);
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.7;
  transition: transform 0.15s ease;
}
.nice-select.open .nice-select-caret {
  transform: rotate(225deg) translateY(-1px);
}
.nice-select-panel {
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--field-2);
  box-shadow: 0 18px 42px rgba(28, 32, 48, 0.16);
  max-height: min(380px, 60vh);
  overflow: hidden;
  box-sizing: border-box;
}
.nice-select-panel[hidden] { display: none !important; }
.nice-select-panel.is-open {
  position: fixed;
}
.nice-select-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--chip);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.nice-select-search-wrap:focus-within {
  background: var(--field);
  border-color: #9ec9ef;
  box-shadow: var(--focus);
}
.nice-select-search-ico {
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  opacity: 0.8;
}
.nice-select-search {
  width: 100%;
  border: 0 !important;
  outline: none;
  background: transparent !important;
  box-shadow: none !important;
  padding: 10px 0;
  font-weight: 600;
  font-size: 13.5px;
}
.nice-select-search::placeholder { color: #8a91a4; font-weight: 500; }
.nice-select-search::-webkit-search-cancel-button { cursor: pointer; }
.nice-select-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 280px;
  padding: 2px 4px 2px 2px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll) transparent;
}
.nice-select-list::-webkit-scrollbar { width: 6px; }
.nice-select-list::-webkit-scrollbar-track { background: transparent; }
.nice-select-list::-webkit-scrollbar-thumb {
  background: var(--scroll);
  border-radius: 999px;
}
.nice-select-list::-webkit-scrollbar-thumb:hover { background: var(--scroll-hover); }
.nice-select-sep {
  height: 1px;
  margin: 6px 8px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.nice-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  font-weight: 650;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.nice-select-option:hover {
  background: var(--hover-wash);
  border-color: var(--line);
}
.nice-select-option.on {
  background: rgba(225, 6, 0, 0.16);
  border-color: rgba(225, 6, 0, 0.28);
  color: var(--brown-2);
}
.nice-select-option.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.nice-select-mark {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--chip);
  color: var(--brown-2);
  font-size: 13px;
  font-weight: 700;
}
.nice-select-mark[data-kind="channel"] { background: #ebe7fb; color: #5a4bd1; }
.nice-select-mark[data-kind="voice"] { background: #e5f4ea; color: #2f7a49; }
.nice-select-mark[data-kind="category"] { background: #e8ebf8; color: #9B0000; }
.nice-select-mark[data-kind="none"] { background: #ececef; color: #7a7d88; }
.nice-select-trigger-mark[data-kind="channel"] { background: #ebe7fb; color: #5a4bd1; }
.nice-select-trigger-mark[data-kind="voice"] { background: #e5f4ea; color: #2f7a49; }
.nice-select-trigger-mark[data-kind="category"] { background: #e8ebf8; color: #9B0000; }
.nice-select-trigger-mark[data-kind="none"] { background: #ececef; color: #7a7d88; }
.nice-select-option-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1 1 auto;
}
.nice-select-option-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 700;
}
.nice-select-option-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.nice-select-check {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  opacity: 0;
  position: relative;
}
.nice-select-option.on .nice-select-check {
  opacity: 1;
}
.nice-select-option.on .nice-select-check::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid var(--brown-2);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.nice-select-empty {
  margin: 0;
  padding: 22px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.media-tools .nice-select,
.gx-toolbar .nice-select {
  min-width: 150px;
  width: auto;
  flex: 0 1 auto;
}
.staff-form .nice-select,
.rights-toolbar .nice-select {
  min-width: 140px;
}
.pair-row .nice-select,
.ticket-btn-row .nice-select,
.social-row .nice-select {
  width: 100%;
}
.disc-form .check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #e9ebf3;
  font-weight: 650;
}
.disc-form .check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}
.disc-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}
.disc-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 8px;
}
.disc-list-block h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 550;
}
.pair-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.pair-row { display: grid; grid-template-columns: 1fr 120px; gap: 8px; }
.disc-status {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #e9ebf3;
  font-size: 13px;
  font-weight: 650;
  color: var(--brown-2);
}
.disc-status.ok { background: #eaf5ee; color: #2f6b42; border-color: #c9dccf; }
.disc-status.bad { background: #f8ece8; color: #8a4b35; border-color: #e5cfc6; }
.ticket-btn-row {
  display: grid;
  grid-template-columns: 1.2fr 80px 110px 1fr;
  gap: 8px;
}
.ticket-btn-row textarea {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #e9ebf3;
  resize: vertical;
}
.social-row {
  display: grid;
  grid-template-columns: 110px 1fr 1fr 1.2fr;
  gap: 8px;
}
.social-row input,
.social-row select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #e9ebf3;
}
.pair-row.react-row { grid-template-columns: 120px 1fr; }
@media (max-width: 900px) {
  .social-row, .ticket-btn-row { grid-template-columns: 1fr; }
}
.ticket-btn-row input,
.ticket-btn-row select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #e9ebf3;
}
.ghost {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 650;
  color: var(--brown-2);
}
@media (max-width: 900px) {
  .disc-form .form-grid,
  .disc-stats-grid,
  .disc-form .check-grid { grid-template-columns: 1fr; }
}
.disc-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--ink);
  font-weight: 650;
}
.disc-link-title { font-size: 14px; }
.disc-link-note {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 550;
  line-height: 1.3;
}
.disc-link:hover { background: var(--beige); }
.disc-link.on {
  background: var(--card);
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
}
.disc-link.on .disc-link-note { color: var(--brown-2); }
.guild-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.paper-card { margin-top: 8px; }
.plain-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
}
@media (max-width: 900px) {
  .staff-grid, .staff-form { grid-template-columns: 1fr; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.spaces {
  display: flex;
  gap: 4px;
  margin: 18px 0 14px;
  background: var(--chip);
  border-radius: 999px;
  padding: 4px;
}
.spaces button {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 8px 10px;
  font-weight: 650;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.spaces button.on {
  background: var(--solid);
  color: var(--solid-text);
  box-shadow: 0 4px 12px rgba(28, 25, 22, 0.16);
}

.side-progress .count { margin: 0 0 6px; color: var(--muted); font-size: 12px; }
.bar { height: 5px; background: var(--chip); border-radius: 99px; overflow: hidden; }
.bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold), #d4b57a);
  transition: width 0.25s ease;
}

.search { position: relative; display: block; margin: 14px 0 8px; }
.search input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--field);
  border-radius: var(--radius-sm);
  padding: 11px 68px 11px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search input:focus {
  outline: none;
  border-color: #c9b089;
  box-shadow: 0 0 0 3px rgba(196, 163, 106, 0.22);
}
.search kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 2px 7px;
  font-size: 11px;
  color: var(--muted);
  background: var(--field-2);
}

nav { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 10px 10px;
  color: var(--ink);
  cursor: grab;
  transition: background 0.15s ease;
}
.nav-btn:hover { background: rgba(225, 6, 0, 0.7); }
.nav-btn.dragging { opacity: 0.4; }
.nav-btn.over-top { box-shadow: inset 0 2px 0 var(--brown); }
.nav-btn.over-bottom { box-shadow: inset 0 -2px 0 var(--brown); }
.nav-btn svg { flex: none; color: #9a9186; }
.nav-btn span { flex: 1; }
.nav-btn .pill { flex: none; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.nav-btn .drop {
  flex: none;
  border: 0;
  background: transparent;
  color: #b3aa9e;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}
.nav-btn .drop:hover { color: #9b2c2c; }
.nav-btn.active {
  background: var(--beige);
  box-shadow: inset 0 0 0 1px #e4d8c4;
}
.nav-btn.active svg { color: var(--brown); }
.nav-btn .rename {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px 6px;
  background: var(--field);
}

.new-folder { margin-top: auto; padding-top: 16px; }
.new-folder input { display: none; }
.new-folder button, #new-task button, .do, .menu button { cursor: pointer; }
.new-folder button {
  width: 100%;
  border: 0;
  background: var(--brown);
  color: white;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-weight: 700;
  transition: background 0.15s ease, transform 0.15s ease;
}
.new-folder button:hover { background: var(--brown-2); }
.new-folder:focus-within input, .new-folder.open input {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--field);
}

/* â€”â€” Contenu â€”â€” */
main {
  padding: 28px 40px 56px;
  overflow: auto;
  height: 100vh;
  animation: rise 0.4s ease both;
}
#error {
  background: #fdecea;
  border: 1px solid #f0cfcf;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 0 0 12px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.crumb { margin: 0; color: var(--muted); font-size: 13px; }
.crumb a {
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.crumb a:hover { color: var(--brown); border-bottom-color: var(--gold); }

h1 {
  margin: 16px 0 6px;
  font-family: var(--serif);
  font-size: clamp(36px, 4vw, 50px);
  font-weight: 550;
  letter-spacing: -0.03em;
  line-height: 1.08;
}
.lead {
  margin: 0 0 20px;
  color: var(--muted);
  max-width: 52ch;
}

.stats {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow-soft);
}
.stat i {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--beige);
  display: grid;
  place-items: center;
  color: var(--brown);
  font-style: normal;
  flex: none;
}
.stat b {
  display: block;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.stat small { color: var(--muted); }
.stat .track {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.stat .track span {
  display: block;
  height: 4px;
  border-radius: 99px;
  background: #efeae2;
  position: relative;
  overflow: hidden;
}
.stat .track span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--p, 0%);
  background: var(--gold);
}
.stat .track em { font-style: normal; color: var(--muted); font-size: 12px; }

.hero {
  display: grid;
  grid-template-columns: 32px 22px minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 14px 16px 16px;
  margin-bottom: 16px;
}
.hero-side {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  max-width: 280px;
}
.hero .ai-toolbar { display: contents; }
.hero .ai-progress {
  flex: 1 0 100%;
  width: auto;
  min-width: 0;
  max-width: none;
  justify-content: flex-end;
}
.hero .ai-progress-track { height: 6px; max-width: 160px; }
.hero .ai-cta.detail,
.hero .do,
.hero .ai-cta.go {
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
  box-shadow: none;
  white-space: nowrap;
}
.hero .ai-cta.detail {
  order: 2;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.hero .do { order: 3; }
.hero .more { order: 4; }
.hero .ai-progress,
.hero .ai-live,
.hero .ai-cta:not(.detail) { order: 1; }
.hero .more {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--field);
}
.hero .title { font-size: 17px; letter-spacing: -0.02em; }
.hero .task-badges { margin-top: 8px; }
.hero .detail { margin-top: 6px; line-height: 1.45; }
.hero .by { margin-top: 8px; font-size: 12px; }
.hero .num, .row .num {
  color: #b3aa9e;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.hero .title, .row .title { font-weight: 700; }
.hero, .row { align-items: start; }
.hero .ai-toolbar, .row .ai-toolbar,
.hero .do, .hero .more, .row .more { align-self: center; }
.hero .task-main, .row .task-main { min-width: 0; cursor: pointer; }
.hero .detail, .row .detail {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
  white-space: pre-wrap;
}
.hero .detail.notes, .row .detail.notes {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
  color: #6f675c;
}
.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.thumb {
  position: relative;
  width: 64px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #efeae2;
  cursor: zoom-in;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb-more {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(28, 25, 22, 0.45);
  color: white;
  font-size: 12px;
  font-weight: 700;
}
button.title {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-weight: 700;
  text-align: left;
  color: inherit;
}
button.title:hover { color: var(--brown-2); }
.by { color: var(--muted); font-size: 12px; margin-top: 3px; }
.row.over-top, .hero.over-top { box-shadow: inset 0 2px 0 var(--brown); }
.row.over-bottom, .hero.over-bottom { box-shadow: inset 0 -2px 0 var(--brown); }
.row.dragging, .hero.dragging { opacity: 0.45; }

.me {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  box-shadow: var(--shadow-soft);
}
.me img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.me button {
  border: 0;
  background: rgba(225, 6, 0, 0.1);
  color: var(--brown-2);
  padding: 4px 9px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  transition: background 0.15s ease;
}
.me button:hover { background: rgba(225, 6, 0, 0.18); }

/* —— Connexion —— */
.gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(225, 6, 0, 0.14), transparent 55%),
    rgba(228, 230, 238, 0.92);
  backdrop-filter: blur(10px);
}
.gate[hidden] { display: none; }
.gate-card {
  width: min(440px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 34px 28px;
  text-align: center;
  box-shadow: var(--shadow);
  animation: rise 0.4s ease both;
}
.gate-card h1 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 650;
  letter-spacing: -0.03em;
}
.gate-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.gate-card .do {
  display: block;
  width: fit-content;
  margin: 20px auto 0;
  text-decoration: none;
  border-radius: 12px;
  padding: 11px 18px;
  box-shadow: 0 6px 16px rgba(225, 6, 0, 0.24);
  transition: background 0.15s ease, transform 0.15s ease;
}
.gate-card .do:hover {
  background: var(--brown-2);
  transform: translateY(-1px);
}
.gate-help {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--beige);
  color: var(--ink);
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  word-break: break-all;
  text-align: left;
}
.gate-link {
  display: block;
  margin-top: 14px;
  color: var(--brown-2);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}
.gate-link:hover { text-decoration: underline; }

/* —— Fiche tâche —— */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 10, 18, 0.58);
  backdrop-filter: blur(10px);
}
.sheet-card {
  width: min(680px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px 22px 0;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
  animation: rise 0.25s ease both;
}
.sheet-card h2 {
  margin: 0;
  font-family: var(--sans);
  font-weight: 750;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.sheet-card label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.sheet-card input:not([type="checkbox"]):not([type="file"]),
.sheet-card textarea,
.sheet-card select {
  width: 100%;
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: var(--field);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.sheet-card input:not([type="checkbox"]):not([type="file"]):focus,
.sheet-card textarea:focus,
.sheet-card select:focus {
  outline: none;
  border-color: rgba(225, 6, 0, 0.55);
  box-shadow: var(--focus);
}
.sheet-card textarea { min-height: 108px; resize: vertical; }
.sheet-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 18px -22px 0;
  padding: 14px 22px 16px;
  background: linear-gradient(180deg, transparent, var(--card) 22%);
  border-top: 1px solid var(--line);
}
.sheet-actions button {
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--ink);
  border-radius: 12px;
  padding: 9px 16px;
  font-weight: 650;
}
.sheet-actions button:hover {
  background: var(--field-2);
  border-color: rgba(225, 6, 0, 0.35);
}
.sheet-actions .do {
  border: 0;
  background: var(--brown);
  color: white;
  font-weight: 700;
}
.sheet-actions .do:hover {
  background: #9B0000;
}
.shots { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.shot { position: relative; }
.shot img {
  width: 148px;
  height: 100px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}
.shot button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 252, 247, 0.92);
  box-shadow: 0 2px 8px rgba(28, 25, 22, 0.12);
}
.file {
  display: inline-block;
  margin-top: 10px;
  color: var(--brown);
  font-weight: 650;
  cursor: pointer;
}
.file input { display: none; }

.do {
  border: 0;
  background: var(--brown);
  color: white;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.do:hover {
  background: #9B0000;
  box-shadow: 0 6px 16px rgba(225, 6, 0, 0.22);
}
.more, .menu button {
  border: 0;
  background: transparent;
  color: var(--muted);
}

#list {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 6px 8px 8px;
  box-shadow: var(--shadow-soft);
}
#list:empty { display: none; }

.table-head, .row {
  display: grid;
  grid-template-columns: 36px 28px 1fr auto 36px;
  gap: 12px;
  align-items: center;
}
.table-head {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 12px 10px 10px;
  font-weight: 650;
}
.row {
  padding: 14px 10px;
  border-radius: 14px;
  border-top: 0;
  transition: background 0.12s ease;
}
.row + .row { margin-top: 2px; }
.row:hover { background: var(--hover-wash); }
.row.done { opacity: 0.45; }
.row.done .title { text-decoration: line-through; }

.who { display: inline-flex; margin-left: 8px; vertical-align: middle; }
.avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu {
  position: absolute;
  z-index: 4;
  background: var(--field-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  min-width: 200px;
  box-shadow: 0 14px 36px rgba(28, 25, 22, 0.12);
}
.menu button, .menu label {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  border-radius: 9px;
}
.menu button:hover { background: var(--hover-wash); }
.menu .do {
  background: rgba(232, 163, 23, 0.18);
  color: var(--ink);
  font-weight: 750;
  margin-bottom: 4px;
}
.menu .do:hover { background: rgba(232, 163, 23, 0.28); }
.menu select, .menu input {
  width: 100%;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
}
.danger { color: #9b2c2c; }

.ask {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(28, 25, 22, 0.32);
  backdrop-filter: blur(3px);
}
.ask-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 18px 16px;
  box-shadow: 0 20px 50px rgba(28, 25, 22, 0.16);
  animation: rise 0.22s ease both;
}
.ask[hidden] { display: none !important; }
.ask-card p { margin: 0 0 16px; }
.task-create {
  width: min(520px, 100%);
  display: grid;
  gap: 12px;
}
.task-create h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.task-create label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.task-create input,
.task-create textarea,
.task-create select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
}
.task-create textarea { min-height: 96px; resize: vertical; }
.task-create-meta {
  display: grid;
  grid-template-columns: 1.1fr 1fr 88px;
  gap: 10px;
}
.task-create-hint {
  margin: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}
.task-create .ask-actions { margin-top: 4px; }
@media (max-width: 560px) {
  .task-create-meta { grid-template-columns: 1fr; }
}
.sheet-extra {
  margin-top: 16px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 10px 14px 12px;
  background: transparent;
}
.sheet-extra summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  list-style: none;
}
.sheet-extra summary::-webkit-details-marker { display: none; }
.sheet-extra[open] summary { margin-bottom: 8px; }
.sheet-extra .shots { margin-top: 8px; }
.sheet-extra .dropzone {
  margin-top: 8px;
  min-height: 56px;
  background: var(--card);
  border-color: var(--line);
  color: var(--muted);
}
.ask-actions { display: flex; justify-content: flex-end; gap: 8px; }
.ask-actions button {
  border: 1px solid var(--line);
  background: var(--field);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: var(--ink);
}
.ask-actions .do {
  border: 0;
  background: var(--brown);
  color: white;
  font-weight: 700;
}

.new-task {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(240px, 1.4fr);
  gap: 10px 12px;
  margin-top: 18px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
}
.new-task input,
.new-task select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  background: var(--field);
  font: inherit;
}
.new-task-tools {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.new-task-tools input,
.new-task-tools select {
  width: auto;
  flex: 0 0 auto;
}
.new-task input[type="date"],
.new-task input[name="dueTime"],
.new-task select {
  min-width: 120px;
}
.new-task input[name="dueTime"] { min-width: 88px; width: 88px; }
.new-task input:focus,
.new-task select:focus {
  outline: none;
  border-color: #c9b089;
  box-shadow: 0 0 0 3px rgba(196, 163, 106, 0.22);
}
.new-task-tools button {
  margin-left: auto;
}
.new-task button {
  border: 0;
  background: var(--solid);
  color: var(--solid-text);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-weight: 700;
}
.new-task-hint {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.new-task-hint b { color: var(--ink); }
.task-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.task-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: #dde1ec;
  color: var(--ink);
}
.task-badge.prio-high { background: rgba(196, 92, 92, 0.16); color: #9a3a3a; }
.task-badge.prio-low { background: #e4e7ef; color: #6a7285; }
.task-badge.due.today { background: rgba(225, 6, 0, 0.14); color: var(--brown-2); }
.task-badge.due.late { background: rgba(196, 92, 92, 0.18); color: #9a3a3a; }
.task-badge.assignee { background: rgba(61, 90, 76, 0.14); color: #2f5a45; }
.task-badge.steps { background: #e7e9f2; color: #3d4560; }
.steps { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.step-row, .step-add { display: flex; align-items: center; gap: 8px; }
.step-row input[type="checkbox"] { width: 16px; height: 16px; flex: none; }
.step-row span { flex: 1; }
.step-row.done span { text-decoration: line-through; color: var(--muted); }
.step-row button, .step-add button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.step-add input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--field);
  font: inherit;
}
.menu-label { margin: 4px 8px 2px; font-size: 12px; color: var(--muted); }
.sheet-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.sheet-meta-row select,
.sheet-meta-row input[type="date"],
.sheet-meta-row input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
}

/* â€”â€” Stats â€”â€” */
body.board { display: block; }
.board-wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 28px 80px;
  animation: rise 0.45s ease both;
}
.board-head h1 { margin: 14px 0 6px; }
.board-wrap h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 550;
  letter-spacing: -0.02em;
}
.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.figure {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 15px 13px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.figure:hover {
  transform: translateY(-2px);
  border-color: #c4cada;
  background: #e8eaf2;
}
.figure small {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}
.figure b {
  display: block;
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.figure em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  color: var(--muted);
  font-size: 13px;
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 18px 16px;
  margin-top: 14px;
  box-shadow: var(--shadow-soft);
}
.panel-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 10px;
}
.panel-top p, .before { margin: 0; color: var(--muted); font-size: 13px; }
.before { margin-top: 10px; }
.chart svg { width: 100%; height: auto; display: block; }
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}
.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
}
.swatch.work { background: var(--brown); }
.swatch.rest { background: var(--green); }
.swatch.done { background: var(--gold); border-radius: 50%; }
.records {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 36px;
  margin-top: 8px;
}
.records h3 {
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.record-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.record-line span { color: var(--muted); }
.record-line b {
  display: block;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--serif);
  font-weight: 550;
  font-size: 18px;
}
.record-line small {
  display: block;
  margin-top: 2px;
  text-align: right;
  color: var(--muted);
  font-size: 12px;
}
.split {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 16px;
  align-items: start;
}
.split .panel { margin-top: 16px; }
.rings { display: grid; gap: 16px; margin-top: 16px; }
.ring-row { display: flex; align-items: center; gap: 14px; }
.ring { width: 84px; height: 84px; flex: none; }
.ring-row b {
  display: block;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  font-family: var(--serif);
  font-weight: 550;
}
.ring-row small { color: var(--muted); }
.prog {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.prog .track {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: #efeae2;
  overflow: hidden;
  margin-top: 6px;
}
.prog .track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brown), #a77845);
  border-radius: 99px;
}
.space-name {
  margin: 14px 0 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}
.done-line {
  display: grid;
  grid-template-columns: 16px 132px 1fr;
  gap: 12px;
  align-items: start;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.done-line .dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(196, 163, 106, 0.18);
}
.done-line b { display: block; }
.done-line small, .prog small { color: var(--muted); font-size: 13px; }
.board-wrap .back { display: inline-flex; width: auto; }
.empty { color: var(--muted); margin: 12px 0 0; }

@media (max-width: 980px) {
  body { grid-template-columns: 1fr; }
  aside { position: relative; height: auto; }
  main { height: auto; padding: 22px 20px 48px; }
  body:not(.home) .apps { grid-template-columns: 1fr; }
  body:not(.home) .home-wrap { padding-top: 10vh; }
  .stats, .figures, .split, .records { grid-template-columns: 1fr; }
  .done-line { grid-template-columns: 16px 1fr; }
  .panel-top { display: block; }
  h1 { font-size: 36px; }
  .new-task { grid-template-columns: 1fr; }
  .table-head, .row {
    grid-template-columns: 28px 24px 1fr auto 36px;
  }
  .hero {
    grid-template-columns: 28px 28px 1fr;
    gap: 10px;
  }
  .hero-side {
    grid-column: 1 / -1;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

.top-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.top-actions .do {
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
}
.ghost {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--muted);
  font-weight: 650;
  font-size: 13px;
  box-shadow: var(--shadow-soft);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.ghost:hover { background: var(--beige); color: var(--ink); }
.ghost.on {
  background: var(--beige);
  border-color: #dccfba;
  color: var(--brown-2);
}
.done-title {
  margin: 14px 8px 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}
.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.sheet-status {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--brown-2);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.sheet-status.is-done {
  background: rgba(61, 190, 122, 0.16);
  color: var(--green);
}
.sheet-status.is-open {
  background: rgba(232, 163, 23, 0.16);
  color: #d4b15a;
}
.sheet-card input.sheet-title {
  width: 100%;
  margin-top: 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 6px 2px 12px;
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.03em;
  background: transparent;
  color: var(--ink);
}
.sheet-card input.sheet-title:focus {
  border-color: rgba(225, 6, 0, 0.45);
  box-shadow: none;
}
.sheet-meta { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.sheet-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  margin-top: 16px;
}
.sheet-fields label { margin-top: 0; }
.sheet-fields > .steps-label,
.sheet-fields > .sheet-meta-row { grid-column: 1 / -1; }
.sheet-fields textarea { min-height: 128px; }
.sheet-card .steps {
  margin-top: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
}
.sheet-card .step-add input {
  width: auto;
  flex: 1;
  background: var(--card);
}
.sheet-people {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sheet-people .staff-btn {
  flex: 0 1 auto;
  min-height: 36px;
  padding: 7px 12px;
}
.shot-open {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: 12px;
  overflow: hidden;
}
.shot-open img {
  width: 148px;
  height: 100px;
  object-fit: cover;
  display: block;
  background: #efeae2;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.shot-drop {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 252, 247, 0.92);
  box-shadow: 0 2px 8px rgba(28, 25, 22, 0.12);
}
.dropzone {
  display: grid;
  place-items: center;
  margin-top: 12px;
  min-height: 72px;
  border: 1.5px dashed #d5c8b2;
  border-radius: 14px;
  background: #faf6ef;
  color: var(--brown);
  font-weight: 650;
  font-size: 13px;
  text-align: center;
  padding: 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dropzone:hover, .dropzone.over {
  background: var(--beige);
  border-color: var(--brown);
}
.dropzone input { display: none; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 28px;
  background: rgba(28, 25, 22, 0.72);
  backdrop-filter: blur(4px);
}
.lightbox-card {
  grid-column: 2;
  max-width: min(960px, 100%);
  margin: 0 auto;
  text-align: center;
}
.lightbox-card img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  border-radius: 16px;
  background: #1c1916;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.lightbox-meta {
  margin: 12px 0 0;
  color: #f4efe6;
  font-size: 13px;
}
.lightbox button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 252, 247, 0.92);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: auto !important;
  height: auto !important;
  padding: 8px 14px;
  border-radius: 999px !important;
  font-size: 13px !important;
  font-weight: 700;
}
@media (max-width: 980px) {
  .sheet-fields,
  .sheet-meta-row { grid-template-columns: 1fr; }
  .lightbox { grid-template-columns: 1fr; }
  .lightbox button[data-prev], .lightbox button[data-next] {
    position: absolute;
    bottom: 24px;
  }
  .lightbox button[data-prev] { left: 24px; }
  .lightbox button[data-next] { right: 24px; }
}

/* —— Toasts —— */
.toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  min-width: 180px;
  max-width: min(320px, calc(100vw - 36px));
  padding: 11px 14px;
  border-radius: 12px;
  background: #2a3040;
  color: #f4f2ff;
  font-size: 13px;
  font-weight: 650;
  box-shadow: 0 12px 28px rgba(21, 24, 33, 0.22);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.in {
  opacity: 1;
  transform: translateY(0);
}
.toast.ok { background: #2a6b45; }
.toast.warn { background: #8a5a1f; }

/* —— Modales custom —— */
.pa-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(28, 32, 48, 0.42);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.16s ease;
}
.pa-modal.in { opacity: 1; }
.pa-modal-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 18px 16px;
  box-shadow: 0 18px 48px rgba(21, 24, 33, 0.18);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.18s ease;
}
.pa-modal.in .pa-modal-card {
  transform: translateY(0) scale(1);
}
.pa-modal-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.pa-modal-msg {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.pa-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0 4px;
}
.pa-modal-field span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.pa-modal-field input,
.pa-modal-field select {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--field);
  padding: 11px 12px;
  font-size: 14px;
  font-weight: 600;
}
.pa-modal-field input:focus,
.pa-modal-field select:focus {
  outline: none;
  border-color: #9ec9ef;
  box-shadow: var(--focus);
  background: var(--field-2);
}
.pa-modal-field .nice-select {
  width: 100%;
}
.pa-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.pa-modal-actions .do {
  min-width: 110px;
}
.pa-modal-actions .do.pa-modal-danger,
.do.pa-modal-danger {
  background: #a14b3a;
  box-shadow: 0 6px 16px rgba(161, 75, 58, 0.22);
}
.pa-modal-actions .do.pa-modal-danger:hover,
.do.pa-modal-danger:hover {
  background: #8a3f31;
}

/* —— Thème sombre : surfaces unies, accent bleu Aria, pas de lavande —— */
html:not([data-theme="light"]) {
  --ink: #e8ecf4;
  --muted: #8b93a8;
  --line: rgba(148, 163, 184, 0.16);
  --paper: #0a0c12;
  --card: #12161f;
  --beige: #171c28;
  --field: #1a2030;
  --field-2: #222838;
  --chip: rgba(225, 6, 0, 0.12);
  --hover-wash: rgba(225, 6, 0, 0.1);
  --solid: #E10600;
  --solid-text: #ffffff;
  --brown: #E10600;
  --brown-2: #3d8bff;
  --gold: #3d8bff;
  --green: #3dbe7a;
  --danger: #ff6b6b;
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
  --shadow-soft: none;
  --scroll: rgba(225, 6, 0, 0.4);
  --scroll-hover: rgba(61, 139, 255, 0.75);
  --focus: 0 0 0 3px rgba(225, 6, 0, 0.28);
}
html:not([data-theme="light"]) body {
  background:
    radial-gradient(900px 420px at 88% -10%, rgba(225, 6, 0, 0.1), transparent 55%),
    var(--paper);
}
html:not([data-theme="light"]) aside {
  background: rgba(6, 6, 15, 0.96);
}
html:not([data-theme="light"]) .home-bg {
  background:
    radial-gradient(980px 460px at 18% -8%, rgba(225, 6, 0, 0.1), transparent 58%),
    radial-gradient(700px 380px at 70% 100%, rgba(0, 0, 0, 0.18), transparent 52%),
    var(--paper);
}
html:not([data-theme="light"]) .home-bg::after {
  background-image: radial-gradient(rgba(255, 255, 255, 0.035) 0.7px, transparent 0.7px);
}
html:not([data-theme="light"]) .app {
  background: var(--card);
}
html:not([data-theme="light"]) .app:hover {
  background: #1a2233;
  border-color: rgba(61, 139, 255, 0.45);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}
html:not([data-theme="light"]) .home-services.is-ok .home-dot {
  box-shadow: 0 0 0 3px rgba(61, 190, 122, 0.18);
}
html:not([data-theme="light"]) .home-pill { background: var(--card); }
html:not([data-theme="light"]) .home-pill.ok {
  background: #163224;
  border-color: #2a5a3d;
  color: #8ed4a8;
}
html:not([data-theme="light"]) .home-pill.bad {
  background: #3a1c1a;
  border-color: #6a3530;
  color: #f0b0aa;
}
html:not([data-theme="light"]) .ghost.on {
  background: var(--brown);
  border-color: transparent;
  color: #fff;
}
html:not([data-theme="light"]) .gate,
html:not([data-theme="light"]) .sheet { background: rgba(4, 6, 12, 0.72); }
html:not([data-theme="light"]) .gate-card,
html:not([data-theme="light"]) .pa-modal-card,
html:not([data-theme="light"]) .pa-search-card,
html:not([data-theme="light"]) .ask-card,
html:not([data-theme="light"]) .sheet-card {
  background: var(--card);
  border-color: var(--line);
  color: var(--ink);
}
html:not([data-theme="light"]) .sheet-status.is-open {
  background: rgba(232, 163, 23, 0.18);
  color: #e6c56a;
}
html:not([data-theme="light"]) .sheet-extra .dropzone {
  background: var(--field);
  border-color: rgba(148, 163, 184, 0.28);
  color: var(--muted);
}
html:not([data-theme="light"]) .nice-select-trigger {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
html:not([data-theme="light"]) .nice-select.open .nice-select-trigger {
  background: rgba(225, 6, 0, 0.16);
  border-color: rgba(225, 6, 0, 0.4);
}
html:not([data-theme="light"]) .nice-select-trigger-mark {
  background: rgba(225, 6, 0, 0.18);
  color: var(--brown-2);
}
html:not([data-theme="light"]) .nice-select-panel {
  background: #0e1428;
  border-color: rgba(225, 6, 0, 0.28);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.5);
}
html:not([data-theme="light"]) .nice-select-search-wrap {
  background: rgba(225, 6, 0, 0.1);
}
html:not([data-theme="light"]) .nice-select-option:hover {
  background: rgba(255, 45, 45, 0.1);
}
html:not([data-theme="light"]) .nice-select-mark {
  background: rgba(225, 6, 0, 0.18);
}
html:not([data-theme="light"]) select:not(.nice-select-native) {
  background-color: var(--field);
}
html:not([data-theme="light"]) input[type="checkbox"],
html:not([data-theme="light"]) input[type="radio"] {
  border-color: rgba(186, 198, 220, 0.38);
  background-color: transparent;
}
html:not([data-theme="light"]) input[type="checkbox"]:hover,
html:not([data-theme="light"]) input[type="radio"]:hover {
  border-color: #3d8bff;
  background-color: rgba(225, 6, 0, 0.14);
}
html:not([data-theme="light"]) input[type="checkbox"]:checked,
html:not([data-theme="light"]) input[type="radio"]:checked {
  border-color: #0066ff;
  background-color: #0066ff;
}
html:not([data-theme="light"]) input[type="checkbox"]:checked:hover,
html:not([data-theme="light"]) input[type="radio"]:checked:hover {
  border-color: #3d8bff;
  background-color: #1a74ff;
}
html:not([data-theme="light"]) input[type="file"] {
  border-color: rgba(255, 45, 45, 0.3);
  color: var(--muted);
}
html:not([data-theme="light"]) .disc-form input,
html:not([data-theme="light"]) .disc-form select,
html:not([data-theme="light"]) .disc-form textarea {
  background: var(--field);
}
html:not([data-theme="light"]) .hero {
  background: #141a28;
  border-color: rgba(225, 6, 0, 0.22);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}
html:not([data-theme="light"]) .hero .more {
  background: #1a2030;
  border-color: rgba(148, 163, 184, 0.16);
}
html:not([data-theme="light"]) .hero .num,
html:not([data-theme="light"]) .row .num { color: var(--muted); }
html:not([data-theme="light"]) .hero .detail.notes,
html:not([data-theme="light"]) .row .detail.notes { color: var(--muted); }
html:not([data-theme="light"]) .nav-btn:hover { background: var(--hover-wash); }
html:not([data-theme="light"]) .nav-btn.active {
  background: var(--beige);
  box-shadow: inset 0 0 0 1px var(--line);
}
html:not([data-theme="light"]) .nav-btn svg { color: var(--muted); }
html:not([data-theme="light"]) .search input:focus,
html:not([data-theme="light"]) .new-task input:focus,
html:not([data-theme="light"]) .new-task select:focus {
  border-color: rgba(225, 6, 0, 0.55);
  box-shadow: var(--focus);
}
html:not([data-theme="light"]) .back:hover { border-color: #4a5268; }
html:not([data-theme="light"]) #error {
  background: #3a1c1a;
  border-color: #6a3530;
  color: #f0b0aa;
}
html:not([data-theme="light"]) .stat .track span,
html:not([data-theme="light"]) .prog .track,
html:not([data-theme="light"]) .thumb { background: var(--chip); }
html:not([data-theme="light"]) .task-badge { background: var(--chip); color: var(--ink); }
html:not([data-theme="light"]) .task-badge.ai-pending {
  background: rgba(232, 163, 23, 0.18);
  color: #f3c56b;
}
html:not([data-theme="light"]) .task-badge.ai-queued {
  background: rgba(232, 163, 23, 0.18);
  color: #e6c56a;
}
html:not([data-theme="light"]) .task-badge.ai-running,
html:not([data-theme="light"]) .task-badge.ai-review {
  background: rgba(225, 6, 0, 0.18);
  color: #8ec5ff;
}
html:not([data-theme="light"]) .cursor-bar {
  background: linear-gradient(90deg, rgba(225, 6, 0, 0.12), #101624);
  border-color: rgba(255, 45, 45, 0.28);
}
html:not([data-theme="light"]) .cursor-bar.off {
  background: #1a160e;
  border-color: rgba(232, 163, 23, 0.4);
}
html:not([data-theme="light"]) .ai-cta:not(.go):not(.detail) {
  background: #f0b429;
  color: #16120a;
}
html:not([data-theme="light"]) .new-task-hint b { color: var(--ink); }
html:not([data-theme="light"]) .task-badge.prio-high { background: rgba(224, 122, 104, 0.16); color: #f0b0aa; }
html:not([data-theme="light"]) .task-badge.prio-low { background: var(--chip); color: var(--muted); }
html:not([data-theme="light"]) .task-badge.due.today { background: rgba(225, 6, 0, 0.16); color: var(--brown-2); }
html:not([data-theme="light"]) .logs-search { background: transparent; }
.wl-bar .logs-search {
  flex: 1 1 220px;
  max-width: 280px;
  min-width: 180px;
  background: transparent;
}
.wl-bar .logs-search input {
  appearance: none;
  -webkit-appearance: none;
  height: 36px;
  margin: 0;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.42);
  background: var(--field);
  box-shadow: none;
  padding: 0 14px 0 32px;
  font-weight: 600;
}
.wl-bar .logs-search input::-webkit-search-decoration,
.wl-bar .logs-search input::-webkit-search-results-button,
.wl-bar .logs-search input::-webkit-search-results-decoration {
  display: none;
}
.wl-bar .logs-search input:hover {
  border-color: rgba(225, 6, 0, 0.55);
}
.wl-bar .logs-search input:focus {
  border-color: #0066ff;
  background: var(--field-2);
  box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.22);
}
html:not([data-theme="light"]) .wl-bar .logs-search,
html:not([data-theme="light"]) .wl-bar .logs-search input {
  background: #12161f;
  box-shadow: none;
}
html:not([data-theme="light"]) .wl-bar .logs-search {
  background: transparent;
}
html:not([data-theme="light"]) .wl-bar .logs-search input {
  border-color: rgba(186, 198, 220, 0.42);
}
html:not([data-theme="light"]) .wl-bar .logs-search input:hover {
  border-color: rgba(61, 139, 255, 0.85);
  background: #171d2b;
}
html:not([data-theme="light"]) .wl-bar .logs-search input:focus {
  border-color: #3d8bff;
  background: #171d2b;
  box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.28);
}
html:not([data-theme="light"]) .disc-form .check-row {
  background: var(--field);
  border-color: rgba(186, 198, 220, 0.34);
  color: var(--ink);
}
html:not([data-theme="light"]) .disc-form .check-row:hover {
  border-color: rgba(61, 139, 255, 0.7);
}
html:not([data-theme="light"]) .disc-form .check-row:has(input:checked) {
  background: rgba(225, 6, 0, 0.16);
  border-color: rgba(61, 139, 255, 0.85);
}
html:not([data-theme="light"]) .logs-chip.is-on {
  background: var(--solid);
  color: var(--solid-text);
}
html:not([data-theme="light"]) input::placeholder,
html:not([data-theme="light"]) textarea::placeholder {
  color: #6f778c;
}
html:not([data-theme="light"]) input[type="date"],
html:not([data-theme="light"]) input[type="time"] {
  color-scheme: dark;
}
input[type="date"],
input[type="time"] {
  min-width: 168px;
  min-height: 42px;
}
.gx-toolbar .field:has(input[type="date"]),
.gx-toolbar .field:has(input[type="time"]),
.pub-when .field {
  flex: 1.4 1 180px;
  min-width: 180px;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.85;
  margin-inline-start: 8px;
}
html:not([data-theme="light"]) input[type="date"]::-webkit-calendar-picker-indicator,
html:not([data-theme="light"]) input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.7);
}
.fr-date {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}
.fr-date input[type="date"],
.fr-date input[type="time"] {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0.02;
  cursor: pointer;
  color: transparent;
  background: transparent;
}
.fr-date input[type="date"]::-webkit-calendar-picker-indicator,
.fr-date input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  pointer-events: none;
}
.fr-date-face {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  font-weight: 650;
  pointer-events: none;
}
.fr-date-face.is-empty {
  color: var(--muted);
  font-weight: 500;
}
.fr-date:focus-within .fr-date-face {
  border-color: #3d8bff;
  box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.28);
}
.fr-date-ico {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  background: currentColor;
  opacity: 0.75;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 2h2v2h6V2h2v2h3v18H4V4h3V2zm11 8H6v10h12V10z'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 2h2v2h6V2h2v2h3v18H4V4h3V2zm11 8H6v10h12V10z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.fr-date:has(input[type="time"]) .fr-date-ico {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm1 5v5.2l3.2 1.9-.9 1.5L11 13V7h2z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm1 5v5.2l3.2 1.9-.9 1.5L11 13V7h2z'/%3E%3C/svg%3E");
}
html:not([data-theme="light"]) .pack-chip {
  background: var(--chip);
  border-color: rgba(148, 163, 184, 0.28);
  color: var(--ink);
}
html:not([data-theme="light"]) .pack-chip.owner {
  background: rgba(225, 6, 0, 0.2);
  border-color: rgba(61, 139, 255, 0.5);
  color: #9fd8ff;
}
html:not([data-theme="light"]) .pack-chip.admin {
  background: rgba(225, 6, 0, 0.14);
  border-color: rgba(61, 139, 255, 0.35);
  color: #b9d4ff;
}
html:not([data-theme="light"]) .pack-chip.modo {
  background: #163224;
  border-color: #2a5a3d;
  color: #8ed4a8;
}
html:not([data-theme="light"]) .pack-chip.member {
  background: var(--field);
  border-color: rgba(148, 163, 184, 0.28);
  color: var(--muted);
}
html:not([data-theme="light"]) .staff-row-avatar,
html:not([data-theme="light"]) .rule-avatar,
html:not([data-theme="light"]) .person-fallback {
  background: rgba(225, 6, 0, 0.16);
  color: #9fd8ff;
}
html:not([data-theme="light"]) .nice-select-mark,
html:not([data-theme="light"]) .nice-select-trigger-mark,
html:not([data-theme="light"]) .nice-select-mark[data-kind],
html:not([data-theme="light"]) .nice-select-trigger-mark[data-kind] {
  background: rgba(225, 6, 0, 0.16);
  color: #9fd8ff;
}
html:not([data-theme="light"]) .nice-select-mark[data-kind="channel"],
html:not([data-theme="light"]) .nice-select-trigger-mark[data-kind="channel"] {
  background: rgba(139, 132, 212, 0.22);
  color: #d4cbff;
}
html:not([data-theme="light"]) .nice-select-mark[data-kind="voice"],
html:not([data-theme="light"]) .nice-select-trigger-mark[data-kind="voice"] {
  background: #163224;
  color: #8ed4a8;
}
html:not([data-theme="light"]) .nice-select-mark[data-kind="none"],
html:not([data-theme="light"]) .nice-select-trigger-mark[data-kind="none"] {
  background: var(--field);
  color: var(--muted);
}
html:not([data-theme="light"]) .save-msg.ok {
  background: #163224;
  color: #8ed4a8;
}
html:not([data-theme="light"]) .save-msg.bad {
  background: #3a1c1a;
  color: #f0b0aa;
}
html:not([data-theme="light"]) .disc-status {
  background: var(--field);
  color: var(--ink);
  border-color: var(--line);
}
html:not([data-theme="light"]) .disc-status.ok {
  background: #163224;
  color: #8ed4a8;
  border-color: #2a5a3d;
}
html:not([data-theme="light"]) .disc-status.bad,
html:not([data-theme="light"]) .disc-status.warn {
  background: #3a1c1a;
  color: #f0b0aa;
  border-color: #6a3530;
}
html:not([data-theme="light"]) .disc-status.warn {
  background: #3a3118;
  color: #e6c56a;
  border-color: #6a5420;
}
.wl-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wl-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: var(--shadow-soft);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { background: var(--beige); }
.theme-toggle svg { width: 18px; height: 18px; display: none; }
html[data-theme="light"] .theme-toggle .theme-ico-moon,
html:not([data-theme]) .theme-toggle .theme-ico-moon { display: block; }
html:not([data-theme="light"]) .theme-toggle .theme-ico-sun { display: block; }
.theme-toggle.float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 25;
}
body.home .theme-toggle.float { display: none; }
body.home .home-session .theme-toggle { width: 36px; height: 36px; }

/* —— Whitelist staff —— */
.wl-page { display: block; }
.wl-wrap { max-width: 980px; margin: 0 auto; padding: 22px 22px 80px; }
.wl-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 18px;
}
.wl-kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-soft);
}
.wl-kpi strong { display: block; font-size: 26px; letter-spacing: -0.03em; }
.wl-kpi span { color: var(--muted); font-size: 12.5px; font-weight: 650; }
.wl-kpi.pending strong { color: var(--brown-2); }
.wl-kpi.accepted strong { color: var(--green); }
.wl-kpi.refused strong { color: var(--danger); }
.wl-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.wl-views { display: flex; flex-wrap: wrap; gap: 6px; }
.wl-list { display: grid; gap: 12px; }
.wl-empty { color: var(--muted); padding: 28px 8px; }
.wl-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-soft);
}
.wl-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.wl-card-head img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.wl-card-meta { min-width: 0; flex: 1; }
.wl-card-meta strong { display: block; font-size: 16px; }
.wl-card-meta small { color: var(--muted); font-size: 12.5px; }
.wl-card-meta .wl-grant { display: block; margin-top: 2px; }
.wl-card-meta .wl-grant.is-ok { color: var(--green); }
.wl-card-meta .wl-grant.is-bad { color: var(--danger); }
.wl-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.wl-badge.pending { background: rgba(139, 131, 224, 0.14); color: var(--brown-2); }
.wl-badge.accepted { background: rgba(47, 157, 87, 0.14); color: var(--green); }
.wl-badge.refused { background: rgba(161, 75, 58, 0.12); color: var(--danger); }
.wl-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.wl-fact {
  font-size: 12.5px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--beige);
  color: var(--ink);
}
.wl-fact em {
  font-style: normal;
  color: var(--muted);
  margin-right: 6px;
  font-weight: 650;
}
.wl-more { margin-top: 12px; }
.wl-more summary {
  cursor: pointer;
  color: var(--brown-2);
  font-weight: 650;
  font-size: 13.5px;
}
.wl-more-body { display: grid; gap: 10px; margin-top: 10px; }
.wl-detail span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.wl-detail p { margin: 3px 0 0; white-space: pre-wrap; }
.wl-actions { display: flex; gap: 8px; margin-top: 14px; }
@media (max-width: 720px) {
  .wl-kpis { grid-template-columns: 1fr 1fr; }
}
.visual-flag {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.new-task-tools .visual-flag {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--field);
  white-space: nowrap;
}
.visual-flag input { flex: 0 0 auto; width: auto; }
.ai-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  align-self: center;
}
.ai-cta {
  border: 0;
  background: #e8a317;
  color: #1a1408;
  font-weight: 750;
  font-size: 12.5px;
  letter-spacing: 0.01em;
  border-radius: 999px;
  padding: 8px 13px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(232, 163, 23, 0.22);
}
.ai-cta:hover { filter: brightness(1.06); }
.ai-cta.go {
  background: var(--solid);
  color: var(--solid-text);
  box-shadow: 0 6px 16px rgba(225, 6, 0, 0.22);
}
.ai-cta.detail {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  box-shadow: none;
  font-weight: 650;
}
.ai-cta.detail:hover {
  border-color: rgba(225, 6, 0, 0.4);
  color: var(--brown-2);
}
.ai-talk-card { width: min(720px, 100%); }
.ai-talk-title {
  margin: 8px 0 0;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.ai-talk-log {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(46vh, 420px);
  overflow: auto;
  padding-right: 4px;
}
.ai-bubble {
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--field);
  border: 1px solid var(--line);
}
.ai-bubble small {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.ai-bubble-body { display: grid; gap: 8px; }
.ai-bubble p { margin: 0; white-space: pre-wrap; font-size: 14px; line-height: 1.45; }
.ai-bubble pre {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  overflow: auto;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
}
.ai-bubble.staff { background: rgba(225, 6, 0, 0.12); }
.ai-bubble.outil {
  background: transparent;
  padding: 7px 10px;
}
.ai-bubble.outil small { margin-bottom: 2px; }
.ai-bubble.outil .ai-bubble-body p {
  font-size: 12.5px;
  color: var(--muted);
}
.ai-bubble.question { border-color: rgba(232, 163, 23, 0.4); }
.ai-bubble.resume {
  border-color: rgba(255, 45, 45, 0.35);
  background: linear-gradient(180deg, rgba(225, 6, 0, 0.1), var(--field));
}
.ai-fix {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.ai-fix textarea { min-height: 88px; }
.ai-live {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}
.ai-live.ok { color: var(--green); }
.ai-live.wait { color: #d4b15a; }
.task-badge.ai-queued {
  background: rgba(232, 163, 23, 0.16);
  color: #d4b15a;
}
.ai-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 118px;
  max-width: 160px;
}
.ai-progress-track {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: rgba(225, 6, 0, 0.16);
  overflow: hidden;
}
.ai-progress-track span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #E10600, #FF2D2D);
  box-shadow: 0 0 10px rgba(255, 45, 45, 0.35);
  transition: width 0.45s ease;
}
.ai-progress em {
  flex: none;
  font-style: normal;
  font-size: 12px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--brown-2);
  min-width: 2.6em;
  text-align: right;
}
.ai-box .ai-progress {
  max-width: none;
  margin-top: 2px;
}
.ai-box .ai-progress-track { height: 8px; }
.ai-box {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(225, 6, 0, 0.22);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(225, 6, 0, 0.08), var(--field));
  display: grid;
  gap: 8px;
}
.ai-box.is-wait {
  border-color: rgba(232, 163, 23, 0.32);
  background: linear-gradient(180deg, rgba(232, 163, 23, 0.1), var(--field));
}
.ai-box.is-run {
  border-color: rgba(255, 45, 45, 0.35);
  background: linear-gradient(180deg, rgba(255, 45, 45, 0.1), var(--field));
}
.ai-title {
  margin: 0;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ai-meta, .ai-result, .ai-error { margin: 0; font-size: 13px; white-space: pre-wrap; }
.ai-error { color: var(--danger); }
.ai-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ai-actions .do {
  border-radius: 10px;
  padding: 8px 14px;
}
.ai-actions textarea { flex: 1 0 100%; min-height: 72px; }
.task-badge.ai-running, .task-badge.ai-review { background: #efe4cc; }
.task-badge.ai-conflict, .task-badge.ai-error, .task-badge.ai-blocked { background: #f3d6d2; }
.ai-log { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12px; }
.task-badge.ai-merged { background: #dcead8; }
.task-badge.ai-pending { background: #efe4cc; color: #7a5610; }
.cursor-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 45, 45, 0.28);
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(225, 6, 0, 0.08), var(--field));
}
.cursor-bar p { margin: 0; font-size: 13px; }
.cursor-bar.off {
  border-color: rgba(232, 163, 23, 0.45);
  background: rgba(232, 163, 23, 0.1);
}
.menu .do.go {
  background: rgba(225, 6, 0, 0.16);
  color: var(--brown-2);
}
.menu .do.go:hover { background: rgba(225, 6, 0, 0.24); }