:root {
  /* Soft slate — confortable, peu de blanc pur, accent lavande discret */
  --ink: #222636;
  --muted: #667085;
  --line: #cfd4e0;
  --paper: #dde1ea;
  --card: #e8ebf2;
  --beige: #e2e5ee;
  --brown: #6b63c9;
  --brown-2: #5750b0;
  --gold: #8580c4;
  --green: #2f9d57;
  --danger: #a14b3a;
  --shadow: 0 12px 30px rgba(24, 28, 40, 0.06);
  --shadow-soft: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
  --serif: "DM Sans", "Segoe UI", sans-serif;
  --sans: "DM Sans", "Segoe UI", sans-serif;
  --radius: 16px;
  --radius-sm: 12px;
  --scroll: #a8b0c0;
  --scroll-hover: #8791a5;
  --focus: 0 0 0 3px rgba(107, 99, 201, 0.22);
}

* { box-sizing: border-box; }

html { color-scheme: light; }

* {
  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(106, 91, 216, 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(228, 230, 238, 0.92);
  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(106, 91, 216, 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;
  gap: 16px;
  max-width: 920px;
  margin: 0 auto;
  padding: 18px 28px 0;
}
.home-bar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}
.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(106, 91, 216, 0.25);
}
.home-session { display: flex; align-items: center; gap: 8px; }
.home-wrap {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
  min-height: calc(100vh - 70px);
  padding: 8vh 28px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: rise 0.55s ease both;
}
.home-mark {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brown-2);
}
.home h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(48px, 8vw, 72px);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 0.98;
}
.home-lead {
  margin: 16px 0 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
}
.home-health {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 4px;
}
.home-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}
.home-pill.ok {
  background: #e3f3ea;
  border-color: #b7d4c2;
  color: #216344;
}
.home-pill.bad {
  background: #fff1f0;
  border-color: #efc2bf;
  color: #8b3a36;
}
.home-continue {
  margin: 14px 0 0;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink);
}
.home-continue a {
  color: var(--brown-2);
  text-decoration: none;
  border-bottom: 1px solid rgba(86, 72, 192, 0.35);
}
.home-continue a:hover { border-bottom-color: var(--brown-2); }
.apps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 34px;
}
@media (max-width: 900px) {
  .apps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.app {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  background: rgba(236, 238, 244, 0.88);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 16px;
  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: #e4e7f1;
  border-color: #c4cada;
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(28, 32, 48, 0.08);
}
.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(106, 91, 216, 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: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.app-copy > span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13.5px;
}
.app-go {
  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: 640px) {
  .apps { grid-template-columns: 1fr; }
  .home-bar { padding-left: 18px; padding-right: 18px; }
  .home-wrap { padding-left: 18px; padding-right: 18px; }
  .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: #c7c0e8;
  background: #e9ebf3;
}
.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, #ddd8f4);
  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: 0;
  background: #dde1ec;
  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;
}
.staff-btn:hover {
  background: #d0d5e4;
}
.staff-btn.on {
  background: var(--brown);
  color: #f4f2ff;
  box-shadow: 0 4px 12px rgba(106, 91, 216, 0.22);
}
.staff-btn.on:hover {
  background: var(--brown-2);
}
.staff-btn.soft {
  background: rgba(106, 91, 216, 0.12);
  color: var(--brown-2);
}
.staff-btn.soft:hover {
  background: rgba(106, 91, 216, 0.2);
}
.staff-btn.danger {
  color: #a14b3a;
  background: rgba(161, 75, 58, 0.12);
}
.staff-btn.danger:hover {
  background: rgba(161, 75, 58, 0.2);
}
.staff-row .rights-editor {
  border-top: 1px solid var(--line);
  background: #e2e5ef;
}
@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: linear-gradient(180deg, #eceef4, #e7e9f1);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.rule, .person, .feed-line, .guild {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid rgba(212, 216, 228, 0.9);
  border-radius: 0;
  background: transparent;
  transition: background 0.15s ease;
}
.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: rgba(255, 252, 247, 0.9);
}
.rule-avatar, .person-fallback {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #ddd8f4, #cfc8ec);
  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: #ddd8f4; border-color: #c7c0e8; color: #5648c0; }
.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: #fff4ea;
  border-color: #e8d2b8;
}
.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: 28px 18px;
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
  line-height: 1.45;
  border: 1px dashed #c9cfde;
  border-radius: 14px;
  background: rgba(231, 233, 241, 0.55);
}
.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 transparent;
  border-radius: 9px;
  background: #dde1ec;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.rights-check:hover {
  background: #d2d7e6;
}
.rights-check.on {
  background: rgba(106, 91, 216, 0.16);
  border-color: rgba(106, 91, 216, 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 #a8b0c4;
  background: #e9ebf3;
}
.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(106, 91, 216, 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(106, 91, 216, 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: center;
  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: #ddd8f4;
  border-color: #c7c0e8;
}
.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, #ddd8f4, #cfc8ec);
  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: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.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: #e9ebf3;
  resize: vertical;
}

/* —— Formulaires : selects / checkbox / radio —— */
select:not(.nice-select-native) {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  border-radius: 11px;
  background-color: #e9ebf3;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--brown-2) 50%),
    linear-gradient(135deg, var(--brown-2) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding: 9px 34px 9px 12px;
  font-weight: 650;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
select:not(.nice-select-native):hover {
  border-color: #c4cada;
  background-color: #e2e5ef;
}
select:not(.nice-select-native):focus {
  outline: none;
  border-color: #c7c0e8;
  box-shadow: var(--focus);
}

input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 17px;
  height: 17px;
  margin: 0;
  flex: 0 0 auto;
  border: 1.5px solid #a8b0c4;
  background: #eef0f6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  vertical-align: middle;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
input[type="checkbox"] { border-radius: 5px; }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:hover,
input[type="radio"]:hover {
  border-color: var(--brown);
  background: #e7e9f8;
}
input[type="checkbox"]:checked,
input[type="radio"]:checked {
  border-color: var(--brown-2);
  background: var(--brown);
  box-shadow: none;
}
input[type="checkbox"]:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23f4f2ff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.2 6.6 11.2 12.5 4.8'/%3E%3C/svg%3E");
  background-size: 12px 12px;
  background-position: center;
  background-repeat: no-repeat;
}
input[type="radio"]:checked {
  background-image: radial-gradient(circle at center, #f4f2ff 0 3.5px, transparent 4px);
}
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.45;
  cursor: not-allowed;
}

/* 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: #e9ebf3;
  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: #e2e5ef;
  border-color: #c4cada;
}
.nice-select.open .nice-select-trigger {
  border-color: #c7c0e8;
  background: #ddd8f4;
  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, #ddd8f4, #cfc8ec);
  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: #f4f5fa;
  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: #e9ebf3;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.nice-select-search-wrap:focus-within {
  background: #eef0f8;
  border-color: #c7c0e8;
  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, #c9cfde, 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: #e7e9f1;
  border-color: #d4d8e4;
}
.nice-select-option.on {
  background: rgba(106, 91, 216, 0.16);
  border-color: rgba(106, 91, 216, 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: #dde1ec;
  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: #5648c0; }
.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: #5648c0; }
.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 1fr;
  gap: 8px;
}
.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); }
}

/* â€”â€” Pomodoro â€”â€” */
.pomo {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin: 4px 0 0;
  box-shadow: var(--shadow-soft);
}
.pomo.break { background: var(--beige); }
.pomo-top { display: flex; justify-content: space-between; align-items: baseline; }
.pomo-phase, .pomo-round {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}
.pomo-time {
  margin: 4px 0 10px;
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 550;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.pomo-bar { margin-bottom: 10px; }
.pomo.break .bar span { background: var(--green); }
.pomo-set { display: flex; gap: 8px; margin-bottom: 8px; }
.pomo-set label { flex: 1; color: var(--muted); font-size: 12px; }
.pomo-set input {
  display: block;
  width: 100%;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 9px;
  background: white;
}
.pomo.going .pomo-set { display: none; }
.pomo-actions { display: flex; gap: 6px; }
.pomo-actions .do {
  flex: 1;
  border: 0;
  background: var(--brown);
  color: white;
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  font-weight: 700;
}
.pomo-actions button {
  border: 1px solid var(--line);
  background: white;
  border-radius: var(--radius-sm);
  padding: 9px 10px;
}
.pomo-actions button:hover { background: var(--beige); }

.spaces {
  display: flex;
  gap: 4px;
  margin: 18px 0 14px;
  background: #efe9df;
  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(--ink);
  color: #faf7f2;
  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: #d4d8e4; 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: white;
  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: #faf8f5;
}

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(243, 236, 223, 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: white;
}

.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: white;
}

/* â€”â€” 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 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: 36px 28px 1fr auto auto auto;
  gap: 12px;
  align-items: center;
  background: linear-gradient(135deg, #f5ebdb 0%, #efe4d0 100%);
  border: 1px solid #e4d7c2;
  border-radius: 18px;
  padding: 18px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-soft);
}
.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 .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(106, 91, 216, 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(106, 91, 216, 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(106, 91, 216, 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(106, 91, 216, 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(28, 25, 22, 0.32);
  backdrop-filter: blur(3px);
}
.sheet-card {
  width: min(640px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 20px 50px rgba(28, 25, 22, 0.16);
  animation: rise 0.25s ease both;
}
.sheet-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 550;
  font-size: 28px;
}
.sheet-card label {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.sheet-card input,
.sheet-card textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  background: white;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sheet-card input:focus,
.sheet-card textarea:focus {
  outline: none;
  border-color: #c9b089;
  box-shadow: 0 0 0 3px rgba(196, 163, 106, 0.22);
}
.sheet-card textarea { min-height: 92px; resize: vertical; }
.sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.sheet-actions button {
  border: 1px solid var(--line);
  background: white;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
}
.sheet-actions .do {
  border: 0;
  background: var(--brown);
  color: white;
  font-weight: 700;
}
.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; }

.clock {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  border: 0;
  background: transparent;
}
.clock.on { color: var(--green); font-weight: 700; }
.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: var(--brown-2);
  box-shadow: 0 6px 16px rgba(106, 91, 216, 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: 4px 10px 6px;
  box-shadow: var(--shadow-soft);
}
#list:empty { display: none; }

.table-head, .row {
  display: grid;
  grid-template-columns: 36px 28px 1fr 88px 36px;
  gap: 12px;
  align-items: center;
}
.table-head {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 12px 8px 10px;
  font-weight: 650;
}
.row {
  padding: 13px 8px;
  border-top: 1px solid var(--line);
  transition: background 0.12s ease;
}
.row:hover { background: rgba(243, 236, 223, 0.45); }
.row.done { opacity: 0.45; }
.row.done .title { text-decoration: line-through; }
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brown);
}

.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: white;
  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: #f6f1e8; }
.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-card p { margin: 0 0 16px; }
.ask-actions { display: flex; justify-content: flex-end; gap: 8px; }
.ask-actions button {
  border: 1px solid var(--line);
  background: white;
  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: flex;
  gap: 8px;
  margin-top: 18px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
}
.new-task input,
.new-task select {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  background: white;
  font: inherit;
}
.new-task input[type="date"],
.new-task input[name="dueTime"],
.new-task select {
  flex: 0 0 auto;
  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 button {
  border: 0;
  background: var(--ink);
  color: white;
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-weight: 700;
}
.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(106, 91, 216, 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: auto; 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: #fff;
  font: inherit;
}
.menu-label { margin: 4px 8px 2px; font-size: 12px; color: var(--muted); }
.plan-ask { width: min(420px, 100%); }
.plan-ask-fields { display: flex; gap: 8px; margin: 12px 0; }
.plan-ask-fields input, .plan-ask-fields select {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  background: #fff;
}
.plan-ask-msg { margin: 0 0 8px; color: #9a3a3a; font-size: 14px; }
.plan-ask .ask-actions a { align-self: center; }
.sheet-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.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: 10px;
  padding: 9px 11px;
  background: #e9ebf3;
  font: inherit;
}
#view-today.on,
#mine-only.on {
  background: rgba(106, 91, 216, 0.12);
  color: var(--brown-2);
  border-color: rgba(106, 91, 216, 0.28);
}

/* â€”â€” 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; }
  .apps { grid-template-columns: 1fr; }
  .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 { flex-direction: column; }
  .hero {
    grid-template-columns: 28px 28px 1fr;
    gap: 10px;
  }
  .hero .clock, .hero .do, .hero .more { grid-column: span 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

.top-actions { display: flex; align-items: center; gap: 10px; }
.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: baseline;
  gap: 12px;
}
.sheet-status {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.sheet-title {
  width: 100%;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 550;
  background: white;
}
.sheet-meta { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.sheet-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
.sheet-fields label { margin-top: 8px; }
.sheet-fields > .steps-label,
.sheet-fields > .sheet-meta-row { grid-column: 1 / -1; }
.sheet-fields textarea { min-height: 140px; }
.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 { 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: #e9ebf3;
  padding: 11px 12px;
  font-size: 14px;
  font-weight: 600;
}
.pa-modal-field input:focus,
.pa-modal-field select:focus {
  outline: none;
  border-color: #c7c0e8;
  box-shadow: var(--focus);
  background: #f4f5fa;
}
.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;
}