/* Vue « Fiche » — toutes les classes sont préfixées sh-. Couleurs : uniquement les variables du thème. */
.sh { max-width: 1320px; margin: 0 auto; padding: 12px 12px 24px; }
.sh .card { background: var(--surface); }
.sh-card { padding: 14px; min-width: 0; }
.sh h3, .sh h4 { margin: 0; }
.sh h3 { font-size: 1.15rem; color: var(--brand); }
.sh h4 { font-size: 1rem; }
.sh-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.sh-card > .sh-h:not(:first-child) { margin-top: 16px; }
.sh-h-r { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: .9rem; color: var(--muted); }
.sh-h-r b { color: var(--ink); }
.sh-hint { color: var(--muted); font-size: .8rem; margin: 8px 0 0; }
.sh-hint:empty { display: none; }
.sh-muted { color: var(--muted); font-size: .85rem; }
.sh-spacer { flex: 1; }
.sh-g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sh-g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.sh-span2 { grid-column: 1 / -1; }
.sh-stackf { display: grid; gap: 10px; align-content: start; }
.sh-stackf > .sh-h { margin: 0; }
.sh-narrow { max-width: 200px; margin-top: 10px; }
.sh input[type="number"] { text-align: center; padding-left: 4px; padding-right: 4px; }
.sh-inrow { display: flex; gap: 6px; align-items: center; }
.sh-inrow input { flex: 1; min-width: 0; }

/* ─── En-tête ─── */
.sh-head { padding: 12px; margin-bottom: 10px; }
.sh-id { display: flex; gap: 10px; align-items: center; }
.sh-portrait { flex: none; width: 60px; height: 60px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); font-size: 2.1rem; line-height: 1; display: grid; place-items: center; }
.sh-portrait:hover { border-color: var(--gold); }
.sh-id-main { flex: 1; min-width: 0; }
.sh-name { font-family: var(--font-title); font-size: 1.35rem; font-weight: 700; border-color: transparent; background: transparent; padding: 4px 6px; min-height: 38px; }
.sh-name:hover { border-color: var(--line); }
.sh-sub { color: var(--muted); font-size: .85rem; padding: 0 6px; overflow-wrap: anywhere; }
.sh-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(74px, 1fr)); gap: 6px; margin-top: 10px; }
.sh-quick2 { grid-template-columns: 1fr 1fr; }
.sh-stat { position: relative; display: grid; justify-items: center; align-content: center; gap: 0; padding: 6px 4px; min-height: 56px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); text-align: center; color: var(--ink); overflow: hidden; }
.sh-stat small { font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; white-space: nowrap; }
.sh-stat b { font-size: 1.25rem; font-family: var(--font-title); white-space: nowrap; }
button.sh-stat:hover { border-color: var(--gold); }
.sh-insp.on { background: var(--warn-soft); border-color: var(--gold); }
.sh-insp.on b { color: var(--gold); }
.sh-hpbar { display: block; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.sh-hpbar i { display: block; height: 100%; width: var(--p, 100%); background: var(--good); transition: width .3s; }
.sh-hpbar[data-lvl="mid"] i { background: var(--warn); }
.sh-hpbar[data-lvl="low"] i { background: var(--bad); }
.sh-stat .sh-hpbar { position: absolute; left: 6px; right: 6px; bottom: 4px; height: 4px; }
.sh-hpbar.big { height: 8px; margin: 2px 0 10px; }
.sh-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.sh-adv { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.sh-adv button { border: 0; background: var(--surface); padding: 0 10px; min-height: 34px; font-size: .85rem; font-weight: 700; color: var(--muted); }
.sh-adv button + button { border-left: 1px solid var(--line); }
.sh-adv button.on { background: var(--brand); color: var(--brand-ink); }
.sh-adv button[data-v="1"].on { background: var(--good); color: var(--surface); }
.sh-adv button[data-v="-1"].on { background: var(--bad); color: var(--surface); }

/* ─── Sous-onglets ─── */
.sh-tabs { position: sticky; top: 61px; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 6px 0; margin-bottom: 6px; background: var(--bg); }
.sh-tabs button { display: grid; justify-items: center; gap: 1px; border: 1px solid transparent; background: transparent; border-radius: 10px; padding: 6px 2px; font-size: .74rem; font-weight: 700; color: var(--muted); min-height: 48px; }
.sh-tabs button span { font-size: 1.15rem; }
.sh-tabs button[aria-selected="true"] { background: var(--surface); border-color: var(--line); color: var(--brand); box-shadow: var(--shadow); }
@media (min-width: 600px) {
  .sh-tabs { display: flex; justify-content: center; }
  .sh-tabs button { grid-auto-flow: column; gap: 6px; padding: 6px 14px; font-size: .92rem; min-height: 40px; align-items: center; }
  .sh-tabs button span { font-size: 1rem; }
}
@media (min-width: 900px) { .sh-tabs { position: static; } }

/* ─── Colonnes ─── */
.sh-body { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.sh-col { display: grid; gap: 12px; min-width: 0; align-content: start; }
@media (min-width: 760px) {
  .sh-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sh-col.wide { grid-column: span 2; }
}
@media (min-width: 1100px) {
  .sh-body { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ─── Caractéristiques ─── */
.sh-abil { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sh-ab { display: grid; justify-items: center; gap: 4px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.sh-ab-l { font-size: .75rem; font-weight: 800; letter-spacing: .06em; color: var(--muted); }
.sh-ab-mod { width: 100%; min-height: 48px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-family: var(--font-title); font-size: 1.6rem; font-weight: 800; color: var(--ink); }
.sh-ab-mod:hover, .sh-rollrow:hover { border-color: var(--gold); }
.sh-ab-mod:active, .sh-rollrow:active { background: var(--warn-soft); }
.sh .sh-ab-score { width: 64px; min-height: 34px; padding: 4px; font-weight: 700; }

/* ─── Lignes (sauvegardes, compétences) ─── */
.sh-lines { display: grid; gap: 4px; }
.sh-line { display: flex; gap: 6px; align-items: center; }
.sh-chk { flex: none; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; }
.sh-cantrip { color: var(--muted); font-weight: 800; cursor: default; }
.sh-rollrow { flex: 1; min-width: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 40px; padding: 4px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-align: left; font-size: .95rem; }
.sh-rollrow small { color: var(--muted); font-size: .72rem; font-weight: 700; }
.sh-rollrow b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.sh-mark { flex: none; width: 34px; height: 34px; border: 0; background: transparent; border-radius: 50%; font-size: 1.25rem; line-height: 1; color: var(--muted); }
.sh-mark:hover { background: var(--surface-2); }
.sh-mark[data-lv="1"], .sh-mark[data-lv="2"] { color: var(--brand); }
.sh-mark[data-lv="0.5"] { color: var(--gold); }
.sh-passive { margin-top: 10px; display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 10px; background: var(--info-soft); color: var(--info); font-weight: 700; }

/* ─── Classes ─── */
.sh-classes { display: grid; gap: 8px; margin-bottom: 8px; }
.sh-class { display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; grid-template-areas: "name sub del" "lvl die ."; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.sh-c-name { grid-area: name; } .sh-c-sub { grid-area: sub; } .sh-c-lvl { grid-area: lvl; } .sh-c-die { grid-area: die; } .sh-c-del { grid-area: del; }
.sh-mini { display: flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.sh-mini input, .sh-mini select { min-height: 38px; padding: 4px 6px; }

/* ─── Combat ─── */
.sh-hpact { display: flex; gap: 6px; flex-wrap: wrap; }
.sh .sh-amt { flex: 1 1 90px; width: 90px; min-height: 34px; }
.sh-hddice { margin-top: 8px; }
.sh-ds { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; font-size: .85rem; color: var(--muted); font-weight: 700; }
.sh-line2 { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 6px; }
.sh-exh { display: flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 700; color: var(--muted); }
.sh-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 8px; }
.sh-chips .chip { min-height: 32px; color: var(--ink); }
.sh-chips .chip.bad { color: var(--bad); border-color: var(--bad); }
.sh .sh-cond-in { min-height: 36px; }

/* Pastilles */
.sh-pips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 30px; }
.sh-pip { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid var(--gold); background: transparent; }
.sh-pip.on { background: var(--gold); box-shadow: inset 0 0 0 3px var(--surface); }
.sh-pips.good .sh-pip { border-color: var(--good); } .sh-pips.good .sh-pip.on { background: var(--good); }
.sh-pips.bad .sh-pip { border-color: var(--bad); } .sh-pips.bad .sh-pip.on { background: var(--bad); }
.sh-count { color: var(--muted); font-weight: 700; margin-left: 4px; font-variant-numeric: tabular-nums; }
b.sh-count { color: var(--ink); font-size: 1.1rem; margin: 0 6px; }

/* Cases à cocher libellées */
.sh-tog { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; cursor: pointer; min-height: 36px; }
.sh-tog.sm { font-size: .8rem; gap: 5px; min-height: 30px; }
.sh-tog.sm input { width: 18px; height: 18px; }
.sh-togs { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }

/* ─── Listes d'éléments ─── */
.sh-items { display: grid; gap: 8px; }
.sh-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--surface-2); min-width: 0; }
.sh-item-t { display: grid; min-width: 0; }
.sh-item-t b { font-size: 1rem; overflow-wrap: anywhere; }
.sh-item-t small { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.sh-item-t small:empty { display: none; }
.sh-item-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.sh-item details { margin-top: 6px; }
.sh-item summary, .sh-feat > summary { cursor: pointer; color: var(--muted); font-size: .85rem; font-weight: 700; padding: 4px 0; }
.sh-feat > summary { color: var(--ink); font-size: 1rem; }
.sh-feat > summary small { color: var(--muted); font-weight: 600; font-size: .8rem; }
.sh-edit { margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--line); }
.sh-edit:not(.sh-g2) { display: grid; gap: 10px; }
.sh-edit .btn.danger { justify-self: start; grid-column: 1 / -1; }
.sh-crit.sh-hot { background: var(--warn-soft); color: var(--warn); border-color: var(--gold); animation: sh-pulse 1s ease-in-out 3; }
@keyframes sh-pulse { 50% { transform: scale(1.06); } }
.sh-res-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.sh-res-top .chip { font-size: .72rem; }

/* ─── Sorts ─── */
.sh-slot { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.sh-slot > span { flex: none; width: 64px; font-weight: 700; font-size: .9rem; }
.sh-slot small { color: var(--muted); }
.sh-slotedit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.sh-spgroup + .sh-spgroup { margin-top: 14px; }
.sh-sp-lvl { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.sh-sp-lvl h4 { font-family: var(--font-title); color: var(--brand); }
.sh-sp-lvl span { color: var(--muted); font-size: .82rem; font-weight: 700; }
.sh-spgroup .sh-item + .sh-item { margin-top: 6px; }
.sh-sp-head { display: flex; align-items: center; gap: 6px; }
.sh-sp-head .sh-item-t { flex: 1; }
.sh-sp-btns { display: flex; gap: 6px; flex: none; }
.sh-spdmg:has(span:empty) { display: none; }

/* ─── Inventaire ─── */
.sh-invsum { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .9rem; margin-bottom: 10px; }
.sh-invsum b { color: var(--ink); }
.sh-inv { display: grid; gap: 6px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
  grid-template-columns: minmax(0, 1fr) auto auto 40px; grid-template-areas: "name qty kg del" "tog tog notes notes"; }
.sh-inv-name { grid-area: name; font-weight: 700; }
.sh-inv-qty { grid-area: qty; } .sh-inv-kg { grid-area: kg; } .sh-inv-del { grid-area: del; }
.sh-inv-qty input { width: 52px; } .sh-inv-kg input { width: 60px; }
.sh-inv-tog { grid-area: tog; display: flex; gap: 10px; }
.sh .sh-inv-notes { grid-area: notes; min-height: 34px; font-size: .88rem; padding: 4px 8px; }
.sh .sh-inv input:not([type="checkbox"]) { min-height: 38px; }
@media (max-width: 420px) {
  .sh-inv { grid-template-areas: "name name name del" "qty kg . ." "tog tog tog tog" "notes notes notes notes"; grid-template-columns: auto auto 1fr 40px; }
  .sh-inv-qty, .sh-inv-kg { display: flex; }
}
@media (min-width: 1100px) {
  .sh-inv { grid-template-columns: minmax(0, 1.4fr) auto auto auto minmax(0, 1fr) 40px; grid-template-areas: "name qty kg tog notes del"; }
}
.sh-money { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.sh-coin > span { text-align: center; }
.sh-coin input { padding: 6px 2px; }
.sh-coin-po > span { color: var(--gold); }

/* ─── Modales (hors .sh) ─── */
.sh-emojis { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.sh-emoji { font-size: 1.7rem; height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.sh-emoji:hover { border-color: var(--gold); }
.sh-json { min-height: 45dvh; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .78rem; white-space: pre; }

@media (max-width: 420px) {
  .sh { padding: 8px 8px 20px; }
  .sh-card { padding: 12px; }
  .sh-g3 { gap: 6px; }
  .sh-g3 label.field > span { font-size: .64rem; }
}
.sh textarea[rows="2"] { min-height: 58px; }
@media (max-width: 520px) {
  .sh-adv { width: 100%; }
  .sh-adv button { flex: 1; }
  .sh-tools .sh-spacer { display: none; }
  .sh-tools .btn { flex: 1; padding: 0 6px; }
}
.sh-insp small { white-space: normal; line-height: 1.1; }
