/* ================================================================
   BIP // PLAN-OPS — Brigade Interarmes Polaris
   ================================================================ */
:root {
  --bg: #070b14;
  --bg-2: #0a101c;
  --surface: #0f1624;
  --surface-2: #141d2e;
  --surface-3: #1a2539;
  --line: #1f2b40;
  --line-2: #2a3a55;
  --text: #e8eef6;
  --muted: #8a98ad;
  --primary: #0032a6;
  --primary-hi: #3d6fe0;
  --ice: #9cc9e0;
  --ok: #3fb47a;
  --warn: #e0a030;
  --danger: #d8434a;
  --fr-blue: #1f3fa8;
  --fr-red: #d8262e;
  --radius: 6px;
  --head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 120px; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--body);
  background-image:
    radial-gradient(1200px 500px at 80% -10%, rgba(0, 50, 166, .18), transparent 60%),
    linear-gradient(rgba(156, 201, 224, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(156, 201, 224, .025) 1px, transparent 1px);
  background-size: auto, 40px 40px, 40px 40px;
  background-attachment: fixed;
}
a { color: var(--ice); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 700; letter-spacing: .02em; margin: 0 0 .5em; line-height: 1.15; }
h1 { font-size: 2rem; text-transform: uppercase; }
h2 { font-size: 1.5rem; text-transform: uppercase; }
h3 { font-size: 1.15rem; text-transform: uppercase; display: flex; align-items: center; gap: .5em; }
h4 { font-size: 1rem; text-transform: uppercase; display: flex; align-items: center; gap: .45em; }
p { margin: 0 0 .75em; }
code, .mono { font-family: var(--mono); font-size: .9em; }
.ico { flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hint { color: var(--muted); font-size: .82rem; display: block; margin-top: .3em; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 1rem; }
.mt-xs { margin-top: .35rem; }
.mb { margin-bottom: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; display: block; }
.ml-auto { margin-left: auto; }
.grow { flex: 1; min-width: 200px; }
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.gap-xs { gap: .3rem; } .gap-s { gap: .6rem; }
.center-x { justify-content: center; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack-s { display: flex; flex-direction: column; gap: .5rem; }
[hidden] { display: none !important; }

.container { max-width: 1280px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.container.narrow { max-width: 820px; }

.tricolore { height: 3px; background: linear-gradient(90deg, var(--fr-blue) 0 33.3%, #fff 33.3% 66.6%, var(--fr-red) 66.6%); }

/* ---------- En-tête ---------- */
#app-header {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 1.5rem;
  padding: .55rem 1.25rem; background: rgba(7, 11, 20, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
#app-header::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, var(--fr-blue) 0 33.3%, #fff 33.3% 66.6%, var(--fr-red) 66.6%); opacity: .85; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { filter: drop-shadow(0 0 6px rgba(156, 201, 224, .25)); }
.brand-txt { display: flex; flex-direction: column; line-height: 1; font-family: var(--head); text-transform: uppercase; }
.brand-txt b { font-size: 1.15rem; letter-spacing: .12em; }
.brand-txt small { font-size: .72rem; letter-spacing: .3em; color: var(--ice); margin-top: 2px; }
.topnav { display: flex; gap: .25rem; }
.navlink { display: flex; align-items: center; gap: .4rem; padding: .45rem .75rem; border-radius: var(--radius); color: var(--muted); font-family: var(--head); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.navlink:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.user-chip { display: flex; align-items: center; gap: .5rem; color: var(--text); padding: .2rem .6rem .2rem .2rem; border-radius: 999px; border: 1px solid var(--line); }
.user-chip:hover { border-color: var(--line-2); text-decoration: none; }
.badge-invite { display: flex; align-items: center; gap: .3rem; background: var(--primary); color: #fff; border-radius: 999px; padding: .2rem .6rem; font-weight: 700; font-size: .85rem; }
body.op-mode #app-header { background: color-mix(in srgb, var(--op-bg, #070b14) 85%, transparent); }

.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; object-fit: cover; color: #fff; font-weight: 700; flex: none; font-family: var(--head); }

/* ---------- Boutons & champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .55rem 1rem;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); border-radius: var(--radius);
  font: 600 .92rem/1.1 var(--head); text-transform: uppercase; letter-spacing: .06em; cursor: pointer; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--surface-3); border-color: #3a4d6e; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: #1a4fc8; color: #fff; }
.btn-primary:hover { background: #0a40c4; border-color: #3d6fe0; }
.btn-danger { background: transparent; border-color: rgba(216, 67, 74, .6); color: #ff8a90; }
.btn-danger:hover { background: rgba(216, 67, 74, .15); border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn-sm { padding: .35rem .65rem; font-size: .8rem; }
.btn-block { width: 100%; }
.btn.pulse { box-shadow: 0 0 0 0 rgba(61, 111, 224, .6); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(61, 111, 224, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 111, 224, 0); } }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--radius); border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--line); text-decoration: none; }
.icon-btn.sm { width: 26px; height: 26px; }
.icon-btn.danger:hover { color: #ff8a90; border-color: rgba(216, 67, 74, .5); }
.icon-btn:disabled { opacity: .3; cursor: default; }

.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.lbl { font: 600 .78rem var(--head); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.input {
  width: 100%; padding: .55rem .7rem; background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2);
  border-radius: var(--radius); font: inherit; font-size: .93rem; transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--primary-hi); box-shadow: 0 0 0 3px rgba(61, 111, 224, .2); }
.input.static { background: transparent; border-style: dashed; color: var(--muted); }
textarea.input { resize: vertical; min-height: 70px; line-height: 1.45; }
select.input { cursor: pointer; }
.input-sm { padding: .3rem .45rem; font-size: .85rem; }
.input.bold { font-weight: 700; }
.w-rank { width: 70px; } .w-radio { width: 120px; } .w-freq { width: 100px; } .w-ch { width: 60px; }
.check { display: flex; align-items: center; gap: .55rem; cursor: pointer; user-select: none; flex-wrap: wrap; }
.check input { width: 17px; height: 17px; accent-color: var(--primary-hi); }
.check .hint { flex-basis: 100%; margin: 0 0 0 1.6rem; }
.field.inline { flex-direction: row; align-items: center; }
.field.inline .input { width: auto; }
input[type=color] { width: 42px; height: 36px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2); padding: 2px; cursor: pointer; flex: none; }
input[type=color].swatch { width: 30px; height: 26px; }
.color-row { display: flex; gap: .4rem; }
.color-row .input { font-family: var(--mono); }
.range-row { display: flex; align-items: center; gap: .6rem; }
.range-row input { flex: 1; accent-color: var(--primary-hi); }
.range-row output { font-family: var(--mono); font-size: .82rem; min-width: 50px; text-align: right; color: var(--muted); }
.img-row { display: flex; gap: .7rem; align-items: center; }
.img-prev { width: 64px; height: 64px; border-radius: var(--radius); border: 1px dashed var(--line-2); display: flex; align-items: center; justify-content: center; color: var(--muted); overflow: hidden; flex: none; background: var(--bg-2); }
.img-prev.round { border-radius: 50%; }
.img-prev img { width: 100%; height: 100%; object-fit: contain; }
.img-ctrl { flex: 1; display: flex; flex-direction: column; gap: .4rem; min-width: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem 1rem; align-items: start; }
.span-2 { grid-column: span 2; } .span-3 { grid-column: 1 / -1; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 2px); padding: 1.2rem; box-shadow: var(--shadow); }
.card > h3:first-child, .card > h4:first-child { margin-top: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.section-head h1, .section-head h2, .section-head h3 { margin: 0; display: flex; align-items: center; gap: .5rem; }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .6rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: .8rem; color: var(--text); cursor: default; font-family: inherit; }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--ice); }
.chip.ok { border-color: rgba(63, 180, 122, .5); color: #8fe0b6; }
.notice { display: flex; gap: .6rem; align-items: center; padding: .7rem .9rem; border-radius: var(--radius); background: rgba(0, 50, 166, .18); border: 1px solid rgba(61, 111, 224, .4); font-size: .9rem; }
.form-error { background: rgba(216, 67, 74, .12); border: 1px solid rgba(216, 67, 74, .45); color: #ffb3b7; padding: .6rem .8rem; border-radius: var(--radius); font-size: .9rem; }
.error-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .5rem; }

.status { display: inline-block; padding: .15rem .55rem; border-radius: 3px; font: 700 .72rem var(--head); text-transform: uppercase; letter-spacing: .1em; border: 1px solid; }
.st-draft { color: #c9d2de; border-color: #56647a; background: rgba(86, 100, 122, .25); }
.st-pub { color: #9cc9e0; border-color: #3d6fe0; background: rgba(0, 50, 166, .35); }
.st-live { color: #fff; border-color: #e04848; background: rgba(224, 72, 72, .45); animation: blink 2s infinite; }
.st-done { color: #8fe0b6; border-color: #3fb47a; background: rgba(63, 180, 122, .2); }
.st-arch { color: #8a98ad; border-color: #3a4558; }
@keyframes blink { 50% { opacity: .65; } }
.role-tag { display: inline-flex; align-items: center; gap: .2rem; font: 700 .72rem var(--head); text-transform: uppercase; letter-spacing: .08em; padding: .12rem .5rem; border-radius: 3px; background: var(--surface-3); color: var(--muted); }
.role-owner { background: rgba(224, 160, 48, .18); color: #f0c878; }
.role-manager { background: rgba(61, 111, 224, .2); color: #a9c2ff; }
.team-pill { display: inline-flex; align-items: center; gap: .3rem; font: 700 .72rem var(--head); text-transform: uppercase; letter-spacing: .06em; padding: .1rem .45rem; border-radius: 3px;
  background: color-mix(in srgb, var(--t) 28%, transparent); border: 1px solid color-mix(in srgb, var(--t) 70%, transparent); color: var(--text); }
.team-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--t); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font: 600 .75rem var(--head); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--bg-2); padding: .55rem .7rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: .45rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: rgba(156, 201, 224, .03); }
.tbl tr.disabled td { opacity: .45; }
.tbl tr.leader td { background: rgba(224, 160, 48, .05); }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; white-space: nowrap; }
.cell-click { cursor: pointer; user-select: none; }
.cell-click:hover { background: rgba(61, 111, 224, .12) !important; }
.net-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .4rem; vertical-align: 1px; }
.net-mark { font-weight: 800; }
.freq { color: var(--ice); }
.assigned { color: #8fe0b6; font-weight: 600; white-space: nowrap; }

/* ---------- Toasts & modales ---------- */
#toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 200; display: flex; flex-direction: column; gap: .5rem; max-width: min(420px, calc(100vw - 2rem)); }
.toast { display: flex; gap: .6rem; align-items: center; padding: .7rem 1rem; border-radius: var(--radius); background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: slidein .25s ease; transition: opacity .3s, transform .3s; }
.toast.out { opacity: 0; transform: translateX(20px); }
.toast-ok { border-left: 3px solid var(--ok); } .toast-ok .ico { color: var(--ok); }
.toast-error { border-left: 3px solid var(--danger); } .toast-error .ico { color: var(--danger); }
.toast-info { border-left: 3px solid var(--ice); }
@keyframes slidein { from { opacity: 0; transform: translateY(10px); } }
.modal-wrap { position: fixed; inset: 0; z-index: 150; background: rgba(2, 5, 10, .72); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 1rem 1rem; overflow-y: auto; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(540px, 100%); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 30px 80px -20px #000; }
.modal-wide { width: min(900px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 1.1rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .8rem 1.1rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.big-code { display: block; font-size: 1.5rem; text-align: center; padding: 1rem; background: var(--bg-2); border: 1px dashed var(--line-2); border-radius: var(--radius); letter-spacing: .1em; user-select: all; }

/* ---------- Authentification ---------- */
.auth-page { min-height: calc(100vh - 60px); display: grid; grid-template-columns: 1fr 1fr; max-width: 1100px; margin: 0 auto; align-items: center; gap: 3rem; padding: 2rem 1.25rem; }
.auth-side { text-align: center; }
.auth-logo { width: min(260px, 60vw); filter: drop-shadow(0 10px 40px rgba(0, 50, 166, .5)); }
.auth-side h1 { font-size: 3rem; letter-spacing: .25em; margin: .5rem 0 .2rem; }
.auth-motto { color: var(--ice); font-style: italic; }
.auth-points { list-style: none; padding: 0; margin: 1.5rem auto 0; display: inline-flex; flex-direction: column; gap: .55rem; text-align: left; color: var(--muted); }
.auth-points li { display: flex; gap: .6rem; align-items: center; }
.auth-points .ico { color: var(--ice); }
.auth-card { padding: 0; overflow: hidden; }
.auth-card h2 { padding: 1.3rem 1.5rem 0; }
.auth-form { display: flex; flex-direction: column; gap: .9rem; padding: 0 1.5rem 1.5rem; }
.auth-switch { text-align: center; color: var(--muted); margin: 0; }

/* ---------- Tableau de bord ---------- */
.dash-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; flex-wrap: wrap; padding: 1.5rem 0 2rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.dash-hero h1 { font-size: 2.6rem; margin: 0 0 .3rem; }
.eyebrow { font: 600 .8rem var(--head); text-transform: uppercase; letter-spacing: .25em; color: var(--ice); margin: 0 0 .3rem; }
.dash-section { margin-bottom: 2.5rem; }
.search-box { display: flex; align-items: center; gap: .4rem; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 0 .6rem; min-width: 280px; color: var(--muted); }
.search-box .input { border: 0; background: transparent; box-shadow: none; padding-left: 0; }
.op-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.op-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, border-color .15s, box-shadow .15s; }
.op-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 70%, var(--line)); box-shadow: 0 16px 40px -18px color-mix(in srgb, var(--c) 60%, #000); }
.op-card-link { color: inherit; display: block; flex: 1; }
.op-card-link:hover { text-decoration: none; }
.op-card-banner { height: 110px; position: relative; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 70%, #000), #070b14) center/cover; border-bottom: 2px solid var(--c); }
.op-card-banner .status { position: absolute; top: .6rem; right: .6rem; }
.op-card-logo { position: absolute; left: .8rem; bottom: -22px; width: 54px; height: 54px; object-fit: contain; filter: drop-shadow(0 4px 10px #000); }
.op-card-body { padding: 1.6rem 1rem 1rem; display: flex; flex-direction: column; gap: .35rem; }
.op-card-body h3 { margin: 0; font-size: 1.25rem; }
.op-meta { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .86rem; margin: 0; }
.op-teams { display: flex; flex-wrap: wrap; gap: .3rem; margin: .3rem 0; }
.op-card-foot { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--muted); margin-top: .2rem; }
.op-card-actions { display: flex; gap: .5rem; padding: .7rem 1rem; border-top: 1px solid var(--line); }
.fill-bar { height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.fill-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary-hi), var(--ice)); }
.fill-bar.big { height: 6px; flex: 1; min-width: 120px; max-width: 260px; }
.md h2, .md h3, .md h4, .md h5 { margin: 1.2em 0 .5em; }
.md h2:first-child, .md h3:first-child { margin-top: 0; }
.md ul, .md ol { padding-left: 1.3em; margin: 0 0 .75em; }
.md blockquote { margin: 0 0 .75em; padding: .4em .9em; border-left: 3px solid var(--ice); background: rgba(156, 201, 224, .06); }
.md mark { background: rgba(224, 160, 48, .35); color: inherit; padding: 0 .2em; }
.md code { background: rgba(255, 255, 255, .06); padding: .1em .35em; border-radius: 3px; }
.md hr { border: 0; border-top: 1px solid var(--line-2); margin: 1.2em 0; }
.md-preview { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; max-height: 480px; overflow-y: auto; }

/* ---------- Page opération (thémée) ---------- */
body.op-mode { background: var(--op-bg); color: var(--op-text); font-family: var(--op-font-body); }
body.op-mode::before {
  content: ""; position: fixed; inset: 0; z-index: -1; background: var(--op-bg-image) center/cover no-repeat; background-attachment: var(--op-bg-attach);
  filter: var(--op-bg-filter, none); transform: var(--op-bg-transform, none);
}
body.op-mode::after { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--op-bg); opacity: var(--op-overlay); pointer-events: none; }
.opv { --radius: var(--op-radius); }
.opv h1, .opv h2, .opv h3, .opv h4 { font-family: var(--op-font-head); text-transform: var(--op-head-transform); }
.opv .card { background: var(--op-surface); border-color: var(--op-line); backdrop-filter: var(--op-card-bf, none); border-radius: var(--op-radius); }
.opv .muted, .opv .hint { color: var(--op-muted); }
.opv a { color: var(--op-accent); }
.opv .btn-op, .btn-op { background: var(--op-primary, var(--primary)); color: var(--op-on-primary, #fff); border-color: color-mix(in srgb, var(--op-primary, var(--primary)) 70%, #fff); }
.opv .btn-op:hover, .btn-op:hover { filter: brightness(1.15); background: var(--op-primary, var(--primary)); }
.opv .tbl th { background: color-mix(in srgb, var(--op-surface-solid) 70%, #000); color: var(--op-muted); border-color: var(--op-line); }
.opv .tbl td, .opv .table-wrap { border-color: var(--op-line); }

.opv-hero { position: relative; min-height: var(--op-banner-h); background: linear-gradient(135deg, color-mix(in srgb, var(--op-primary) 55%, #000), var(--op-bg)) var(--op-banner-pos) / cover no-repeat; display: flex; align-items: flex-end; border-bottom: 3px solid var(--op-primary); }
.opv-hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .15) 0%, color-mix(in srgb, var(--op-bg) 92%, transparent) 100%); }
.opv-tri { position: absolute; left: 0; right: 0; bottom: -3px; z-index: 2; }
.opv-hero-inner { position: relative; z-index: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 3rem 1.25rem 2rem; display: flex; gap: 2rem; align-items: flex-end; }
.opv-patch { flex: none; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .7)); }
.opv-patch svg { display: block; }
.opv-logo { width: 150px; height: 150px; object-fit: contain; flex: none; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .7)); }
.opv-logo.small { width: 70px; height: 70px; }
.opv-title { flex: 1; min-width: 0; }
.opv-title h1 { font-size: clamp(2.2rem, 5vw, 4rem); margin: .35rem 0 .15rem; letter-spacing: .04em; text-shadow: 0 3px 20px rgba(0, 0, 0, .6); color: var(--op-text); }
.opv-sub { font-size: 1.2rem; color: var(--op-accent); margin: 0; font-family: var(--op-font-head); letter-spacing: .05em; }
.opv-tagline { font-style: italic; color: var(--op-muted); margin: .3rem 0 0; }
.opv-facts { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 1rem 0; }
.fact { display: flex; gap: .5rem; align-items: center; }
.fact .ico { color: var(--op-accent); }
.fact small { display: block; font: 600 .68rem var(--op-font-head); text-transform: uppercase; letter-spacing: .1em; color: var(--op-muted); }
.fact b { font-weight: 600; }
.fact-link { color: inherit !important; border-bottom: 1px dashed var(--op-accent); }
.fact-link:hover { text-decoration: none; }
.opv-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.opv-maps { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.map-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border-radius: 999px; font-size: .82rem; background: rgba(0, 0, 0, .35); border: 1px solid var(--op-line); color: var(--op-text) !important; backdrop-filter: blur(4px); }
.map-btn:hover { border-color: var(--op-accent); text-decoration: none; }
.map-btn .ico { color: var(--op-accent); }
.opv-hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: .8rem; }
.opv-countdown { display: flex; gap: .4rem; }
.opv-countdown div { background: rgba(0, 0, 0, .45); border: 1px solid var(--op-line); border-radius: var(--op-radius); padding: .4rem .55rem; text-align: center; min-width: 54px; backdrop-filter: blur(4px); }
.opv-countdown b { display: block; font: 700 1.6rem var(--mono); line-height: 1; color: var(--op-text); }
.opv-countdown small { font: 600 .65rem var(--op-font-head); text-transform: uppercase; color: var(--op-muted); letter-spacing: .1em; }
.invite-code { display: flex; align-items: center; gap: .5rem; background: rgba(0, 0, 0, .45); border: 1px dashed var(--op-accent); color: var(--op-text); border-radius: var(--op-radius); padding: .4rem .7rem; cursor: pointer; font: inherit; }
.invite-code small { color: var(--op-muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.invite-code b { font-family: var(--mono); letter-spacing: .12em; }

.opv-nav { position: sticky; top: 53px; z-index: 40; background: color-mix(in srgb, var(--op-bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--op-line); }
.opv-nav-inner { max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; display: flex; gap: .2rem; overflow-x: auto; scrollbar-width: none; }
.opv-nav a { display: flex; align-items: center; gap: .4rem; padding: .75rem .8rem; color: var(--op-muted); font: 600 .85rem var(--op-font-head); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; border-bottom: 2px solid transparent; }
.opv-nav a:hover { color: var(--op-text); border-bottom-color: var(--op-primary); text-decoration: none; }

.opv-body { max-width: 1280px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; display: flex; flex-direction: column; gap: 1.2rem; }
.opv-me { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; border-left: 3px solid var(--op-primary); }
.opv-section { padding-top: 1rem; }
.opv-h2 { display: flex; align-items: center; gap: .6rem; font-size: 1.7rem; padding-bottom: .5rem; margin-bottom: 1rem; border-bottom: 1px solid var(--op-line); color: var(--op-text); }
.opv-h2 .ico { color: var(--op-accent); }
.opv-h2 small { font-family: var(--mono); font-size: .9rem; color: var(--op-muted); margin-left: auto; }
.opv-h2 { border-image: linear-gradient(90deg, var(--op-primary) 0 60px, var(--op-line) 60px) 1; }
.opv-brief { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; }
.opv-brief > .md { background: var(--op-surface); border: 1px solid var(--op-line); border-radius: var(--op-radius); padding: 1.3rem 1.5rem; backdrop-filter: var(--op-card-bf, none); }
.opv-brief .md h2, .opv-brief .md h3 { color: var(--op-accent); font-family: var(--op-font-head); text-transform: var(--op-head-transform); }
.opv-brief-side { display: flex; flex-direction: column; gap: 1rem; }
.info-row { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; border-bottom: 1px dashed var(--op-line); }
.info-row .muted { min-width: 110px; }
.info-row .mono { flex: 1; word-break: break-all; }

.wish-panel { border-left: 3px solid var(--warn); }
.wish-panel h3 .ico { color: var(--warn); }

/* ORBAT (organigramme) */
.orbat-toolbar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.legend { display: flex; flex-wrap: wrap; gap: .3rem; flex: 1; }
.orbat-scroll { overflow-x: auto; padding: .5rem 0 1rem; }
.orbat-tree { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; position: relative; }
.orbat-tree.root { min-width: max-content; }
.orbat-tree > li { position: relative; padding: 22px 8px 0; display: flex; flex-direction: column; align-items: center; }
.orbat-tree.root > li { padding-top: 0; }
/* traits de liaison */
.orbat-tree > li::before, .orbat-tree > li::after { content: ""; position: absolute; top: 0; height: 22px; border-top: 2px solid var(--op-line); width: 50%; }
.orbat-tree > li::before { right: 50%; }
.orbat-tree > li::after { left: 50%; border-left: 2px solid var(--op-line); }
.orbat-tree > li:first-child::before, .orbat-tree > li:last-child::after { border-top: 0; }
.orbat-tree > li:only-child::after { border-top: 0; }
.orbat-tree > li:only-child::before { display: none; }
.orbat-tree > li:last-child::before { border-right: 2px solid var(--op-line); border-radius: 0 6px 0 0; }
.orbat-tree > li:first-child::after { border-radius: 6px 0 0 0; }
.orbat-tree.root > li::before, .orbat-tree.root > li::after { display: none; }
.orbat-tree > li > .orbat-tree { padding-top: 22px; }
.orbat-tree > li > .orbat-tree::before { content: ""; position: absolute; top: 0; left: 50%; height: 22px; border-left: 2px solid var(--op-line); }
/* sous-unités empilées verticalement */
.orbat-tree.vertical { flex-direction: column; align-items: stretch; padding-left: 18px; margin-left: 18px; }
.orbat-tree > li > .orbat-tree.vertical::before { left: 0; top: 0; height: calc(100% - 30px); }
.orbat-tree.vertical > li { padding: 10px 0 0; align-items: stretch; }
.orbat-tree.vertical > li::before { width: 18px; left: -18px; right: auto; top: 34px; height: 0; border-top: 2px solid var(--op-line); border-right: 0; border-radius: 0; display: block; }
.orbat-tree.vertical > li::after { display: none; }

.unit-card { width: 290px; background: var(--op-surface); border: 1px solid var(--op-line); border-top: 3px solid var(--u); border-radius: var(--op-radius); backdrop-filter: var(--op-card-bf, none); box-shadow: 0 8px 24px -14px #000; text-align: left; }
.unit-head { display: flex; gap: .6rem; align-items: center; padding: .6rem .7rem .4rem; }
.unit-sym { flex: none; line-height: 0; }
.unit-titles { min-width: 0; }
.unit-titles b { font-family: var(--op-font-head); text-transform: var(--op-head-transform); font-size: 1.02rem; letter-spacing: .03em; display: block; line-height: 1.15; }
.callsign { font: 600 .72rem var(--mono); color: var(--op-accent, var(--ice)); background: rgba(0, 0, 0, .3); border: 1px solid var(--op-line, var(--line)); padding: 0 .35rem; border-radius: 3px; margin-left: .3rem; white-space: nowrap; }
.unit-titles .callsign { margin-left: 0; }
.unit-veh { padding: 0 .7rem .3rem; color: var(--op-muted); }
.unit-nets { display: flex; flex-wrap: wrap; gap: .25rem; padding: 0 .7rem .45rem; }
.net-chip { display: inline-flex; gap: .3rem; align-items: center; font-size: .7rem; padding: .08rem .4rem; border-radius: 3px; border: 1px solid color-mix(in srgb, var(--n) 70%, transparent); background: color-mix(in srgb, var(--n) 16%, transparent); white-space: nowrap; }
.net-chip b { font-family: var(--head); letter-spacing: .04em; }
.net-chip .mono { font-size: .95em; opacity: .85; }
.unit-notes { padding: .4rem .7rem .6rem; border-top: 1px dashed var(--op-line); }
.slot-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--op-line); }
.slot { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "rank role acts" "rank who acts"; align-items: center; column-gap: .4rem; padding: .3rem .5rem .3rem .6rem; font-size: .84rem; border-bottom: 1px solid color-mix(in srgb, var(--op-line) 55%, transparent); }
.slot:last-child { border-bottom: 0; }
.slot-rank { grid-area: rank; font-size: .7rem; color: var(--op-muted); }
.slot-role { grid-area: role; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: .25rem; }
.slot-role small { display: none; }
.slot.leader .slot-role { font-weight: 700; }
.slot.leader .slot-role .ico { color: #f0c878; }
.slot-who { grid-area: who; overflow: hidden; white-space: nowrap; font-weight: 600; display: flex; align-items: baseline; gap: .45rem; line-height: 1.25; font-size: .8rem; }
.slot-who .vacant, .vacant { color: var(--op-muted, var(--muted)); font-weight: 400; font-style: italic; }
.wish-count { color: var(--warn); font-weight: 600; font-size: .68rem; }
.slot.filled .slot-who { color: var(--op-text); }
.slot.mine { background: color-mix(in srgb, var(--op-primary) 30%, transparent); }
.slot.my-wish { background: rgba(224, 160, 48, .1); }
.slot.flash { animation: flash 1.6s ease 2; }
@keyframes flash { 30% { background: color-mix(in srgb, var(--op-accent) 45%, transparent); box-shadow: inset 0 0 0 2px var(--op-accent); } }
.slot-acts { grid-area: acts; display: flex; gap: .15rem; }
.slot-btn { display: inline-flex; align-items: center; gap: .2rem; border: 1px solid var(--op-line); background: transparent; color: var(--op-text); border-radius: 4px; padding: .12rem .35rem; font: 600 .68rem var(--op-font-head); text-transform: uppercase; cursor: pointer; }
.slot-btn:hover { border-color: var(--op-accent); }
.slot-btn.take { background: var(--op-primary); color: var(--op-on-primary); border-color: transparent; }
.slot-btn.wished { border-color: var(--warn); color: #f0c878; }
.slot-btn.leave:hover { border-color: var(--danger); color: #ff8a90; }
.slot-btn.has-wish { border-color: var(--warn); color: #f0c878; }
.slot-btn.ghost { border-color: transparent; color: var(--op-muted); opacity: 0; }
.slot:hover .slot-btn.ghost { opacity: 1; }

/* Chaîne de commandement */
.cmd-chain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .35rem; }
.cmd-chain li { display: flex; align-items: center; gap: .8rem; padding: .45rem .8rem; margin-left: calc(var(--d) * 28px); background: var(--op-surface); border: 1px solid var(--op-line); border-left: 3px solid var(--op-primary); border-radius: var(--op-radius); position: relative; }
.cmd-chain li::before { content: ""; position: absolute; left: -16px; top: 50%; width: 14px; border-top: 1px dashed var(--op-line); }
.cmd-sym { line-height: 0; flex: none; }
.cmd-main { flex: 1; min-width: 0; }
.cmd-main b { font-family: var(--op-font-head); text-transform: var(--op-head-transform); }
.cmd-main .who { color: var(--op-text); font-weight: 600; }
.cmd-nets { display: flex; gap: .25rem; flex-wrap: wrap; justify-content: flex-end; }

/* Équipes, sites, liens, TS, modpack, membres */
.team-grid, .site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.team-card { border-top: 4px solid var(--t); background: linear-gradient(160deg, color-mix(in srgb, var(--t) 18%, transparent), transparent 60%), var(--op-surface) !important; }
.team-card-head { display: flex; gap: .8rem; align-items: center; margin-bottom: .6rem; }
.team-card-head img { width: 54px; height: 54px; object-fit: contain; }
.team-card-head h3 { margin: 0; }
.team-badge { width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--t); color: var(--t2); font: 700 .95rem var(--head); border: 3px solid var(--t2); }
.team-card-foot { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin-top: .5rem; }
.site-card { padding: 0; overflow: hidden; border-left: 3px solid var(--t); }
.site-img { width: 100%; height: 150px; object-fit: cover; display: block; }
.site-body { padding: .9rem 1rem; }
.site-body h3 { margin: 0; }
.ts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.ts-channels { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.ts-channels li { padding: .45rem .6rem; border: 1px solid var(--op-line); border-radius: var(--op-radius); }
.ts-channels li.sub { margin-left: 1.4rem; }
.ts-channels .pw { margin-left: auto; color: var(--op-accent); }
.mp-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.mp-head h3 { margin: 0; }
.mod-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .35rem; margin-top: .8rem; }
.mod { display: flex; align-items: center; gap: .6rem; padding: .4rem .6rem; border: 1px solid var(--op-line); border-radius: var(--op-radius); background: var(--op-surface); color: var(--op-text) !important; font-size: .88rem; }
.mod:hover { border-color: var(--op-accent); text-decoration: none; }
.mod-n { color: var(--op-muted); font-size: .75rem; }
.mod-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-src { font-size: .7rem; color: var(--op-muted); text-transform: uppercase; }
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .6rem; }
.link-card { display: flex; align-items: center; gap: .7rem; color: var(--op-text) !important; padding: .9rem 1rem; }
.link-card span { flex: 1; font-weight: 600; }
.link-card:hover { border-color: var(--op-accent); text-decoration: none; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .5rem; }
.member-card { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border: 1px solid var(--op-line); border-radius: var(--op-radius); background: var(--op-surface); }
.member-card > div { flex: 1; min-width: 0; }
.member-row { display: flex; align-items: center; gap: .7rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.member-row:last-child { border-bottom: 0; }
.opv-foot { max-width: 1280px; margin: 0 auto; padding: 1.5rem 1.25rem 2.5rem; display: flex; align-items: center; gap: .8rem; color: var(--op-muted); font-size: .85rem; border-top: 1px solid var(--op-line); flex-wrap: wrap; }
.opv-foot .muted { margin-left: auto; }

/* ---------- Éditeur ---------- */
.editor { max-width: 1480px; margin: 0 auto; padding: 0 1.25rem 4rem; }
.ed-bar { position: sticky; top: 53px; z-index: 30; display: flex; align-items: center; gap: .8rem; padding: .8rem 0; background: rgba(7, 11, 20, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ed-bar-title small { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; }
.ed-bar-title h1 { margin: 0; font-size: 1.5rem; }
.dirty-tag { font-size: .78rem; color: #f0c878; border: 1px solid rgba(224, 160, 48, .5); padding: .15rem .55rem; border-radius: 999px; }
.ed-body { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 1.5rem; margin-top: 1.2rem; }
.ed-body.single { grid-template-columns: 1fr; }
.ed-tabs { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 130px; align-self: start; }
.ed-tabs a { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; color: var(--muted); border-radius: var(--radius); font: 600 .9rem var(--head); text-transform: uppercase; letter-spacing: .06em; border-left: 2px solid transparent; }
.ed-tabs a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.ed-tabs a.on { background: var(--surface-2); color: var(--text); border-left-color: var(--primary-hi); }
.ed-tabs a.on .ico { color: var(--ice); }
.ed-content { min-width: 0; }

.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .5rem; }
.preset { display: flex; flex-direction: column; gap: .4rem; padding: .55rem; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); border-radius: var(--radius); cursor: pointer; text-align: left; font: 600 .82rem var(--body); }
.preset:hover { border-color: var(--ice); }
.preset-sw { display: flex; height: 22px; border-radius: 3px; overflow: hidden; }
.preset-sw i { flex: 1; }
.appearance { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.2rem; }
.appearance-side .sticky { position: sticky; top: 140px; }
.theme-preview { border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); background: var(--op-bg); color: var(--op-text); font-family: var(--op-font-body); }
.tp-banner { min-height: 140px; display: flex; align-items: flex-end; gap: .8rem; padding: 1rem; background: linear-gradient(135deg, color-mix(in srgb, var(--op-primary) 55%, #000), var(--op-bg)) center/cover; position: relative; border-bottom: 3px solid var(--op-primary); }
.tp-banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent, color-mix(in srgb, var(--op-bg) 85%, transparent)); }
.tp-banner > * { position: relative; }
.tp-banner img { width: 56px; height: 56px; object-fit: contain; }
.tp-title { font: 700 1.6rem var(--op-font-head); text-transform: var(--op-head-transform); line-height: 1; }
.tp-sub { color: var(--op-accent); font-family: var(--op-font-head); }
.tp-body { padding: 1rem; }
.tp-card { background: var(--op-surface); border: 1px solid var(--op-line); border-radius: var(--op-radius); padding: .9rem; backdrop-filter: var(--op-card-bf, none); }
.tp-h { font: 700 1.05rem var(--op-font-head); text-transform: var(--op-head-transform); margin-bottom: .4rem; }
.tp-accent { color: var(--op-accent); font-weight: 700; }
.tp-btn { display: inline-block; margin-top: .4rem; padding: .45rem .9rem; border-radius: var(--op-radius); background: var(--op-primary); color: var(--op-on-primary); font: 600 .85rem var(--op-font-head); text-transform: uppercase; }
.patch-editor { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.2rem; align-items: start; }
.patch-preview { display: flex; justify-content: center; padding: 1rem; background: repeating-conic-gradient(#0d1420 0% 25%, #111a29 0% 50%) 50% / 24px 24px; border-radius: var(--radius); }
.list-ed { display: flex; flex-direction: column; gap: .8rem; }
.list-item-bar { display: flex; align-items: center; margin: -.4rem 0 .6rem; }
.chip-picks { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip-pick { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .55rem; border: 1px solid var(--line-2); border-radius: 999px; font-size: .8rem; cursor: pointer; white-space: pre; }
.chip-pick input { display: none; }
.chip-pick.on { background: rgba(0, 50, 166, .35); border-color: var(--primary-hi); }
.invite-link { background: var(--bg-2); border: 1px dashed var(--line-2); padding: .45rem .7rem; border-radius: var(--radius); word-break: break-all; flex: 1; min-width: 240px; font-size: .82rem; }
.search-results { margin-top: .6rem; }
.activity { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; }
.act-row { display: flex; gap: .6rem; align-items: baseline; padding: .3rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; flex-wrap: wrap; }
.act-row .mono { min-width: 90px; }
.danger-zone { border-color: rgba(216, 67, 74, .4); }
.map-link-row { display: grid; grid-template-columns: 220px 1fr 2fr auto; gap: .5rem; align-items: center; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .7rem; }
.stat { padding: .8rem 1rem; }
.stat small { display: block; color: var(--muted); font: 600 .72rem var(--head); text-transform: uppercase; letter-spacing: .1em; }
.stat b { font: 700 1.3rem var(--head); }

/* Éditeur ORBAT */
.oe { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 1rem; align-items: start; }
.oe-left { position: sticky; top: 130px; max-height: calc(100vh - 150px); display: flex; flex-direction: column; padding: .9rem; }
.oe-left-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.oe-left-head h3 { margin: 0; }
.oe-tree { overflow-y: auto; flex: 1; margin: .4rem -.4rem 0; padding: 0 .4rem; }
.oe-row { display: flex; align-items: center; gap: .35rem; padding: .3rem .35rem .3rem calc(.35rem + var(--d) * 18px); border-radius: 5px; cursor: pointer; border: 1px solid transparent; position: relative; }
.oe-row:hover { background: var(--surface-2); }
.oe-row.sel { background: rgba(0, 50, 166, .3); border-color: rgba(61, 111, 224, .6); }
.oe-row.dragging { opacity: .4; }
.oe-row[data-drop=before] { box-shadow: inset 0 2px 0 var(--ice); }
.oe-row[data-drop=after] { box-shadow: inset 0 -2px 0 var(--ice); }
.oe-row[data-drop=inside] { background: rgba(156, 201, 224, .15); border-color: var(--ice); }
.oe-toggle { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; flex: none; }
.oe-sym { line-height: 0; flex: none; }
.oe-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .9rem; }
.oe-name small { color: var(--muted); font-family: var(--mono); font-size: .72rem; margin-left: .35rem; font-weight: 400; }
.oe-count { font-size: .72rem; color: var(--muted); background: var(--bg-2); padding: 0 .35rem; border-radius: 3px; }
.oe-actions { display: none; }
.oe-row:hover .oe-actions, .oe-row.sel .oe-actions { display: flex; }
.oe-rootdrop { margin-top: .5rem; padding: .6rem; border: 1px dashed var(--line-2); border-radius: 5px; text-align: center; font-size: .78rem; color: var(--muted); }
.oe-rootdrop.over { border-color: var(--ice); color: var(--ice); }
.oe-detail { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.oe-dhead { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.oe-dhead h3 { margin: 0; font-size: 1.4rem; }
.oe-sym-big { line-height: 0; }
.net-picks { display: flex; flex-wrap: wrap; gap: .3rem; }
.net-pick { border: 1px solid color-mix(in srgb, var(--n) 50%, var(--line-2)); background: transparent; color: var(--muted); padding: .25rem .6rem; border-radius: 4px; cursor: pointer; font: 600 .78rem var(--head); letter-spacing: .04em; }
.net-pick.on { background: color-mix(in srgb, var(--n) 22%, transparent); color: var(--text); }
.net-pick.primary { background: color-mix(in srgb, var(--n) 45%, transparent); color: #fff; border-color: var(--n); }
.slots-tbl td { padding: .3rem .35rem; }
.slots-tbl .input-sm { min-width: 90px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; }
.tpl { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .9rem .6rem; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); border-radius: var(--radius); cursor: pointer; text-align: center; font: inherit; }
.tpl:hover { border-color: var(--ice); background: var(--surface-2); }
.tpl small { color: var(--muted); }
.mini-sym { line-height: 0; display: inline-block; vertical-align: middle; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .appearance, .patch-editor { grid-template-columns: 1fr; }
  .appearance-side .sticky { position: static; }
  .oe { grid-template-columns: 1fr; }
  .oe-left { position: static; max-height: 420px; }
  .opv-brief { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .ed-body { grid-template-columns: 1fr; }
  .ed-tabs { position: static; flex-direction: row; overflow-x: auto; gap: .2rem; padding-bottom: .3rem; }
  .ed-tabs a { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .ed-tabs a.on { border-bottom-color: var(--primary-hi); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  .auth-page { grid-template-columns: 1fr; gap: 1.5rem; }
  .auth-side h1 { font-size: 2rem; }
  .auth-points { display: none; }
  .opv-hero-inner { flex-direction: column; align-items: flex-start; padding-top: 2rem; }
  .opv-hero-side { align-items: flex-start; }
  .opv-patch svg { width: 110px; height: 110px; }
  .map-link-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  #app-header { gap: .6rem; padding: .5rem .8rem; }
  .brand-txt, .navlink span, .user-chip span { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  .container { padding: 1rem 1rem 3rem; }
  .dash-hero h1 { font-size: 1.8rem; }
  .search-box { min-width: 0; width: 100%; }
  .unit-card { width: 250px; }
  .opv-body, .opv-hero-inner, .editor { padding-left: 1rem; padding-right: 1rem; }
  .ed-bar-title h1 { font-size: 1.15rem; }
}

/* ---------- Impression ---------- */
@media print {
  #app-header, .opv-nav, .opv-actions, .opv-maps, .slot-acts, .opv-me, .wish-panel, .invite-code, #toasts, .orbat-toolbar label { display: none !important; }
  body, body.op-mode { background: #fff !important; color: #000 !important; }
  body.op-mode::before, body.op-mode::after { display: none; }
  .opv-hero { min-height: 0; background: none !important; border-bottom: 2px solid #000; }
  .opv-hero-shade { display: none; }
  .opv-hero-inner { padding: 1rem 0; }
  .opv-title h1, .opv-sub, .fact b { color: #000 !important; text-shadow: none; }
  .card, .unit-card, .opv-brief > .md, .cmd-chain li, .mod, .member-card { background: #fff !important; border-color: #999 !important; box-shadow: none; backdrop-filter: none; }
  .orbat-scroll { overflow: visible; }
  .opv-section { break-inside: avoid-page; }
  .unit-card { break-inside: avoid; }
  a { color: #000 !important; }
}
