/* Couleurs du site Juditech3D (juditech3d.fr) : fond noir, or, bordeaux, textes crème.
   Le site est sombre ; l'espace des licences l'est aussi, quel que soit le réglage du système. */
@font-face { font-family: 'Montserrat'; font-weight: 700; font-display: swap;
  src: url('polices/Montserrat-700-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: 'Montserrat'; font-weight: 700; font-display: swap;
  src: url('polices/Montserrat-700-latin-ext.woff2') format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #0b0906;              /* fond de page */
  --surface: #130f0a;         /* cartes (jt3d-card) */
  --surface2: #1c160e;
  --text: #d8c9a8;            /* texte crème */
  --heading: #f0e4c0;         /* titres */
  --muted: #a08a62;           /* texte secondaire (brun clair, lisible sur le fond) */
  --border: #2c2010;          /* bordures et grille */
  --brand: #c9a227;           /* or */
  --brand-light: #e8c84a;     /* or clair (liens, survol) */
  --brand-text: #1a1206;      /* texte sur un bouton doré */
  --wine: #5c1020;            /* bordeaux du logo */
  --ok: #9fcf6e;
  --warn: #e8c84a;
  --bad: #e8a0b0;             /* rose bordeaux du site */

  color-scheme: dark;
  accent-color: var(--brand);
  --radius: 14px;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --title: 'Montserrat', "Segoe UI", system-ui, sans-serif;
}

/* Le fond du site : grille brune très fine et halo doré. */
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(201, 162, 39, .13), transparent 70%),
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 100% 100%, 48px 48px, 48px 48px;
  background-attachment: fixed;
}
h1, h2, h3, .brand { font-family: var(--title); color: var(--heading); letter-spacing: .01em; }
h1, h2 { font-weight: 700; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
a.comp-link { color: inherit; text-decoration: none; }
a.comp-link:hover b { color: var(--brand); text-decoration: underline; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.5 "Segoe UI", system-ui, Roboto, sans-serif;
  color: var(--text);
  min-height: 100dvh;
}
a { color: var(--brand-light); }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .6rem; }
h3 { font-size: 1rem; margin: 0 0 .4rem; }
p { margin: .4rem 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.small { font-size: .85rem; }
[hidden] { display: none !important; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 1rem;
  padding: .6rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.mainnav { display: flex; gap: .25rem; overflow-x: auto; flex: 1; scrollbar-width: none; }
.mainnav a {
  padding: .4rem .7rem; border-radius: 8px; text-decoration: none; color: var(--muted); white-space: nowrap;
}
.mainnav a:hover { background: var(--surface2); color: var(--text); }
.mainnav a[aria-current="page"] { background: var(--surface2); color: var(--brand); font-weight: 600; }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: .4rem; padding: .5rem .75rem; }
  .mainnav { order: 3; flex-basis: 100%; }
  .top-tools { margin-left: auto; }
}

main { max-width: 1180px; margin: 0 auto; padding: 1.25rem 1rem 4rem; outline: none; }

/* ---------- Controls ---------- */
button, .btn {
  font: inherit; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .45rem .9rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  text-decoration: none; white-space: nowrap;
}
button:hover, .btn:hover { border-color: var(--brand); }
button.primary, .btn.primary { background: var(--brand); color: var(--brand-text); border-color: var(--brand); font-weight: 600; }
button.danger { color: var(--bad); }
button.ghost { background: transparent; border-color: transparent; }
button.small, .btn.small { padding: .2rem .55rem; font-size: .85rem; }
button:disabled { opacity: .5; cursor: progress; }

input, select, textarea {
  font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: .45rem .6rem; width: 100%;
}
textarea { resize: vertical; min-height: 5rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 1px;
}
label { display: grid; gap: .2rem; font-size: .88rem; color: var(--muted); }
label > span { font-weight: 500; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; }
.form-grid .wide { grid-column: 1 / -1; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.actions.end { justify-content: flex-end; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 1rem 0; }
.toolbar input[type="search"] { flex: 1 1 240px; width: auto; }
.toolbar select { width: auto; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .75rem; }

/* ---------- Cards / stats ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.stats { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 1rem 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; text-decoration: none; color: inherit; }
.stat b { display: block; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .88rem; }
a.card { text-decoration: none; color: inherit; display: block; }
a.card:hover, a.stat:hover { border-color: var(--brand); }
.quick { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.quick a.card b { display: block; color: var(--brand); margin-bottom: .2rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem .65rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--surface2); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--surface2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.qty { display: inline-flex; align-items: center; gap: .3rem; }
.qty button { width: 1.8rem; height: 1.8rem; padding: 0; }
.qty b { min-width: 2.5ch; text-align: center; font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  table.responsive thead { display: none; }
  table.responsive tr { display: grid; grid-template-columns: 1fr auto; gap: .1rem .75rem; padding: .6rem .75rem; border-bottom: 1px solid var(--border); }
  table.responsive td { border: 0; padding: 0; }
  table.responsive td[data-hide-mobile] { display: none; }
  table.responsive td.num { text-align: left; }
}

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; border: 1px solid currentColor; white-space: nowrap; }
.badge.ok { color: var(--ok); }
.badge.partial { color: var(--warn); }
.badge.missing { color: var(--bad); }
.badge.neutral { color: var(--muted); }
.cat { font-size: .78rem; color: var(--muted); }
.low { color: var(--bad); font-weight: 600; }

.progress { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--surface2); margin: .5rem 0; }
.progress i { display: block; }
.progress .ok { background: var(--ok); }
.progress .partial { background: var(--warn); }
.progress .missing { background: var(--bad); }

/* ---------- Dialog ---------- */
dialog {
  width: min(680px, calc(100vw - 1.5rem)); max-height: calc(100dvh - 2rem);
  border: 1px solid var(--border); border-radius: 14px; padding: 0;
  background: var(--surface); color: var(--text);
}
dialog::backdrop { background: rgb(0 0 0 / .45); backdrop-filter: blur(2px); }
.modal-inner { padding: 1.25rem; }
.modal-inner h2 { margin-top: 0; }
.modal-inner .actions.end { margin-top: 1.25rem; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 1.25rem; translate: -50% 0;
  background: var(--text); color: var(--bg); padding: .6rem 1rem; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100vw - 2rem); z-index: 100;
}
#toast.show { opacity: 1; }
#toast.error { background: var(--bad); color: #fff; }

/* ---------- Misc ---------- */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.notice { border-left: 4px solid var(--brand); background: var(--surface); padding: .75rem 1rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1rem 0; }
.notice.warn { border-color: var(--warn); }
.pre { white-space: pre-wrap; }
.spinner { display: inline-block; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 2rem 1rem; text-align: center; background: var(--surface); }
.dropzone.drag { border-color: var(--brand); }
.photo-preview { max-width: 100%; max-height: 320px; border-radius: var(--radius); display: block; margin: .75rem auto; }
.draft { display: grid; gap: .6rem; }

/* ---------- Circuits ---------- */
.tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--border); margin: 1rem 0; scrollbar-width: thin; }
.tabs a { padding: .55rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.steps-intro { list-style: none; counter-reset: s; padding: 0; margin: 1rem 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.steps-intro li { counter-increment: s; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; display: grid; gap: .2rem; }
.steps-intro li::before { content: counter(s); display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--brand); color: var(--brand-text); font-weight: 700; font-size: .85rem; }
.steps-intro span { color: var(--muted); font-size: .88rem; }
.net-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.net { padding: .7rem .85rem; }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
.pin-chip { font-size: .8rem; padding: .1rem .45rem; border-radius: 6px; background: var(--surface2); font-family: var(--mono); }
.pin-chip i { font-style: normal; color: var(--muted); font-family: system-ui, sans-serif; }
table.pins { margin-top: .4rem; font-size: .82rem; }
table.pins td { padding: .15rem .4rem; }
.checklist { padding-left: 1.2rem; display: grid; gap: .5rem; }
.checklist label { display: flex; gap: .45rem; align-items: baseline; color: var(--text); font-size: .95rem; }
.checklist input { width: auto; }
.checklist p { margin: .15rem 0 0 1.5rem; color: var(--muted); }
.plain { list-style: none; padding: 0; margin: .3rem 0; display: grid; gap: .3rem; }
.review { margin-bottom: .75rem; }
.issue { border-top: 1px solid var(--border); padding-top: .5rem; margin-top: .5rem; }
.issue p { margin: .25rem 0 0; }
.log { max-height: 240px; overflow: auto; background: var(--surface2); padding: .6rem; border-radius: 8px; font-size: .75rem; white-space: pre-wrap; }
.board-views { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-top: 1rem; }
.board-views figure { margin: 0; }
.board-views figcaption { font-size: .85rem; color: var(--muted); margin-bottom: .4rem; }
.board-views img { width: 100%; height: auto; border-radius: 8px; background: #000; }
.board-views img.light { background: #f5f1e8; }
.order-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
textarea.mono { font-family: var(--mono); font-size: .8rem; }

/* ---------- Location tree ---------- */
.crumbs { font-size: .9rem; color: var(--muted); }
.tree { list-style: none; margin: 0; padding-left: 1.25rem; border-left: 1px dashed var(--border); }
.tree.root { padding-left: 0; border: 0; margin-top: 1rem; display: grid; gap: .75rem; }
.tree.root > li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; }
.tree li { margin: .35rem 0; }
.tree-node { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; text-decoration: none; color: var(--text); }
.tree-node:hover b { color: var(--brand); }
.tree-node .kind { width: 1.4rem; text-align: center; }
.tree-map { display: block; max-width: 340px; margin: .5rem 0 .25rem 1.9rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .8rem .4rem; margin: 0; }
legend { font-size: .85rem; color: var(--muted); padding: 0 .3rem; }
.swatches { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; }
.swatch { display: block; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span { display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 6px; background: var(--c); border: 1px solid var(--border); color: var(--muted); font-size: .8rem; }
.swatch input:checked + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.swatch input:focus-visible + span { outline: 2px solid var(--brand); }
.suggest { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin-top: .25rem; }
.chip { border-radius: 999px; }
.sel-list { display: grid; gap: .15rem; max-height: 280px; overflow: auto; }
.sel { display: flex; gap: .4rem; align-items: center; color: var(--text); font-size: .9rem; }
details > summary { cursor: pointer; }
.where { margin: 1rem 0; }
.where .gf-grid { max-width: 420px; margin-top: .6rem; }

/* ---------- Gridfinity plan ---------- */
.gf-grid {
  --gap: 4px;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows), minmax(0, 1fr));
  aspect-ratio: var(--cols) / var(--rows);
  gap: var(--gap);
  padding: var(--gap);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: min(100%, calc(var(--cols) * 150px));
}
.gf-cell, .gf-bin { min-width: 0; min-height: 0; padding: .3rem; border-radius: 7px; font-size: .78rem; }
.gf-cell { border: 1px dashed var(--border); background: transparent; color: var(--muted); }
.gf-cell span { opacity: .6; }
.gf-cell:hover { border-color: var(--brand); color: var(--brand); }
.gf-bin {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: .1rem;
  text-align: left; white-space: normal; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: inset 0 4px 0 var(--bin, var(--border));
}
.gf-bin b { font-size: .85rem; }
.gf-bin small { color: var(--muted); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gf-bin i { font-style: normal; font-size: .72rem; color: var(--muted); margin-top: auto; }
.gf-bin.hl { background: var(--brand); color: var(--brand-text); border-color: var(--brand); }
.gf-bin.hl small, .gf-bin.hl i { color: inherit; }
.gf-bin.moving { outline: 3px solid var(--warn); outline-offset: 1px; }
.gf-grid.compact { --gap: 2px; pointer-events: none; }
.gf-grid.compact .gf-cell, .gf-grid.compact .gf-bin { padding: 2px; font-size: .62rem; border-radius: 4px; }
.gf-grid.compact .gf-bin b { font-size: .62rem; }
@media (max-width: 720px) {
  .gf-cell, .gf-bin { font-size: .65rem; padding: .15rem; }
  .gf-bin small { display: none; }
}

/* ---------- Gridfinity labels (true size in mm) ---------- */
.gf-labels { display: flex; flex-wrap: wrap; gap: 2mm; }
.gf-label {
  display: flex; align-items: center; gap: 1.2mm; padding: .6mm 1.2mm;
  background: #fff; color: #000; border: .2mm dashed #999; border-radius: 1mm;
  overflow: hidden; break-inside: avoid; font-family: system-ui, "Segoe UI", sans-serif;
}
.gf-label img { height: 100%; aspect-ratio: 1; flex: none; image-rendering: pixelated; }
.gf-label .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; line-height: 1.05; }
.gf-label b { font-size: 3.2mm; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gf-label span { font-size: 2.1mm; color: #444; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gf-label .bands { width: 10mm; height: auto; flex: none; }

/* ---------- QR labels (print) ---------- */
.labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .5rem; }
.label { border: 1px dashed var(--border); border-radius: 8px; padding: .5rem; display: grid; grid-template-columns: 72px 1fr; gap: .5rem; align-items: center; background: #fff; color: #000; break-inside: avoid; }
.label img { width: 72px; height: 72px; }
.label b { display: block; font-size: .95rem; line-height: 1.2; }
.label span { font-size: .72rem; color: #444; }

@media print {
  .topbar, .no-print, #toast { display: none !important; }
  body, main { background: #fff; padding: 0; max-width: none; }
  .labels { grid-template-columns: repeat(3, 1fr); gap: 4mm; }
  .label { border-color: #999; }
  .gf-labels.roll { display: block; }
  .gf-labels.roll .gf-label { border: 0; border-radius: 0; break-after: page; }
}

/* Fields just filled by the AI: highlight until the user reviews them */
.ai-filled { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.cad-results { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .5rem; }
.cad-results .card { padding: .7rem .85rem; }
.cad-results p { margin: .25rem 0; }

/* ---------- Component images & documents ---------- */
.name-cell { display: flex; align-items: center; gap: .6rem; }
.thumb { width: 40px; height: 40px; flex: none; border-radius: 8px; object-fit: cover; background: var(--surface2); border: 1px solid var(--border); }
.thumb.placeholder, .hero.placeholder { display: grid; place-items: center; color: var(--muted); font-size: 1rem; }
.comp-top { display: grid; gap: .75rem; grid-template-columns: minmax(180px, 260px) 1fr; margin: 1rem 0; align-items: stretch; }
.comp-top > .card { display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 560px) { .comp-top { grid-template-columns: 1fr; } }
.image-card { padding: .6rem; }
.hero-img { padding: 0; border: 0; background: none; display: block; width: 100%; cursor: zoom-in; }
.hero-img:disabled { cursor: default; opacity: 1; }
.hero { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; border-radius: 8px; background: var(--surface2); }
.hero.placeholder { font-size: 3rem; }
.lightbox-img { display: block; max-width: 100%; max-height: 70dvh; margin: 0 auto; border-radius: 8px; background: #fff; }
.doc-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.doc { margin: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.doc-preview { display: grid; place-items: center; height: 120px; width: 100%; padding: 0; border: 0; border-radius: 0; background: var(--surface2); text-decoration: none; color: var(--muted); cursor: zoom-in; }
.doc-preview img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.doc-preview.pdf { cursor: pointer; }
.doc-preview.pdf span { font-size: 2.4rem; }
.doc-preview.pdf small { font-weight: 700; letter-spacing: .08em; }
.doc figcaption { padding: .45rem .6rem .55rem; display: grid; gap: .15rem; min-width: 0; }
.doc figcaption b { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc figcaption .actions { gap: .6rem; }

/* ---------- Phone connection ---------- */
.top-tools { display: flex; gap: .15rem; align-items: center; }
.top-tools .btn, .top-tools button { white-space: nowrap; }
@media (max-width: 900px) { .top-tools .tool-label { display: none; } }
.phone-qr { display: grid; grid-template-columns: 220px 1fr; gap: 1rem; align-items: center; }
.phone-qr img, .phone-qr .qr-box { width: 220px; height: 220px; background: #fff; border-radius: 10px; padding: 6px; }
.phone-qr .qr-box svg { width: 100%; height: 100%; display: block; }
.phone-steps { padding-left: 1.2rem; margin: 0 0 .5rem; display: grid; gap: .25rem; }
@media (max-width: 560px) { .phone-qr { grid-template-columns: 1fr; justify-items: center; } }
.segmented { display: inline-flex; flex-wrap: wrap; gap: .35rem; }

/* ---------- NFC ---------- */
.copy-row { display: flex; gap: .4rem; align-items: flex-start; }
.copy-row input, .copy-row textarea { flex: 1; min-height: 0; font-size: .85rem; }
.nfc-badge { font-size: .7em; }
.nfc-mark { flex: none; font-size: 3mm; line-height: 1; }
.nfc-mark.big { font-size: 1.6rem; width: 72px; text-align: center; }

/* ---------- Tailscale ---------- */
.ts-steps { padding-left: 1.3rem; display: grid; gap: .3rem; }
.ts-steps li.done { color: var(--muted); text-decoration: line-through; }
.ts-steps li.done::marker { content: '✔ '; color: var(--ok); }
.ts-steps li.current { font-weight: 500; }

/* ---------- Mode mixte (consultation à distance) ---------- */
.mode-banner { background: var(--warn); color: #1d1400; text-align: center; padding: .45rem 1rem; font-size: .9rem; font-weight: 500; }
body.readonly :is([data-adj], [data-edit], #addComp, #edit, #compAi, #nfcComp, #addLoc, #addChild, #addHere, #editLoc, #nfcLoc, #moveMode, #fill,
  #imgUrl, #imgRm, #docUrl, #docDs, #docSearch, #cadSearch, #cadRm, .image-card label.btn, #docs label.btn, #cad label.btn,
  #newProj, #addItem, #importBom, #makePcb, #consume, #dup, #pDelete, #pEdit, #newCirc, #cDelete, #cStatus,
  a[href="#/importer"], a[href="#/photo"], a[href="#/ajout-ia"], a[href="#/stock?new=1"], .quick) { display: none !important; }
body.readonly .gf-cell { pointer-events: none; }

/* ---------- Connexion ---------- */
body.locked .mainnav, body.locked #phoneBtn, body.locked #modeBanner { display: none !important; }
.login-card { max-width: 360px; margin: 10vh auto 0; }
.login-card .brand { font-size: 1.4rem; }

/* ---------- Plateforme en ligne : connexion, bannières, compte ---------- */
.auth-wrap { min-height: calc(100dvh - 8rem); display: grid; place-items: start center; }
.auth-wrap .login-card { margin-top: 6vh; width: min(400px, 100%); }
.auth-sep { display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .85rem; margin: 1rem 0; }
.auth-sep::before, .auth-sep::after { content: ''; flex: 1; border-top: 1px solid var(--border); }
.lang-switch { display: inline-flex; gap: .25rem; }
label.check { display: flex; flex-direction: row; gap: .45rem; align-items: baseline; color: var(--text); font-size: .9rem; }
label.check input { width: auto; }
.saas-banner { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: center; padding: .45rem 1rem; font-size: .9rem; border-bottom: 1px solid var(--border); }
.saas-banner.info { background: color-mix(in srgb, var(--brand) 12%, var(--surface)); }
.saas-banner.warn { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); }
.saas-banner.bad { background: var(--bad); color: #fff; font-weight: 500; }
#accountBtn { position: relative; }
#accountBtn .dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.twofa-setup { display: grid; grid-template-columns: 200px 1fr; gap: 1rem; align-items: start; margin-top: 1rem; }
.twofa-qr svg { width: 200px; height: 200px; background: #fff; border-radius: 10px; padding: 6px; }
@media (max-width: 560px) { .twofa-setup { grid-template-columns: 1fr; justify-items: center; } }
pre.codes { background: var(--surface2); padding: .75rem; border-radius: 8px; font-size: 1rem; line-height: 1.7; columns: 2; }
.check-list li { margin: .4rem 0; line-height: 1.45; }
fieldset[hidden] { display: none; }
.gens { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
.gens legend { width: 100%; }

/* Clé de licence et réglages en ligne (gestionnaire général) */
.key-row { align-items: center; margin-bottom: .6rem; }
.licence-key { font-size: 1.15rem; letter-spacing: .08em; padding: .35rem .6rem; border: 1px dashed var(--muted); border-radius: 8px; user-select: all; }
label.inline { display: flex; flex-direction: row; align-items: center; gap: .45rem; }
label.inline input { width: auto; }
tr.low td { opacity: .55; }

/* Allure du site Juditech3D : cartes à halo doré, boutons dorés, badges en pastille. */
.topbar { background: rgba(11, 9, 6, .88); backdrop-filter: blur(6px); border-bottom-color: var(--border); }
.card { box-shadow: 0 0 40px rgba(201, 162, 39, .08); }
button.primary, .btn.primary { background: linear-gradient(180deg, var(--brand-light), var(--brand)); border-color: var(--brand); }
button.primary:hover, .btn.primary:hover { filter: brightness(1.08); }
button:not(.primary), .btn:not(.primary) { background: rgba(201, 162, 39, .06); border-color: rgba(201, 162, 39, .25); color: var(--text); }
button:not(.primary):hover, .btn:not(.primary):hover { border-color: var(--brand); color: var(--brand-light); }
button.danger { color: var(--bad); background: rgba(92, 16, 32, .25); border-color: rgba(92, 16, 32, .6); }
button.danger:hover { border-color: var(--bad); color: var(--bad); }
button.ghost { background: transparent; border-color: transparent; }
input, select, textarea { background: #0f0c08; border-color: var(--border); }
.badge { background: rgba(201, 162, 39, .1); }
.badge.missing { background: rgba(92, 16, 32, .25); }
.licence-key { color: var(--brand-light); border-color: rgba(201, 162, 39, .45); background: rgba(201, 162, 39, .06); }
.notice { background: var(--surface); }
