/* Inventorio v0.2.1 · réalisé par Claude Delorme, France · 2026-11-19
   Palette : turquoise, corail, violet, bleu doux, safran, vert sauge.
   Polices incluses dans assets/polices (licence SIL OFL) : rien n'est chargé depuis Google. */
@font-face { font-family: "Marcellus"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("polices/marcellus-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Marcellus"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("polices/marcellus-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("polices/plus-jakarta-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("polices/plus-jakarta-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: italic; font-weight: 200 800; font-display: swap;
  src: url("polices/plus-jakarta-sans-italique-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: italic; font-weight: 200 800; font-display: swap;
  src: url("polices/plus-jakarta-sans-italique-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root {
  --bg: #fbf7f1; --surface: #ffffff; --surface-2: #f5efe6; --fg: #2b2723; --muted: #6f665c; --line: #e6ddd0;
  --turquoise: #1f9e9a; --turquoise-soft: #dcf2f0; --turquoise-ink: #0f6f6c;
  --corail: #e9694c; --corail-soft: #fde5de; --corail-ink: #b2432a;
  --violet: #7b5ea7; --violet-soft: #ece5f6; --violet-ink: #5a3f86;
  --bleu: #5b8fd4; --bleu-soft: #e2ecf9; --bleu-ink: #315f9e;
  --safran: #e9a91f; --safran-soft: #fcf0d2; --safran-ink: #8a6100;
  --sauge: #7fa37a; --sauge-soft: #e6efe3; --sauge-ink: #4a6b45;
  --danger: #c4372b; --ok: #3f8a4d;
  --shadow: 0 1px 2px rgba(60,40,20,.06), 0 6px 20px rgba(60,40,20,.07);
  --radius: 6px; --radius-sm: 6px;
  --display: "Marcellus", Georgia, serif; --body: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #1b1916; --surface: #24211d; --surface-2: #2c2924; --fg: #f1ebe2; --muted: #a99f92; --line: #3a352e;
  --turquoise: #45c2bd; --turquoise-soft: #173a38; --turquoise-ink: #7fdcd7;
  --corail: #f08a70; --corail-soft: #43251d; --corail-ink: #ffb39f;
  --violet: #a487d1; --violet-soft: #2f2640; --violet-ink: #cbb6ef;
  --bleu: #84aee6; --bleu-soft: #1f2d42; --bleu-ink: #b3cdf2;
  --safran: #f2bf4f; --safran-soft: #3d3016; --safran-ink: #f7d488;
  --sauge: #9dc097; --sauge-soft: #243122; --sauge-ink: #c3dcbd;
  --danger: #ef6a5e; --ok: #6fc07d; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #1b1916; --surface: #24211d; --surface-2: #2c2924; --fg: #f1ebe2; --muted: #a99f92; --line: #3a352e;
  --turquoise: #45c2bd; --turquoise-soft: #173a38; --turquoise-ink: #7fdcd7;
  --corail: #f08a70; --corail-soft: #43251d; --corail-ink: #ffb39f;
  --violet: #a487d1; --violet-soft: #2f2640; --violet-ink: #cbb6ef;
  --bleu: #84aee6; --bleu-soft: #1f2d42; --bleu-ink: #b3cdf2;
  --safran: #f2bf4f; --safran-soft: #3d3016; --safran-ink: #f7d488;
  --sauge: #9dc097; --sauge-soft: #243122; --sauge-ink: #c3dcbd;
  --danger: #ef6a5e; --ok: #6fc07d; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.55 var(--body); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-left)) 120px max(16px, env(safe-area-inset-right)); outline: none; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(30px, 4.5vw, 44px); }
h2 { font-size: clamp(22px, 3vw, 28px); }
h3 { font-size: 20px; }
a { color: var(--turquoise-ink); }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--safran); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Barre du haut ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; padding: 10px max(16px, env(safe-area-inset-left)); padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); min-width: 0; }
.brand-name { font-family: var(--display); font-size: 24px; }
.brand-coll { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topnav { display: flex; gap: 4px; margin-left: auto; }
.topnav a { text-decoration: none; color: var(--fg); padding: 8px 14px; border-radius: 6px; font-weight: 500; font-size: 15px; }
.topnav a:hover { background: var(--surface-2); }
.topnav a.active { background: var(--turquoise-soft); color: var(--turquoise-ink); }
.topright { display: flex; gap: 6px; }
.iconbtn { width: 42px; height: 42px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); display: inline-grid; place-items: center; cursor: pointer; }
.iconbtn svg { width: 20px; height: 20px; }
@media (max-width: 860px) { .topnav { display: none; } .brand-coll { display: none; } .topright { margin-left: auto; } }

.footer { display: flex; justify-content: space-between; gap: 12px; padding: 14px max(16px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-bottom)); color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

/* ---------- Boutons ---------- */
.btn { font: 600 16px var(--body); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); cursor: pointer; text-decoration: none; transition: transform .08s, background .15s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.primary { background: var(--turquoise); border-color: var(--turquoise); color: #fff; }
.btn.primary:hover { background: color-mix(in srgb, var(--turquoise) 88%, #000); }
.btn.corail { background: var(--corail); border-color: var(--corail); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.big { min-height: 58px; font-size: 18px; padding: 12px 26px; }
.btn.small { min-height: 38px; font-size: 14px; padding: 6px 14px; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.ghost { border-color: transparent; background: transparent; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Accueil ---------- */
.hello { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 26px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .tiles { gap: 10px; } }
.tile { --c: var(--turquoise); --cs: var(--turquoise-soft); --ci: var(--turquoise-ink); position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px; min-height: 150px; border-radius: 6px;
  background: var(--cs); color: var(--ci); text-decoration: none; border: 2px solid transparent; transition: transform .12s, border-color .15s; cursor: pointer; font: inherit; text-align: left; }
.tile:hover { transform: translateY(-2px); border-color: var(--c); }
.tile .ico { width: 54px; height: 54px; border-radius: 6px; background: var(--c); color: #fff; display: grid; place-items: center; }
.tile .ico svg { width: 30px; height: 30px; }
.tile .t { font-family: var(--display); font-size: 24px; line-height: 1.15; color: var(--fg); }
.tile .s { font-size: 15px; }
.tile .count { position: absolute; top: 18px; right: 20px; font: 700 26px var(--body); font-variant-numeric: tabular-nums; }
.tile.corail { --c: var(--corail); --cs: var(--corail-soft); --ci: var(--corail-ink); }
.tile.violet { --c: var(--violet); --cs: var(--violet-soft); --ci: var(--violet-ink); }
.tile.bleu { --c: var(--bleu); --cs: var(--bleu-soft); --ci: var(--bleu-ink); }
.tile.safran { --c: var(--safran); --cs: var(--safran-soft); --ci: var(--safran-ink); }
.tile.sauge { --c: var(--sauge); --cs: var(--sauge-soft); --ci: var(--sauge-ink); }
@media (max-width: 520px) { .tile { padding: 16px; min-height: 128px; } .tile .t { font-size: 19px; } .tile .s { display: none; } .tile .ico { width: 44px; height: 44px; } }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 40px 0 14px; }

/* ---------- Galerie ---------- */
.toolbar { display: flex; flex-direction: column; gap: 12px; margin: 18px 0 20px; }
.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 2px solid var(--line); border-radius: 6px; padding: 4px 8px 4px 18px; }
.search:focus-within { border-color: var(--turquoise); }
.search svg { width: 22px; height: 22px; color: var(--muted); flex: none; }
.search input[type=search] { flex: 1; min-width: 0; border: 0; background: transparent; font: 18px var(--body); color: var(--fg); padding: 10px 0; outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 500 15px var(--body); display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 6px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--k, var(--muted)); }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip .x { font-size: 18px; line-height: 1; opacity: .7; }
.filters-line { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.filters-line label { font-size: 14px; color: var(--muted); }
select, input[type=text], input[type=password], input[type=number], textarea {
  font: 17px var(--body); color: var(--fg); background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; width: 100%; }
select { width: auto; min-height: 44px; }
input:focus, textarea:focus, select:focus { border-color: var(--turquoise); outline: none; }
textarea { resize: vertical; line-height: 1.55; }
.result-count { color: var(--muted); font-size: 15px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.card { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: var(--fg); border: 1px solid var(--line); transition: transform .12s; }
.card:hover { transform: translateY(-2px); }
.card .pic { aspect-ratio: 1; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.card .pic img { width: 100%; height: 100%; object-fit: contain; background: var(--surface-2); }
.card .pic .nopic { color: var(--muted); font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.card .pic .nopic svg { width: 36px; height: 36px; }
.card .meta { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.card .num { font: 600 12px var(--body); letter-spacing: .05em; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.card .ti { font-weight: 600; line-height: 1.3; }
.card .ti.untitled { color: var(--muted); font-weight: 500; font-style: italic; }
.card .badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.badge { font: 600 12px var(--body); padding: 3px 9px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.badge.todo { background: var(--safran-soft); color: var(--safran-ink); }
.badge.done { background: var(--sauge-soft); color: var(--sauge-ink); }
.badge.sel { background: var(--violet-soft); color: var(--violet-ink); }
.tech-huile { --k: var(--corail); } .tech-pastel { --k: var(--violet); } .tech-aquarelle { --k: var(--bleu); } .tech-croquis { --k: var(--sauge); } .tech-autre { --k: var(--safran); }
.badge.tech { background: color-mix(in srgb, var(--k) 18%, var(--surface)); color: var(--fg); }
.empty { text-align: center; padding: 50px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 200px); gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.strip .card { scroll-snap-align: start; }

/* ---------- Fiche ---------- */
.work-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 18px; }
.work-head .id { font: 700 14px var(--body); letter-spacing: .06em; background: var(--turquoise-soft); color: var(--turquoise-ink); padding: 5px 12px; border-radius: 6px; }
.work-head h1 { flex: 1 1 300px; min-width: 0; overflow-wrap: anywhere; }
.pager { display: flex; gap: 8px; }
.work { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start; }
@media (max-width: 900px) { .work { grid-template-columns: 1fr; } }
.photos { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 900px) { .photos { position: static; } }
.mainpic { position: relative; background: var(--surface-2); border-radius: var(--radius); min-height: 280px; display: grid; place-items: center; overflow: hidden; border: 2px dashed transparent; }
.mainpic img { max-height: 62vh; width: 100%; object-fit: contain; cursor: zoom-in; }
.mainpic.drop { border-color: var(--turquoise); background: var(--turquoise-soft); }
.addphoto { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 36px 16px; text-align: center; color: var(--muted); }
.addphoto svg { width: 54px; height: 54px; color: var(--turquoise); }
.pic-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs button { padding: 0; border: 3px solid transparent; border-radius: 6px; overflow: hidden; width: 84px; height: 84px; background: var(--surface-2); cursor: pointer; }
.thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.thumbs button[aria-current="true"] { border-color: var(--turquoise); }
.thumbs .add { display: grid; place-items: center; color: var(--turquoise); border: 2px dashed var(--line); }
.thumbs .add svg { width: 30px; height: 30px; }
.mainmark { position: absolute; top: 10px; left: 10px; }

.form { display: flex; flex-direction: column; gap: 22px; }
.block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.block > h2 { font-size: 22px; display: flex; align-items: center; gap: 10px; }
.block > h2 .pill { width: 12px; height: 12px; border-radius: 50%; background: var(--k, var(--turquoise)); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-weight: 600; font-size: 16px; }
.field .hint { font-size: 14px; color: var(--muted); margin-top: -2px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; } }
.dims { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dims input { width: 110px; }
.dims .x { color: var(--muted); }
.radios { display: flex; flex-wrap: wrap; gap: 8px; }
.radios label { cursor: pointer; }
.radios input { position: absolute; opacity: 0; pointer-events: none; }
.radios span { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 8px 18px; border-radius: 6px; border: 2px solid var(--line); background: var(--surface); font-weight: 600; }
.radios span::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--k, var(--muted)); }
.radios input:checked + span { border-color: var(--k, var(--turquoise)); background: color-mix(in srgb, var(--k, var(--turquoise)) 16%, var(--surface)); }
.radios input:focus-visible + span { outline: 3px solid var(--safran); outline-offset: 2px; }
.story textarea { min-height: 260px; font-size: 18px; background: var(--surface-2); }
.dictate { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.dictate .live { color: var(--corail-ink); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.dictate .live::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--corail); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 6px; }
.tags:focus-within { border-color: var(--turquoise); }
.tags input { border: 0; flex: 1; min-width: 140px; padding: 6px; }
.tag { display: inline-flex; align-items: center; gap: 4px; background: var(--bleu-soft); color: var(--bleu-ink); border-radius: 6px; padding: 4px 6px 4px 12px; font-weight: 600; font-size: 15px; }
.tag button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 18px; line-height: 1; width: 26px; height: 26px; border-radius: 50%; }
.tag button:hover { background: rgba(0,0,0,.08); }
details.more > summary { cursor: pointer; font-weight: 600; color: var(--turquoise-ink); padding: 4px 0; }

.statusbox { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .statusbox { grid-template-columns: 1fr; } }
.statusbox button { font: 600 17px var(--body); text-align: left; padding: 16px; min-height: 76px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.statusbox button small { font-weight: 500; color: var(--muted); font-size: 14px; }
.statusbox .todo[aria-pressed="true"] { border-color: var(--safran); background: var(--safran-soft); }
.statusbox .done[aria-pressed="true"] { border-color: var(--sauge); background: var(--sauge-soft); }

/* Barre d'enregistrement collée en bas */
.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  padding: 10px max(16px, env(safe-area-inset-left)) max(10px, env(safe-area-inset-bottom)); }
.savebar .in { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.savestate { display: flex; align-items: center; gap: 8px; font-weight: 600; flex: 1; min-width: 160px; }
.savestate .d { width: 12px; height: 12px; border-radius: 50%; background: var(--ok); flex: none; }
.savestate.dirty .d { background: var(--safran); }
.savestate.saving .d { background: var(--bleu); animation: pulse 1s infinite; }
.savestate.error .d { background: var(--danger); }
.savestate.error { color: var(--danger); }

/* ---------- Pages simples ---------- */
.narrow { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.login { max-width: 440px; margin: 6vh auto 0; display: flex; flex-direction: column; gap: 18px; }
.login .logo { display: flex; align-items: center; gap: 14px; }
.login .logo img { width: 64px; height: 64px; }
.notice { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--bleu-soft); color: var(--bleu-ink); }
.notice.warn { background: var(--safran-soft); color: var(--safran-ink); }
.notice.err { background: var(--corail-soft); color: var(--corail-ink); }
.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.list > div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.list > div:first-child { border-top: 0; }
code, .mono { font-family: ui-monospace, Menlo, monospace; font-size: 14px; overflow-wrap: anywhere; }
.copyline { display: flex; gap: 8px; align-items: center; }
.copyline input { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }

/* ---------- Fenêtres ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(20, 16, 12, .55); display: grid; place-items: center; padding: 16px; }
.dialog { background: var(--surface); color: var(--fg); border-radius: 6px; padding: 24px; max-width: 540px; width: 100%; max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.dialog .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.viewer { position: fixed; inset: 0; z-index: 60; background: #0d0c0b; display: flex; flex-direction: column; touch-action: none; }
.viewer .bar { display: flex; gap: 8px; padding: 10px; padding-top: max(10px, env(safe-area-inset-top)); justify-content: space-between; align-items: center; color: #eee; flex-wrap: wrap; }
.viewer .stage { flex: 1; overflow: hidden; position: relative; cursor: grab; }
.viewer .stage img { position: absolute; left: 50%; top: 50%; max-width: none; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; }
.viewer .btn { background: #2a2724; color: #eee; border-color: #3d3935; min-height: 42px; }

/* ---------- Éditeur photo ---------- */
.pe { position: fixed; inset: 0; z-index: 70; background: #161412; color: #eee; display: flex; flex-direction: column; }
.pe-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); flex-wrap: wrap; }
.pe-top h2 { font-size: 22px; color: #fff; }
.pe-body { flex: 1; display: grid; grid-template-columns: 1fr 320px; min-height: 0; }
@media (max-width: 820px) { .pe-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } }
.pe-stage { position: relative; min-height: 0; touch-action: none; }
.pe-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pe-loupe { position: absolute; width: 130px; height: 130px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 4px 20px rgba(0,0,0,.5); pointer-events: none; display: none; }
.pe-side { background: #201d1a; padding: 16px; display: flex; flex-direction: column; gap: 16px; overflow: auto; }
@media (max-width: 820px) { .pe-side { max-height: 42vh; } }
.pe-side h3 { font-family: var(--body); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #b9b0a5; }
.pe-side .btn { background: #2d2925; color: #eee; border-color: #433d37; }
.pe-side .btn.primary { background: var(--turquoise); border-color: var(--turquoise); color: #fff; }
.pe-side .hint { color: #b9b0a5; font-size: 14px; }
.pe-side input[type=range] { width: 100%; accent-color: var(--turquoise); }
.pe-side label.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.pe-side label.check input { width: 22px; height: 22px; accent-color: var(--turquoise); flex: none; margin-top: 2px; }
.pe-busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.55); font-size: 20px; z-index: 2; }

/* ---------- Messages ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 96px; z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(560px, calc(100% - 32px)); pointer-events: none; }
.toast { background: var(--fg); color: var(--bg); padding: 12px 18px; border-radius: 6px; font-weight: 600; box-shadow: var(--shadow); pointer-events: auto; }
.toast.err { background: var(--danger); color: #fff; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--turquoise); animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .topbar, .footer, .savebar, .pic-actions, .pager, .thumbs .add { display: none !important; } }

/* ---------- 0.1.1 : fonds de couleur au lieu des pastilles ---------- */
.chip .dot, .block > h2 .pill { display: none; }
.chip[style*="--k"], .chip[class*="tech-"] {
  background: color-mix(in srgb, var(--k) 34%, var(--surface)); border-color: color-mix(in srgb, var(--k) 55%, var(--surface)); color: var(--fg); }
.chip[style*="--k"]:hover, .chip[class*="tech-"]:hover { background: color-mix(in srgb, var(--k) 38%, var(--surface)); }
.chip[aria-pressed="true"][style*="--k"], .chip[aria-pressed="true"][class*="tech-"] { background: var(--k); border-color: var(--k); color: #fff; }
.radios span::before { display: none; }
.radios span { background: color-mix(in srgb, var(--k, var(--turquoise)) 32%, var(--surface)); border-color: color-mix(in srgb, var(--k, var(--turquoise)) 55%, var(--surface)); }
.radios input:checked + span { background: var(--k, var(--turquoise)); border-color: var(--k, var(--turquoise)); color: #fff; }
.block { background: color-mix(in srgb, var(--k, var(--turquoise)) 12%, var(--surface)); border-color: color-mix(in srgb, var(--k, var(--turquoise)) 35%, var(--surface)); }
.block > h2 { margin: -20px -20px 0; padding: 14px 20px; border-radius: 6px 6px 0 0; background: var(--k, var(--turquoise)); color: #fff; }
.badge.tech { background: var(--k); color: #fff; }

.checkline { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.checkline input { width: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: var(--turquoise); }

/* 0.3.0 : bas de page */
.footer { flex-wrap: wrap; align-items: baseline; }
.footer-version { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
@media (max-width: 620px) { .footer { flex-direction: column; gap: 4px; } }

/* 0.3.0 : présence du propriétaire (visible du responsable média) et changements en direct */
.presence { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; max-width: 46vw; padding: 6px 12px; border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--sauge) 60%, var(--surface)); background: color-mix(in srgb, var(--sauge) 22%, var(--surface));
  color: var(--fg); font: 500 14px var(--body); cursor: pointer; text-align: left; }
.presence > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.presence .pdot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.presence.away { background: var(--surface-2); border-color: var(--line); color: var(--muted); }
.presence.away .pdot { background: var(--muted); box-shadow: none; }
.presence .pago { color: var(--muted); }
@media (max-width: 860px) { .presence { margin-left: auto; max-width: 52vw; } .presence .pago { display: none; } }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--safran); } 100% { box-shadow: 0 0 0 3px transparent; } }
.flash { animation: flash 1.6s ease-out; border-radius: 6px; }
.has-savebar .footer { padding-bottom: 96px; }
.presence .pshort { display: none; }
.presence .plong, .presence .pshort { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 860px) { .presence .plong { display: none; } .presence .pshort { display: inline; } }
@media (max-width: 480px) { .topbar:has(.presence:not([hidden])) .brand-name { display: none; } }

/* 0.4.0 : boutons « Annuler » et « Se déconnecter » dans la barre du haut (texte sur ordinateur, icône sur téléphone) */
.navbtn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); font: 500 15px var(--body); cursor: pointer; white-space: nowrap; }
.navbtn svg { width: 19px; height: 19px; flex: none; }
.navbtn:hover:not(:disabled) { background: var(--surface-2); }
.navbtn:disabled { opacity: .4; cursor: default; }
@media (max-width: 1400px) { .navbtn { width: 42px; padding: 0; justify-content: center; } .navbtn span { display: none; } }
.topnav a { white-space: nowrap; }
@media (max-width: 1200px) { .topnav a { padding: 8px 10px; } .brand-coll { display: none; } }
.iconbtn[hidden], .navbtn[hidden] { display: none; }

/* 0.4.3 : titre modifiable dans l'en-tête de la fiche ; état d'enregistrement */
.title-edit { cursor: text; display: flex; align-items: center; gap: 12px; border-radius: 6px; padding: 2px 8px; margin-left: -8px; }
.title-edit .pen { opacity: 0; transition: opacity .15s; color: var(--muted); display: inline-flex; }
.title-edit .pen svg { width: 22px; height: 22px; }
.title-edit:hover, .title-edit:focus-visible { background: var(--surface-2); outline: none; }
.title-edit:hover .pen, .title-edit:focus-visible .pen { opacity: 1; }
@media (hover: none) { .title-edit .pen { opacity: .7; } }
.title-edit.editing { background: transparent; padding: 0; margin-left: 0; }
.title-edit input[type=text].title-input { font: inherit; color: inherit; width: 100%; min-height: 0; padding: 2px 8px; border: 2px solid var(--turquoise); border-radius: 6px; background: var(--surface); }
.savestate.error { color: var(--danger); }
.savestate.error .txt { font-weight: 600; }

/* 0.5.0 : page « Suivi » du propriétaire */
.suivi .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.suivi .stats > div { background: var(--surface-2); border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; }
.suivi .stats b { font: 28px var(--display); }
.suivi .stats span { color: var(--muted); font-size: 14px; }
.slist { display: flex; flex-direction: column; gap: 4px; }
.srow { display: flex; align-items: center; gap: 12px; padding: 6px; border-radius: 6px; text-decoration: none; color: var(--fg); }
.srow:hover { background: var(--surface-2); }
.srow img, .srow .nothumb { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; flex: none; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.srow .nothumb svg { width: 22px; height: 22px; }
.sinfo { display: flex; flex-direction: column; min-width: 0; }
.jday { font: 600 16px var(--body); margin: 8px 0 2px; color: var(--muted); }
.journal { display: flex; flex-direction: column; border-left: 3px solid var(--line); padding-left: 12px; gap: 6px; }
.journal > div { display: flex; gap: 12px; align-items: baseline; }
.journal .jt { flex: none; width: 112px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; }
.journal .j-seance { color: var(--muted); }
.pdot-inline { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); vertical-align: 1px; }
@media (max-width: 520px) { .suivi .stats { grid-template-columns: 1fr; } .journal > div { flex-direction: column; gap: 0; } }
