/* ══════════════════════════════════════════════════════════════════
   RSM — Reworld Social Media Studio
   Design system : sombre, dense, précis. Inter + Newsreader.
   ══════════════════════════════════════════════════════════════════ */

:root {
  --bg: #08090a;
  --bg-soft: #0a0b0d;
  --panel: #0e0f12;
  --panel-2: #121317;
  --panel-3: #16181d;
  --border: #1c1f24;
  --border-2: #262a31;
  --border-3: #333840;
  --text: #e9eaee;
  --muted: #9a9fa9;
  --dim: #6b7079;
  --brand: #1d7a6f;
  --on-brand: #ffffff;
  --accent-soft: rgba(29, 122, 111, 0.14);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 12px 32px -8px rgba(0,0,0,.7), 0 2px 8px rgba(0,0,0,.4);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --max-w: 1600px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 78% -10%, rgba(255,255,255,.045), transparent 60%),
    radial-gradient(700px 400px at 12% 110%, var(--accent-soft), transparent 65%);
  z-index: 0;
}

button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; }
::selection { background: color-mix(in srgb, var(--brand) 40%, transparent); }

/* ── scrollbars ── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #22262c; border-radius: 20px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #31363e; }

.ico { width: 18px; height: 18px; flex: 0 0 auto; }
.ico.sm { width: 15px; height: 15px; }
kbd {
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--dim);
  background: #16181c;
  border: 1px solid var(--border-2);
  border-radius: 5px;
  padding: 1px 5px;
  line-height: 1.5;
}

/* ══════════════ APP SHELL ══════════════ */
.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 244px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ══════════════ RAIL ══════════════ */
.rail {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, #0a0b0d, #08090a 60%);
  padding: 18px 12px 12px;
  gap: 4px;
  min-height: 0;
}

.rail-head { padding: 2px 8px 16px; }
.brandmark {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(100deg, #fff, color-mix(in srgb, var(--brand) 70%, #fff));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brandmark-sub {
  font-size: 10.5px;
  color: var(--dim);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-top: 2px;
  font-weight: 500;
}

.rail-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: background .13s ease, color .13s ease;
  position: relative;
}
.nav-item span { flex: 1; }
.nav-item kbd { opacity: 0; transition: opacity .13s ease; }
.nav-item:hover { background: #101216; color: var(--text); }
.nav-item:hover kbd { opacity: 1; }
.nav-item.active { background: #15181d; color: var(--text); }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 18px;
  border-radius: 0 2px 2px 0;
  background: var(--brand);
}
.nav-item.active .ico { color: var(--brand); }

.rail-sep { height: 1px; background: var(--border); margin: 12px 4px; }
.rail-section { padding: 0 4px; }
.rail-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--dim);
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}

.brand-pick {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  text-align: left;
  transition: border-color .14s ease, background .14s ease;
}
.brand-pick:hover { border-color: var(--border-2); background: var(--panel-2); }
.swatch {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
  flex: 0 0 auto;
}
.brand-pick-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.brand-pick-meta b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-pick-meta i { font-size: 10.5px; color: var(--dim); font-style: normal; }

.kit-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.kit-colors { display: flex; gap: 4px; flex: 1; }
.kit-dot {
  width: 16px; height: 16px; border-radius: 4px;
  border: 1px solid rgba(255,255,255,.16);
  cursor: pointer;
  transition: transform .12s ease;
}
.kit-dot:hover { transform: translateY(-1px) scale(1.08); }
.mini-btn {
  font-size: 10.5px;
  color: var(--dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  transition: color .12s, border-color .12s;
}
.mini-btn:hover { color: var(--text); border-color: var(--border-3); }

.rail-foot { margin-top: auto; padding: 10px 8px 0; display: flex; flex-direction: column; gap: 8px; }
.health-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--dim);
}
.health-pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #3f444d;
  box-shadow: 0 0 0 3px rgba(255,255,255,.03);
}
.health-pill.ok .dot { background: #35c07a; box-shadow: 0 0 0 3px rgba(53,192,122,.14); }
.health-pill.err .dot { background: #e5484d; box-shadow: 0 0 0 3px rgba(229,72,77,.14); }
.rail-hint { font-size: 10.5px; color: #4d525b; }

/* ══════════════ MAIN ══════════════ */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.topbar {
  height: 52px;
  flex: 0 0 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(8,9,10,.72);
  backdrop-filter: blur(12px);
}
.crumb { display: flex; align-items: baseline; gap: 10px; }
.crumb #crumbTitle { font-size: 13px; font-weight: 600; }
.crumb-sub { font-size: 11.5px; color: var(--dim); }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.viewport { flex: 1; overflow: auto; padding: 26px 28px 40px; min-height: 0; }
.view { max-width: var(--max-w); margin: 0 auto; }
.hidden { display: none !important; }

/* ── boutons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid var(--border-2);
  background: var(--panel-2);
  color: var(--text);
  transition: background .13s ease, border-color .13s ease, transform .08s ease, opacity .13s;
  white-space: nowrap;
}
.btn:hover { background: var(--panel-3); border-color: var(--border-3); }
.btn:active { transform: translateY(.5px); }
.btn.primary {
  background: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 70%, #000);
  color: var(--on-brand);
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, var(--shadow-1);
}
.btn.primary:hover { background: color-mix(in srgb, var(--brand) 88%, #fff); }
.btn.primary kbd { background: rgba(0,0,0,.18); border-color: rgba(255,255,255,.18); color: rgba(255,255,255,.75); }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.sm { height: 27px; padding: 0 9px; font-size: 11.5px; }
.btn.full { width: 100%; }
.btn.icon-only { width: 32px; padding: 0; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn kbd { background: rgba(0,0,0,.25); border-color: rgba(255,255,255,.1); color: inherit; opacity: .65; }

/* ── vues ── */
.view-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 22px; flex-wrap: wrap;
}
.view-head h1 {
  font-size: 22px; font-weight: 650; letter-spacing: -0.028em;
  margin: 0 0 5px; display: flex; align-items: center; gap: 10px;
}
.sub { margin: 0; color: var(--muted); font-size: 12.5px; }
.sub b { color: var(--text); font-weight: 600; }
.badge-live {
  font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: #35c07a; background: rgba(53,192,122,.1);
  border: 1px solid rgba(53,192,122,.24);
  padding: 2px 6px; border-radius: 5px;
  display: inline-flex; align-items: center; gap: 5px;
}
.badge-live::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: #35c07a;
  animation: pulse 2.2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 27px; padding: 0 10px; border-radius: 7px;
  font-size: 11.5px; font-weight: 500; color: var(--muted);
  border: 1px solid var(--border); background: transparent;
  transition: all .13s ease;
}
.chip:hover { color: var(--text); border-color: var(--border-2); }
.chip.active {
  color: var(--text); background: var(--panel-2); border-color: var(--border-3);
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset;
}

/* ══════════════ RADAR ══════════════ */
.radar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
}
.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255,255,255,.018), transparent 40%),
    var(--panel);
  padding: 16px 16px 14px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
  overflow: hidden;
}
.card:hover { border-color: var(--border-3); transform: translateY(-1px); }
.card::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 16px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent);
}
.card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border-radius: var(--radius);
  background: radial-gradient(400px 120px at 20% 0%, rgba(255,255,255,.035), transparent 70%);
  opacity: 0; transition: opacity .2s ease;
}
.card:hover::after { opacity: 1; }

.card-top { display: flex; align-items: center; gap: 8px; }
.score {
  display: inline-flex; align-items: baseline; gap: 1px;
  font-variant-numeric: tabular-nums;
  font-weight: 700; font-size: 15px; letter-spacing: -.03em;
  padding: 2px 7px; border-radius: 6px;
  border: 1px solid var(--border-2);
  background: var(--panel-2);
  color: var(--muted);
}
.score i { font-size: 9.5px; font-style: normal; color: var(--dim); font-weight: 600; }
.score.hot { color: #fff; background: color-mix(in srgb, var(--brand) 26%, var(--panel-2)); border-color: color-mix(in srgb, var(--brand) 55%, transparent); }
.score.hot i { color: rgba(255,255,255,.6); }
.src { font-size: 11px; font-weight: 600; color: var(--muted); }
.age { font-size: 11px; color: var(--dim); margin-left: auto; font-variant-numeric: tabular-nums; }

.card h3 {
  margin: 0; font-size: 13.5px; line-height: 1.42; font-weight: 600;
  letter-spacing: -0.012em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-why { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; }
.card-why::before { content: "▸"; color: var(--brand); flex: 0 0 auto; }

.card-media {
  display: flex; gap: 12px; align-items: center;
  padding-top: 2px;
}
.card-thumb {
  width: 60px; height: 60px; border-radius: 9px; object-fit: cover;
  border: 1px solid var(--border-2); background: var(--panel-2); flex: 0 0 auto;
}
.card-tpl {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--dim); border: 1px solid var(--border);
  padding: 3px 7px; border-radius: 5px; font-weight: 600;
}
.card-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; }
.card-foot .btn { flex: 1; }

.skel {
  height: 168px; border-radius: var(--radius);
  background: linear-gradient(100deg, var(--panel) 30%, var(--panel-3) 50%, var(--panel) 70%);
  background-size: 220% 100%;
  animation: sheen 1.4s infinite linear;
  border: 1px solid var(--border);
}
@keyframes sheen { 0% { background-position: 120% 0 } 100% { background-position: -120% 0 } }

/* ══════════════ STUDIO ══════════════ */
.studio {
  display: grid;
  grid-template-columns: 268px minmax(420px, 1fr) 336px;
  gap: 14px;
  height: calc(100vh - 52px - 66px);
  min-height: 560px;
}

.studio-left, .studio-right {
  display: flex; flex-direction: column; gap: 12px;
  min-height: 0; overflow: auto;
  padding-right: 2px;
}

.brief-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.brief-box textarea {
  width: 100%; resize: vertical; min-height: 62px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 9px;
  font-size: 12.5px; line-height: 1.5; color: var(--text);
  outline: none; transition: border-color .14s ease;
}
.brief-box textarea:focus { border-color: color-mix(in srgb, var(--brand) 60%, var(--border-2)); }
.hint { font-size: 10.5px; color: var(--dim); line-height: 1.45; }

.tpl-list-head { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.tpl-count { font-size: 10.5px; color: var(--dim); }
.tpl-list { display: flex; flex-direction: column; gap: 3px; }
.tpl-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border-radius: 7px;
  font-size: 12.5px; color: var(--muted); text-align: left;
  border: 1px solid transparent;
  transition: all .12s ease;
}
.tpl-item:hover { background: var(--panel); color: var(--text); }
.tpl-item.active { background: var(--panel-2); border-color: var(--border-2); color: var(--text); }
.tpl-item .tpl-ico {
  width: 22px; height: 22px; border-radius: 5px; flex: 0 0 auto;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700; letter-spacing: -.02em;
  background: var(--panel-3); color: var(--muted);
  border: 1px solid var(--border-2);
}
.tpl-item.active .tpl-ico { background: var(--brand); color: var(--on-brand); border-color: transparent; }
.tpl-item span { flex: 1; }
.tpl-item i { font-style: normal; font-size: 10px; color: var(--dim); }

.studio-center { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.canvas-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 0 2px 12px;
  flex-wrap: wrap;
}
.seg {
  display: inline-flex; padding: 2px; gap: 2px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
}
.seg button {
  height: 24px; padding: 0 9px; border-radius: 6px;
  font-size: 11.5px; font-weight: 500; color: var(--muted);
  transition: all .12s ease;
}
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--panel-3); color: var(--text); box-shadow: var(--shadow-1); }
.zoom { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.toolbar-right { margin-left: auto; display: flex; gap: 8px; }

.canvas-stage {
  flex: 1; min-height: 0;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(255,255,255,.03), transparent 70%),
    repeating-conic-gradient(from 0deg at 50% 50%, #0b0c0e 0% 25%, #090a0c 0% 50%) 0 0/22px 22px;
  padding: 20px;
  overflow: hidden;
}
.canvas-frame {
  position: relative;
  box-shadow: var(--shadow-2);
  border-radius: 6px;
  overflow: hidden;
  line-height: 0;
  transition: width .18s ease;
}
#canvas { display: block; height: auto; max-height: 100%; border-radius: 6px; }
.canvas-foot {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 2px 0; font-size: 10.5px; color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.canvas-foot .sep { opacity: .4; }

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--dim);
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent);
}
.tpl-badge {
  font-size: 10px; text-transform: none; letter-spacing: 0;
  color: var(--muted); background: var(--panel-3);
  border: 1px solid var(--border-2); border-radius: 5px; padding: 1px 6px;
}
#fieldsWrap { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 10px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field-label {
  font-size: 10.5px; font-weight: 600; color: var(--dim);
  text-transform: uppercase; letter-spacing: .06em;
  display: flex; justify-content: space-between; align-items: center;
}
.field-label i { font-style: normal; text-transform: none; letter-spacing: 0; color: #595e67; font-weight: 500; }
.field input[type="text"], .field textarea, .field select {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 9px; font-size: 12.5px;
  outline: none; transition: border-color .14s ease, background .14s;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--border-2));
  background: #0c0d10;
}
.field .row { display: flex; gap: 6px; }
.field .row > * { flex: 1; }

.slider-row { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--dim); }
.slider-row input[type="range"] {
  flex: 1; height: 3px; -webkit-appearance: none; appearance: none;
  background: var(--border-3); border-radius: 3px; outline: none;
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
  background: var(--text); border: 2px solid var(--bg); cursor: pointer;
}

.photo-drop {
  margin: 10px 12px;
  border: 1px dashed var(--border-3);
  border-radius: var(--radius-sm);
  padding: 16px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center; font-size: 11.5px; color: var(--dim);
  cursor: pointer; transition: all .14s ease;
}
.photo-drop:hover, .photo-drop.over {
  border-color: color-mix(in srgb, var(--brand) 60%, var(--border-3));
  color: var(--text); background: color-mix(in srgb, var(--brand) 7%, transparent);
}
.photo-drop u { text-decoration-color: var(--border-3); }
.photo-tools { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.photo-tools .row { display: flex; gap: 6px; }
.photo-tools .row > * { flex: 1; }

.color-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 11px 12px 13px; }
.color-cell { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.color-cell input[type="color"] {
  width: 100%; height: 30px; border: 1px solid var(--border-2);
  border-radius: 7px; background: none; padding: 0; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.color-cell input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
.color-cell input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }
.color-cell span { font-size: 9.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }

/* ══════════════ BIBLIOTHÈQUE ══════════════ */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.lib-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); overflow: hidden; cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}
.lib-card:hover { border-color: var(--border-3); transform: translateY(-2px); }
.lib-thumb { line-height: 0; background: #0a0b0d; border-bottom: 1px solid var(--border); }
.lib-thumb canvas { width: 100%; height: auto; display: block; }
.lib-meta { padding: 9px 11px 11px; display: flex; align-items: center; gap: 8px; }
.lib-meta b { font-size: 12.5px; font-weight: 600; }
.lib-meta span { margin-left: auto; font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }

/* ══════════════ PLANNING ══════════════ */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left; padding: 9px 12px; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .07em; color: var(--dim); font-weight: 600;
  border-bottom: 1px solid var(--border); background: rgba(255,255,255,.014);
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255,255,255,.014); }
.table .msg { color: var(--muted); max-width: 520px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 5px;
  border: 1px solid var(--border-2); color: var(--muted); white-space: nowrap;
}
.status-pill.s200 { color: #35c07a; border-color: rgba(53,192,122,.3); background: rgba(53,192,122,.08); }
.status-pill.s210 { color: #e2b33c; border-color: rgba(226,179,60,.3); background: rgba(226,179,60,.08); }
.status-pill.s202 { color: #6aa7ff; border-color: rgba(106,167,255,.3); background: rgba(106,167,255,.08); }

/* ══════════════ COMPTES ══════════════ */
.acct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 10px; }
.acct {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 11px; background: var(--panel);
}
.acct.off { opacity: .5; }
.acct-ico {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  background: var(--panel-3); border: 1px solid var(--border-2); color: var(--muted);
}
.acct b { display: block; font-size: 12.5px; font-weight: 600; }
.acct span { font-size: 10.5px; color: var(--dim); }
.acct .ok {
  margin-left: auto; font-size: 10px; color: #35c07a;
  display: inline-flex; align-items: center; gap: 4px;
}

/* ══════════════ OVERLAY / PALETTE ══════════════ */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4,5,6,.62); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 14vh;
}
.palette {
  width: min(620px, 92vw);
  background: #0d0e11;
  border: 1px solid var(--border-2);
  border-radius: 13px;
  box-shadow: 0 30px 70px -16px rgba(0,0,0,.9);
  overflow: hidden;
  animation: pop .14s ease-out;
}
@keyframes pop { from { transform: translateY(-6px) scale(.99); opacity: 0 } }
.palette-input {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.palette-input input {
  flex: 1; background: none; border: none; outline: none; font-size: 14px;
}
.palette-input input::placeholder { color: #565b64; }
.palette-list { max-height: 46vh; overflow: auto; padding: 6px; }
.pal-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; font-size: 12.5px; color: var(--muted);
  width: 100%; text-align: left;
}
.pal-item:hover, .pal-item.sel { background: var(--panel-2); color: var(--text); }
.pal-item .pal-k { margin-left: auto; font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }

/* ══════════════ DRAWER ══════════════ */
.drawer-bg {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(4,5,6,.55); backdrop-filter: blur(3px);
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0 } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 71;
  width: min(460px, 96vw);
  background: #0b0c0f;
  border-left: 1px solid var(--border-2);
  box-shadow: -30px 0 70px -20px rgba(0,0,0,.85);
  display: flex; flex-direction: column;
  animation: slide .2s cubic-bezier(.22,.8,.3,1);
}
@keyframes slide { from { transform: translateX(24px); opacity: .6 } }
.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 16px 12px; border-bottom: 1px solid var(--border); gap: 10px;
}
.drawer-head h2 { margin: 0 0 3px; font-size: 15px; font-weight: 650; letter-spacing: -.02em; }
.drawer-body { flex: 1; overflow: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; }
.drawer-preview {
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: #08090a; line-height: 0; max-height: 200px;
  display: grid; place-items: center;
}
.drawer-preview canvas { width: 100%; height: auto; max-height: 200px; object-fit: contain; }
.drawer-foot {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--border); background: rgba(255,255,255,.014);
}
.drawer-foot .btn { flex: 1; }
.net-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.net-item {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border-2); border-radius: 8px;
  padding: 6px 9px; font-size: 11.5px; color: var(--muted);
  background: var(--panel); transition: all .13s ease;
}
.net-item:hover { border-color: var(--border-3); color: var(--text); }
.net-item.on { color: var(--text); border-color: color-mix(in srgb, var(--brand) 60%, transparent); background: color-mix(in srgb, var(--brand) 12%, var(--panel)); }
.net-item .dot { width: 6px; height: 6px; border-radius: 50%; background: #3f444d; }
.net-item.on .dot { background: var(--brand); }
.net-item.disabled { opacity: .4; cursor: not-allowed; }
input[type="datetime-local"] {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 9px; font-size: 12.5px;
  color-scheme: dark; outline: none;
}
input[type="datetime-local"]:focus { border-color: color-mix(in srgb, var(--brand) 55%, var(--border-2)); }

/* ══════════════ TOASTS ══════════════ */
.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: flex-start; gap: 9px;
  min-width: 260px; max-width: 380px;
  background: #101216; border: 1px solid var(--border-2);
  border-radius: 10px; padding: 10px 12px; font-size: 12px;
  box-shadow: var(--shadow-2);
  animation: toastIn .18s cubic-bezier(.22,.8,.3,1);
}
@keyframes toastIn { from { transform: translateY(8px); opacity: 0 } }
.toast .bar { width: 3px; border-radius: 3px; background: var(--brand); align-self: stretch; }
.toast.err .bar { background: #e5484d; }
.toast.ok .bar { background: #35c07a; }
.toast b { display: block; font-size: 12px; margin-bottom: 1px; }
.toast span { color: var(--muted); font-size: 11.5px; line-height: 1.45; }

/* ══════════════ RESPONSIVE (desktop first, dégradé assumé) ══════════════ */
@media (max-width: 1360px) {
  .studio { grid-template-columns: 234px minmax(360px, 1fr) 300px; }
}
@media (max-width: 1120px) {
  .app { grid-template-columns: 68px 1fr; }
  .rail-head .brandmark-sub, .rail-label, .rail-hint, .brand-pick-meta, .kit-row, .nav-item span, .nav-item kbd { display: none; }
  .rail-head { padding: 0 0 14px; text-align: center; }
  .nav-item { justify-content: center; }
  .brand-pick { justify-content: center; padding: 8px; }
  .studio { grid-template-columns: 1fr; height: auto; }
  .studio-left, .studio-right { overflow: visible; }
  .canvas-stage { min-height: 420px; }
}
