/* Polices hébergées sur le site (plus de requête vers Google) */
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/static/fonts/IBMPlexMono-1da89f68.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/static/fonts/IBMPlexMono-cf8d2b0e.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/static/fonts/IBMPlexMono-616b92f1.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/static/fonts/IBMPlexMono-d53d001f.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: italic;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/IBMPlexSans-77f5d981.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: italic;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/IBMPlexSans-46a3d971.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/IBMPlexSans-71c30cd3.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/IBMPlexSans-a68a2001.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/IBMPlexSans-71c30cd3.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/IBMPlexSans-a68a2001.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/IBMPlexSans-71c30cd3.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(/static/fonts/IBMPlexSans-a68a2001.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/static/fonts/Oswald-31399ed9.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/static/fonts/Oswald-ed56cbd3.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/static/fonts/Oswald-31399ed9.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/static/fonts/Oswald-ed56cbd3.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/static/fonts/Oswald-31399ed9.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/static/fonts/Oswald-ed56cbd3.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ===================================================================
   Day of Decay - Aide
   Base (couleurs redéfinies plus bas par le thème Day of Decay).
   =================================================================== */
:root {
  --ink: #0b0d10;          /* fond */
  --ink-2: #101317;        /* fond secondaire */
  --surface: #14181d;      /* panneaux */
  --surface-2: #191e25;    /* survol / champs */
  --line: #242b35;         /* filets */
  --line-2: #343e4d;

  --bone: #d7e7cf;         /* texte principal */
  --bone-dim: #8594a9;     /* texte secondaire */
  --bone-faint: #556377;

  --blood: #8e1b1b;        /* rouge du blason */
  --blood-hi: #b02a24;
  --blood-deep: #4a0e0e;
  --brass: #79b85a;        /* laiton des serpents / ailes */
  --brass-hi: #9ccd83;
  --brass-dim: #4e7a38;
  --steel: #707f93;        /* lame */
  --rust: #a5562b;
  --ok: #5b7599;           /* vert-de-gris discret */
  --warn: #c99434;

  --r: 3px;
  --display: 'Oswald', 'Arial Narrow', sans-serif;
  --body: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 400 15px/1.55 var(--body);
  color: var(--bone);
  background-color: var(--ink);
  background-image:
    radial-gradient(1100px 700px at 100% 0%, rgba(142, 27, 27, .10), transparent 60%),
    radial-gradient(900px 600px at 0% 100%, rgba(121, 184, 90, .05), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body::before { /* grain très léger */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: var(--brass-hi); text-decoration: none; }
a:hover { color: var(--bone); }
code { font: 13px var(--mono); padding: 1px 6px; border-radius: var(--r); background: var(--ink-2); border: 1px solid var(--line); color: var(--brass-hi); }
h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: .02em; margin: 0; line-height: 1.15; }
.muted { color: var(--bone-dim); }
.faint { color: var(--bone-faint); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ================= Structure ================= */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
/* Voile du menu téléphone : hors de la grille, et caché sur PC */
.nav-backdrop { display: none; position: fixed; inset: 0; }
@media (max-width: 860px) { .nav-backdrop { display: block; } }

.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0e1115 0%, #0c0f12 100%);
  border-right: 1px solid var(--line);
}
.side-brand { padding: 26px 22px 20px; text-align: center; border-bottom: 1px solid var(--line); }
.side-brand img { width: 112px; height: 112px; object-fit: contain; display: block; margin: 0 auto 10px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .6)); }
.side-brand .name { font-family: var(--display); font-size: 24px; letter-spacing: .01em; text-transform: none; color: var(--bone); }
.side-brand .tag { font-size: 11px; letter-spacing: .01em; text-transform: none; color: var(--brass); margin-top: 2px; }

.side-nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.side-nav .group { font-size: 10.5px; letter-spacing: .01em; text-transform: none; color: var(--bone-faint); padding: 14px 12px 6px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r);
  color: var(--bone-dim); font-weight: 500; position: relative;
}
.side-nav a:hover { color: var(--bone); background: rgba(215, 231, 207, .04); }
.side-nav a.active { color: var(--bone); background: rgba(142, 27, 27, .16); }
.side-nav a.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; background: var(--blood-hi); border-radius: 0 2px 2px 0; }
.side-nav a.active .icon { color: var(--brass-hi); }

.side-foot { margin-top: auto; padding: 14px 16px 18px; border-top: 1px solid var(--line); }
.who-box { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; color: var(--bone); }
.who-box:hover { color: var(--bone); }
.who-box .initial {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-family: var(--display); font-size: 16px; color: var(--brass-hi); background: var(--surface-2); border: 1px solid var(--line-2);
}
.who-box b { display: block; font-weight: 600; line-height: 1.25; font-size: 14px; color: var(--bone); }
.who-box .role { display: block; font-size: 12px; color: var(--bone-faint); }
.logout button {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent; color: var(--bone-dim); border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 8px; font: 500 13px var(--body); cursor: pointer;
}
.logout button:hover { color: var(--bone); border-color: var(--blood); background: rgba(142, 27, 27, .12); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { padding: 34px clamp(18px, 3.2vw, 48px) 28px; max-width: 1320px; width: 100%; }
.foot { margin-top: auto; padding: 18px clamp(18px, 3.2vw, 48px); color: var(--bone-faint); font-size: 12px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--bone-faint); }
.sync::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(91, 117, 153, .15); }
.sync.stale::before { background: var(--warn); box-shadow: 0 0 0 3px rgba(201, 148, 52, .18); }

/* ================= En-têtes ================= */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(26px, 3vw, 34px); text-transform: none; letter-spacing: .01em; }
.kicker { font-size: 11px; letter-spacing: .01em; text-transform: none; color: var(--brass); margin-bottom: 6px; }
.page-head .lead { color: var(--bone-dim); margin: 6px 0 0; max-width: 640px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ================= Panneaux ================= */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-title { font-size: 15px; text-transform: none; letter-spacing: .01em; color: var(--bone); display: flex; align-items: center; gap: 10px; }
.panel-title .icon { color: var(--brass); }
.panel-link { font-size: 13px; color: var(--brass); display: inline-flex; align-items: center; gap: 6px; }
.empty { color: var(--bone-faint); font-style: italic; margin: 4px 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 20px; margin-bottom: 20px; }
.grid-2 > .panel { margin-bottom: 0; }
.note { border-left: 2px solid var(--brass-dim); padding: 2px 0 2px 14px; color: var(--bone-dim); margin: 0 0 20px; }
.note p { margin: 0 0 6px; }
.note p:last-child { margin: 0; }

/* ================= Tableau de bord ================= */
.welcome { display: grid; grid-template-columns: 1fr; gap: 26px; align-items: center; margin-bottom: 26px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.welcome img { width: 92px; height: 92px; object-fit: contain; }
.welcome h1 { font-size: clamp(28px, 3.4vw, 38px); text-transform: none; letter-spacing: .01em; }
.welcome p { margin: 10px 0 0; color: var(--bone-dim); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 20px; }
.stat { background: var(--surface); padding: 18px 20px; }
.stat-n { font: 500 32px/1 var(--display); color: var(--bone); letter-spacing: .02em; }
.stat-l { font-size: 12px; letter-spacing: .01em; text-transform: none; color: var(--bone-faint); margin-top: 8px; }
.stat.alert .stat-n { color: var(--blood-hi); }

/* ================= Listes ================= */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.rows > li:last-child { border-bottom: 0; }
.rows .grow { flex: 1; min-width: 0; }
.rows .qty { font: 500 15px var(--mono); }
.item-name { font-weight: 600; color: var(--bone); }
.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv li span { color: var(--bone-faint); }
.sub-title { font-size: 12px; letter-spacing: .01em; text-transform: none; color: var(--bone-faint); margin: 22px 0 10px; font-family: var(--body); font-weight: 600; }
.perm-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px 18px; }
.perm-list li { display: flex; gap: 8px; align-items: baseline; color: var(--bone-dim); font-size: 14px; }
.perm-list li::before { content: ''; width: 6px; height: 6px; border-radius: 1px; background: var(--brass); transform: translateY(-2px); flex: none; }
.perm-list li.muted::before { display: none; }

/* ================= Étiquettes ================= */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .01em; text-transform: none; padding: 3px 8px; border-radius: 2px; border: 1px solid var(--line-2); color: var(--bone-dim); white-space: nowrap; }
.chip-out { background: var(--blood); border-color: var(--blood); color: #f6e9e4; }
.chip-low { border-color: var(--warn); color: var(--warn); }
.chip-add { border-color: rgba(91, 117, 153, .6); color: #a9c083; }
.chip-take { border-color: rgba(176, 42, 36, .7); color: #e08a80; }
.chip-borrow { border-color: rgba(201, 148, 52, .6); color: var(--warn); }
.chip-return { border-color: rgba(112, 127, 147, .7); color: #b3bcc8; }
.chip-me { border-color: var(--brass-dim); color: var(--brass-hi); }
.grade-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; letter-spacing: .01em; text-transform: none; color: var(--bone); padding: 3px 10px 3px 8px; border: 1px solid var(--line-2); border-radius: 2px; background: var(--ink-2); }
.grade-chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--bone-faint)); }
.via { font-size: 11px; letter-spacing: .01em; text-transform: none; }
.via-site { color: var(--brass); }
.via-discord { color: #9aa3d6; }

/* ================= Avatars ================= */
.avatar { border-radius: 50%; object-fit: cover; background: var(--ink-2); border: 1px solid var(--line-2); flex: none; }
.avatar.sm { width: 30px; height: 30px; }
.avatar.lg { width: 52px; height: 52px; }

/* ================= Journal ================= */
.timeline { list-style: none; margin: 0; padding: 0; }
.event { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.event:last-child { border-bottom: 0; }
.event-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.event-meta { font-size: 13px; color: var(--bone-faint); margin-top: 3px; }
.event-meta b { color: var(--bone-dim); font-weight: 500; }
.event-note { font-size: 13px; color: var(--bone-dim); margin-top: 4px; padding-left: 10px; border-left: 2px solid var(--line-2); }
.event-time { font: 12px var(--mono); color: var(--bone-faint); white-space: nowrap; }

/* ================= Stock ================= */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.search-wrap { position: relative; flex: 1; max-width: 380px; min-width: 220px; }
.search-wrap .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--bone-faint); }
.search-wrap input { padding-left: 38px; }
/* Catégories : sur plusieurs lignes (toutes visibles, aucun défilement) */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; white-space: nowrap;
  color: var(--bone-dim); font-weight: 500; font-size: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .12s, color .12s, background .12s;
}
.tab:hover { color: var(--bone); border-color: var(--line-2); }
.tab.active { color: var(--bone); border-color: var(--blood); background: rgba(142, 27, 27, .18); box-shadow: inset 0 -2px 0 var(--blood-hi); }
.tab .count { font: 12px var(--mono); color: var(--bone-faint); padding: 1px 6px; border-radius: 2px; background: var(--ink-2); }
.tab.active .count { color: var(--brass-hi); background: rgba(0, 0, 0, .25); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s; }
.card:hover { border-color: var(--line-2); }
.card.lv-low { border-top: 2px solid var(--warn); }
.card.lv-out { border-top: 2px solid var(--blood-hi); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-cat { font-size: 11px; letter-spacing: .01em; text-transform: none; color: var(--bone-faint); }
.card-name { font: 500 19px/1.2 var(--display); letter-spacing: .03em; margin-top: 3px; }
.card-qty { display: flex; align-items: baseline; gap: 8px; }
.card-qty b { font: 500 34px/1 var(--display); color: var(--bone); letter-spacing: .01em; }
.lv-low .card-qty b { color: var(--warn); }
.lv-out .card-qty b { color: var(--blood-hi); }
.card-qty span { font-size: 12px; color: var(--bone-faint); text-transform: none; letter-spacing: .01em; }
.card-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--bone-faint); min-height: 18px; }
.card-meta span { display: inline-flex; align-items: center; gap: 5px; }
.card-meta .icon { width: 14px; height: 14px; }
.meter { height: 4px; background: var(--ink); border-radius: 2px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--brass); }
.lv-low .meter span { background: var(--warn); }
.lv-out .meter span { background: var(--blood-hi); }
.card-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 2px; padding-top: 12px; border-top: 1px solid var(--line); }
.card-actions .btn { min-width: 0; padding: 8px 4px; font-size: 11.5px; letter-spacing: .03em; }
.card-actions .btn .icon { display: none; }
.card-tools { display: flex; align-items: center; gap: 8px; }
.card-tools .btn-icon { padding: 5px 6px; }
.card-tools .btn-icon .icon { width: 15px; height: 15px; }

/* ================= Boutons ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: 600 13px var(--body); letter-spacing: .04em; text-transform: none;
  padding: 9px 16px; border-radius: var(--r); border: 1px solid var(--line-2); cursor: pointer;
  background: var(--surface-2); color: var(--bone); transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { border-color: var(--bone-faint); color: var(--bone); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn .icon { width: 16px; height: 16px; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-block { width: 100%; padding: 12px 16px; }
.btn-primary { background: var(--blood); border-color: var(--blood); color: #f6ece6; }
.btn-primary:hover { background: var(--blood-hi); border-color: var(--blood-hi); color: #ffffff; }
.btn-brass { background: transparent; border-color: var(--brass-dim); color: var(--brass-hi); }
.btn-brass:hover { background: rgba(121, 184, 90, .1); border-color: var(--brass); color: var(--brass-hi); }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: rgba(176, 42, 36, .55); color: #e08a80; }
.btn-danger:hover { background: rgba(142, 27, 27, .2); border-color: var(--blood-hi); color: #f1b0a8; }
.btn-icon { padding: 7px 9px; }
.act-add { border-color: rgba(91, 117, 153, .5); color: #b4c892; background: transparent; }
.act-add:hover { background: rgba(91, 117, 153, .12); border-color: var(--ok); color: #cfe0b1; }
.act-take { border-color: rgba(176, 42, 36, .55); color: #e59a91; background: transparent; }
.act-take:hover { background: rgba(142, 27, 27, .18); border-color: var(--blood-hi); color: #f3b9b2; }
.act-borrow { border-color: rgba(201, 148, 52, .5); color: #dcb168; background: transparent; }
.act-borrow:hover { background: rgba(201, 148, 52, .12); border-color: var(--warn); color: #ecc98a; }

/* ================= Formulaires ================= */
input, select, textarea {
  width: 100%; font: 400 15px var(--body); color: var(--bone);
  background: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 9px 12px; outline: none;
  transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: var(--bone-faint); }
input:focus, select:focus, textarea:focus { border-color: var(--brass); box-shadow: 0 0 0 3px rgba(121, 184, 90, .14); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--blood-hi); flex: none; }
input[type=color] { width: 40px; height: 38px; padding: 3px; flex: none; cursor: pointer; }
label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .01em; text-transform: none; color: var(--bone-dim); }
label .opt { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--bone-faint); }
label > input, label > select, label > textarea, label > .qty-row { margin-top: 7px; }
label.check { display: flex; flex-direction: row; align-items: center; gap: 10px; text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 400; color: var(--bone); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form input:not([type=color]):not([type=checkbox]):not([type=hidden]) { flex: 1 1 160px; width: auto; }
.inline-form select { width: auto; flex: 1 1 160px; }
.inline-form.grow { flex: 1; }
.emoji-input { flex: 0 0 64px !important; max-width: 64px; text-align: center; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.qty-row { display: grid; grid-template-columns: auto auto 1fr auto auto; gap: 6px; }
.qty-row input { text-align: center; font: 500 20px var(--mono); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.seg label { display: block; text-transform: none; letter-spacing: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 10px 6px; font-size: 13px; font-weight: 600; letter-spacing: .01em; text-transform: none; color: var(--bone-dim); cursor: pointer; border-right: 1px solid var(--line-2); }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { color: var(--bone); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--brass); }
.seg input[value=take]:checked + span { box-shadow: inset 0 -2px 0 var(--blood-hi); }
.seg input[value=borrow]:checked + span { box-shadow: inset 0 -2px 0 var(--warn); }
.seg input[value=add]:checked + span { box-shadow: inset 0 -2px 0 var(--ok); }
.seg input:disabled + span { opacity: .3; cursor: not-allowed; }

/* ================= Fenêtres ================= */
.dlg { width: min(500px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); color: var(--bone); box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
.dlg::backdrop { background: rgba(5, 6, 8, .78); }
.dlg-head { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { font-size: 20px; text-transform: none; letter-spacing: .01em; }
.dlg-head p { margin: 4px 0 0; color: var(--bone-faint); font-size: 13px; }
.dlg-body { padding: 20px 22px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }

/* ================= Messages ================= */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; margin-bottom: 22px; border-radius: var(--r); border: 1px solid var(--line-2); border-left-width: 3px; background: var(--surface); }
.flash .icon { margin-top: 2px; }
.flash-ok { border-left-color: var(--ok); }
.flash-ok .icon { color: var(--ok); }
.flash-error { border-left-color: var(--blood-hi); background: rgba(142, 27, 27, .1); }
.flash-error .icon { color: var(--blood-hi); }

/* ================= Tableau ================= */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; letter-spacing: .01em; text-transform: none; font-weight: 600; color: var(--bone-faint); padding: 0 10px 10px; border-bottom: 1px solid var(--line-2); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .who { display: flex; align-items: center; gap: 10px; }
.row-mine td { background: rgba(121, 184, 90, .04); }

/* ================= Membres ================= */
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.member { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.member-top { display: flex; gap: 14px; align-items: center; }
.member-name { font: 500 18px var(--display); letter-spacing: .03em; display: flex; align-items: center; gap: 8px; }
.member-sub { font-size: 13px; color: var(--bone-faint); }
.member-actions { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ================= Grades ================= */
.ladder { display: flex; flex-direction: column; gap: 10px; }
.rung { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); border-left: 3px solid var(--c); }
.rung.mine { box-shadow: 0 0 0 1px var(--brass-dim); }
.rung-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; flex-wrap: wrap; }
.rank { font: 500 22px var(--display); color: var(--bone-faint); min-width: 38px; }
.rung-name { font: 500 19px var(--display); letter-spacing: .04em; display: flex; align-items: center; gap: 10px; flex: 1; }
.rung-name::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.move { display: inline-flex; gap: 4px; }
.move form { margin: 0; }
.rung-body { padding: 0 18px 16px 70px; }
.perm-box summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .01em; text-transform: none; color: var(--brass); padding: 4px 0; }
.perm-box summary::-webkit-details-marker { display: none; }
.perm-box summary::before { content: '+'; font: 500 16px var(--mono); width: 14px; }
.perm-box[open] summary::before { content: '−'; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 6px; margin-top: 12px; }
.perm { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--ink-2); text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 400; color: var(--bone); cursor: pointer; }
.perm:hover { border-color: var(--line-2); }
.perm-locked { opacity: .4; cursor: not-allowed; }
.perm-box form + form { margin-top: 12px; }

/* ================= Connexion / erreur ================= */
.auth { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: min(400px, 100%); text-align: center; }
.auth-card .logo { width: 180px; height: 180px; object-fit: contain; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .7)); }
.auth-card h1 { font-size: 40px; text-transform: none; letter-spacing: .01em; margin-top: 10px; }
.auth-card .sub { font-size: 11px; letter-spacing: .01em; text-transform: none; color: var(--brass); margin: 6px 0 28px; }
.auth-form { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.auth-help { color: var(--bone-faint); font-size: 13px; margin-top: 18px; }
.err-code { font: 500 96px/1 var(--display); color: var(--blood-hi); letter-spacing: .04em; }

/* ================= Responsive ================= */
@media (max-width: 1000px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 268px; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 20px 0 50px rgba(0, 0, 0, .6); }
  body.nav-open .sidebar { transform: none; }
  /* Voile derrière le menu : dans le même plan que le menu, donc toujours SOUS lui */
  .nav-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .sidebar { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30; padding: 10px 16px; background: rgba(11, 13, 16, .95); border-bottom: 1px solid var(--line); }
  .topbar img { width: 34px; height: 34px; object-fit: contain; }
  .topbar .name { font-family: var(--display); letter-spacing: .01em; text-transform: none; font-size: 17px; }
  .burger { background: none; border: 1px solid var(--line-2); color: var(--bone); border-radius: var(--r); padding: 6px 8px; cursor: pointer; display: grid; place-items: center; }
  .topbar .sync { margin-left: auto; }
  .content { padding-top: 22px; }
  .welcome { grid-template-columns: 1fr; text-align: left; }
  .welcome img { width: 64px; height: 64px; }
  .grid-2, .members { grid-template-columns: 1fr; }
  .rung-body { padding-left: 18px; }
  .search-wrap { max-width: none; }
  /* Sur téléphone : une seule ligne qui défile, avec une barre visible */
  .tabs { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 12px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
  .tabs::-webkit-scrollbar { height: 6px; }
  .tabs::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
  .table thead { display: none; }
  .table tr { display: grid; grid-template-columns: 26px 1fr auto; gap: 2px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: 2px 0; }
  .table td:nth-child(n+4) { grid-column: 2 / -1; font-size: 13px; color: var(--bone-dim); }
}

/* ================= Notifications instantanées ================= */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(440px, calc(100vw - 40px)); }
.toast { padding: 12px 16px; border-radius: var(--r); border: 1px solid var(--line-2); border-left-width: 3px; background: var(--surface-2); color: var(--bone); box-shadow: 0 14px 40px rgba(0, 0, 0, .55); font-size: 14px; animation: toast-in .18s ease-out; transition: opacity .4s, transform .4s; }
.toast-ok { border-left-color: var(--ok); }
.toast-error { border-left-color: var(--blood-hi); }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.flash-card { animation: card-pulse .9s ease-out; }
@keyframes card-pulse { 0% { box-shadow: 0 0 0 1px var(--brass); } 100% { box-shadow: 0 0 0 1px transparent; } }

/* ================= Véhicules ================= */
.plate {
  display: inline-block; font: 600 14px var(--mono); letter-spacing: .01em; color: #11151b;
  background: linear-gradient(180deg, #d8e9d0, #b6c2d4); border: 1px solid #687c97; border-radius: 3px;
  padding: 3px 9px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35), 0 1px 0 rgba(0, 0, 0, .5); white-space: nowrap;
}
.table.vehicles td { vertical-align: middle; }

/* Choix du type de véhicule */
.field-label { font-size: 12px; font-weight: 600; letter-spacing: .01em; text-transform: none; color: var(--bone-dim); margin-bottom: 7px; }
.type-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.type-tile { display: block; text-transform: none; letter-spacing: 0; cursor: pointer; }
.type-tile input { position: absolute; opacity: 0; pointer-events: none; }
.type-tile span {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 10px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--ink-2);
  font-size: 13px; font-weight: 600; color: var(--bone-dim); transition: border-color .12s, color .12s, background .12s;
}
.type-tile span .icon { width: 28px; height: 28px; stroke-width: 1.4; }
.type-tile:hover span { border-color: var(--bone-faint); color: var(--bone); }
.type-tile input:checked + span { border-color: var(--brass); color: var(--brass-hi); background: rgba(121, 184, 90, .08); box-shadow: inset 0 -2px 0 var(--brass); }
.type-tile input:focus-visible + span { box-shadow: 0 0 0 3px rgba(121, 184, 90, .25); }
button.tab { font: inherit; font-weight: 500; font-size: 14px; cursor: pointer; }
.tab .icon { width: 16px; height: 16px; }
.avatar-ph { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font: 500 13px var(--display); color: var(--bone-dim); background: var(--surface-2); border: 1px solid var(--line-2); }
.owner-name { font-weight: 500; }
.table.vehicles { table-layout: fixed; }
.table.vehicles th:nth-child(1) { width: 18%; }
.table.vehicles th:nth-child(2) { width: 32%; }
.table.vehicles th:nth-child(3) { width: 26%; }
.table.vehicles th:nth-child(4) { width: 17%; }
.table.vehicles th:nth-child(5) { width: 7%; }
@media (max-width: 860px) { .table.vehicles { table-layout: auto; } }

/* Bouton de vote (en haut à gauche) */
.vote-btn {
  display: flex; align-items: center; gap: 10px; margin: 14px 14px 0; padding: 10px 12px;
  border: 1px solid var(--brass-dim); border-radius: var(--r); background: rgba(121, 184, 90, .08);
  color: var(--brass-hi); font-weight: 600; font-size: 13px; letter-spacing: .01em; text-transform: none;
  transition: background .12s, border-color .12s, color .12s;
}
.vote-btn span { flex: 1; }
.vote-btn .icon { width: 17px; height: 17px; }
.vote-btn .icon:last-child { width: 14px; height: 14px; opacity: .7; }
.vote-btn:hover { background: rgba(121, 184, 90, .16); border-color: var(--brass); color: var(--bone); }
.vote-mini { display: none; }
@media (max-width: 860px) {
  .vote-mini { display: inline-flex; margin: 0; padding: 6px 10px; gap: 6px; font-size: 12px; }
  .vote-mini span { flex: none; }
  .topbar .sync { margin-left: auto; }
}

/* ================= Codes ================= */
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.code-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.code-card:hover { border-color: var(--line-2); }
.code-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.code-name { font: 500 19px/1.2 var(--display); letter-spacing: .03em; }
.code-value { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 14px; background: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r); }
.code-secret { flex: 1; font: 500 20px var(--mono); letter-spacing: .01em; color: var(--bone-faint); word-break: break-all; }
.code-secret.shown { color: var(--brass-hi); letter-spacing: .01em; }
.code-comment { margin: 0; color: var(--bone-dim); font-size: 14px; padding-left: 10px; border-left: 2px solid var(--line-2); white-space: pre-line; }
.code-meta { font-size: 12px; color: var(--bone-faint); margin-top: auto; }

/* ================= Rangement ================= */
.card-loc { display: flex; align-items: flex-start; gap: 7px; font-size: 13px; color: var(--bone-dim); padding: 7px 9px; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r); }
.card-loc .icon { width: 15px; height: 15px; color: var(--brass); margin-top: 2px; }
.card-loc b { color: var(--bone); font-weight: 600; }
.chest-filter { display: flex; align-items: center; gap: 8px; color: var(--bone-faint); }
.chest-filter select { width: auto; min-width: 200px; }
.vote-btn:not(.vote-mini) { text-transform: none; letter-spacing: .01em; font-size: 13.5px; }

/* ================= Choses à faire ================= */
.section-title { font-size: 13px; letter-spacing: .01em; text-transform: none; color: var(--bone-dim); margin: 6px 0 12px; font-family: var(--body); font-weight: 600; }
.tasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-bottom: 26px; }
.task { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--blood); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.task:hover { border-color: var(--line-2); border-left-color: var(--blood-hi); }
.task-done { border-left-color: var(--ok); opacity: .85; }
.task-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.task-title { font: 500 20px/1.2 var(--display); letter-spacing: .03em; }
.task-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--bone-dim); margin-top: 4px; }
.task-item .icon { width: 14px; height: 14px; color: var(--brass); }
.task-count { display: flex; gap: 22px; flex-wrap: wrap; }
.task-count b { display: block; font: 500 26px/1.1 var(--display); color: var(--bone); }
.task-count .faint-b { color: var(--bone-dim); }
.task-label { display: block; font-size: 10.5px; letter-spacing: .01em; text-transform: none; color: var(--bone-faint); margin-bottom: 2px; }
.task-meter span { background: var(--blood-hi); }
.task-done .task-meter span { background: var(--ok); }
.task-reason { margin: 0; font-size: 14px; color: var(--bone-dim); padding-left: 10px; border-left: 2px solid var(--line-2); white-space: pre-line; }
.ok-text { color: #a9c083 !important; }

/* Codes confidentiels */
.code-conf { border-color: rgba(142, 27, 27, .55); background: linear-gradient(180deg, rgba(142, 27, 27, .08), var(--surface) 60%); }
.chip-conf { border-color: var(--blood); color: #e59a91; margin-bottom: 6px; }
.chip-conf .icon { width: 12px; height: 12px; }
.conf-check { align-items: flex-start; padding: 10px 12px; border: 1px solid rgba(142, 27, 27, .5); border-radius: var(--r); background: rgba(142, 27, 27, .08); font-size: 14px; }
.conf-check input { margin-top: 3px; }
.note .icon { width: 15px; height: 15px; vertical-align: -2px; color: var(--blood-hi); }

/* Codes confidentiels : grades autorisés */
.conf-box { display: flex; flex-direction: column; gap: 10px; }
.conf-grades { padding: 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--ink-2); }
.conf-grade-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.conf-grade-list .perm { padding: 6px 8px; }
.conf-grade-list .grade-chip { border: 0; background: none; padding: 0; }
.code-grades { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.code-grades .task-label { width: 100%; margin: 0; }

/* ================= Téléphone : ajustements de toutes les pages ================= */
@media (max-width: 860px) {
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 15px; }
  .content { padding: 18px 14px 24px; }
  .page-head { margin-bottom: 18px; padding-bottom: 14px; }
  .page-head .lead { font-size: 14px; }
  .head-actions, .head-actions .btn { width: 100%; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-wrap { min-width: 0; }
  .chest-filter select { flex: 1; min-width: 0; }
  .panel { padding: 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 14px; }
  .stat-n { font-size: 26px; }
  .cards, .codes, .tasks, .members, .ladder { grid-template-columns: 1fr; }
  .rung-head { gap: 10px; }
  .rung-head .inline-form { width: 100%; }
  .perm-grid, .conf-grade-list { grid-template-columns: 1fr; }
  .type-picker { grid-template-columns: repeat(2, 1fr); }
  .event { grid-template-columns: 30px 1fr; }
  .event-time { grid-column: 2; }
  /* Fenêtres : plein écran ou presque, défilement interne */
  .dlg { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); margin: auto; overflow-y: auto; }
  .dlg-head, .dlg-body { padding-left: 16px; padding-right: 16px; }
  .qty-row { grid-template-columns: repeat(2, auto) 1fr repeat(2, auto); }
  /* Champs assez grands pour éviter le zoom automatique sur iPhone */
  input, select, textarea { font-size: 16px; }
  /* Tableau des véhicules : une carte par ligne */
  .table.vehicles, .table.vehicles tbody { display: block; table-layout: auto; }
  .table.vehicles tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .table.vehicles td { display: block; padding: 0; border: 0; }
  .table.vehicles td:nth-child(1) { grid-column: 1; }
  .table.vehicles td:nth-child(2), .table.vehicles td:nth-child(3), .table.vehicles td:nth-child(4) { grid-column: 1 / -1; font-size: 14px; color: var(--bone); }
  .table.vehicles td:nth-child(5) { grid-column: 2; grid-row: 1; }
  .vote-mini span { display: none; }
}
@media (max-width: 860px) {
  .table.vehicles td:nth-child(4) { font-size: 12px !important; color: var(--bone-faint) !important; }
  .table.vehicles td:nth-child(4) br { display: none; }
  .table.vehicles td:nth-child(4) .faint::before { content: ' · '; }
}

/* À faire : plusieurs ressources liées */
.pick { border: 1px solid var(--line-2); border-radius: var(--r); background: var(--ink-2); }
.pick-head { display: flex; align-items: center; gap: 10px; padding: 8px; border-bottom: 1px solid var(--line); }
.pick-search { max-width: none; min-width: 0; flex: 1; }
.pick-search input { padding-top: 7px; padding-bottom: 7px; }
.pick-list { max-height: 240px; overflow-y: auto; padding: 4px 8px 8px; overscroll-behavior: contain; }
.pick-cat { font-size: 10.5px; letter-spacing: .01em; text-transform: none; color: var(--brass); padding: 10px 2px 4px; }
.pick-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r); text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 400; color: var(--bone); cursor: pointer; }
.pick-item span:nth-child(2) { flex: 1; }
.pick-item:hover { background: var(--surface-2); }
.pick-item.on { background: rgba(121, 184, 90, .1); }
.task-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.task-items li { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--bone-dim); padding: 4px 0; border-bottom: 1px solid var(--line); }
.task-items li:last-child { border-bottom: 0; }
.task-items .icon { width: 14px; height: 14px; color: var(--brass); }
.task-items b { color: var(--bone); }
.task-items .grow { flex: 1; }

/* ================= Configuration Discord ================= */
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px 24px; }
.cfg-item p { margin: 6px 0 0; }
@media (max-width: 860px) { .cfg-grid { grid-template-columns: 1fr; } }

/* Ressources réservées à certains grades */
.card-vis { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: 12px; color: #e59a91; padding: 6px 8px; border: 1px solid rgba(142, 27, 27, .45); border-radius: var(--r); background: rgba(142, 27, 27, .08); }
.card-vis .icon { width: 13px; height: 13px; }
.card-vis .grade-chip { font-size: 10.5px; padding: 1px 7px 1px 6px; }

/* Véhicules : filtre propriétaire + classement */
.vtoolbar { align-items: center; }
.vtools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.owner-filter { display: flex; flex-direction: row; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; color: var(--bone-faint); font-weight: 400; }
.owner-filter select { width: auto; min-width: 220px; margin: 0; }
.seg-sm { display: inline-grid; grid-template-columns: repeat(2, auto); }
.seg-sm span { display: flex; align-items: center; gap: 7px; padding: 9px 14px; font-size: 12.5px; white-space: nowrap; }
.seg-sm .icon { width: 15px; height: 15px; }
.owner-title { gap: 10px; text-transform: none; letter-spacing: .04em; font-size: 17px; }
.owner-types { display: flex; flex-wrap: wrap; gap: 6px; }
.owner-types .chip .icon { width: 13px; height: 13px; }
.vtype { display: inline-flex; align-items: center; gap: 6px; color: var(--bone-dim); }
.vtype .icon { width: 16px; height: 16px; color: var(--brass); }
.table.vehicles-owner th:nth-child(1) { width: 18%; }
.table.vehicles-owner th:nth-child(2) { width: 16%; }
.table.vehicles-owner th:nth-child(3) { width: 42%; }
.table.vehicles-owner th:nth-child(4) { width: 17%; }
@media (max-width: 860px) {
  .vtools, .owner-filter, .seg-sm { width: 100%; }
  .owner-filter select { flex: 1; min-width: 0; }
  .seg-sm { grid-template-columns: 1fr 1fr; }
  .seg-sm span { justify-content: center; }
  .table.vehicles-owner td:nth-child(2) { grid-column: 1 / -1; }
}
@media (max-width: 860px) { .vtoolbar { align-items: stretch; } .vtoolbar .search-wrap { width: 100%; } }

/* Accueil des grades sans accès aux réserves */
.restricted { text-align: center; padding: 40px 22px; max-width: 620px; margin: 10px auto; }
.restricted .panel-title { justify-content: center; margin-bottom: 10px; }
.restricted-icon { width: 54px; height: 54px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--blood); background: rgba(142, 27, 27, .12); color: #e59a91; }
.restricted-icon .icon { width: 24px; height: 24px; }

/* ===== Activité ===== */
.act-totals { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 18px; }
.act-totals > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.act-totals span { font-size: 11px; letter-spacing: .01em; text-transform: none; }
.act-totals b { font: 600 24px var(--mono); color: var(--bone); }
.table-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.table.activity td, .table.activity th { white-space: nowrap; }
.act-who { display: inline-flex; align-items: center; gap: 10px; }
.table.activity .rank { color: var(--bone-faint); }
.table.activity .rank-1 { color: var(--brass-hi); font-weight: 600; }
.table.activity .rank-2, .table.activity .rank-3 { color: var(--brass); }
.table.activity form { margin: 0; }
@media (max-width: 860px) { .act-totals { grid-template-columns: repeat(2, 1fr); } }

/* Fiche activité d'un membre */
button.act-who { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
button.act-who:hover b { color: var(--brass-hi); }
.act-info { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; letter-spacing: .01em; text-transform: none; color: var(--bone-faint); border: 1px solid var(--line-2); border-radius: 2px; padding: 2px 6px; }
.act-info .icon { width: 13px; height: 13px; }
button.act-who:hover .act-info { color: var(--bone); border-color: var(--brass-dim); }
.dlg.dlg-wide { width: min(680px, calc(100vw - 28px)); }
.act-prof-head { display: flex; align-items: center; gap: 14px; }
.act-prof-head p { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.act-totals.act-mini { margin: 0; gap: 8px; }
.act-totals.act-mini > div { padding: 8px 10px; }
.act-totals.act-mini b { font-size: 18px; }
.act-blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.act-block { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; background: var(--ink-2); }
.act-block .field-label { display: flex; align-items: center; gap: 6px; }
.act-block ul, .act-recent { list-style: none; margin: 6px 0 0; padding: 0; }
.act-block ul { max-height: 220px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
.act-block li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.act-block li:last-child { border-bottom: 0; }
.act-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.act-recent { max-height: 260px; overflow-y: auto; overscroll-behavior: contain; }
.act-recent li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.act-what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 860px) { .act-totals.act-mini { grid-template-columns: repeat(3, 1fr); } }

/* ===== Vote alerte ===== */
.vote-alert { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--r); color: var(--bone-dim); font-size: 13px; font-weight: 600; letter-spacing: .01em; text-transform: none; text-decoration: none; }
.vote-alert span { flex: 1; }
.vote-alert b { font-size: 12px; letter-spacing: 0; }
.vote-alert:hover, .vote-alert.active { color: var(--bone); border-color: var(--brass-dim); }
.vote-alert.running { border-color: var(--brass-dim); }
.vote-alert.running b { color: var(--brass-hi); }
.vote-alert .cd-done { color: var(--blood-hi); }
.vote-panel { text-align: center; }
.vote-clock { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0 22px; }
.vote-clock > .icon { width: 30px; height: 30px; color: var(--bone-faint); }
.vote-clock.running > .icon { color: var(--brass-hi); }
.vote-time { font-size: 54px; font-weight: 500; line-height: 1.1; color: var(--bone); letter-spacing: .02em; }
.vote-time.idle { font-size: 26px; color: var(--bone-faint); }
.vote-time.cd-done { color: var(--blood-hi); font-size: 30px; }
.vote-bar { width: min(420px, 100%); height: 6px; margin-top: 10px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.vote-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brass-dim), var(--brass-hi)); transition: width 1s linear; }
.vote-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.vote-actions form { margin: 0; }
.vote-delay { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.vote-delay label { width: 120px; }
@media (max-width: 860px) { .vote-time { font-size: 40px; } .vote-actions .btn { width: 100%; justify-content: center; } .vote-actions form { width: 100%; } }

/* Préventions de restart */
.restart-times { display: flex; flex-wrap: wrap; gap: 8px; }
.restart-times input { width: 120px; margin: 0; }
.switch-line { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--bone-dim); margin: 0; }
.switch-line input { width: auto; margin: 0; }

/* ===== Carte ===== */
:root { --mp-perso: #d9b56a; --mp-voiture: #d4473f; --mp-moto: #e08a2e; --mp-carton: #7fae5a; --mp-maison: #6fa8c9; --mp-table: #c98f5a; }
.map-toolbar { align-items: center; }
.map-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.mf { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid var(--line-2); border-radius: var(--r); background: transparent; color: var(--bone-faint); font: 600 12.5px var(--sans, inherit); cursor: pointer; opacity: .55; }
.mf .icon { width: 15px; height: 15px; color: var(--c); }
.mf .count { font: 12px var(--mono); padding: 1px 6px; border-radius: 2px; background: var(--ink-2); }
.mf.on { opacity: 1; color: var(--bone); border-color: var(--c); box-shadow: inset 0 -2px 0 var(--c); }
.place-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 14px; border: 1px solid var(--brass); border-radius: var(--r); color: var(--brass-hi); background: rgba(121, 184, 90, .07); }
.place-banner span { flex: 1; }
.place-banner[hidden] { display: none; }
.map-panel { padding: 14px; }
.map { position: relative; width: 100%; max-width: min(860px, calc((100vh - 120px) * 0.6955)); margin: 0 auto; user-select: none; -webkit-user-select: none; touch-action: pan-y; --z: 1; }
.map-stage { position: relative; transform-origin: 0 0; }
.map-stage.smooth { transition: transform .25s ease; }
.map-stage > img { display: block; width: 100%; height: auto; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .6)); -webkit-user-drag: none; }
.map.placing { cursor: crosshair; }
.map.placing .pin { pointer-events: none; }
.pin[hidden] { display: none; }
@keyframes pinPulse { 0% { box-shadow: 0 0 0 0 var(--c); } 70% { box-shadow: 0 0 0 18px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.pin-card img { display: block; width: 100%; height: 140px; object-fit: cover; background: var(--ink-2); }
.pin-card-body { display: flex; flex-direction: column; gap: 3px; padding: 9px 11px 10px; color: var(--bone); font-size: 13px; }
.pin-card-body b { font-size: 14px; }
.pin-type { font-size: 10.5px; letter-spacing: .01em; text-transform: none; color: var(--c); font-weight: 600; }
.pin-desc { color: var(--bone-dim); font-size: 12.5px; line-height: 1.4; white-space: normal; }
.mp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.mp-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: var(--r); overflow: hidden; }
.mp-card[hidden] { display: none; }
.mp-thumb { position: relative; overflow: hidden; display: grid; place-items: center; height: 170px; padding: 0; border: 0; background: var(--ink-2); color: var(--c); cursor: zoom-in; }
.mp-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-thumb > .icon { width: 46px; height: 46px; stroke-width: 1.2; opacity: .6; }
.mp-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; flex: 1; }
.mp-body h3 { margin: 0; font-size: 17px; }
.mp-body p { margin: 0; }
.mp-desc { color: var(--bone-dim); white-space: pre-line; line-height: 1.45; }
.mp-chip { border-color: var(--c); color: var(--c); }
.mp-chip .icon { width: 13px; height: 13px; }
.mp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.mp-detail-img { background: var(--ink-2); border-bottom: 1px solid var(--line); }
.mp-detail-img img { display: block; width: 100%; max-height: 60vh; object-fit: contain; }
.file-drop { display: block; text-transform: none; letter-spacing: 0; cursor: pointer; }
.file-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-drop span { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border: 1px solid var(--line-2); border-radius: var(--r); color: var(--bone-dim); font-weight: 400; }
.file-drop em { font-style: normal; }
.file-drop:hover span { border-color: var(--brass-dim); color: var(--bone); }
.img-preview { display: block; max-width: 100%; max-height: 180px; margin: 8px 0; border-radius: var(--r); border: 1px solid var(--line); }
.img-preview[hidden] { display: none; }
.check-line { display: flex; flex-direction: row; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--bone-dim); margin-top: 8px; }
.check-line input { width: auto; margin: 0; }
.check-line[hidden] { display: none; }
@media (max-width: 860px) {
  .map-panel { padding: 6px; }
  .pin-card { display: none; }
}

/* Zoom de la carte */
.map.zoomed { overflow: hidden; touch-action: none; cursor: grab; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line-2); }
.map.dragging { cursor: grabbing; }
.map.placing { cursor: crosshair; }
.map-zoom { position: absolute; top: 10px; right: 10px; z-index: 20; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 5px; background: rgba(12, 14, 18, .88); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
.zbtn { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid transparent; border-radius: 3px; background: transparent; color: var(--bone-dim); cursor: pointer; }
.zbtn:hover { color: var(--bone); border-color: var(--brass-dim); background: var(--surface-2); }
.zbtn .icon { width: 18px; height: 18px; }
.zlevel { font-size: 11px; color: var(--brass-hi); padding: 2px 0; }
.map-help { text-align: center; margin: 10px 0 0; }

/* ===== Marqueurs de carte : goutte colorée + icône + nom ===== */
.pin { position: absolute; width: 0; height: 0; padding: 0; border: 0; background: none; cursor: pointer; z-index: 2; transform: scale(calc(1 / var(--z))); transform-origin: 0 0; }
.pin[hidden] { display: none; }
.pin:hover, .pin:focus-visible { z-index: 8; outline: none; }
.pin-head { position: absolute; left: -17px; top: -42px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--c); border: 2px solid #f3e6c8; box-shadow: 0 4px 10px rgba(0, 0, 0, .7); transition: transform .12s; }
.pin-head .icon { transform: rotate(45deg); width: 19px; height: 19px; color: #0d1117; stroke-width: 2.3; }
.pin:hover .pin-head, .pin:focus-visible .pin-head { transform: rotate(-45deg) scale(1.14); }
.pin-label { position: absolute; left: 0; top: 3px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; max-width: 170px; overflow: hidden; text-overflow: ellipsis;
  padding: 2px 7px; border-radius: 3px; background: rgba(9, 12, 15, .86); border: 1px solid var(--c); color: #f3e6c8; font: 600 11.5px/1.3 var(--sans, inherit); letter-spacing: .02em; pointer-events: auto; }
.pin-label .icon { width: 11px; height: 11px; flex: none; color: var(--c); }
.map.no-labels .pin-label { display: none; }
.pin.pulse .pin-head { animation: pinPulse 1.4s ease-out 2; }
@keyframes pinPulse { 0% { box-shadow: 0 0 0 0 var(--c); } 70% { box-shadow: 0 0 0 20px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.pin-ghost { --c: var(--brass-hi); pointer-events: none; }
.pin-ghost .pin-head { animation: pinPulse 1.4s ease-out infinite; }
.pin-card { position: absolute; left: 0; bottom: 52px; transform: translateX(-50%) scale(.96); width: 240px; background: var(--surface); border: 1px solid var(--c); border-radius: var(--r);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .75); overflow: hidden; text-align: left; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .12s, transform .12s; z-index: 10; }
.pin-card.fx { left: auto; right: -24px; transform: scale(.96); }
.pin-card.fy { bottom: auto; top: 30px; }
.pin:hover .pin-card, .pin:focus-visible .pin-card { opacity: 1; visibility: visible; transform: translateX(-50%) scale(1); }
.pin:hover .pin-card.fx, .pin:focus-visible .pin-card.fx { transform: scale(1); }
.mf-labels { --c: var(--brass); }
.mp-vis { border-color: var(--line-2); color: var(--bone-dim); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.mp-vis .icon { width: 12px; height: 12px; }
.mp-top { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-vis-line { display: flex; align-items: center; gap: 6px; color: var(--brass-hi) !important; }
.mp-vis-line .icon { width: 14px; height: 14px; }
@media (max-width: 860px) {
  .pin-head { left: -14px; top: -35px; width: 28px; height: 28px; }
  .pin-head .icon { width: 15px; height: 15px; }
  .pin-label { font-size: 10.5px; padding: 1px 5px; }
}

/* Plusieurs images par point */
.img-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 8px; }
.img-list:empty { display: none; }
.img-tile { position: relative; aspect-ratio: 4 / 3; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--ink-2); }
.img-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-tile .cover-tag { display: none; position: absolute; left: 4px; bottom: 4px; font-size: 9.5px; font-weight: 600; letter-spacing: .01em; text-transform: none; padding: 1px 5px; border-radius: 2px; background: rgba(9, 12, 15, .85); color: var(--brass-hi); }
.img-tile:first-child { border-color: var(--brass); }
.img-tile:first-child .cover-tag { display: block; }
.img-tile:first-child .tile-first { display: none; }
.tile-btn { position: absolute; top: 4px; width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line-2); border-radius: 50%; background: rgba(9, 12, 15, .85); color: var(--bone); font-size: 14px; line-height: 1; cursor: pointer; }
.tile-del { right: 4px; }
.tile-del:hover { color: #ffffff; background: var(--blood); border-color: var(--blood-hi); }
.tile-first { left: 4px; color: var(--brass-hi); font-size: 12px; }
.tile-first:hover { border-color: var(--brass); }
.img-count { position: absolute; right: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 3px; background: rgba(9, 12, 15, .85); color: var(--bone); font: 600 11.5px var(--mono); }
.img-count .icon { width: 12px; height: 12px; }
.pin-card-img { position: relative; display: block; }
.mp-gallery .mp-detail-img { position: relative; }
.gal-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line-2); border-radius: 50%; background: rgba(9, 12, 15, .8); color: var(--bone); font-size: 26px; line-height: 1; cursor: pointer; }
.gal-nav:hover { border-color: var(--brass); color: var(--brass-hi); }
.gal-nav[hidden], .gal-pos[hidden] { display: none; }
.gal-prev { left: 10px; }
.gal-next { right: 10px; }
.gal-pos { position: absolute; right: 10px; bottom: 10px; padding: 2px 8px; border-radius: 3px; background: rgba(9, 12, 15, .85); color: var(--bone); font-size: 12px; }
.gal-thumbs { display: flex; gap: 6px; padding: 8px 10px; overflow-x: auto; overscroll-behavior-x: contain; background: var(--ink-2); border-bottom: 1px solid var(--line); }
.gal-thumbs:empty { display: none; }
.gal-thumb { flex: none; width: 64px; height: 48px; padding: 0; border: 2px solid transparent; border-radius: 3px; overflow: hidden; background: none; cursor: pointer; opacity: .6; }
.gal-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-thumb.on, .gal-thumb:hover { opacity: 1; border-color: var(--brass); }

/* Type « Teub » : logo en texte */
:root { --mp-Teub: #b57be0; }
.glyph { display: inline-block; font: 600 13px/1 system-ui, 'Segoe UI', 'Noto Sans', 'Noto Sans Arabic', sans-serif; white-space: nowrap; letter-spacing: 0; text-transform: none; }
.pin-head.pin-head-glyph { left: 0; top: -36px; width: auto; min-width: 34px; height: 28px; padding: 0 9px; border-radius: 14px; transform: translateX(-50%); }
.pin-head.pin-head-glyph::after { content: ''; position: absolute; left: 50%; bottom: -7px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: #f3e6c8; }
.pin-head-glyph .glyph { color: #0d1117; font-size: 14px; padding-top: 3px; }
.pin:hover .pin-head.pin-head-glyph, .pin:focus-visible .pin-head.pin-head-glyph { transform: translateX(-50%) scale(1.12); }
.type-tile .glyph { font-size: 17px; height: 28px; display: flex; align-items: center; }
.mf .glyph { color: var(--c); font-size: 12px; }
.mp-chip .glyph { font-size: 11px; }
.mp-thumb > .glyph { font-size: 30px; color: var(--c); opacity: .75; }
@media (max-width: 860px) { .pin-head.pin-head-glyph { left: 0; top: -31px; height: 24px; padding: 0 7px; } .pin-head-glyph .glyph { font-size: 12px; } }

/* ===== Sélecteur « Visible par » : grades + membres ===== */
.access-pick { display: grid; gap: 6px; }
.access-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 6px; font-size: 11px; font-weight: 700; letter-spacing: .01em; text-transform: none; color: var(--bone-dim); }
.access-sub .icon { width: 13px; height: 13px; color: var(--brass); }
.access-sub .access-count { text-transform: none; letter-spacing: 0; font-weight: 500; }
.access-search { margin-left: auto; flex: 1 1 160px; max-width: 220px; padding: 5px 9px !important; font-size: 13px !important; text-transform: none; letter-spacing: 0; }
.access-members { max-height: 190px; overflow-y: auto; padding-right: 4px; }
.member-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--bone); padding: 2px 9px 2px 3px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--ink-2); }
.member-chip::before { content: ''; width: 14px; height: 14px; border-radius: 50%; background: var(--c, var(--bone-faint)); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .35); }
.conf-grade-list .member-chip { background: none; }
.perm input:checked + .member-chip { border-color: var(--brass); color: var(--brass-hi); }
.card-vis .member-chip { font-size: 10.5px; padding: 0 7px 0 2px; }
.card-vis .member-chip::before { width: 10px; height: 10px; }
.code-grades .member-chip { font-size: 11.5px; }
.task .card-vis { margin-top: 6px; }
.vis-lock { display: inline-flex; vertical-align: middle; color: var(--brass-hi); }
.vis-lock .icon { width: 13px; height: 13px; }

/* ===== Commandes ===== */
.seg.seg-2 { grid-template-columns: repeat(2, 1fr); }
.seg span .icon { width: 15px; height: 15px; margin-right: 6px; vertical-align: -3px; }
.order-filters { display: flex; flex-wrap: wrap; gap: 10px; }
.orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; margin-bottom: 26px; }
.order-card { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--brass); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.order-card.order-done { border-left-color: #5b7599; }
.order-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.order-id { font-size: 12px; color: var(--bone-faint); }
.order-client { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; font-size: 20px; }
.order-client .icon { width: 18px; height: 18px; color: var(--brass); flex: none; }
.order-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.order-lines li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 3px; min-width: 0; }
.order-lines .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.order-qty { color: var(--brass-hi); min-width: 48px; }
.order-stock { display: inline-flex; align-items: center; gap: 4px; font: 12px var(--mono); color: var(--bone-dim); white-space: nowrap; }
.order-stock .icon { width: 12px; height: 12px; }
.order-stock.is-short { color: #e07a6a; }
.order-free { font-size: 11px; color: var(--bone-faint); font-style: italic; white-space: nowrap; }
.order-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.order-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 22px; }
.order-sum .panel { margin: 0; }
.order-sum .section-title .icon { width: 15px; height: 15px; vertical-align: -2px; color: var(--brass); }
.order-totals { max-height: 340px; overflow-y: auto; }
.order-clients { display: grid; gap: 6px; }
.order-client-sum { border: 1px solid var(--line); border-radius: 3px; background: var(--ink-2); }
.order-client-sum summary { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; flex-wrap: wrap; }
.order-client-sum summary .icon { width: 15px; height: 15px; color: var(--brass); }
.order-client-sum summary .faint { margin-left: auto; }
.order-client-sum .order-lines { padding: 0 8px 8px; }
.order-client-sum .order-lines li { background: var(--surface); }
.order-groups { margin-top: 10px; }
.order-groups summary { cursor: pointer; display: flex; align-items: center; gap: 8px; }
.order-groups summary .icon { width: 15px; height: 15px; color: var(--brass); }
.order-group-list { display: grid; gap: 8px; margin-top: 14px; }
.order-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.order-group .inline-form { flex: 1 1 260px; }
.ol-rows { display: grid; gap: 8px; margin-bottom: 8px; }
.ol-row { display: grid; grid-template-columns: 1fr 96px auto; gap: 8px; align-items: center; }
.ol-row .ol-hint { grid-column: 1 / -1; margin-top: -4px; }
.ol-hint.is-ok { color: #a9c083; }
.ol-hint.is-short, .is-short { color: #e07a6a; }
@media (max-width: 560px) { .orders { grid-template-columns: 1fr; } .ol-row { grid-template-columns: 1fr 74px auto; } }
[data-ofield][hidden], [data-otake-box][hidden] { display: none !important; }
.order-card > .code-meta { margin-top: auto; }

/* ===== Commandes : choix de ressource ===== */
.ol-row { grid-template-columns: minmax(0, 1fr) 96px auto; }
.ol-name { position: relative; min-width: 0; }
.ol-name input { width: 100%; }
.ol-suggest { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 260px; overflow-y: auto; background: var(--surface-2, var(--surface)); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 14px 34px rgba(0, 0, 0, .7); padding: 4px; }
.ol-opt { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 9px; border: 0; border-radius: 3px; background: none; color: var(--bone); text-align: left; cursor: pointer; font: inherit; font-size: 14px; }
.ol-opt span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-opt small { margin-left: 8px; color: var(--bone-faint); font-size: 11.5px; }
.ol-opt b { color: var(--brass-hi); font-size: 12.5px; flex: none; }
.ol-opt:hover, .ol-opt.on { background: rgba(142, 27, 27, .28); }
.ol-opt-none { padding: 8px 9px; font-size: 12.5px; color: var(--bone-faint); font-style: italic; }
.ol-create { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: -2px; }
.ol-create[hidden], .ol-create select[hidden] { display: none !important; }
.ol-create .check { margin: 0; text-transform: none; letter-spacing: 0; font-size: 13px; }
.ol-create select { width: auto; flex: 1 1 180px; max-width: 280px; padding: 6px 9px; font-size: 13px; }
/* Profil cumulé (Journal / Activité) */
.hist-profile { display: grid; gap: 14px; }
.hist-profile .act-prof-head { display: flex; align-items: center; gap: 14px; }
.hist-profile .act-prof-head h2 { margin: 0; }
.tabs-sm { margin-bottom: 0; padding-bottom: 12px; }
.tabs-sm .tab { padding: 6px 12px; font-size: 13px; }
.table.prof-res td, .table.prof-res th { padding: 7px 10px; }
.table.prof-res td:not(:first-child), .table.prof-res th:not(:first-child) { text-align: right; white-space: nowrap; }
.pr-add b { color: #a9c083; }
.pr-take b { color: #e0a06a; }
.pr-pos { color: #a9c083; font-weight: 700; }
.pr-neg { color: #e07a6a; font-weight: 700; }
/* Visites (IP) */
.table.visits td { vertical-align: top; }
.table.visits .ip { color: var(--brass-hi); text-decoration: none; }
.table.visits .ip:hover { text-decoration: underline; }
.visit-path { word-break: break-all; color: var(--bone-dim); }
.table.visits .chip { margin: 1px 0; }

/* Commandes : fréquence radio du client */
.order-radio { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; padding: 2px 8px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13px; color: var(--bone); background: var(--ink-2); }
.order-radio .icon { width: 14px; height: 14px; color: var(--brass); }
.order-client-sum summary .order-radio { margin-top: 0; }
.order-group-kind .icon { width: 16px; height: 16px; color: var(--brass); }
.order-group .order-radio-input { max-width: 150px; }

/* Stock : emplacement dans la fenêtre de mouvement */
.act-loc { margin-top: 4px; color: var(--bone); font-size: 14px; }

/* Présences (checks Discord) */
.checks { display: grid; gap: 16px; }
.check-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.check-card.closed { opacity: .75; }
.check-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.check-when { font-size: 20px; color: var(--bone); margin: 4px 0 2px; }
.check-reason { margin: 8px 0 0; }
.check-meta { margin-top: 4px; }
.check-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.check-col h4 { margin: 0 0 6px; font-size: 13px; letter-spacing: .01em; text-transform: none; }
.check-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.check-col li { border: 1px solid var(--line-2); border-radius: 2px; padding: 2px 8px; font-size: 14px; }
.check-col.yes h4 { color: #a9c083; } .check-col.yes li { border-color: rgba(91, 117, 153, .5); }
.check-col.no h4 { color: #e08a80; } .check-col.no li { border-color: rgba(176, 42, 36, .5); }
.check-col.late h4 { color: #e0b866; } .check-col.late li { border-color: rgba(201, 162, 39, .5); }
.btn.is-on.btn-late { background: rgba(201, 162, 39, .2); border-color: rgba(201, 162, 39, .8); color: #f0d48a; }
.chk-late { display: inline-block; } .chk-late > summary { list-style: none; cursor: pointer; } .chk-late > summary::-webkit-details-marker { display: none; }
.chk-late[open] { display: block; flex-basis: 100%; order: 5; }
.chk-late-form { display: flex !important; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 10px; padding: 12px; border: 1px solid rgba(201, 162, 39, .4); border-radius: var(--r); }
.chk-late-form label { flex: 1 1 160px; } .chk-late-form label:first-of-type { flex: 0 1 140px; }
.check-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.check-actions form { display: inline; }
.btn.is-on.btn-yes { background: rgba(91, 117, 153, .25); border-color: rgba(91, 117, 153, .8); color: #c9dca8; }
.btn.is-on.btn-no { background: rgba(142, 27, 27, .3); border-color: var(--blood-hi); color: #f1b0a8; }
@media (max-width: 760px) { .check-cols { grid-template-columns: 1fr; } }
.check-dt { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Recherche du stock */
.search-count { color: var(--bone-faint); font-size: 13px; white-space: nowrap; }
.search-empty { margin: 6px 0 18px; }
.search-empty a { color: var(--brass-hi); }

/* ===================================================================
   Refonte « carnet de camp » — par-dessus le style de base.
   Métal brut, papier jauni, ruban adhésif, tampons, pochoir.
   =================================================================== */
@font-face { font-family: 'Saira Stencil One'; font-style: normal; font-weight: 400; font-display: swap; src: url(/static/fonts/SairaStencil-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Saira Stencil One'; font-style: normal; font-weight: 400; font-display: swap; src: url(/static/fonts/SairaStencil-lat.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Special Elite'; font-style: normal; font-weight: 400; font-display: swap; src: url(/static/fonts/SpecialElite-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Special Elite'; font-style: normal; font-weight: 400; font-display: swap; src: url(/static/fonts/SpecialElite-lat.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --ink: #0d0f12;
  --ink-2: #090b0d;
  --surface: #14171c;
  --surface-2: #1b2026;
  --line: #222831;
  --line-2: #333d4a;
  --bone: #cdd6e2;
  --bone-dim: #8494ab;
  --bone-faint: #59687e;
  --paper: #bdd8b0;
  --paper-ink: #191e25;
  --tape: #9ec78a;
  --olive: #506788;
  --ok: #5c7599;
  --r: 2px;
  --stencil: 'Saira Stencil One', 'Oswald', sans-serif;
  --type: 'Special Elite', 'Courier New', monospace;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --stamp: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='40'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -3 2.4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23s)'/%3E%3C/svg%3E");
}

/* ---------- Fond : béton sale, quelques taches, pas de halo ---------- */
body {
  background-color: var(--ink);
  background-image:
    radial-gradient(420px 260px at 82% 14%, rgba(110, 30, 20, .10), transparent 70%),
    radial-gradient(300px 380px at 12% 78%, rgba(60, 90, 45, .08), transparent 70%),
    radial-gradient(180px 140px at 64% 92%, rgba(0, 0, 0, .35), transparent 70%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .008) 0 2px, transparent 2px 7px);
}
body::before { opacity: .5; background-image: var(--grain); mix-blend-mode: overlay; }
::selection { background: rgba(142, 27, 27, .6); color: #ffffff; }
a { color: var(--tape); }
a:hover { color: var(--bone); }
code { font-family: var(--mono); background: #07090b; border-color: var(--line-2); color: var(--tape); }
.empty { font-family: var(--type); font-style: normal; color: var(--bone-faint); }

/* ---------- Barre de gauche : plaque de métal ---------- */
.sidebar {
  background: #0b0d10 var(--grain);
  border-right: 2px solid #050505;
  box-shadow: inset -1px 0 0 #1f242c;
}
.side-brand { border-bottom: 1px solid var(--line-2); padding-bottom: 18px; }
.side-brand img { filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .55)) saturate(.9); }
.side-brand .name { font-family: var(--stencil); letter-spacing: .01em; font-size: 25px; color: var(--bone); }
.side-brand .tag { font-family: var(--type); letter-spacing: .01em; text-transform: none; font-size: 12.5px; color: var(--tape); opacity: .85; }
.side-nav .group { font-family: var(--type); letter-spacing: .01em; text-transform: none; font-size: 13px; color: var(--bone-faint); display: flex; align-items: center; gap: 8px; }
.side-nav .group::after { content: ''; flex: 1; border-top: 1px solid var(--line-2); }
.side-nav a { border-radius: 0; isolation: isolate; color: var(--bone-dim); font-weight: 500; }
.side-nav a:hover { background: transparent; color: var(--bone); }
.side-nav a:hover .icon { color: var(--tape); }
/* Lien actif : un coup de peinture rouge passé à la main */
.side-nav a.active { background: transparent; color: #f4ebdc; }
.side-nav a.active::before {
  content: ''; position: absolute; inset: 3px -4px 3px -6px; width: auto; z-index: -1; border-radius: 0;
  background: linear-gradient(92deg, rgba(142, 27, 27, .95), rgba(126, 24, 22, .85) 70%, rgba(126, 24, 22, .35));
  clip-path: none;
}
.side-nav a.active .icon { color: #f4ebdc; }
.side-foot { border-top: 1px solid var(--line-2); }
.who-box .initial { font-family: var(--stencil); border-radius: 2px; background: #15191f; color: var(--tape); }
.logout button { border-radius: 0; font-family: var(--type); font-size: 13.5px; font-weight: 400; }
.vote-btn { border-radius: 0; border-style: solid; background: rgba(158, 199, 138, .05); color: var(--tape); }
.vote-btn:hover { background: rgba(158, 199, 138, .1); border-style: solid; }

/* ---------- En-tête de page : pochoir + trait de peinture ---------- */
.page-head { border-bottom: 1px solid var(--line-2); padding-bottom: 20px; position: relative; }
.page-head h1, .welcome h1 { font-family: var(--stencil); font-weight: 400; letter-spacing: .04em; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.05; color: var(--bone); }
.page-head h1 { position: relative; display: inline-block; }
.page-head h1::after {
  content: ''; position: absolute; left: -4px; right: 20%; bottom: -6px; height: 7px;
  background: var(--blood); opacity: .85; z-index: -1;
  clip-path: none;
}
.kicker { font-family: var(--type); letter-spacing: .04em; text-transform: none; font-size: 14px; color: var(--tape); margin-bottom: 4px; }
.kicker::before { content: '// '; color: var(--bone-faint); }
.kicker a { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.page-head .lead { color: var(--bone-dim); }

/* ---------- Panneaux : tôle rivetée ---------- */
.panel {
  border-radius: var(--r); border: 1px solid #21262e;
  background-color: var(--surface);
  background-image:
    radial-gradient(circle at 9px 9px, #2d3541 1.6px, #090b0d 2.2px, transparent 2.8px),
    radial-gradient(circle at calc(100% - 9px) 9px, #2d3541 1.6px, #090b0d 2.2px, transparent 2.8px),
    radial-gradient(circle at 9px calc(100% - 9px), #2d3541 1.6px, #090b0d 2.2px, transparent 2.8px),
    radial-gradient(circle at calc(100% - 9px) calc(100% - 9px), #2d3541 1.6px, #090b0d 2.2px, transparent 2.8px),
    linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 40%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 3px 0 rgba(0, 0, 0, .45);
}
/* Titre de panneau : bout de ruban adhésif collé de travers */
.panel-title {
  display: inline-flex; align-self: flex-start; width: fit-content;
  font-family: var(--type); font-weight: 400; font-size: 15px; letter-spacing: .03em; text-transform: none;
  color: var(--paper-ink); background: var(--tape); padding: 4px 14px 3px; transform: none;
  clip-path: none;
  box-shadow: none; margin-left: -4px;
}
.panel-title .icon { color: var(--paper-ink); width: 16px; height: 16px; }
.panel-head .panel-title { margin-bottom: 0; }
.panel > .panel-title { margin-bottom: 14px; }
.panel-link { font-family: var(--type); color: var(--tape); }
.section-title { font-family: var(--type); font-weight: 400; letter-spacing: .03em; text-transform: none; font-size: 16px; color: var(--bone); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 14px; }
.section-title::after { content: ''; flex: 1 1 60px; border-top: 1px solid var(--line-2); min-width: 40px; }
.sub-title { font-family: var(--type); font-weight: 400; letter-spacing: .03em; text-transform: none; font-size: 14px; color: var(--bone-dim); }
.note { border-left: 3px solid var(--tape); font-family: var(--body); }
.divider { border-top: 1px solid var(--line-2); }

/* ---------- Chiffres clés : marquages au pochoir ---------- */
.stats { gap: 0; background: transparent; border: 1px solid #21262e; box-shadow: 0 3px 0 rgba(0, 0, 0, .45); }
.stat { background: var(--surface) var(--grain); border-right: 1px solid var(--line-2); }
.stat:last-child { border-right: 0; }
.stat-n { font-family: var(--stencil); font-weight: 400; font-size: 36px; letter-spacing: .02em; }
.stat-l { font-family: var(--type); letter-spacing: .02em; text-transform: none; font-size: 13.5px; color: var(--bone-faint); }

/* ---------- Fiches (stock, codes, tâches, membres) ---------- */
.card, .code-card, .task, .member, .rung, .check-card, .recipe, .plan-card {
  border-radius: var(--r); border-color: #21262e;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .45);
}
.card { background: var(--surface) linear-gradient(180deg, rgba(255, 255, 255, .02), transparent 50%); }
.card:hover, .code-card:hover { border-color: var(--line-2); }
.card-cat { font-family: var(--type); letter-spacing: .03em; text-transform: none; font-size: 13px; }
.card-qty b { font-family: var(--stencil); font-weight: 400; font-size: 38px; }
.card-qty span, .task-label { font-family: var(--type); letter-spacing: .02em; text-transform: none; font-size: 12.5px; }
.card-actions { border-top: 1px solid var(--line-2); }
.card.lv-low { border-top: 3px solid var(--warn); }
.card.lv-out { border-top: 3px solid var(--blood-hi); }
.task { border-left-width: 4px; }
.task-count b { font-family: var(--stencil); font-weight: 400; }
.task-reason, .code-comment { border-left: 2px solid var(--line-2); }
.code-value { background: #07090b; border-radius: 0; }
.code-meta, .member-sub { font-family: var(--type); font-size: 12.5px; }
.rank { font-family: var(--stencil); }

/* ---------- Boutons : peints, un peu usés ---------- */
.btn {
  font: 500 14px var(--display); letter-spacing: .01em; text-transform: none;
  border-radius: 0; padding: 8px 15px; background: #1c2128; border: 1px solid #36404f; border-bottom-width: 2px; border-bottom-color: #080a0c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.btn:hover { background: #222831; border-color: #4b5a6f; border-bottom-color: #080a0c; }
.btn:active { transform: translateY(1px); border-bottom-width: 1px; margin-bottom: 1px; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-primary { background: var(--blood) var(--grain); border-color: #a2271f; border-bottom-color: #3a0a0a; color: #ecf5e8; text-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.btn-primary:hover { background-color: #a3221d; border-color: #c03a2e; border-bottom-color: #3a0a0a; color: #ffffff; }
.btn-brass { background: rgba(158, 199, 138, .07); border-color: #536a8b; border-bottom-color: #222c3a; color: var(--tape); }
.btn-brass:hover { background: rgba(158, 199, 138, .15); border-color: var(--tape); border-bottom-color: #222c3a; color: #efe2c0; }
.btn-ghost { background: transparent; border-color: #2c3440; border-bottom-color: #080a0c; }
.btn-ghost:hover { background: rgba(255, 255, 255, .03); }
.btn-danger { background: transparent; border-color: rgba(176, 42, 36, .6); border-bottom-color: #3a0a0a; color: #e8968c; }
.btn-danger:hover { color: #ffffff; border-color: var(--blood-hi); background: repeating-linear-gradient(-45deg, rgba(142, 27, 27, .45) 0 8px, rgba(20, 8, 6, .6) 8px 16px); }
.btn-icon { padding: 6px 8px; }
.act-add, .act-take, .act-borrow { background: transparent; }

/* ---------- Champs : fiche à remplir ---------- */
input, select, textarea {
  border-radius: 0; background: #080a0c; border: 1px solid #29313d; border-bottom-color: #404d5e;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, .45);
}
input:focus, select:focus, textarea:focus { border-color: var(--tape); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .45), 0 0 0 1px var(--tape); }
input[type=checkbox], input[type=radio] { box-shadow: none; accent-color: var(--blood-hi); }
label, .field-label { font-family: var(--type); font-weight: 400; letter-spacing: .02em; text-transform: none; font-size: 14px; color: var(--bone-dim); }
label .opt, .field-label .opt { font-family: var(--body); font-size: 12.5px; }
label.check, .perm, .pick-item { font-family: var(--body); }
.seg { border-radius: 0; border-color: #29313d; }
.seg span { font-family: var(--display); font-weight: 500; letter-spacing: .01em; }
.seg input:checked + span { background: #1e242c; }

/* ---------- Étiquettes : coups de tampon ---------- */
.chip {
  font-family: var(--type); font-weight: 400; letter-spacing: .01em; font-size: 12px;
  border: 1.5px solid currentColor; border-radius: 3px; padding: 1px 7px 0; transform: none;
  -webkit-mask-image: var(--stamp); mask-image: var(--stamp); -webkit-mask-size: 90px 40px; mask-size: 90px 40px;
}
.chip-out { background: transparent; border-color: var(--blood-hi); color: #ef7b6f; }
.chip-add { border-color: currentColor; color: #a9bd7c; }
.chip-take { border-color: currentColor; color: #e8796d; }
.chip-low, .chip-borrow { color: #dba94c; border-color: currentColor; }
.grade-chip { border-radius: 0; font-family: var(--type); font-weight: 400; letter-spacing: .04em; text-transform: none; font-size: 13px; background: #0a0c0f; }
.via { font-family: var(--type); letter-spacing: .02em; text-transform: none; font-size: 12px; }

/* ---------- Tableaux : registre ---------- */
.table th { font-family: var(--type); font-weight: 400; letter-spacing: .03em; text-transform: none; font-size: 13px; color: var(--bone-faint); border-bottom: 2px solid var(--line-2); }
.table td { border-bottom: 1px solid var(--line); }
.event { border-bottom: 1px solid var(--line); }
.event-time { font-family: var(--type); font-size: 12.5px; }
.rows > li, .kv li { border-bottom-style: solid; }

/* ---------- Onglets (catégories) : étiquettes de caisse ---------- */
.tabs { border-bottom: 1px solid var(--line-2); }
.tab { border-radius: 0; background: #0f1216; border-color: #252c35; }
.tab.active { background: #2a1210; border-color: #7a1e19; box-shadow: inset 0 -3px 0 var(--blood-hi); }
.tab .count { font-family: var(--type); border-radius: 0; background: #080a0c; }

/* ---------- Jauges : remplies à la main ---------- */
.meter { height: 6px; background: #07090b; border: 1px solid #21262e; border-radius: 0; }
.meter span { background: repeating-linear-gradient(-45deg, var(--tape) 0 5px, #6b84a7 5px 10px); }
.task-meter span { background: repeating-linear-gradient(-45deg, #a3221d 0 5px, #7d1915 5px 10px); }
.task-done .task-meter span, .plan-card.is-done .meter span { background: var(--ok); }

/* ---------- Fenêtres : dossier ---------- */
.dlg { border-radius: 0; border: 1px solid #36404f; background: var(--surface) var(--grain); box-shadow: 0 20px 0 -8px rgba(0, 0, 0, .5), 0 30px 80px rgba(0, 0, 0, .7); }
.dlg-head { border-bottom: 1px solid var(--line-2); background: rgba(0, 0, 0, .18); }
.dlg-head h2 { font-family: var(--stencil); font-weight: 400; letter-spacing: .04em; font-size: 24px; }
.dlg-head p { font-family: var(--body); }

/* ---------- Messages : note épinglée ---------- */
.flash, .toast { border-radius: 0; border-left-width: 4px; background: #15191f var(--grain); box-shadow: 0 2px 0 rgba(0, 0, 0, .4); }
.flash span, .toast { font-family: var(--type); font-size: 14.5px; }

/* ---------- Divers ---------- */
.plate { border-radius: 2px; }
.avatar-ph { font-family: var(--stencil); }
.topbar { background: rgba(9, 11, 13, .96) var(--grain); border-bottom: 1px solid var(--line-2); }
.topbar .name { font-family: var(--stencil); letter-spacing: .01em; }
.burger { border-radius: 0; }
.foot { border-top: 1px solid var(--line-2); font-family: var(--type); }
.auth-card h1 { font-family: var(--stencil); font-weight: 400; letter-spacing: .01em; }
.auth-card .sub { font-family: var(--type); letter-spacing: .01em; text-transform: none; font-size: 14px; color: var(--tape); }
.auth-form { border-radius: 0; background: var(--surface) var(--grain); box-shadow: 0 3px 0 rgba(0, 0, 0, .45); }
.err-code { font-family: var(--stencil); font-weight: 400; }
.perm, .pick, .conf-grades, .card-loc, .card-vis, .conf-check { border-radius: 0; }
.rung { border-left-width: 4px; }
.pick-cat { font-family: var(--type); letter-spacing: .03em; text-transform: none; font-size: 13px; }
.perm-box summary { font-family: var(--type); font-weight: 400; letter-spacing: .03em; text-transform: none; font-size: 14px; color: var(--tape); }
@media (max-width: 860px) {
  .stat { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .page-head h1, .welcome h1 { font-size: 30px; }
}
.vote-alert { margin: 8px 14px 0; border-radius: 0; font-family: var(--type); font-weight: 400; letter-spacing: .03em; text-transform: none; font-size: 13.5px; }
@media (max-width: 860px) { .vote-alert { margin: 0; } }
.panel-title { white-space: nowrap; max-width: 100%; } .panel-head { flex-wrap: wrap; row-gap: 8px; }

/* ================= Fabrication ================= */
.workshop { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.workshop-tools { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.workshop-tools .search-wrap { max-width: 420px; }
.recipes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.recipe { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 10px; transition: border-color .12s; }
.recipe[hidden] { display: none; }
.recipe.is-picked { border-color: #536a8b; }
.recipe.is-picked::after { /* bout de ruban : « dans le bon » */
  content: 'dans le bon'; position: absolute; top: -9px; right: 14px; font: 12px var(--type, monospace); color: var(--paper-ink, #1e2126);
  background: var(--tape, #9ec78a); padding: 1px 10px 0; transform: none;
  clip-path: none;
}
.recipe-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.recipe-top h3 { margin: 0; font: 500 19px/1.2 var(--display); letter-spacing: .03em; color: var(--bone); }
.recipe-yield { font: 12.5px var(--type, monospace); color: var(--bone-faint); margin-top: 2px; }
.recipe-ings { list-style: none; margin: 0; padding: 8px 0 0; border-top: 1px solid var(--line-2); display: grid; gap: 3px; }
.recipe-ings li, .tk-list li { display: flex; align-items: baseline; gap: 6px; font-size: 14.5px; }
.recipe-ings li span, .tk-list li span { min-width: 0; }
.recipe-ings li i, .tk-list li i { flex: 1; border-bottom: 1px dotted currentColor; opacity: .35; transform: translateY(-4px); min-width: 12px; }
.recipe-ings li b { font: 500 14px var(--mono); color: var(--tape, #9ec78a); }
.sub-tag { font: 11px var(--type, monospace); color: var(--bone-faint); border: 1px solid var(--line-2); padding: 0 4px; }
.recipe-note { margin: 0; font-size: 13px; color: var(--bone-dim); border-left: 2px solid var(--line-2); padding-left: 8px; }
.recipe-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-2); }
.recipe-by { font: 12px var(--type, monospace); color: var(--bone-faint); }
.stepper { display: inline-grid; grid-template-columns: 38px 70px 38px; height: 38px; border: 1px solid #36404f; background: #080a0c; }
.stepper button { background: #1c2128; border: 0; color: var(--bone); font: 500 20px/1 var(--display); cursor: pointer; }
.stepper button:hover { background: #29313d; color: #ffffff; }
.stepper button:active { background: var(--blood); }
.stepper input { border: 0; border-left: 1px solid #29313d; border-right: 1px solid #29313d; box-shadow: none; text-align: center; padding: 0 4px; font: 500 16px var(--mono); -moz-appearance: textfield; appearance: textfield; background: transparent; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.is-picked .stepper { border-color: #536a8b; }
.is-picked .stepper input { color: var(--tape, #9ec78a); }

/* Le bon de fabrication : ticket papier */
.workshop-side { position: sticky; top: 18px; display: grid; gap: 14px; }
.ticket {
  position: relative; color: var(--paper-ink, #191e25); font-family: var(--type, monospace);
  background: var(--paper, #bdd8b0); padding: 18px 18px 22px;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .18), transparent 30%), radial-gradient(160px 90px at 85% 80%, rgba(69, 114, 46, .18), transparent 70%);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .3), 0 12px 24px rgba(0, 0, 0, .45);
  transform: none;
  clip-path: none;
}
.ticket-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 2px solid rgba(25, 30, 37, .5); }
.ticket-head b { font: 400 19px var(--stencil, sans-serif); letter-spacing: .01em; text-transform: none; }
.ticket-date { font-size: 13px; opacity: .7; }
.ticket-empty p { margin: 4px 0; font-size: 14.5px; }
.ticket h4 { margin: 14px 0 4px; font: 400 13px var(--type, monospace); text-transform: none; letter-spacing: .01em; opacity: .7; }
[data-tk-body] > h4:first-child { margin-top: 0; }
.tk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tk-list li { font-size: 15px; flex-wrap: wrap; }
.tk-list li b { font: 600 15px var(--mono); }
.tk-list small { font-size: 12px; opacity: .7; }
.tk-list .tk-extra { flex-basis: 100%; padding-left: 10px; }
.tk-x { border: 0; background: none; color: inherit; font: 18px/1 var(--mono); cursor: pointer; opacity: .5; padding: 0 2px; margin-left: 2px; }
.tk-x:hover { opacity: 1; color: #8e1b1b; }
.tk-total { display: flex; gap: 18px; margin-top: 14px; padding-top: 10px; border-top: 2px solid rgba(25, 30, 37, .5); }
.tk-total span { display: block; font-size: 12px; text-transform: none; letter-spacing: .01em; opacity: .7; }
.tk-total b { font: 400 30px/1.1 var(--stencil, sans-serif); color: #7d1915; }
.tk-clear { margin-top: 12px; background: none; border: 0; padding: 0; color: inherit; opacity: .6; font: 13px var(--type, monospace); text-decoration: underline; cursor: pointer; }
.tk-clear:hover { opacity: 1; }
.tk-save { background: var(--surface); border: 1px solid var(--line); padding: 16px; display: grid; gap: 12px; box-shadow: 0 2px 0 rgba(0, 0, 0, .45); }
.tk-save[hidden] { display: none; }
.tk-save-title { font: 400 18px var(--stencil, sans-serif); letter-spacing: .04em; color: var(--bone); }
.tk-save p { margin: -6px 0 0; }
.ticket-bar { display: none; }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; margin-bottom: 26px; }
.plan-card { display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid #536a8b; border-radius: var(--r); padding: 12px 14px; color: inherit; text-decoration: none; }
.plan-card:hover { border-color: var(--line-2); border-left-color: var(--tape, #9ec78a); color: inherit; }
.plan-card.is-done { border-left-color: var(--ok); }
.plan-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.plan-top b { font: 500 17px var(--display); letter-spacing: .03em; color: var(--bone); }
.plan-what { font-size: 13.5px; color: var(--bone-dim); }
.plan-foot { display: flex; gap: 12px; flex-wrap: wrap; font: 12.5px var(--type, monospace); color: var(--bone-faint); }

/* Page d'un plan */
.plan-head { margin-bottom: 16px; display: grid; gap: 10px; }
.plan-progress { display: flex; gap: 30px; flex-wrap: wrap; }
.plan-progress b { display: block; font: 400 32px/1.1 var(--stencil, var(--display)); color: var(--bone); }
.plan-targets { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.plan-target { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; font: 500 16px var(--display) !important; letter-spacing: .03em !important; color: var(--bone) !important; border: 1px solid var(--line-2); padding: 8px 10px; }
.plan-target input { width: 110px; text-align: right; margin: 0; }
.plan-table .num, .plan-table th.num { text-align: right; white-space: nowrap; }
.plan-table td { padding: 8px 10px; }
.plan-table tr.is-ok td { color: #a9bd7c; }
.plan-table tr.is-ok td:first-child::after { content: ' ✓'; }
.plan-table tr.is-zero td { opacity: .45; }
.plan-have { width: 110px; text-align: right; padding: 6px 8px; }
.plan-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.head-actions form { display: inline; }
.table-wrap { overflow-x: auto; }
.task-plan { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Fenêtre recette */
.dlg-wide { width: min(620px, calc(100vw - 28px)); }
.rc-grid { display: grid; grid-template-columns: 1fr 150px; gap: 12px; }
.ing-head { display: grid; grid-template-columns: 90px 1fr 38px; gap: 8px; font: 12px var(--type, monospace); color: var(--bone-faint); margin-bottom: 4px; }
.ing-rows { display: grid; gap: 6px; margin-bottom: 10px; }
.ing-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 38px; gap: 8px; align-items: center; }
.ing-row input[name=iqty] { text-align: right; }
.rc-del { padding-top: 0; display: flex; justify-content: flex-start; }

@media (max-width: 1100px) {
  .workshop { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 860px) {
  .workshop { grid-template-columns: 1fr; }
  .workshop-side { position: static; }
  .recipes { grid-template-columns: 1fr; }
  .ticket { transform: none; }
  .ticket-bar:not([hidden]) {
    display: flex; position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 35; justify-content: space-between; align-items: center; gap: 10px;
    padding: 12px 14px; background: var(--paper, #bdd8b0); color: var(--paper-ink, #1e2126); font: 14px var(--type, monospace);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .6);
  }
  .ticket-bar b { font: 400 14px var(--stencil, sans-serif); text-transform: none; letter-spacing: .01em; color: #7d1915; }
  .content:has(.ticket-bar:not([hidden])) { padding-bottom: 80px; }
  .rc-grid { grid-template-columns: 1fr 110px; }
  .ing-row, .ing-head { grid-template-columns: 70px minmax(0, 1fr) 38px; }
  .plan-have, .plan-target input { width: 84px; }
}
@media (max-width: 860px) {
  .table.plan-table thead { display: table-header-group; }
  .table.plan-table tr { display: table-row; padding: 0; }
  .table.plan-table td, .table.plan-table td:nth-child(n) { display: table-cell; padding: 7px 5px; border-bottom: 1px solid var(--line); font-size: 14px; color: inherit; }
  .table.plan-table th { padding: 0 5px 8px; font-size: 12px; }
  .plan-have { width: 72px; padding: 5px 6px; }
}
[data-plan-form] > .panel:last-child { display: grid; gap: 14px; }

/* ================= Fabrication : types, niveaux, armes ================= */
.craft-filter { display: grid; gap: 12px; margin-bottom: 16px; scroll-margin-top: 14px; }
.craft-tabs { margin-bottom: 0; padding-bottom: 12px; }
.craft-tabs .tab { cursor: pointer; font: inherit; }
.craft-tabs .tab[disabled] { opacity: .4; cursor: default; }
.tab-lvl { font: 12px var(--type, monospace); color: var(--tape, #9ec78a); letter-spacing: 0; text-transform: none; }
.weapon-bar { display: flex; gap: 10px; align-items: flex-start; }
.weapon-bar-label { font: 13px var(--type, monospace); color: var(--bone-faint); padding-top: 6px; flex: none; }
.weapon-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.weapon-chip {
  font: 500 14px var(--display); letter-spacing: .04em; color: var(--bone-dim); cursor: pointer;
  background: #13161b; border: 1px solid var(--line-2); border-left: 3px solid #404d5f; padding: 4px 9px 4px 8px;
}
.weapon-chip span { font: 12px var(--mono); color: var(--bone-faint); margin-left: 3px; }
.weapon-chip:hover { color: var(--bone); border-left-color: var(--tape, #9ec78a); }
.weapon-chip.active { color: #ffffff; background: rgba(142, 27, 27, .3); border-color: var(--blood, #8e1b1b); border-left-color: var(--blood-hi, #c0392b); }
.weapon-chip.active span { color: var(--tape, #9ec78a); }
.weapon-chip[hidden] { display: none; }
.weapon-focus {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border: 1px solid var(--tape, #9ec78a); background: rgba(158, 199, 138, .06);
}
.weapon-focus[hidden] { display: none; }
.weapon-focus b { font: 400 22px var(--stencil, var(--display)); letter-spacing: .01em; color: var(--bone); margin: 0 4px; }
.weapon-focus-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.recipe-group { margin-bottom: 22px; }
.recipe-group[hidden] { display: none; }
.recipe-group-title { margin-top: 4px; }
.group-lvl { font: 13px var(--type, monospace); color: var(--tape, #9ec78a); letter-spacing: 0; text-transform: none; margin-left: 6px; }

.recipe-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: -4px; }
.weapon-tag {
  font: 12.5px var(--type, monospace); color: var(--paper-ink, #191e25); background: var(--tape, #9ec78a); border: 0; cursor: pointer;
  padding: 1px 8px 0; clip-path: none;
}
.weapon-tag:hover { background: #b9dca8; }
.lvl-stamp {
  font: 400 13px var(--stencil, var(--display)); letter-spacing: .01em; text-transform: none; color: #d0645a;
  border: 2px solid #a8362c; padding: 0 6px; transform: none;
  -webkit-mask-image: var(--stamp); mask-image: var(--stamp); -webkit-mask-size: 90px 40px; mask-size: 90px 40px;
}
.recipe.is-picked .recipe-meta { padding-right: 86px; } /* place pour le ruban « dans le bon » */

/* Mode « classer » */
.pick-box { display: none; }
.is-sorting .pick-box { display: block; position: absolute; top: 10px; left: -9px; z-index: 2; }
.pick-box input { width: 22px; height: 22px; accent-color: var(--blood, #8e1b1b); cursor: pointer; margin: 0; }
.is-sorting .recipe { cursor: pointer; }
.is-sorting .recipe:hover { border-color: var(--line-2); }
.recipe.is-checked { outline: 2px solid var(--blood, #8e1b1b); outline-offset: 2px; }
.sort-bar {
  position: fixed; left: calc(50% + 124px); bottom: 14px; transform: translateX(-50%); z-index: 40;
  width: min(880px, calc(100vw - 28px)); display: grid; gap: 10px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line-2); border-top: 3px solid var(--blood, #8e1b1b); box-shadow: 0 14px 40px rgba(0, 0, 0, .7);
}
.sort-bar[hidden] { display: none; }
.sort-bar-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.sort-bar-head b { font: 400 17px var(--stencil, var(--display)); letter-spacing: .04em; color: var(--bone); }
.sort-bar-head .tk-clear { margin: 0; color: var(--bone-dim); }
.sort-bar-fields { display: grid; grid-template-columns: 1.2fr 1.2fr 110px auto; gap: 10px; align-items: end; }
.sort-bar-clear { display: grid; gap: 4px; padding-bottom: 4px; }
.sort-bar-clear .check { font-size: 13px; }
.sort-bar-actions { display: flex; justify-content: flex-end; gap: 10px; }
.content:has(.sort-bar:not([hidden])) { padding-bottom: 220px; }

/* Bon : niveau */
.tk-level-why { margin: 8px 0 0; font-size: 13px; opacity: .75; }
.tk-level-why[hidden] { display: none; }

/* Fenêtres */
.rc-grid3 { display: grid; grid-template-columns: 1fr 1fr 140px; gap: 12px; }
.rc-hint { margin: -6px 0 0; }
.ty-head { display: grid; grid-template-columns: minmax(0, 1fr) 90px 38px; gap: 8px; font: 12px var(--type, monospace); color: var(--bone-faint); margin-bottom: 4px; }
.ty-rows { display: grid; gap: 6px; margin-bottom: 10px; }
.ty-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 38px; gap: 8px; align-items: center; }
.ty-row input[name=tlevel] { text-align: right; }

@media (max-width: 860px) {
  .weapon-bar { display: grid; gap: 6px; }
  .weapon-bar-label { padding: 0; }
  .weapon-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin-right: -16px; padding-right: 16px; scrollbar-width: thin; }
  .weapon-chip { flex: none; }
  .craft-tabs { flex-wrap: nowrap; overflow-x: auto; margin-right: -16px; padding-right: 16px; }
  .craft-tabs .tab { flex: none; }
  .rc-grid3 { grid-template-columns: 1fr 1fr; }
  .rc-grid3 label:last-child { grid-column: span 2; }
  .sort-bar { left: 8px; right: 8px; width: auto; transform: none; bottom: 8px; padding: 12px; max-height: 70dvh; overflow-y: auto; }
  .sort-bar-fields { grid-template-columns: 1fr 1fr; }
  .is-sorting .pick-box { left: 6px; top: 6px; }
  .is-sorting .recipe { padding-left: 36px; }
  .is-sorting .ticket-bar { display: none !important; }
}

/* ================= Alertes en haut de l'écran ================= */
#toasts.notices, .notices {
  position: fixed; top: 16px; left: calc(50% + 124px); right: auto; bottom: auto; transform: translateX(-50%); z-index: 120;
  width: min(600px, calc(100vw - 288px)); max-width: none; display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.notice {
  --c: #567196; --life: 6s;
  position: relative; pointer-events: auto; overflow: hidden;
  display: grid; grid-template-columns: 46px minmax(0, 1fr) auto auto; align-items: center; gap: 4px 12px;
  padding: 14px 10px 16px 0; color: var(--bone);
  background: #161a1f var(--grain); border: 1px solid #374150; border-left: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 18px 50px rgba(0, 0, 0, .75), 0 0 0 100vmax transparent;
  animation: notice-in .38s cubic-bezier(.2, 1.3, .4, 1) both;
  transition: opacity .3s, transform .3s;
}
.notice::before { /* bande de couleur à gauche */
  content: ''; position: absolute; inset: 0 auto 0 0; width: 8px; background: var(--c);
}
.notice-icon { display: grid; place-items: center; align-self: stretch; padding-left: 8px; }
.notice-icon .icon { width: 26px; height: 26px; color: var(--c); stroke-width: 2.4; }
.notice-body { display: grid; gap: 2px; min-width: 0; }
.notice-body b { font: 400 17px/1.1 var(--stencil, var(--display)); letter-spacing: .01em; text-transform: none; color: var(--c); }
.notice-body span { font: 15.5px/1.4 var(--type, monospace); color: var(--bone); overflow-wrap: anywhere; }
.notice-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid transparent; background: none; color: var(--bone-faint);
  cursor: pointer; font: 26px/1 var(--mono); padding: 0;
}
.notice-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.notice-btn:hover { color: var(--bone); border-color: var(--line-2); background: rgba(255, 255, 255, .04); }
.notice-btn.is-off { color: #a8362c; }
.notice-timer { position: absolute; left: 8px; right: 0; bottom: 0; height: 3px; background: var(--c); opacity: .6; transform-origin: left; animation: notice-life var(--life) linear forwards; }
.notice:hover .notice-timer { animation-play-state: paused; }
.notice.out { opacity: 0; transform: translateY(-14px) scale(.98); }

.notice-error {
  --c: #e0533f;
  background: linear-gradient(180deg, rgba(160, 30, 22, .38), rgba(90, 16, 12, .5)), #13181e var(--grain);
  border-color: #8e2a20;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 18px 50px rgba(0, 0, 0, .75), 0 0 34px rgba(200, 40, 30, .35);
  padding-top: 20px;
  animation: notice-in .38s cubic-bezier(.2, 1.3, .4, 1) both, notice-shake .5s .38s ease-in-out;
}
.notice-error::before { /* bandes danger */
  width: 10px; background: repeating-linear-gradient(135deg, #e3b23c 0 8px, #0f1115 8px 16px);
}
.notice-error::after { /* liseré danger en haut */
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px;
  background: repeating-linear-gradient(135deg, #e3b23c 0 10px, #0f1115 10px 20px); opacity: .9;
}
.notice-error .notice-icon { padding-left: 12px; }
.notice-error .notice-body span { color: #f4e6dc; }

@keyframes notice-in { from { opacity: 0; transform: translateY(-40px); } }
@keyframes notice-shake { 0%, 100% { translate: 0; } 20% { translate: -7px; } 40% { translate: 6px; } 60% { translate: -4px; } 80% { translate: 2px; } }
@keyframes notice-life { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* Problème affiché dans une page : plus voyant aussi */
.flash-error {
  position: relative; border: 1px solid #8e2a20; border-left: 0; padding-left: 24px;
  background: linear-gradient(180deg, rgba(160, 30, 22, .25), rgba(90, 16, 12, .35)), #13181e var(--grain);
}
.flash-error::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 10px; background: repeating-linear-gradient(135deg, #e3b23c 0 8px, #0f1115 8px 16px); }
.flash-error .icon { color: #e0533f; }
.flash-error span { color: #f4e6dc; }

@media (max-width: 860px) {
  #toasts.notices, .notices { top: 62px; left: 8px; right: 8px; width: auto; transform: none; }
  .notice { grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 2px 8px; padding-right: 4px; }
  .notice-body span { font-size: 14.5px; }
  .notice-btn { width: 32px; height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .notice, .notice-error { animation: none; }
}

/* ================= Choses à faire : compteur manuel ================= */
.rc-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.task-contrib { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.task-contrib .task-label { width: 100%; margin: 0; }
.task-who { font-size: 13px; color: var(--bone-dim); border: 1px solid var(--line-2); padding: 2px 8px; background: rgba(255, 255, 255, .02); }
.task-who b { color: var(--bone); margin-left: 2px; }
.task-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.task-add-l { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--bone-dim); flex: 1 1 200px; }
.task-add-l { white-space: nowrap; }
.task-add-l input { width: 100%; max-width: 160px; margin: 0; }
.task-done .task-add { opacity: .8; }
@media (max-width: 520px) { .rc-grid2 { grid-template-columns: 1fr; } }

/* ================= Choses à faire : plusieurs objets ================= */
.tl-edit { display: grid; gap: 6px; }
.tl-rows { display: grid; gap: 6px; }
.tl-erow { display: grid; grid-template-columns: 96px minmax(0, 1fr) 92px 34px; gap: 8px; align-items: center; }
.tl-erow input { margin: 0; min-width: 0; }
.tl-erow input[type=number] { text-align: right; }
.tl-ehead { font-size: 11.5px; color: var(--bone-faint); letter-spacing: .04em; }
.tl-ehead span:first-child, .tl-ehead span:nth-child(3) { text-align: right; }
.tl-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-top: 4px; }
.tl-paste { flex: 1 1 220px; }
.tl-paste summary { cursor: pointer; font-size: 13.5px; color: var(--brass, #c9a227); padding: 6px 0; }
.tl-paste textarea { width: 100%; margin: 6px 0; font-family: var(--type, monospace); }
.tl-total { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tl-total .task-label { width: 100%; margin: 0; }
.tl-total b { font: 400 26px/1.1 var(--stencil, var(--display)); color: var(--bone); }
.tl-card { display: grid; gap: 10px; margin: 0; }
.tl-list { display: grid; gap: 2px; }
.tl-line { display: grid; grid-template-columns: minmax(0, 1fr) auto 92px 84px; grid-template-areas: "name num rest q" "bar bar bar q"; column-gap: 12px; row-gap: 5px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.tl-line:last-child { border-bottom: 0; }
.tl-name { grid-area: name; color: var(--bone); font-size: 15px; overflow-wrap: anywhere; }
.tl-num { grid-area: num; font-family: var(--type, monospace); font-size: 15px; white-space: nowrap; text-align: right; }
.tl-num b { color: var(--bone); font-size: 17px; }
.tl-rest { grid-area: rest; font-size: 12.5px; color: var(--bone-faint); white-space: nowrap; }
.tl-q { grid-area: q; width: 84px; margin: 0; text-align: right; }
.tl-meter { grid-area: bar; height: 5px; }
.tl-meter span { background: repeating-linear-gradient(-45deg, #a3221d 0 5px, #7d1915 5px 10px); }
.tl-line.is-done .tl-meter span { background: var(--ok); }
.tl-line.is-done .tl-rest { color: var(--ok); }
.tl-line.is-done .tl-name::before { content: '✓ '; color: var(--ok); }
.tl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line-2); }
.tl-actions .grow { flex: 1 1 200px; }
.task-who .faint { font-size: 12px; }
@media (max-width: 560px) {
  .tl-erow { grid-template-columns: 70px minmax(0, 1fr) 64px 30px; gap: 6px; }
  .tl-line { grid-template-columns: minmax(0, 1fr) auto 70px; grid-template-areas: "name name q" "num rest q" "bar bar bar"; }
  .tl-q { width: 70px; }
  .tl-num { text-align: left; }
}

/* ===================================================================
   Day of Decay - Aide — apocalypse sobre (couche finale, par-dessus tout le reste)
   Tiré du logo : nuit d'hiver bleu acier, brouillard, ville en ruine, peau verdâtre, sang séché, neige.
   =================================================================== */
:root {
  --ink: #0a0f17;
  --ink-2: #070b11;
  --surface: #111923;
  --surface-2: #17212e;
  --line: #1f2b3b;
  --line-2: #2c3b50;
  --bone: #dde4ec;
  --bone-dim: #98a6b6;
  --bone-faint: #64748a;
  --paper: #cdd6de;
  --paper-ink: #121a24;
  --brass: #94a888;          /* vert-de-gris de la peau du zombie */
  --brass-hi: #b6c7aa;
  --brass-dim: #5f7157;
  --tape: #a9bb9d;
  --olive: #7d9070;
  --blood: #8a2424;          /* sang séché des gouttes du logo */
  --blood-hi: #b13a35;
  --blood-deep: #3c1013;
  --ice: #bfe2f3;            /* reflet des yeux */
  --steel: #7d8b9c;
  --ok: #7fa37a;
  --warn: #c99a45;
  --r: 4px;
  --display: 'Oswald', 'Arial Narrow', sans-serif;
  --body: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --stencil: var(--display);
  --type: var(--body);
  --grain: none;
  --stamp: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 6px 18px rgba(0, 0, 0, .28);
  /* silhouette de ville en ruine, comme le fond du logo */
  --ruins: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='220' viewBox='0 0 1200 220'%3E%3Cpath fill='%23182536' d='M0 220V150h40v-30h26v40h30V96h18v-14h10v14h22v124h12V130h34v-22h8v22h28v90h20V60h14V44h22v16h16v160h18V140h46v80h14V112h12v-20h30v128h26V150h22v-34h40v104h18V70h10V58h34v12h12v150h24V128h52v92h16V96h22V80h26v140h20V150h44v-26h18v96h22V104h14V88h30v132h18V140h40v80h16V60h12V46h26v174h22V130h38v-20h12v110h26V150h30v70h20V100h28v120h18V136h40v84z'/%3E%3C/svg%3E");
}

body {
  font: 400 15px/1.55 var(--body);
  background-color: var(--ink);
  background-image:
    linear-gradient(180deg, rgba(10, 15, 23, 0) 55%, rgba(120, 140, 165, .07) 100%),
    radial-gradient(1000px 520px at 78% -8%, rgba(110, 140, 175, .13), transparent 65%),
    radial-gradient(600px 380px at 8% 105%, rgba(138, 36, 36, .07), transparent 70%);
  background-attachment: fixed;
}
/* ville en ruine dans le brouillard, en bas de l'écran + neige très légère */
body::before {
  opacity: 1; mix-blend-mode: normal; z-index: 0;
  background:
    radial-gradient(1.3px 1.3px at 14% 22%, rgba(221, 228, 236, .28), transparent 60%) 0 0 / 460px 460px,
    radial-gradient(1px 1px at 63% 12%, rgba(221, 228, 236, .22), transparent 60%) 0 0 / 460px 460px,
    radial-gradient(1.5px 1.5px at 86% 48%, rgba(221, 228, 236, .18), transparent 60%) 0 0 / 460px 460px,
    radial-gradient(1px 1px at 36% 71%, rgba(221, 228, 236, .2), transparent 60%) 0 0 / 460px 460px;
}
body::after {
  content: ''; position: fixed; left: 0; right: 0; bottom: 0; height: 220px; pointer-events: none; z-index: 0;
  background: linear-gradient(0deg, rgba(150, 168, 190, .06), transparent 140px), var(--ruins) bottom center / 1200px 220px repeat-x;
  -webkit-mask-image: linear-gradient(0deg, #000 10%, rgba(0, 0, 0, .55) 45%, transparent 100%); mask-image: linear-gradient(0deg, #000 10%, rgba(0, 0, 0, .55) 45%, transparent 100%);
}
::selection { background: rgba(177, 58, 53, .55); color: #fff; }
a { color: var(--brass-hi); }
a:hover { color: #fff; }
code { border-radius: 3px; background: var(--ink-2); color: var(--brass-hi); font-family: var(--mono); }
h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: .03em; }
.empty { font-family: var(--body); font-style: italic; color: var(--bone-faint); }

/* ---------- Barre de gauche ---------- */
.sidebar { background: linear-gradient(180deg, rgba(9, 14, 21, .97), rgba(8, 12, 18, .97)); border-right: 1px solid var(--line); box-shadow: none; }
.side-brand { border-bottom: 1px solid var(--line); padding: 22px 18px 18px; }
.side-brand img { width: 116px; height: 116px; border-radius: 50%; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .65)); }
.side-brand .name { font-family: var(--display); font-weight: 500; font-size: 20px; letter-spacing: .08em; text-transform: uppercase; line-height: 1.15; color: var(--bone); }
.side-brand .tag { font-family: var(--body); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--brass); opacity: 1; margin-top: 4px; }
.side-nav { gap: 1px; }
.side-nav .group { font-family: var(--display); font-weight: 500; font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--bone-faint); }
.side-nav .group::after { border-top: 1px solid var(--line); }
.side-nav a { border-radius: var(--r); font-weight: 500; color: var(--bone-dim); }
.side-nav a:hover { background: rgba(221, 228, 236, .04); color: var(--bone); }
.side-nav a:hover .icon { color: var(--brass-hi); }
.side-nav a.active { background: linear-gradient(90deg, rgba(138, 36, 36, .26), rgba(138, 36, 36, .06)); color: #fff; }
.side-nav a.active::before { inset: 7px auto 7px -12px; width: 3px; z-index: 0; background: var(--blood-hi); border-radius: 0 2px 2px 0; clip-path: none; }
.side-nav a.active .icon { color: var(--bone); }
.side-foot { border-top: 1px solid var(--line); }
.who-box .initial { font-family: var(--display); border-radius: 50%; background: var(--surface-2); color: var(--brass-hi); border-color: var(--line-2); }
.logout button { border-radius: var(--r); font-family: var(--body); font-weight: 500; font-size: 13px; }
.vote-btn { border-radius: var(--r); border-style: solid; background: rgba(148, 168, 136, .06); color: var(--brass-hi); }
.vote-btn:hover { background: rgba(148, 168, 136, .12); }
.vote-alert { border-radius: var(--r); }

/* ---------- En-têtes : capitales sobres + trait de sang qui coule ---------- */
.page-head { border-bottom: 1px solid var(--line); }
.page-head h1, .welcome h1 { font-family: var(--display); font-weight: 500; letter-spacing: .05em; text-transform: uppercase; font-size: clamp(28px, 3.2vw, 38px); line-height: 1.08; }
.page-head h1 { position: relative; display: inline-block; padding-bottom: 10px; }
.page-head h1::after {
  display: block; content: ''; position: absolute; left: 0; right: auto; bottom: -8px; width: 72px; height: 16px; opacity: 1; z-index: 0; clip-path: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='16' viewBox='0 0 72 16'%3E%3Cg fill='%238a2424'%3E%3Crect width='72' height='3' rx='1'/%3E%3Crect x='15' y='2' width='2.6' height='8'/%3E%3Ccircle cx='16.3' cy='11' r='2.8'/%3E%3Crect x='44' y='2' width='1.8' height='3.6'/%3E%3Ccircle cx='44.9' cy='6.4' r='1.7'/%3E%3C/g%3E%3C/svg%3E") no-repeat;
}
.kicker { font-family: var(--body); font-weight: 500; font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--brass); }
.kicker::before { content: none; }

/* ---------- Panneaux et fiches ---------- */
.panel { border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); background-image: linear-gradient(180deg, rgba(255, 255, 255, .018), transparent 120px); box-shadow: var(--shadow); }
.panel-title {
  background: none; color: var(--bone); transform: none; clip-path: none; padding: 0; margin-left: 0;
  font-family: var(--display); font-weight: 500; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; gap: 10px;
}
.panel-title .icon { color: var(--brass); width: 17px; height: 17px; }
.panel-link { font-family: var(--body); font-weight: 500; color: var(--brass-hi); }
.section-title, .sub-title { font-family: var(--display); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.note { border-left: 2px solid var(--blood-hi); border-radius: 0; background: rgba(138, 36, 36, .05); padding: 8px 14px; }
.stats { gap: 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.stat { background: var(--surface); border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.stat:last-child { border-right: 0; }
.stat-n { font-family: var(--display); font-weight: 500; font-size: 34px; letter-spacing: .02em; }
.stat-l { font-family: var(--body); font-weight: 500; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; }
.card, .code-card, .task, .member, .rung, .check-card, .recipe, .plan-card { border-radius: var(--r); border-color: var(--line); box-shadow: var(--shadow); }
.card { background: var(--surface); background-image: linear-gradient(180deg, rgba(255, 255, 255, .02), transparent 60%); transform: none; }
.card:hover { transform: none; border-color: var(--line-2); }
.card-cat { font-family: var(--body); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--bone-faint); }
.card-qty span, .task-label, .code-meta, .member-sub { font-family: var(--body); letter-spacing: 0; }
.card-qty b, .task-count b, .rank { font-family: var(--display); font-weight: 500; }
.card-qty b { font-size: 36px; }
.card.lv-low { border-top: 2px solid var(--warn); }
.card.lv-out { border-top: 2px solid var(--blood-hi); }
.code-value { border-radius: 3px; }

/* ---------- Boutons ---------- */
.btn {
  font: 500 13px var(--display); letter-spacing: .1em; text-transform: uppercase;
  border-radius: var(--r); padding: 8px 15px; background: var(--surface-2);
  border: 1px solid var(--line-2); border-bottom-width: 1px; border-bottom-color: var(--line-2);
  box-shadow: none; transform: none;
}
.btn:hover { background: #1e2a3a; border-color: #3d506a; border-bottom-color: #3d506a; }
.btn:active { transform: translateY(1px); border-bottom-width: 1px; margin-bottom: 0; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-primary { background: var(--blood); border-color: #a2302c; border-bottom-color: #a2302c; color: #f3e9e7; text-shadow: none; }
.btn-primary:hover { background: #9e2b29; border-color: var(--blood-hi); border-bottom-color: var(--blood-hi); color: #fff; }
.btn-brass { background: rgba(148, 168, 136, .08); border-color: rgba(148, 168, 136, .4); border-bottom-color: rgba(148, 168, 136, .4); color: var(--brass-hi); }
.btn-brass:hover { background: rgba(148, 168, 136, .15); border-color: var(--brass); color: #fff; }

/* ---------- Onglets, étiquettes, compteurs ---------- */
.tab { border-radius: var(--r); background: var(--surface); border-color: var(--line); font-weight: 500; }
.tab:hover { background: var(--surface-2); border-color: var(--line-2); }
.tab.active { background: rgba(138, 36, 36, .18); border-color: rgba(177, 58, 53, .55); color: #fff; box-shadow: inset 0 -2px 0 var(--blood-hi); }
.tab .count { font-family: var(--mono); border-radius: 3px; background: rgba(0, 0, 0, .3); }
.tab.active .count { color: var(--bone); }
.chip { font-family: var(--body); font-weight: 600; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; border: 1px solid currentColor; border-radius: 3px; padding: 1px 7px; -webkit-mask-image: none; mask-image: none; transform: none; }
.grade-chip { border-radius: 3px; font-family: var(--body); font-weight: 600; letter-spacing: .02em; font-size: 12.5px; }
.sub-tag { border-radius: 3px; font-family: var(--body); }
.seg { border-radius: var(--r); overflow: hidden; }
.stepper { border-radius: var(--r); overflow: hidden; border-color: var(--line-2); background: var(--ink-2); }
.stepper button { background: var(--surface-2); font-family: var(--display); }
.stepper button:hover { background: #22303f; }
.stepper button:active { background: var(--blood); }
.recipe-top h3 { font-family: var(--display); font-weight: 500; letter-spacing: .03em; }
.recipe-ings li b, .is-picked .stepper input { color: var(--brass-hi); }
.recipe.is-picked { border-color: rgba(148, 168, 136, .55); }
.recipe.is-picked::after { border-radius: 3px; font-family: var(--display); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; background: var(--brass); color: #10170c; padding: 1px 8px; }
.weapon-chip { border-radius: var(--r); font-family: var(--body); font-weight: 500; letter-spacing: 0; }
.weapon-chip.active { background: rgba(138, 36, 36, .22); border-color: rgba(177, 58, 53, .6); }
.weapon-focus b { font-family: var(--display); font-weight: 500; letter-spacing: .04em; }
.weapon-tag { border-radius: 3px; font-family: var(--body); font-weight: 600; }
/* Le bon de fabrication : une feuille grise sous la lumière froide */
.ticket { border-radius: var(--r); font-family: var(--body); color: var(--paper-ink); background: var(--paper); background-image: linear-gradient(180deg, rgba(255, 255, 255, .25), transparent 40%); box-shadow: 0 10px 24px rgba(0, 0, 0, .45); transform: none; clip-path: none; }
.ticket-head { border-bottom: 2px solid rgba(18, 26, 36, .25); }
.ticket-head b { font-family: var(--display); font-weight: 500; font-size: 18px; letter-spacing: .08em; text-transform: uppercase; }
.ticket h4 { font-family: var(--display); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }

/* ---------- Champs, fenêtres, messages ---------- */
input, select, textarea { border-radius: var(--r) !important; font-family: var(--body); }
.dlg, .auth-form { border-radius: 6px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.flash, .toast, .notice { border-radius: var(--r); }
.topbar { background: rgba(8, 12, 18, .96); border-bottom: 1px solid var(--line); }
.topbar img { border-radius: 50%; }
.topbar .name { font-family: var(--display); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.burger { border-radius: var(--r); }
.foot { border-top: 1px solid var(--line); }
@media (max-width: 860px) {
  .topbar .name { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
}
@media (max-width: 440px) { .topbar .sync { font-size: 0; gap: 0; } }
