/* Atelier : menu latéral à gauche (barre d'onglets en bas sur téléphone), une vue à la fois à droite */
body.app { padding: 0; display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 18px 14px calc(18px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px)); border-right: 1px solid var(--line); background: var(--panel); }
.sidebar .brand { font-size: 19px; margin: 0 4px 22px; }
.side-links { display: grid; gap: 2px; }
.sidebar a[data-nav] { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--fg); text-decoration: none; font-weight: 700; font-size: 14px; }
.sidebar a[data-nav] svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar a[data-nav]:hover { background: var(--bg); }
.sidebar a[data-nav][aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.side-account { margin-top: auto; border-top: 1px solid var(--line); border-radius: 0 !important; padding-top: 14px !important; }

.app-main { min-width: 0; padding: 20px max(16px, env(safe-area-inset-right, 0px)) 64px 28px; display: grid; align-content: start; }
.view { display: grid; gap: 16px; align-content: start; max-width: 1400px; min-width: 0; }
.view > * { min-width: 0; }
.view-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.view-head h1 { font-size: clamp(28px, 4vw, 38px); }
.view-head h1 .help { margin-left: 8px; position: relative; top: -4px; }

/* barre du schéma */
.schema-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.schema-bar .grow { flex: 1; }
.schema-name { font-family: var(--font-display); font-size: 26px; color: var(--fg); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 2px 8px; min-width: 0; flex: 0 1 420px; }
.schema-name:hover { border-color: var(--line); }
.schema-name:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; background: var(--panel); }
.save-state { font: 600 12px var(--font-mono); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.save-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.save-state.saved::before { background: #3c9a5f; }
.save-state.dirty::before { background: #d4a017; }
.save-msg:empty { display: none; }
.schema-bar button { padding: 8px 14px; }
button[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }

.settings-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); overflow: hidden; }
.set-block { display: grid; gap: 14px; align-content: start; padding: 16px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.set-block h3 { margin: 0; font: 500 11px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.set-block .row { gap: 6px; }
.set-block .row button { padding: 6px 10px; }
.set-foot { grid-column: 1 / -1; display: flex; justify-content: flex-end; padding: 10px 18px; background: var(--bg); }
.settings-panel input[type=number], .settings-panel select, .core-controls input[type=number], .core-controls input[type=text], .prep input[type=number], .prep select { font: 500 15px var(--font-mono); color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; width: 100%; }

/* onglets */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; padding: 10px 14px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.tab-panel { display: grid; gap: 14px; align-content: start; min-width: 0; }
.tab-panel > * { min-width: 0; }

.core-controls { display: grid; gap: 14px 18px; grid-template-columns: 120px minmax(180px, 280px) minmax(0, 1fr); align-items: start; }
.core-controls .swatches .sw { width: 32px; height: 32px; }
.core-controls .row button { padding: 6px 10px; }

/* préparer le tissage */
.prep-grid { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 28px; align-items: start; }
.prep-in { display: grid; gap: 14px; }
.prep-in h2 .help, .df h2 .help { margin-left: 6px; }
.prep .seg button { padding: 8px 12px; }
.prep-params { gap: 14px; flex-wrap: nowrap; }
.prep-params .field { flex: 1; }
.prep-out { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: grid; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--bg); border-radius: 8px; padding: 12px; display: grid; gap: 2px; }
.kpi .k { font-size: 12px; color: var(--muted); font-weight: 700; }
.kpi .v { font-family: var(--font-display); font-size: 26px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--muted); }
.yarn-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.yarn-table th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.yarn-table td { padding: 8px; border-bottom: 1px solid var(--line); }
.yarn-table td.n { text-align: right; font-family: var(--font-mono); }
.yarn-table tfoot td { font-weight: 700; border-bottom: 0; }
.chip { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line); vertical-align: -3px; margin-right: 8px; }

/* bibliothèque et exemples */
.ex-strip.big { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 14px; }
.ex-strip.big .ex-card { padding: 14px; }

/* apprendre */
.learn { max-width: 820px; }
.learn-toc { display: flex; flex-wrap: wrap; gap: 8px; }
.learn-toc a { font-size: 13px; font-weight: 700; color: var(--accent); text-decoration: none; background: var(--accent-soft); padding: 5px 10px; border-radius: 999px; }
.learn article { display: grid; gap: 10px; padding-top: 8px; scroll-margin-top: 16px; }
.learn article h2 { font-size: 24px; }
.learn article p, .learn article li { max-width: 68ch; margin: 0; }
.learn article ul { display: grid; gap: 8px; margin: 0; padding-left: 1.2em; }
.learn .guide { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; }

/* fenêtre « Gardez vos schémas » */
.save-dialog { border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px 18px; max-width: min(480px, calc(100vw - 32px)); background: var(--panel); color: var(--fg); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.save-dialog::backdrop { background: rgba(10, 14, 24, .55); }
.save-dialog h2 { font-size: 26px; margin: 0 0 8px; }
.save-dialog p { margin: 0 0 10px; }
.dlg-close-row { display: flex; justify-content: flex-end; margin: -10px -12px 0 0; }
.dlg-x { border: 0; background: transparent; font-size: 22px; line-height: 1; padding: 4px 8px; color: var(--muted); }
.dlg-form { display: grid; gap: 8px; margin: 14px 0 6px; }
.dlg-form input { font: 500 16px var(--font-body); color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.dlg-form button { padding: 10px 14px; font-size: 14px; }
.dlg-local { margin-top: 8px !important; font-size: 13px; }
button.link { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; font-size: 13px; }

@media (max-width: 1100px) {
  .core-controls { grid-template-columns: 110px minmax(0, 1fr); }
  .core-controls .field:last-child { grid-column: 1 / -1; }
  .prep-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body.app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 20; flex-direction: row; justify-content: space-around; gap: 0; padding: 6px max(8px, env(safe-area-inset-left, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-right, 0px)); border-right: 0; border-top: 1px solid var(--line); }
  .sidebar .brand { display: none; }
  .side-links { display: contents; }
  .sidebar a[data-nav] { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 4px; flex: 1; justify-content: center; text-align: center; }
  .side-account { margin-top: 0; border-top: 0; padding-top: 6px !important; }
  .app-main { padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(96px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
  .schema-name { font-size: 22px; flex-basis: 100%; }
  .core-controls { grid-template-columns: 1fr 2fr; }
}
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--panel); border-color: var(--accent); }
.yarn-table th.n { text-align: right; }

/* ---------- Style éditorial de l'atelier ---------- */
.eyebrow { font: 500 12px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0; }
.sidebar { background: var(--panel); }
.sidebar a[data-nav] { font-weight: 500; font-size: 15px; }
.sidebar a[data-nav][aria-current="page"] { background: var(--bg); color: var(--fg); box-shadow: inset 3px 0 0 var(--accent); border-radius: 0 8px 8px 0; }
.view-head h1 { font-weight: 650; letter-spacing: -0.03em; }
.tabs button { font: 500 12px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.schema-name { font-weight: 650; font-size: 30px; letter-spacing: -0.02em; }
.label { font-family: var(--font-mono); font-weight: 500; letter-spacing: .1em; }
.scroller, .settings-panel, .prep-out { border-radius: 6px; }

/* bandeau de compte, discret */
.account-line { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); font-size: 14px; }
.account-line a { color: var(--accent); font-weight: 700; }

/* Mes schémas : cartes avec un vrai aperçu de bande */
.lib-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 18px; }
.lib-card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; display: grid; grid-template-rows: auto 1fr; transition: border-color .2s ease, transform .2s ease; }
.lib-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.lib-card.current { border-color: var(--accent); outline: 1px solid var(--accent); }
.lib-open { border: 0; border-radius: 0; padding: 0; background: var(--bg); display: block; width: 100%; cursor: pointer; }
.lib-band { height: 190px; display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--line); }
.lib-meta { padding: 14px 16px 16px; display: grid; gap: 4px; align-content: start; }
.lib-name { font-family: var(--font-display); font-weight: 500; font-size: 21px; margin: 0; overflow-wrap: anywhere; }
.lib-sub, .lib-date { margin: 0; font-size: 13px; color: var(--muted); }
.lib-date { font: 500 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.lib-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lib-actions button { padding: 5px 9px; font-size: 12px; }
.lib-actions .quiet { border-color: transparent; background: transparent; color: var(--muted); }
.lib-actions .danger { color: var(--warn); border-color: var(--warn); }
.lib-list.empty { display: block; }
.empty-state { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 32px; align-items: center; background: var(--panel); border: 1px dashed var(--line); border-radius: 6px; padding: 28px; }
.empty-state h2 { font-size: 30px; font-weight: 650; letter-spacing: -0.02em; margin: 0 0 8px; }
.empty-state p { max-width: 52ch; margin: 0 0 16px; }
.empty-state canvas { border-radius: 4px; }
.more-opts { border-top: 1px solid var(--line); padding-top: 14px; }
.more-opts summary { cursor: pointer; font: 500 12px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.more-body { display: grid; gap: 14px; padding-top: 14px; }

/* Connexion */
.login-view { min-height: calc(100vh - 120px); place-items: center; align-content: center; display: grid; max-width: none; }
.login-card { width: min(520px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 36px 36px 30px; display: grid; gap: 14px; }
.login-card h1 { font-size: clamp(32px, 4vw, 42px); font-weight: 650; letter-spacing: -0.03em; line-height: 1.05; }
.login-card p { margin: 0; line-height: 1.6; }
.perks { margin: 4px 0 6px; padding-left: 1.1em; display: grid; gap: 8px; line-height: 1.5; }
.login-form { display: grid; gap: 8px; margin-top: 6px; }
.login-form input { font: 500 16px var(--font-body); color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 11px 13px; }
.login-form button { padding: 11px 14px; font-size: 15px; }
.hint.small { font-size: 12px; }
@media (max-width: 760px) {
  .empty-state { grid-template-columns: 1fr; }
  .login-card { padding: 26px 20px; }
  .login-view { min-height: auto; }
}

/* nom du schéma : on voit tout de suite que c'est un champ à remplir */
.name-field { display: grid; gap: 2px; flex: 0 1 460px; min-width: 0; cursor: text; }
.name-lab { font: 500 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-left: 2px; }
.name-row { display: flex; align-items: center; gap: 8px; border-bottom: 2px dashed var(--line); transition: border-color .15s ease; }
.name-field:hover .name-row, .name-field:focus-within .name-row { border-bottom-color: var(--accent); border-bottom-style: solid; }
.name-row .schema-name { flex: 1; border: 0; border-radius: 0; padding: 2px 2px 4px; background: transparent; outline: none; }
.name-row .schema-name::placeholder { color: var(--muted); opacity: .7;  }
.name-row .schema-name:focus-visible { outline: none; background: transparent; }
.name-pen { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.name-field:hover .name-pen, .name-field:focus-within .name-pen { stroke: var(--accent); }

.dlg-mail { width: 52px; height: 52px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; margin-bottom: 12px; }
.dlg-mail svg { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dlg-steps { margin: 4px 0 12px; padding-left: 1.3em; display: grid; gap: 6px; line-height: 1.5; }
.dlg-actions { margin-top: 6px; }
.dlg-actions button { padding: 9px 14px; }
#dlgStatus:empty, #dlgSentStatus:empty { display: none; }

/* notification de confirmation */
.toast { position: fixed; right: max(24px, env(safe-area-inset-right, 0px)); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: flex; align-items: center; gap: 10px; max-width: min(380px, calc(100vw - 48px)); padding: 12px 16px; background: var(--fg); color: var(--panel); border-radius: 8px; box-shadow: 0 12px 30px rgba(42, 33, 27, .25); font-size: 14px; line-height: 1.4; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s ease, transform .25s ease; }
.toast.show { opacity: 1; transform: none; }
.toast svg { width: 18px; height: 18px; flex: none; fill: none; stroke: #8fd0a6; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
@media (max-width: 760px) { .toast { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); left: 16px; right: 16px; max-width: none; } }

/* état d'enregistrement : une petite pastille discrète */
.save-state { font: 500 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.save-state.saved { color: #2f7a4b; border-color: #bfdcc8; background: #eef6f0; }
.save-state.dirty { color: #8a6412; border-color: #ead7a8; background: #faf3e2; }

/* onglets en intercalaires : l'onglet ouvert se raccorde au contenu */
.tabs { gap: 6px; border-bottom: 1px solid var(--line); overflow-x: auto; align-items: flex-end; }
.tabs button { display: grid; gap: 2px; text-align: left; padding: 10px 18px 11px; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; background: var(--bg); color: var(--muted); font: inherit; letter-spacing: 0; text-transform: none; position: relative; top: 1px; }
.tabs button b { font-size: 15px; font-weight: 700; color: var(--fg); }
.tabs button span { font-size: 12px; color: var(--muted); }
.tabs button:hover b { color: var(--accent); }
.tabs button[aria-selected="true"] { background: var(--panel); border-bottom: 1px solid var(--panel); }
.tabs button[aria-selected="true"] b { color: var(--accent); }
.tab-panel { background: var(--panel); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; padding: 20px; margin-top: -16px; }
.tab-panel .scroller { background: var(--bg); }

.beta { font: 500 9px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--brown); border: 1px solid currentColor; border-radius: 999px; padding: 1px 6px; margin-left: 6px; vertical-align: 2px; }
.beta-note { margin: 0; padding: 10px 14px; border: 1px solid #ead7a8; background: #faf3e2; border-radius: 6px; font-size: 14px; line-height: 1.5; }

.danger-zone { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.danger-zone h2 { font-size: 18px; }
.danger-zone input { flex: 1 1 160px; min-width: 0; font: 500 15px var(--font-mono); color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
.danger-btn { color: var(--warn); border-color: var(--warn); background: transparent; padding: 9px 14px; }
.danger-btn:hover { background: #fbe9e2; border-color: var(--warn); }
.err:empty { display: none; }

.side-legal { margin-top: auto; display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0 10px 10px; font-size: 12px; }
.side-legal a { color: var(--muted); text-decoration: none; }
.side-legal a:hover { color: var(--accent); text-decoration: underline; }
.side-legal + .side-account { margin-top: 0; }
@media (max-width: 760px) { .side-legal { display: none; } }

/* compte dans le menu */
.side-account .acc-txt { display: grid; min-width: 0; line-height: 1.25; }
.side-account .acc-txt small { font: 400 11px var(--font-body); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-avatar { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--accent); color: var(--panel); display: grid; place-items: center; font: 700 13px var(--font-body); }
@media (max-width: 760px) { .side-account .acc-txt small { display: none; } .acc-avatar { width: 22px; height: 22px; font-size: 11px; } }

.dlg-switch { margin: 6px 0 0 !important; font-size: 14px; }
.dlg-switch .link { font-size: 14px; }
.dlg-pseudo-f { display: grid; gap: 8px; }
.dlg-pseudo-f input { font: 500 16px var(--font-body); color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.pseudo-form .row input { flex: 1 1 160px; min-width: 0; }
.pseudo-form .row button { padding: 10px 14px; }

.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-pick button { width: 40px; height: 40px; padding: 0; font-size: 20px; line-height: 1; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.emoji-pick button:hover { border-color: var(--accent); }
.emoji-pick button[aria-checked="true"] { border: 2px solid var(--accent); background: var(--accent-soft); }
.acc-avatar.is-emoji { background: var(--bg); border: 1px solid var(--line); font-size: 16px; }
.pseudo-form .primary { justify-self: start; padding: 10px 16px; margin-top: 4px; }

.emoji-pick .emoji-other-btn { width: auto; padding: 0 12px; font: 600 13px var(--font-body); color: var(--fg); }
.emoji-pick .emoji-other { width: 64px; height: 40px; text-align: center; font-size: 20px; border: 2px solid var(--accent); border-radius: 10px; background: var(--panel); color: var(--fg); }
.emoji-tip { font-size: 12px; }
.set-foot .quiet { border-color: transparent; background: transparent; color: var(--muted); font-size: 13px; }

/* Apprendre : croquis et photos */
.learn h3 { font-size: 18px; margin: 10px 0 0; }
.learn-fig, .loom-fig, .learn .photo { margin: 0; display: grid; gap: 6px; }
.learn-fig svg, .loom-fig svg { width: 100%; height: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.learn-fig figcaption, .loom-fig figcaption { font-size: 13px; color: var(--muted); line-height: 1.45; }
.loom-fig figcaption { font: 500 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.sz-grid, .loom-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.my-loom { display: grid; gap: 14px; grid-template-columns: 1.2fr 1fr; align-items: start; }
.my-loom > div { display: grid; gap: 12px; }
.my-loom .photo:nth-of-type(2) { grid-column: 2; grid-row: 1 / span 2; }
.my-loom .photo img { width: 100%; height: auto; display: block; border-radius: 8px; }
@media (max-width: 640px) { .my-loom { grid-template-columns: 1fr; } .my-loom .photo:nth-of-type(2) { grid-column: auto; grid-row: auto; } }
.learn svg .f-l { font: 500 11px var(--font-mono); fill: var(--muted); text-anchor: middle; dominant-baseline: middle; }
.learn svg .f-big { font: 600 30px var(--font-display); fill: var(--accent); text-anchor: middle; dominant-baseline: middle; }
.learn svg .f-card { fill: var(--bg); stroke: var(--fg); stroke-width: 2; }
.learn svg .f-cardtop { fill: none; stroke: var(--fg); stroke-width: 2; }
.learn svg .f-thread { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.learn svg .f-thread-head { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.learn svg .f-wood { fill: #e9d3ae; stroke: var(--fg); stroke-width: 1.5; }
.learn svg .f-wood-l { fill: none; stroke: #b98a52; stroke-width: 6; stroke-linecap: round; }
.learn svg .f-peg { fill: #c9a06a; stroke: var(--fg); stroke-width: 1.5; }
.learn svg .f-roll { fill: var(--brown); stroke: var(--fg); stroke-width: 1.5; }
.learn svg .f-warp { fill: none; stroke: var(--muted); stroke-width: 1.4; }
.learn svg .f-band { stroke: var(--brown); stroke-width: 7; stroke-linecap: round; }
.learn svg .f-tab { fill: var(--panel); stroke: var(--fg); stroke-width: 1.2; }
.learn svg .f-line { fill: none; stroke: var(--fg); stroke-width: 2.5; stroke-linecap: round; }
.learn svg .f-belt { fill: var(--brown); }
.learn svg .f-weight { fill: var(--fg); }
.my-loom .loom-fig { max-width: 420px; }
.settings-panel select, .prep select { font: 500 14px var(--font-body); padding-right: 28px; text-overflow: ellipsis; }
.learn svg .f-warp-up { fill: none; stroke: var(--accent); stroke-width: 1.8; }
.learn svg .f-warp-down { fill: none; stroke: var(--muted); stroke-width: 1.8; }
.learn svg .f-hole-a { fill: var(--accent); stroke: var(--fg); stroke-width: 1.2; }
.learn svg .f-hole-b { fill: var(--panel); stroke: var(--fg); stroke-width: 1.2; }
.learn svg .f-weft-dot { fill: var(--brown); }
.learn svg .f-pointer { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.learn svg .f-face { fill: var(--accent); }
.learn svg .f-card-s { fill: var(--bg); stroke: var(--fg); stroke-width: 1.4; }
.learn svg .f-warp-w { stroke: var(--muted); stroke-width: 1.4; }
.learn svg .f-bandzone { fill: var(--brown); opacity: .18; }
.learn svg .f-lt { font: 600 13px var(--font-mono); fill: var(--accent); text-anchor: middle; dominant-baseline: middle; }
.learn svg .f-arrow-s { fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.glossary { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.glossary > div { display: grid; grid-template-columns: 9.5em 1fr; gap: 4px 18px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.glossary dt { font-weight: 700; color: var(--fg); }
.glossary dd { margin: 0; color: var(--muted); max-width: 62ch; }
@media (max-width: 560px) { .glossary > div { grid-template-columns: 1fr; } }
/* croquis des métiers : style à plat */
.learn svg .lf-wood { fill: #dcc092; }
.learn svg .lf-wood-l { fill: none; stroke: #c9a46c; stroke-width: 7; stroke-linecap: round; }
.learn svg .lf-peg { fill: #a87b4a; }
.learn svg .lf-roll { fill: var(--brown); }
.learn svg .lf-warp { fill: none; stroke: var(--muted); stroke-width: 1.2; opacity: .8; }
.learn svg .lf-band { stroke: var(--brown); stroke-width: 7; stroke-linecap: round; }
.learn svg .lf-card { fill: var(--panel); stroke: var(--fg); stroke-width: 1.1; }
.learn svg .lf-body { fill: var(--muted); opacity: .35; }
.learn svg .lf-belt { fill: var(--brown); }
.learn svg .lf-weight { fill: var(--fg); }
.learn svg .lf-pill { fill: var(--accent-soft); }
.learn svg .lf-pilltxt { font: 600 10px var(--font-mono); fill: var(--accent); text-anchor: middle; dominant-baseline: middle; letter-spacing: .04em; }
.learn svg .lf-l { font: 500 10px var(--font-mono); fill: var(--muted); text-anchor: middle; dominant-baseline: middle; }
.learn svg .f-mid { font: 600 18px var(--font-display); fill: var(--accent); text-anchor: middle; dominant-baseline: middle; }
.learn svg .f-l, .learn svg .f-mid, .learn svg .f-big { paint-order: stroke; stroke: var(--panel); stroke-width: 5px; stroke-linejoin: round; }
.sz-grid { align-items: start; }

/* Dessiner en pixels */
.px-tools { display: grid; gap: 10px; }
.px-dims, .px-paint { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.px-dims input { font: 500 14px var(--font-mono); color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; width: 4.5em; }
.px-dims .hint + label { margin-left: 10px; }
.px-paint .sw { width: 30px; height: 30px; }
.px-stage { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.px-col { margin: 0; display: grid; gap: 6px; min-width: 0; max-width: 100%; }
.px-col .scroller { padding: 12px; }
#pxCanvas { touch-action: none; cursor: crosshair; display: block; }
.px-status { margin: 0; font-size: 14px; line-height: 1.5; padding: 10px 14px; border-radius: 6px; max-width: 72ch; }
.px-status.ok { background: var(--accent-soft); color: var(--accent); }
.px-status.warn { background: #faf3e2; border: 1px solid #ead7a8; }
.del-dialog h2 { color: var(--warn); }
.del-list { margin: 0 0 12px; padding-left: 1.2em; display: grid; gap: 2px; font-weight: 600; }
.del-actions { justify-content: flex-end; gap: 8px; margin-top: 6px; }
.danger-solid { background: var(--warn); border-color: var(--warn); color: #fff; padding: 9px 14px; }
.danger-solid:hover { filter: brightness(.92); }
.side-legal .side-support { flex-basis: 100%; color: var(--brown); font-weight: 600; }
.support-card { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.support-card p { margin: 0; flex: 1 1 320px; }

/* menu d'une carte */
.draft .cnum { border: 0; background: transparent; padding: 4px 0; cursor: pointer; border-radius: 4px; font: 600 10px var(--font-mono); color: var(--muted); }
.draft .cnum:hover { color: var(--accent); background: var(--accent-soft); text-decoration: underline; }
.draft .cnum.sel { background: var(--accent); color: #fff; text-decoration: none; }
.draft .cell.csel { box-shadow: 0 0 0 2px var(--accent); position: relative; z-index: 1; }
.card-menu { position: absolute; z-index: 70; min-width: 230px; padding: 8px; background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 36px rgba(42, 33, 27, .22); display: grid; gap: 2px; font-size: 14px; }
.card-menu[hidden] { display: none; }
.card-menu .cm-title { margin: 2px 8px 6px; font: 500 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.card-menu > button { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; border: 0; background: transparent; padding: 8px; border-radius: 6px; font: inherit; color: inherit; cursor: pointer; }
.card-menu > button:hover:not(:disabled), .card-menu .cm-row button:hover:not(:disabled) { background: var(--accent-soft); }
.card-menu button:disabled { opacity: .4; cursor: default; }
.card-menu .cm-sw { width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--line); flex: none; }
.card-menu .cm-row { display: flex; align-items: center; gap: 4px; padding: 2px 0 2px 8px; }
.card-menu .cm-row span { flex: 1; }
.card-menu .cm-row button { border: 1px solid var(--line); background: var(--bg); padding: 5px 9px; border-radius: 6px; font: inherit; font-size: 13px; color: inherit; cursor: pointer; }
.card-menu .cm-del { color: var(--warn) !important; border-top: 1px solid var(--line) !important; border-radius: 0 0 6px 6px !important; margin-top: 4px; }
.card-menu .cm-tip { margin: 6px 8px 2px; font-size: 12px; color: var(--muted); max-width: 230px; }
.toast.has-act { pointer-events: auto; }
.toast-act { margin-left: 6px; border: 0; background: transparent; color: #8fd0a6; font: 700 14px var(--font-body); cursor: pointer; padding: 2px 4px; text-decoration: underline; }
