/*
 * Eternal — couche visuelle v3
 * Chargée après styles.css : cette feuille affine l’interface sans modifier
 * la structure existante.
 */

:root {
  color-scheme: dark;
  --bg: #0a0f0c;
  --panel: #121a15;
  --panel-2: #19231c;
  --panel-3: #213027;
  --input: #0c120e;
  --line: #344238;
  --line-soft: rgba(167, 188, 163, 0.15);
  --text: #f3f1e7;
  --muted: #aab3a6;
  --accent: #c8a75f;
  --accent-hover: #ddbf78;
  --accent-2: #91ad88;
  --warning: #d9ae56;
  --danger: #d06b62;
  --success: #8caf7e;
  --sage-deep: #26372c;
  --sage-soft: #b7c9b0;
  --gold-soft: #ead49c;
  --surface-glass: rgba(18, 26, 21, 0.88);
  --surface-raised: linear-gradient(145deg, rgba(31, 43, 35, 0.96), rgba(17, 24, 19, 0.98));
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.18);
  --shadow-gold: 0 12px 28px rgba(200, 167, 95, 0.13);
  --radius: 15px;
  --radius-sm: 10px;
  --sidebar-width: 268px;
}

html {
  scrollbar-gutter: stable;
  scroll-padding-top: 24px;
}

body {
  min-width: 300px;
  background:
    radial-gradient(circle at 82% -8%, rgba(145, 173, 136, 0.13), transparent 31rem),
    radial-gradient(circle at 10% 92%, rgba(200, 167, 95, 0.065), transparent 34rem),
    linear-gradient(140deg, rgba(145, 173, 136, 0.025), transparent 42%),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent 72%);
}

::selection {
  color: #11160f;
  background: var(--accent-hover);
}

* {
  scrollbar-color: #566656 #111813;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: #101713;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid #101713;
  border-radius: 999px;
  background: #506050;
}

a {
  color: var(--sage-soft);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--gold-soft);
}

h1,
h2,
h3 {
  color: #f7f3e8;
  font-family: Georgia, "Times New Roman", ui-serif, serif;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 3.2vw, 3.25rem);
  letter-spacing: -0.035em;
}

h2 {
  letter-spacing: -0.015em;
}

p {
  text-wrap: pretty;
}

small {
  color: var(--muted);
}

/* Layout et navigation */

.app-shell {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.side-nav {
  z-index: 40;
  gap: 14px;
  padding: 20px 14px 14px;
  border-right: 1px solid rgba(167, 188, 163, 0.15);
  background:
    radial-gradient(circle at 16% 0, rgba(200, 167, 95, 0.1), transparent 15rem),
    linear-gradient(180deg, rgba(28, 39, 31, 0.98), rgba(13, 20, 16, 0.985));
  box-shadow: 16px 0 46px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(18px);
}

.nav-brand {
  padding: 3px 9px 12px;
}

.nav-brand-mark {
  border-color: rgba(222, 194, 126, 0.56);
  color: #172018;
  background: linear-gradient(145deg, #ddc179, #a88949);
  box-shadow:
    0 10px 24px rgba(200, 167, 95, 0.16),
    inset 0 1px rgba(255, 255, 255, 0.32);
}

.nav-brand strong {
  color: #fbf7eb;
}

.nav-brand small,
.nav-group-label {
  color: #849184;
}

.nav-user {
  border-color: rgba(167, 188, 163, 0.13);
  background: rgba(10, 15, 12, 0.38);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.nav-user-dot {
  background: #9fc491;
  box-shadow: 0 0 0 4px rgba(159, 196, 145, 0.1);
}

.side-nav a,
.nav-button {
  border-radius: 11px;
  color: #aeb7ac;
}

.side-nav a:hover,
.nav-button:hover {
  color: #f7f4e9;
  border-color: rgba(167, 188, 163, 0.18);
  background: rgba(145, 173, 136, 0.08);
}

.side-nav a.active {
  color: #fff8e7;
  border-color: rgba(200, 167, 95, 0.3);
  background:
    linear-gradient(90deg, rgba(200, 167, 95, 0.2), rgba(145, 173, 136, 0.075));
  box-shadow: inset 3px 0 var(--accent);
}

.nav-icon {
  color: #bec8b9;
  background: rgba(145, 173, 136, 0.07);
}

.side-nav a.active .nav-icon {
  color: #f1d99d;
  background: rgba(200, 167, 95, 0.14);
}

.nav-footer {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.nav-server-link,
.server-manage-link {
  min-height: auto !important;
  padding: 8px 10px !important;
  color: #9faf9c !important;
  font-size: 0.76rem !important;
}

.nav-logout {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.page {
  width: min(1760px, 100%);
  padding: 36px clamp(20px, 3.3vw, 58px) 72px;
}

.app-shell.no-nav .page {
  display: grid;
  align-content: start;
}

/* Sélecteur de serveur dans la navigation */

.server-switcher-wrap {
  display: grid;
  gap: 2px;
}

.server-switcher {
  margin: 0 4px;
  padding: 10px;
  border-color: rgba(167, 188, 163, 0.17);
  border-radius: 12px;
  background: rgba(8, 13, 10, 0.32);
}

.server-switcher:hover {
  border-color: rgba(200, 167, 95, 0.3);
}

.server-switcher-control img,
.server-switcher-icon {
  box-shadow: 0 0 0 1px rgba(200, 167, 95, 0.28);
}

.server-switcher-icon {
  color: #172018;
  background: linear-gradient(145deg, var(--accent-hover), #a98a4d);
}

.server-switcher select {
  min-height: 36px;
  border-color: transparent;
  background: #101813;
}

.server-switcher-empty {
  display: block !important;
  color: var(--gold-soft) !important;
  text-align: center;
}

/* En-têtes, heroes et métriques */

.page-hero {
  min-height: 148px;
  isolation: isolate;
  margin-bottom: 26px;
  padding: clamp(22px, 3vw, 36px);
  border-color: rgba(167, 188, 163, 0.19);
  border-radius: 22px;
  background:
    linear-gradient(112deg, rgba(200, 167, 95, 0.11), transparent 44%),
    radial-gradient(circle at 87% 20%, rgba(145, 173, 136, 0.16), transparent 19rem),
    var(--surface-raised);
  box-shadow: var(--shadow);
}

.page-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.025), transparent 38%);
}

.page-hero::after {
  border-color: rgba(200, 167, 95, 0.14);
  box-shadow:
    0 0 0 42px rgba(145, 173, 136, 0.03),
    0 0 0 84px rgba(200, 167, 95, 0.018);
}

.page-hero h1 {
  margin-bottom: 10px;
}

.page-hero p:last-child {
  color: #b8c0b5;
  font-size: 0.98rem;
}

.eyebrow {
  color: var(--accent);
  letter-spacing: 0.17em;
}

.hero-stats {
  gap: 9px;
}

.hero-stats > span {
  min-width: 98px;
  padding: 11px 13px;
  border-color: rgba(167, 188, 163, 0.16);
  background: rgba(7, 12, 9, 0.4);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.02);
}

.hero-stats strong {
  color: #f5e7bf;
  font-family: Georgia, "Times New Roman", serif;
}

.hero-stats .warning strong {
  color: #efc777;
}

.hero-signal {
  border-color: rgba(145, 173, 136, 0.32);
  color: #d2e0cd;
  background: rgba(145, 173, 136, 0.09);
}

.toolbar {
  min-height: 78px;
  margin-bottom: 22px;
  padding: 16px 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(18, 26, 21, 0.78);
  box-shadow: var(--shadow-soft);
}

.toolbar h1 {
  font-size: clamp(1.75rem, 2.7vw, 2.55rem);
}

.section-title {
  gap: 18px;
  margin-bottom: 17px;
}

.section-title > div {
  min-width: 0;
}

.section-title h2 {
  margin-bottom: 4px;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
}

.section-title span {
  color: var(--muted);
}

.metrics {
  gap: 13px;
  margin-bottom: 24px;
}

.metric {
  min-height: 112px;
  padding: 18px;
  border-color: rgba(167, 188, 163, 0.15);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
}

.metric::after {
  content: "";
  width: 36px;
  height: 2px;
  margin-top: auto;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.metric strong {
  color: #f4e6bd;
}

/* Formulaires et contrôles */

label {
  color: #b5bdb1;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.012em;
}

input,
select,
textarea {
  min-height: 44px;
  padding: 9px 11px;
  border-color: #35433a;
  border-radius: var(--radius-sm);
  color: #f4f1e8;
  background: rgba(7, 12, 9, 0.77);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.018);
}

input::placeholder,
textarea::placeholder {
  color: #6f7b70;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #526356;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px rgba(200, 167, 95, 0.11),
    inset 0 1px rgba(255, 255, 255, 0.025);
}

input:disabled,
select:disabled,
textarea:disabled {
  color: #a7afa4;
  background: rgba(8, 12, 9, 0.52);
}

input[type="checkbox"],
input[type="radio"] {
  min-height: 0;
  accent-color: var(--accent);
}

input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 7px 10px;
  border: 1px solid rgba(167, 188, 163, 0.2);
  border-radius: 8px;
  color: var(--text);
  background: var(--sage-deep);
  cursor: pointer;
}

button,
.button-link,
.wiki-edit-button,
.wiki-add-button {
  min-height: 42px;
  border-color: #3c4a40;
  border-radius: var(--radius-sm);
  color: #f1efe6;
  background: linear-gradient(145deg, #26332a, #1c2720);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}

button:hover,
.button-link:hover,
.wiki-edit-button:hover,
.wiki-add-button:hover {
  border-color: rgba(200, 167, 95, 0.56);
  color: #fff9e9;
  background: linear-gradient(145deg, #304033, #243129);
  transform: translateY(-1px);
}

button:active,
.button-link:active {
  transform: translateY(0);
}

.primary {
  border-color: #d2b36c;
  color: #172018;
  background: linear-gradient(145deg, #e2c77f, #b8934f);
  box-shadow:
    var(--shadow-gold),
    inset 0 1px rgba(255, 255, 255, 0.34);
}

.primary:hover {
  border-color: #ecd18a;
  color: #11170f;
  background: linear-gradient(145deg, #ecd693, #c7a55d);
}

.success-button {
  border-color: #789b6d;
  color: #10170f;
  background: linear-gradient(145deg, #9fc391, #769a6c);
}

.danger-button {
  border-color: #c96860;
  color: #fff3ee;
  background: linear-gradient(145deg, #a84d47, #7f3935);
}

.ghost {
  color: #abb5a9;
  background: rgba(8, 12, 9, 0.25);
}

.ghost:hover {
  color: var(--gold-soft);
}

.editor-grid,
.record,
.auth-panel,
.command-panel,
.stock-import-panel,
.stock-import-review {
  border-color: rgba(167, 188, 163, 0.17);
  border-radius: var(--radius);
  background: var(--surface-glass);
  box-shadow: var(--shadow-soft);
}

.editor-grid {
  gap: 13px;
  padding: 18px;
}

.form-pair {
  gap: 18px;
}

.record {
  padding: 18px;
}

.record:hover {
  border-color: rgba(167, 188, 163, 0.26);
}

.record.danger,
.compact-row.danger {
  border-color: rgba(208, 107, 98, 0.55);
}

.alert,
.form-error {
  border-color: rgba(208, 107, 98, 0.42);
  border-radius: 12px;
  color: #ffd9d4;
  background: rgba(122, 42, 39, 0.2);
}

.success-notice {
  border-color: rgba(140, 175, 126, 0.38);
  color: #d9e9d4;
  background: rgba(90, 126, 78, 0.16);
}

.empty {
  min-height: 110px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  border: 1px dashed rgba(167, 188, 163, 0.22);
  border-radius: var(--radius);
  color: #909b91;
  background: rgba(12, 18, 14, 0.42);
  text-align: center;
}

.command-panel > summary,
.capture-library > summary,
.inline-editor > summary {
  color: #e8e5da;
}

.command-panel > summary:hover,
.capture-library > summary:hover,
.inline-editor > summary:hover {
  color: var(--gold-soft);
}

.command-panel[open] > summary,
.capture-library[open] > summary {
  border-bottom-color: var(--line-soft);
  background: rgba(145, 173, 136, 0.04);
}

.upload-dropzone {
  border-color: rgba(145, 173, 136, 0.27);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(145, 173, 136, 0.08), rgba(200, 167, 95, 0.035));
}

.upload-dropzone:hover,
.upload-dropzone:focus-within {
  border-color: rgba(200, 167, 95, 0.58);
  background:
    linear-gradient(135deg, rgba(145, 173, 136, 0.12), rgba(200, 167, 95, 0.07));
}

.upload-preview img {
  border-color: rgba(200, 167, 95, 0.3);
  border-radius: 9px;
}

.category-badge,
.quantity-pill,
.item-status,
.movement-delta {
  border-radius: 999px;
}

.category-badge.custom,
.quantity-pill {
  border-color: rgba(200, 167, 95, 0.25);
  color: #e5cf98;
  background: rgba(200, 167, 95, 0.09);
}

.item-status.ok {
  color: #cce1c3;
  background: rgba(140, 175, 126, 0.13);
}

.item-status.warning {
  color: #efd18d;
  background: rgba(217, 174, 86, 0.13);
}

.item-status.empty {
  color: #f2b3ac;
  background: rgba(208, 107, 98, 0.14);
}

/* Stock et inventaire */

.inventory-toolbar {
  position: sticky;
  z-index: 12;
  top: 12px;
  margin-bottom: 20px;
  padding: 10px;
  border: 1px solid rgba(167, 188, 163, 0.16);
  border-radius: 13px;
  background: rgba(12, 18, 14, 0.88);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(18px);
}

.inventory-search input {
  background: rgba(5, 9, 7, 0.68);
}

.segmented-tabs {
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: rgba(5, 9, 7, 0.38);
}

.segmented-tabs a {
  border-radius: 8px;
}

.segmented-tabs a.active {
  color: #172018;
  background: linear-gradient(145deg, #dbc17e, #aa8b4e);
}

.stock-actions {
  gap: 16px;
  margin-bottom: 24px;
  align-items: start;
}

.stock-actions > .command-panel {
  height: auto;
  align-self: start;
}

.stock-import-panel,
.stock-import-review {
  background:
    linear-gradient(145deg, rgba(28, 39, 31, 0.94), rgba(16, 23, 18, 0.98));
}

.capture-library {
  border-color: rgba(167, 188, 163, 0.16);
  border-radius: var(--radius);
  background: rgba(18, 26, 21, 0.72);
  box-shadow: var(--shadow-soft);
}

.inventory-category {
  margin-bottom: 14px;
}

.inventory-category-summary,
.inventory-category[open] .inventory-category-summary {
  border-color: rgba(167, 188, 163, 0.17);
  background:
    linear-gradient(145deg, rgba(34, 47, 38, 0.93), rgba(20, 29, 23, 0.97));
}

.inventory-category-summary:hover {
  border-color: rgba(200, 167, 95, 0.32);
}

.category-records {
  gap: 13px;
  border-color: rgba(167, 188, 163, 0.14);
  background: rgba(8, 13, 10, 0.32);
}

.inventory-card {
  border-color: rgba(167, 188, 163, 0.16);
  border-radius: 13px;
  background:
    linear-gradient(145deg, rgba(25, 35, 28, 0.96), rgba(16, 23, 18, 0.98));
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
}

.inventory-card:hover {
  border-color: rgba(167, 188, 163, 0.27);
  box-shadow: 0 15px 34px rgba(0, 0, 0, 0.2);
}

.inventory-card.warning {
  border-color: rgba(217, 174, 86, 0.44);
}

.inventory-card.empty {
  border-color: rgba(208, 107, 98, 0.48);
}

.stock-item-thumb {
  border-color: rgba(167, 188, 163, 0.19);
  border-radius: 12px;
  background:
    radial-gradient(circle at 35% 25%, rgba(200, 167, 95, 0.13), transparent 70%),
    #111a14;
}

.stock-item-thumb img {
  transition: transform 220ms ease, filter 220ms ease;
}

.stock-item-thumb:hover img {
  filter: saturate(1.08) brightness(1.04);
  transform: scale(1.045);
}

.stock-item-thumb.placeholder span {
  color: #9cae98;
}

.stock-card-note {
  color: #aeb7ab;
}

.movement-panel {
  margin-top: 28px;
  padding: 20px;
  border: 1px solid rgba(167, 188, 163, 0.15);
  border-radius: var(--radius);
  background: rgba(16, 23, 18, 0.72);
}

.movement-table {
  border-color: rgba(167, 188, 163, 0.15);
}

.movement-table-head {
  color: #aeb8ab;
  background: rgba(145, 173, 136, 0.07);
}

.movement-row:hover {
  background: rgba(145, 173, 136, 0.035);
}

/* Galerie des emplacements du stock */

.stock-location-panel {
  position: relative;
  margin: 0 0 26px;
  padding: clamp(18px, 2.4vw, 28px);
  overflow: hidden;
  border: 1px solid rgba(167, 188, 163, 0.18);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0, rgba(145, 173, 136, 0.12), transparent 24rem),
    linear-gradient(145deg, rgba(24, 34, 27, 0.96), rgba(13, 20, 16, 0.98));
  box-shadow: var(--shadow);
}

.stock-location-panel::before {
  content: "";
  width: 160px;
  height: 160px;
  position: absolute;
  top: -96px;
  right: 12%;
  border: 1px solid rgba(200, 167, 95, 0.1);
  border-radius: 50%;
  pointer-events: none;
}

.stock-location-heading {
  position: relative;
  z-index: 1;
  align-items: flex-end;
  margin-bottom: 20px;
}

.stock-location-heading .eyebrow {
  margin-bottom: 5px;
}

.stock-location-heading h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
}

.stock-location-heading > div > span {
  display: block;
  max-width: 720px;
}

.stock-location-quick-form {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns:
    minmax(190px, 0.9fr)
    minmax(190px, 1.15fr)
    minmax(180px, 1fr)
    minmax(210px, 1.2fr)
    auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 22px;
  padding: 15px;
  border: 1px solid rgba(167, 188, 163, 0.15);
  border-radius: 14px;
  background: rgba(7, 12, 9, 0.38);
}

.stock-location-upload {
  min-height: 72px;
  justify-content: center;
}

.stock-location-upload span {
  color: #e6e1d4;
}

.stock-location-quick-form > .upload-preview {
  grid-column: 1 / -2;
}

.stock-location-quick-form > button {
  min-width: 160px;
}

.stock-location-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: 15px;
}

.stock-location-card {
  min-width: 0;
  display: grid;
  align-content: start;
  overflow: hidden;
  border: 1px solid rgba(167, 188, 163, 0.17);
  border-radius: 15px;
  background:
    linear-gradient(155deg, rgba(29, 40, 32, 0.97), rgba(15, 22, 17, 0.99));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.stock-location-card:hover {
  border-color: rgba(200, 167, 95, 0.38);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

.stock-location-image {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  display: block;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid rgba(167, 188, 163, 0.13);
  border-radius: 0;
  background: #080d0a;
  box-shadow: none;
}

.stock-location-image:hover {
  border-color: rgba(167, 188, 163, 0.13);
  background: #080d0a;
  transform: none;
}

.stock-location-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: filter 240ms ease, transform 300ms ease;
}

.stock-location-image:hover img {
  filter: brightness(1.06) saturate(1.08);
  transform: scale(1.035);
}

.stock-location-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 16px 17px 15px;
}

.stock-location-pin {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.stock-location-pin::before {
  content: "";
  width: 7px;
  height: 7px;
  border: 2px solid var(--accent);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

.stock-location-copy h3 {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-size: 1.22rem;
}

.stock-location-copy strong {
  color: #d5ddcf;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.stock-location-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.stock-location-copy small {
  margin-top: 5px;
  font-size: 0.69rem;
}

.stock-location-edit {
  margin-top: auto;
  border-top: 1px solid rgba(167, 188, 163, 0.11);
}

.stock-location-edit > summary {
  padding: 10px 17px;
  color: #9faa9d;
  font-size: 0.75rem;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.stock-location-edit > summary::-webkit-details-marker {
  display: none;
}

.stock-location-edit > summary::after {
  content: "＋";
  float: right;
  color: var(--accent);
}

.stock-location-edit[open] > summary::after {
  content: "−";
}

.stock-location-edit[open] > summary {
  color: var(--gold-soft);
  background: rgba(200, 167, 95, 0.045);
}

.stock-location-edit .editor-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 14px 17px 10px;
  border: 0;
  border-radius: 0;
  background: rgba(7, 11, 8, 0.3);
  box-shadow: none;
}

.stock-location-edit .delete-form {
  margin: 0;
  padding: 0 17px 15px;
  background: rgba(7, 11, 8, 0.3);
}

/* Wiki */

.wiki-reader {
  grid-template-columns: minmax(255px, 310px) minmax(0, 1fr);
  gap: 24px;
}

.wiki-index,
.wiki-article,
.wiki-admin,
.wiki-category-manager,
.zombie-edit-card {
  border-color: rgba(167, 188, 163, 0.17);
  border-radius: 18px;
  background: rgba(17, 25, 20, 0.9);
  box-shadow: var(--shadow-soft);
}

.wiki-index {
  top: 18px;
  max-height: calc(100vh - 36px);
  padding: 14px;
  overflow-y: auto;
}

.wiki-index-title {
  padding: 5px 6px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.wiki-category-group {
  padding: 10px 0;
  border-bottom-color: rgba(167, 188, 163, 0.1);
}

.wiki-category-heading {
  padding: 6px 8px;
  color: #e6d19b;
}

.wiki-category-heading span {
  color: #b5c0b1;
  background: rgba(145, 173, 136, 0.09);
}

.wiki-index-link,
.wiki-add-button,
.wiki-edit-button {
  border-radius: 10px;
}

.wiki-index-link {
  margin: 2px 0;
  padding: 10px 9px;
  border: 1px solid transparent;
  color: #dce1d8;
  background: transparent;
}

.wiki-index-link span {
  color: var(--accent);
}

.wiki-index-link:hover,
.wiki-index-link.active {
  border-color: rgba(200, 167, 95, 0.22);
  background: linear-gradient(90deg, rgba(200, 167, 95, 0.11), rgba(145, 173, 136, 0.055));
}

.wiki-index-link.active {
  box-shadow: inset 3px 0 var(--accent);
}

.wiki-article {
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0, rgba(145, 173, 136, 0.08), transparent 24rem),
    rgba(17, 25, 20, 0.94);
}

.wiki-article.danger-4,
.wiki-article.danger-5 {
  border-color: rgba(208, 107, 98, 0.48);
}

.wiki-article-header {
  padding: 22px clamp(18px, 3vw, 28px);
  border-bottom: 1px solid var(--line-soft);
}

.wiki-article-header h2 {
  font-size: clamp(1.9rem, 3.5vw, 2.8rem);
}

.wiki-stars {
  color: var(--accent);
  letter-spacing: 0.05em;
  text-shadow: 0 3px 18px rgba(200, 167, 95, 0.16);
}

.wiki-hero {
  max-height: none;
  aspect-ratio: 16 / 8;
  border-top: 0;
  border-bottom: 1px solid var(--line-soft);
  background:
    radial-gradient(circle at center, rgba(145, 173, 136, 0.09), transparent 55%),
    #080d0a;
}

.wiki-hero img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
}

.wiki-hero span {
  min-height: 240px;
  color: #778379;
}

.wiki-meta {
  gap: 8px;
  padding: 13px clamp(18px, 3vw, 28px);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(145, 173, 136, 0.035);
}

.wiki-meta span {
  padding: 5px 9px;
  border: 1px solid rgba(167, 188, 163, 0.12);
  border-radius: 999px;
  color: #aeb8ab;
  background: rgba(7, 11, 8, 0.28);
  font-size: 0.72rem;
}

.wiki-copy {
  max-width: 900px;
  padding: clamp(20px, 3vw, 32px);
}

.wiki-copy p {
  color: #d3d8cf;
  font-size: 0.98rem;
  line-height: 1.75;
}

.wiki-admin,
.wiki-category-manager {
  padding: clamp(18px, 2.5vw, 26px);
}

.wiki-category-card {
  border-color: rgba(167, 188, 163, 0.14);
  border-radius: 14px;
  background: rgba(7, 12, 9, 0.32);
}

.wiki-category-card:hover {
  border-color: rgba(200, 167, 95, 0.25);
}

/* Catalogue des serveurs Discord */

.route-servers .page {
  width: min(1380px, 100%);
  margin-inline: auto;
}

.server-catalog,
.server-catalog-page,
.server-catalog-shell {
  display: grid;
  gap: 22px;
}

.server-catalog-hero {
  min-height: 170px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(24px, 4vw, 42px);
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(167, 188, 163, 0.19);
  border-radius: 22px;
  background:
    radial-gradient(circle at 88% 10%, rgba(145, 173, 136, 0.19), transparent 20rem),
    linear-gradient(120deg, rgba(200, 167, 95, 0.12), transparent 45%),
    var(--surface-raised);
  box-shadow: var(--shadow);
}

.server-catalog-hero::after {
  content: "";
  width: 220px;
  height: 220px;
  position: absolute;
  top: -120px;
  right: 8%;
  border: 1px solid rgba(200, 167, 95, 0.16);
  border-radius: 50%;
  box-shadow:
    0 0 0 36px rgba(145, 173, 136, 0.035),
    0 0 0 72px rgba(200, 167, 95, 0.018);
}

.server-catalog-hero > * {
  position: relative;
  z-index: 1;
}

.server-catalog-hero h1 {
  margin-bottom: 8px;
}

.server-catalog-hero p {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
}

.server-catalog-summary,
.server-catalog-notice {
  padding: 14px 16px;
  border: 1px solid rgba(167, 188, 163, 0.15);
  border-radius: 13px;
  color: #c2cbc0;
  background: rgba(18, 26, 21, 0.72);
}

.server-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}

.server-catalog-card {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  padding: 19px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(167, 188, 163, 0.17);
  border-radius: 16px;
  background:
    linear-gradient(150deg, rgba(29, 41, 33, 0.96), rgba(14, 21, 16, 0.99));
  box-shadow: var(--shadow-soft);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.server-catalog-card::after {
  content: "";
  width: 100px;
  height: 100px;
  position: absolute;
  right: -52px;
  bottom: -58px;
  border: 1px solid rgba(145, 173, 136, 0.1);
  border-radius: 50%;
}

.server-catalog-card:hover {
  border-color: rgba(200, 167, 95, 0.4);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

.server-catalog-card.active,
.server-catalog-card.current,
.server-catalog-card.is-active,
.server-catalog-card.is-current {
  border-color: rgba(200, 167, 95, 0.52);
  box-shadow:
    0 0 0 1px rgba(200, 167, 95, 0.1),
    0 18px 40px rgba(0, 0, 0, 0.24);
}

.server-catalog-card-header,
.server-catalog-head {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
}

.server-catalog-icon,
.server-catalog-avatar,
.server-catalog-card img {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border: 1px solid rgba(200, 167, 95, 0.25);
  border-radius: 15px;
  object-fit: cover;
  background: linear-gradient(145deg, #314235, #1d2a21);
}

.server-catalog-icon {
  display: grid;
  place-items: center;
  color: #f0dca8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 800;
}

.server-catalog-copy,
.server-catalog-card-body,
.server-catalog-body {
  min-width: 0;
}

.server-catalog-copy h2,
.server-catalog-card h2,
.server-catalog-card h3 {
  margin: 0 0 4px;
  overflow-wrap: anywhere;
  font-size: 1.2rem;
}

.server-catalog-copy p,
.server-catalog-card-body p,
.server-catalog-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.server-catalog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.server-catalog-badge,
.server-catalog-status {
  width: fit-content;
  padding: 5px 9px;
  border: 1px solid rgba(167, 188, 163, 0.16);
  border-radius: 999px;
  color: #b9c6b6;
  background: rgba(145, 173, 136, 0.07);
  font-size: 0.68rem;
  font-weight: 750;
}

.server-catalog-status.active,
.server-catalog-status.current,
.server-catalog-status.is-active {
  border-color: rgba(200, 167, 95, 0.28);
  color: #ecdba9;
  background: rgba(200, 167, 95, 0.1);
}

.server-catalog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.server-catalog-actions > * {
  flex: 1;
  margin: 0;
}

.server-catalog-actions button,
.server-catalog-actions .button-link,
.server-catalog-action {
  width: 100%;
}

.server-catalog-empty {
  min-height: 250px;
  display: grid;
  place-items: center;
  padding: 36px;
  border: 1px dashed rgba(167, 188, 163, 0.24);
  border-radius: 18px;
  color: var(--muted);
  background:
    radial-gradient(circle at center, rgba(145, 173, 136, 0.07), transparent 15rem),
    rgba(13, 20, 16, 0.6);
  text-align: center;
}

/* Authentification */

.auth-shell {
  background:
    radial-gradient(circle at 50% 18%, rgba(145, 173, 136, 0.12), transparent 24rem),
    radial-gradient(circle at 12% 90%, rgba(200, 167, 95, 0.08), transparent 24rem);
}

.auth-panel {
  width: min(460px, 100%);
  padding: 30px;
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(29, 40, 32, 0.97), rgba(13, 20, 16, 0.99));
  box-shadow: var(--shadow);
}

.oauth-button {
  border-color: rgba(121, 132, 246, 0.65);
  border-radius: 11px;
  background: linear-gradient(145deg, #6571e8, #4d58c5);
}

/* Responsive */

@media (max-width: 1240px) {
  .stock-location-quick-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stock-location-upload,
  .stock-location-notes {
    grid-column: auto;
  }

  .stock-location-quick-form > .upload-preview {
    grid-column: 1 / -1;
  }

  .stock-location-quick-form > button {
    justify-self: end;
  }
}

@media (max-width: 1020px) {
  .wiki-reader {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 16px;
  }

  .server-catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  }
}

@media (max-width: 920px) {
  :root {
    --sidebar-width: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: sticky;
    top: 0;
    height: auto;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 9px 11px;
    border-right: 0;
    border-bottom: 1px solid rgba(167, 188, 163, 0.16);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
  }

  .nav-scroll {
    mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 18px), transparent);
  }

  .server-switcher-wrap {
    display: none;
  }

  .nav-footer {
    display: block;
    padding: 0;
    border: 0;
  }

  .nav-server-link {
    display: none !important;
  }

  .page {
    padding: 22px 15px 50px;
  }

  .inventory-toolbar {
    top: 66px;
  }

  .wiki-reader {
    grid-template-columns: 1fr;
  }

  .wiki-index {
    position: static;
    max-height: none;
  }

  .wiki-category-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 4px;
  }

  .wiki-category-heading,
  .wiki-category-group > small,
  .wiki-category-empty {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 14px;
  }

  .page-hero,
  .server-catalog-hero {
    min-height: auto;
    align-items: stretch;
    flex-direction: column;
    padding: 21px;
    border-radius: 17px;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .hero-stats > span {
    min-width: 0;
  }

  .toolbar,
  .section-title,
  .stock-location-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar {
    min-height: 0;
    padding: 15px;
  }

  .editor-grid,
  .record-grid,
  .form-pair,
  .inventory-form,
  .stock-import-review {
    grid-template-columns: 1fr;
  }

  .wide,
  .full {
    grid-column: 1;
  }

  .inventory-toolbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .stock-location-panel {
    padding: 17px;
    border-radius: 17px;
  }

  .stock-location-quick-form {
    grid-template-columns: 1fr;
  }

  .stock-location-quick-form > .upload-preview,
  .stock-location-upload,
  .stock-location-notes {
    grid-column: 1;
  }

  .stock-location-quick-form > button {
    width: 100%;
    justify-self: stretch;
  }

  .stock-location-grid,
  .server-catalog-grid,
  .category-records,
  .wiki-category-cards {
    grid-template-columns: 1fr;
  }

  .stock-location-edit .editor-grid {
    grid-template-columns: 1fr;
  }

  .wiki-article-header,
  .wiki-index-title {
    align-items: stretch;
    flex-direction: column;
  }

  .wiki-article-actions {
    justify-items: start;
  }

  .wiki-hero {
    aspect-ratio: 4 / 3;
  }

  .server-catalog-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .side-nav {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 7px;
    padding-inline: 8px;
  }

  .nav-brand {
    grid-template-columns: 34px;
  }

  .nav-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px 4px 10px 4px;
    font-size: 1.05rem;
  }

  .side-nav a {
    min-height: 36px;
    padding-inline: 8px;
  }

  .nav-logout .nav-button {
    max-width: 42px;
    overflow: hidden;
    color: transparent;
  }

  .nav-logout .nav-button::before {
    content: "↪";
    color: #b6beb3;
    font-size: 1rem;
  }

  .page {
    padding-inline: 11px;
  }

  .page-hero,
  .server-catalog-hero,
  .stock-location-panel {
    padding: 17px;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr;
  }

  .metric {
    min-height: 96px;
  }

  .stock-location-card,
  .server-catalog-card,
  .inventory-card {
    border-radius: 13px;
  }

  .stock-location-copy {
    padding-inline: 14px;
  }

  .inventory-card-head.with-thumb {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .stock-item-thumb {
    width: 52px;
    height: 52px;
  }

  .item-card-badges {
    grid-column: 1 / -1;
  }

  .bottom-actions,
  .inventory-card-actions,
  .decision-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .bottom-actions button,
  .inventory-card-actions button,
  .decision-actions button {
    width: 100%;
  }
}

@media (hover: hover) and (pointer: fine) {
  .metric,
  .record,
  .wiki-category-card {
    transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
  }

  .metric:hover,
  .record:hover,
  .wiki-category-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
  }
}

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

/* ==========================================================================
   Objectifs — cartes pleine largeur
   Les objectifs n'ont pas de vignette : leur en-tête ne doit pas hériter de
   la colonne réservée à l'image des articles de stock.
   ========================================================================== */

.objective-records {
  grid-template-columns: minmax(0, 1fr);
}

.objective-card {
  gap: 16px;
}

.objective-card .inventory-card-head {
  align-items: start;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.objective-card .inventory-card-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.objective-card .inventory-card-head strong {
  font-family: Georgia, serif;
  font-size: 1.12rem;
  line-height: 1.3;
}

.objective-card .inventory-card-head > div:first-child span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.objective-card .resource-summary {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(12, 18, 14, 0.42);
}

.objective-card .resource-summary span,
.objective-card .resource-summary small {
  color: var(--muted);
}

/* Les <select> de liaison stock imposaient la largeur de leur plus longue
   option et faisaient déborder la carte. */
.requirement-row > input,
.requirement-row > select,
.requirement-row > button {
  min-width: 0;
}

/* ==========================================================================
   Mes serveurs — catalogue Discord
   ========================================================================== */

.server-catalog-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.server-catalog-stats > span {
  min-width: 92px;
  display: grid;
  gap: 1px;
  padding: 10px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: rgba(10, 16, 12, 0.5);
}

.server-catalog-stats strong {
  color: var(--gold-soft);
  font-family: Georgia, serif;
  font-size: 1.15rem;
  line-height: 1.1;
}

.server-catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 14px;
}

.server-catalog-toolbar h2 {
  margin: 0 0 4px;
}

.server-catalog-toolbar p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.server-catalog-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.server-catalog-filter-note {
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid var(--line-soft);
  border-left: 3px solid rgba(200, 167, 95, 0.45);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.85rem;
  background: rgba(18, 26, 21, 0.6);
}

.server-catalog-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
}

.server-catalog-copy {
  min-width: 0;
}

.server-catalog-copy h3 {
  margin: 0 0 3px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-family: Georgia, serif;
  font-size: 1.06rem;
  line-height: 1.28;
}

.server-catalog-copy small {
  color: #7f8a80;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.server-catalog-meta {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  align-items: center;
  gap: 7px;
  margin-top: 0;
}

.server-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
  background: rgba(10, 16, 12, 0.5);
}

.server-status i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.045);
}

.server-status.active {
  border-color: rgba(200, 167, 95, 0.4);
  color: var(--gold-soft);
  background: rgba(200, 167, 95, 0.11);
}

.server-status.ready {
  border-color: rgba(140, 175, 126, 0.36);
  color: #bcd9ae;
  background: rgba(140, 175, 126, 0.11);
}

.server-status.locked {
  border-color: rgba(217, 174, 86, 0.32);
  color: #e3c483;
  background: rgba(217, 174, 86, 0.09);
}

.server-status.missing {
  border-color: rgba(167, 188, 163, 0.24);
  color: #b3c1b0;
}

.server-role-badge {
  padding: 5px 10px;
  border: 1px dashed rgba(167, 188, 163, 0.24);
  border-radius: 999px;
  color: #8f9a8e;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.server-role-badge.granted {
  border-style: solid;
  border-color: rgba(200, 167, 95, 0.26);
  color: #d6c08c;
}

.server-catalog-card.active {
  background:
    radial-gradient(circle at 84% 6%, rgba(200, 167, 95, 0.14), transparent 12rem),
    linear-gradient(150deg, rgba(33, 46, 36, 0.97), rgba(15, 22, 17, 0.99));
}

.server-action-hint {
  display: block;
  color: #8b958a;
  font-size: 0.8rem;
  line-height: 1.45;
}

.server-catalog-help {
  display: grid;
  gap: 5px;
  margin-top: 22px;
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(18, 26, 21, 0.6);
}

.server-catalog-help strong {
  color: var(--gold-soft);
}

.server-catalog-help p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.server-catalog-logout {
  margin-top: 18px;
  padding: 0;
  border: 0;
  background: none;
}

/* ==========================================================================
   Wiki — barre de recherche, visuel d'article et respiration
   ========================================================================== */

.wiki-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(12, 18, 14, 0.8);
  box-shadow: var(--shadow-soft);
}

.wiki-search > label {
  min-width: 0;
  margin: 0;
}

.wiki-search > label:first-of-type {
  flex: 1 1 280px;
}

.wiki-search > label:nth-of-type(2) {
  flex: 0 1 230px;
}

.wiki-search input,
.wiki-search select {
  background: rgba(5, 9, 7, 0.68);
}

.wiki-search button,
.wiki-search .button-link {
  flex: 0 0 auto;
  min-width: 116px;
  justify-content: center;
}

.wiki-search button[type="submit"] {
  border-color: rgba(200, 167, 95, 0.34);
  color: var(--gold-soft);
}

.wiki-search button[type="submit"]:hover {
  border-color: var(--accent);
  background: rgba(200, 167, 95, 0.12);
}

/* Le visuel occupait la moitié de l'écran. On abandonne `aspect-ratio` : sur un
   <figure> en grille, la taille minimale automatique de l'image (élément
   remplacé) empêche le cadre de rétrécir, et l'image débordait sur le texte.
   Ici la hauteur suit l'image, plafonnée, avec min-height neutralisé. */
.wiki-hero {
  aspect-ratio: auto;
  min-height: 0;
  max-height: min(44vh, 400px);
  overflow: hidden;
}

.wiki-hero img {
  width: 100%;
  height: auto;
  min-width: 0;
  min-height: 0;
  max-height: min(44vh, 400px);
  object-fit: contain;
}

.wiki-hero span {
  min-height: 170px;
}

.wiki-summary {
  max-width: 72ch;
  margin: 9px 0 0;
  color: var(--muted);
}

.wiki-meta {
  gap: 8px;
  padding: 13px clamp(18px, 3vw, 28px);
  font-size: 0.82rem;
}

.wiki-meta span:not(:empty) {
  padding: 4px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(10, 16, 12, 0.45);
}

.wiki-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px clamp(18px, 3vw, 28px);
  border-bottom: 1px solid var(--line-soft);
}

.wiki-tags span {
  padding: 4px 10px;
  border: 1px solid rgba(200, 167, 95, 0.2);
  border-radius: 999px;
  color: #d6c08c;
  font-size: 0.76rem;
  background: rgba(200, 167, 95, 0.07);
}

.wiki-copy {
  padding: 24px clamp(18px, 3vw, 28px) 28px;
}

.wiki-copy p {
  max-width: 82ch;
  margin-bottom: 16px;
  line-height: 1.62;
}

.wiki-copy p:last-child {
  margin-bottom: 0;
}

/* Titre et étoiles alignés au lieu d'être empilés. */
.wiki-index-link {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

@media (max-width: 720px) {
  .server-catalog-toolbar,
  .server-catalog-toolbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .server-catalog-stats > span {
    flex: 1 1 auto;
  }

  .wiki-search > label:first-of-type,
  .wiki-search > label:nth-of-type(2) {
    flex: 1 1 100%;
  }

  .wiki-search button,
  .wiki-search .button-link {
    flex: 1 1 auto;
  }

  .wiki-hero,
  .wiki-hero img {
    max-height: min(38vh, 300px);
  }
}
