/* Wishbrainz V1 — styles repris de la maquette V1 (clair et sombre). */

@font-face { font-family: 'Bricolage Grotesque'; src: url(/fonts/bricolage.woff2) format('woff2-variations'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url(/fonts/plex-sans-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url(/fonts/plex-sans-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url(/fonts/plex-sans-600.woff2) format('woff2'); font-weight: 600 700; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url(/fonts/plex-mono-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url(/fonts/plex-mono-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #F3F3F0; --surf: #FFFFFF; --surf2: #E9E9E3; --line: #E2E2DC; --line2: #D0D0C8;
  --text: #17171A; --mut: #5C5C63; --acc: #1F4A33; --onAcc: #FFFFFF; --accT: #1F4A33; --accT2: #2E7A52;
  --accSoft: #E1EBE3; --accSoftT: #1A3F2B; --accRow: #EEF4EF; --dang: #A12812; --warnBg: #FAEFD2; --warnT: #6B4500;
  --inv: #17171A; --onInv: #FFFFFF; --pill: #FFFFFF; --pillT: #17171A; --shadow: rgba(23,23,26,0.08);
  --toast: #17171A; --toastT: #FFFFFF; --toastLine: #4A4A52; --toastAcc: #8CC9A1; --field: #F3F3F0;
  --orphBg: #E4E4DE; --orphFg: #5C5C63; --off: #8E8E95; --coverBd: 0;
  --display: 'Bricolage Grotesque', 'IBM Plex Sans', system-ui, sans-serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;
}
[data-theme="sombre"] {
  color-scheme: dark;
  --bg: #0F1311; --surf: #171C19; --surf2: #212723; --line: #29302B; --line2: #3A423C;
  --text: #ECEEEA; --mut: #A2AAA4; --acc: #2E6A48; --onAcc: #FFFFFF; --accT: #8CC9A1; --accT2: #8CC9A1;
  --accSoft: #1B3226; --accSoftT: #A9D8B8; --accRow: #1B2A21; --dang: #F08A74; --warnBg: #3A2E10; --warnT: #EBC970;
  --inv: #ECEEEA; --onInv: #0F1311; --pill: #171C19; --pillT: #ECEEEA; --shadow: rgba(0,0,0,0.35);
  --toast: #26302A; --toastT: #ECEEEA; --toastLine: #4A564E; --toastAcc: #8CC9A1; --field: #0F1311;
  --orphBg: #232925; --orphFg: #A2AAA4; --off: #5A625C; --coverBd: 1px solid var(--line);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.4; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: var(--text); }
:focus-visible { outline: 2px solid #3E8E61; outline-offset: 2px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mut { color: var(--mut); }
.mono { font-family: var(--mono); }
svg { flex: none; }

/* ---------- En-tête ---------- */
.top { background: var(--surf); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { max-width: 1200px; margin: 0 auto; padding: 14px 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.addform { flex: 1 1 380px; display: flex; gap: 8px; margin: 0; }
.addfield { flex: 1; display: flex; align-items: center; gap: 10px; background: var(--field); border: 1px solid var(--line2); border-radius: 10px; padding: 0 14px; height: 46px; min-width: 0; }
.addfield input { flex: 1; min-width: 0; border: 0; background: transparent; height: 44px; outline: none; }
.addfield.off { background: var(--surf2); }
.addfield.off input { color: var(--mut); }
.nav { display: flex; align-items: center; gap: 6px; }
.navlink { display: inline-flex; align-items: center; height: 44px; padding: 0 12px; border-radius: 10px; color: var(--mut); font-size: 14px; font-weight: 500; }
.navlink[aria-current="page"] { background: var(--accSoft); color: var(--accSoftT); font-weight: 600; }
.navlink:hover { text-decoration: none; color: var(--text); }
.navlink[aria-current="page"]:hover { color: var(--accSoftT); }
.sync { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 8px; font-size: 13px; color: var(--mut); white-space: nowrap; }
.sync i { width: 8px; height: 8px; border-radius: 999px; background: var(--accT); }
.sync.warn i { background: var(--warnT); }
.sync.busy i { animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .3; } }
.offbar { display: flex; align-items: center; gap: 8px; padding: 10px 32px; background: var(--warnBg); color: var(--warnT); font-size: 13px; font-weight: 600; justify-content: center; }
.mobile-only { display: none !important; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 16px; border: 1px solid var(--line2); border-radius: 10px; background: var(--surf); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover { border-color: var(--mut); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.pri { background: var(--acc); border-color: var(--acc); color: var(--onAcc); }
.btn.pri:hover { filter: brightness(1.12); }
.btn.inv { background: var(--inv); border-color: var(--inv); color: var(--onInv); }
.btn.sm { height: 40px; padding: 0 12px; border-radius: 8px; }
.btn.big { height: 46px; padding: 0 20px; font-size: 15px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.link { border: 0; background: transparent; padding: 0; height: 44px; color: var(--accT); }
.btn.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn.danger { border: 0; background: transparent; padding: 0; color: var(--dang); font-weight: 600; }
.btn.danger:hover { text-decoration: underline; text-underline-offset: 3px; }
.iconbtn { width: 44px; height: 44px; border: 1px solid var(--line2); border-radius: 10px; background: var(--surf); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.iconbtn.bare { border: 0; background: transparent; color: var(--mut); }
.iconbtn.bare:hover { color: var(--text); background: var(--surf2); }
.chip { height: 40px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 999px; background: var(--surf); color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--acc); border-color: var(--acc); color: var(--onAcc); }
.chip.orph { border-style: dashed; display: inline-flex; align-items: center; gap: 6px; }
.chip.orph[aria-pressed="true"] { background: var(--warnBg); color: var(--warnT); border-color: var(--warnT); }
.chip.sm { height: 40px; padding: 0 12px; font-size: 13px; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surf2); }
.seg button { height: 40px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; font-size: 14px; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surf); box-shadow: 0 1px 3px var(--shadow); }
.viewtoggle { display: inline-flex; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; }
.viewtoggle button { width: 44px; height: 42px; border: 0; background: var(--surf); color: var(--mut); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.viewtoggle button + button { border-left: 1px solid var(--line2); }
.viewtoggle button[aria-pressed="true"] { background: var(--accSoft); color: var(--accSoftT); }
.select { height: 44px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 10px; background: var(--surf); font-size: 14px; }
.input { height: 44px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 10px; background: var(--field); width: 100%; }
.textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line2); border-radius: 10px; background: var(--surf); font-size: 15px; line-height: 1.5; resize: vertical; }
.lbl { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.field { display: flex; flex-direction: column; gap: 6px; }

/* ---------- Page ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 32px 32px 140px; display: flex; flex-direction: column; gap: 20px; }
.page.narrow { max-width: 860px; }
.h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 28px; letter-spacing: -0.02em; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.back { display: inline-flex; align-items: center; gap: 6px; height: 44px; font-size: 14px; color: var(--mut); align-self: flex-start; }
.card { background: var(--surf); border: 1px solid var(--line); border-radius: 12px; }
.empty { padding: 48px 24px; border: 1px dashed var(--line2); border-radius: 12px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line2); border-top-color: var(--accT); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Onglets bibliothèque ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surf2); }
.tabs button { display: inline-flex; align-items: baseline; gap: 10px; height: 52px; padding: 0 20px; border: 0; border-radius: 10px; background: transparent; font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -0.02em; line-height: 52px; cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--surf); box-shadow: 0 1px 3px var(--shadow); }
.tabs .n { font-family: var(--mono); font-weight: 500; font-size: 13px; letter-spacing: 0; color: var(--mut); }
.filterbox { flex: 0 1 280px; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 10px; background: var(--surf); }
.filterbox input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 14px; outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Pochettes ---------- */
.cover { position: relative; aspect-ratio: 1 / 1; border-radius: 6px; overflow: hidden; display: flex; align-items: flex-end; padding: 14px; border: var(--coverBd); box-shadow: 0 1px 2px var(--shadow), 0 8px 20px var(--shadow); font-family: var(--display); font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.cover .ini { font-size: 36px; position: relative; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover.orphan { background: var(--orphBg) !important; color: var(--orphFg) !important; border: 1px dashed var(--line2); box-shadow: none; }
.cover .disc { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -60%); opacity: .55; }
.cover.sm { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 4px; padding: 6px 8px; box-shadow: none; }
.cover.sm .ini { font-size: 18px; }
.cover.xs { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 4px; padding: 5px 6px; box-shadow: none; }
.cover.xs .ini { font-size: 15px; }
.cover.xxs { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 4px; padding: 4px 6px; box-shadow: none; }
.cover.xxs .ini { font-size: 14px; }
.cover.big { border-radius: 8px; padding: 28px; box-shadow: 0 2px 4px var(--shadow), 0 20px 40px var(--shadow); }
.cover.big .ini { font-size: 96px; letter-spacing: -0.04em; }
.cover.big.orphan { box-shadow: none; }
.cover.sm .disc, .cover.xs .disc, .cover.xxs .disc { display: none; }

/* ---------- Pastilles (maquette « Pastilles de statut V1 ») ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 4px; }
.cover .pills { position: absolute; top: 10px; left: 10px; right: 50px; z-index: 1; }
.pill { display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 6px; border-radius: 5px; font-family: var(--mono); font-weight: 600; font-size: 11px; letter-spacing: 0.04em; line-height: 1; font-style: normal; }
.pill.heart { border-radius: 999px; background: var(--pill); color: var(--accT); letter-spacing: 0; }
.pill.solid { background: var(--inv); color: var(--onInv); padding: 0 7px; }
.pill.dashed { background: var(--pill); color: var(--pillT); border: 1px dashed var(--mut); }
.pill.outline { background: var(--pill); color: var(--pillT); border: 1px solid var(--pillT); }
.cover .pill { box-shadow: 0 1px 3px rgba(0,0,0,0.22); }
.cover .pill.dashed, .cover .pill.outline { box-shadow: none; }
.flat .pill.heart { background: var(--accSoft); color: var(--accSoftT); }
.flat .pill.dashed, .flat .pill.outline { background: transparent; color: var(--text); }
.flat .pill.outline { border-color: var(--text); }
.badge-orph { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--warnBg); color: var(--warnT); font-size: 12px; font-weight: 600; font-family: var(--sans); letter-spacing: 0; white-space: nowrap; }
.notebadge { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 999px; background: var(--pill); color: var(--pillT); box-shadow: 0 1px 3px rgba(0,0,0,0.22); }
.cover .corner { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 4px; align-items: center; z-index: 1; }
.typetag { font-family: var(--mono); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 6px; border-radius: 4px; background: var(--surf2); color: var(--mut); white-space: nowrap; }

/* ---------- Grille ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 32px 24px; }
.tile { position: relative; content-visibility: auto; contain-intrinsic-size: auto 240px; }
.tile:has(.menu) { content-visibility: visible; z-index: 5; }
.tile > a { display: flex; flex-direction: column; gap: 10px; }
.tile > a:hover { text-decoration: none; }
.tile > a:hover .t-title { text-decoration: underline; text-underline-offset: 3px; }
.t-title { font-weight: 600; font-size: 15px; line-height: 1.3; }
.t-sub { color: var(--mut); font-size: 14px; }
.dots { position: absolute; top: 6px; right: 6px; z-index: 2; width: 36px; height: 36px; border: 0; border-radius: 999px; background: var(--pill); color: var(--pillT); box-shadow: 0 1px 3px rgba(0,0,0,0.22); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }

/* Menu rapide (ordinateur) */
.menu { position: absolute; top: 48px; right: 6px; z-index: 30; width: 264px; background: var(--surf); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 36px rgba(0,0,0,0.22); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.menu-title { font-size: 13px; font-weight: 600; color: var(--mut); }
.fmtgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fmtgrid button { height: 44px; padding: 0 4px; border: 1px solid var(--line2); border-radius: 8px; background: var(--surf); font-size: 13px; font-weight: 600; cursor: pointer; }
.fmtgrid button:hover { border-color: var(--acc); background: var(--accSoft); color: var(--accSoftT); }
.sep { height: 1px; background: var(--line); }
.menu .item { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0; border: 0; background: transparent; font-size: 14px; font-weight: 500; cursor: pointer; text-align: left; }
.menu .item.dang { color: var(--dang); }

/* Feuille d'actions (mobile) */
.scrim { position: fixed; inset: 0; z-index: 40; border: 0; padding: 0; background: rgba(0,0,0,0.45); cursor: pointer; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--surf); border-radius: 18px 18px 0 0; padding: 10px 16px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; box-shadow: 0 -12px 32px rgba(0,0,0,0.25); }
.sheet .grab { align-self: center; width: 40px; height: 4px; border-radius: 999px; background: var(--line2); }
.sheet .fmtgrid { gap: 8px; }
.sheet .fmtgrid button { height: 48px; border-radius: 10px; font-size: 14px; }

/* ---------- Liste dense ---------- */
.listwrap { overflow-x: auto; }
.list { min-width: 780px; }
.lrow { content-visibility: auto; contain-intrinsic-size: auto 69px; position: relative; display: grid; grid-template-columns: 52px minmax(0, 2.4fr) 70px minmax(0, 1.6fr) 120px 48px; gap: 16px; align-items: center; padding: 8px 16px; border-top: 1px solid var(--line); }
.lrow:has(.menu) { content-visibility: visible; z-index: 5; }
.lrow.head { border-top: 0; padding: 10px 16px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mut); }
.lrow .menu { top: 60px; right: 16px; }
.lrow > a { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lrow .ttl { display: flex; align-items: center; gap: 8px; font-weight: 600; }

/* ---------- Résultats ---------- */
.results { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.result { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; padding: 14px 20px; }
.result + .result { border-top: 1px solid var(--line); }
.result .info { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.result .title { font-weight: 600; font-size: 16px; }
.result .acts { flex: 0 1 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.already { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; font-size: 13px; color: var(--accSoftT); }
.added { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 10px; background: var(--accSoft); color: var(--accSoftT); font-size: 14px; font-weight: 600; }
.orphbox { background: var(--surf); border: 1px dashed var(--line2); border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px; font-size: 14px; }
.notice.ok { background: var(--accSoft); color: var(--accSoftT); }
.notice.warn { background: var(--warnBg); color: var(--warnT); }
.notice.err { background: var(--warnBg); color: var(--dang); }
.notice a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; width: min(640px, calc(100% - 32px)); background: var(--toast); color: var(--toastT); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,0.3); padding: 12px 12px 12px 20px; display: flex; flex-direction: column; gap: 12px; animation: up .18s ease-out; }
@keyframes up { from { transform: translate(-50%, 12px); opacity: 0; } }
.toast .line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.toast .msg { flex: 1 1 200px; font-size: 15px; }
.toast .msg strong { font-weight: 600; }
.toast .tl { height: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--toastT); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; display: inline-flex; align-items: center; }
.toast .tb { height: 40px; padding: 0 12px; border: 1px solid var(--toastLine); border-radius: 8px; background: transparent; color: var(--toastT); font-size: 14px; font-weight: 600; cursor: pointer; }
.toast .note { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toast .note input[type=text] { flex: 1 1 260px; height: 44px; padding: 0 12px; border: 1px solid var(--toastLine); border-radius: 8px; background: rgba(255,255,255,0.06); color: var(--toastT); font-size: 14px; }
.toast .note label { display: inline-flex; align-items: center; gap: 8px; height: 44px; font-size: 14px; cursor: pointer; }
.toast .save { height: 44px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--toastT); color: var(--toast); font-weight: 600; font-size: 14px; cursor: pointer; }
.toast.err .ok-ico { display: none; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; margin: 0; accent-color: #2E6A48; }

/* ---------- Fiche ---------- */
.fiche { display: flex; flex-wrap: wrap; gap: 40px 56px; align-items: flex-start; }
.fiche-l { flex: 0 1 360px; min-width: 240px; display: flex; flex-direction: column; gap: 16px; }
.fiche-r { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.fiche h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 52px; letter-spacing: -0.035em; line-height: 1.02; overflow-wrap: anywhere; }
.fiche .artist { margin: 0; font-size: 20px; color: var(--mut); }
.sec { overflow: hidden; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 20px; }
.sec-h h2 { margin: 0; font-size: 16px; font-weight: 600; }
.sec-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 12px 20px; border-top: 1px solid var(--line); }
.sec-row .grow { flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px; }
.sec-row .name { font-weight: 600; }
.sec-row .det { font-size: 13px; color: var(--mut); }
.sec-foot { padding: 10px 20px 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fmtpill { min-width: 44px; justify-content: center; height: 26px; }
.edition { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.edition h2 { margin: 0; font-size: 14px; font-weight: 600; }
.radio { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 8px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.radio.on { background: var(--accRow); }
.radio .d { font-size: 13px; color: var(--mut); }
.notes { display: flex; flex-wrap: wrap; gap: 20px; }
.notes > section { flex: 1 1 300px; display: flex; flex-direction: column; gap: 8px; }
.meta { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line); padding-top: 12px; }
.meta .ids { font-family: var(--mono); font-size: 12px; color: var(--mut); overflow-wrap: anywhere; }
.titlein { height: 52px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 10px; background: var(--surf); font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: -0.02em; width: 100%; }
.artistin { height: 52px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 10px; background: var(--surf); font-size: 18px; width: 100%; }
.saved { font-size: 13px; color: var(--mut); min-height: 18px; }

/* ---------- Paramètres ---------- */
.set { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.set h2 { margin: 0; font-size: 18px; font-weight: 600; }
.set .desc { margin: 0; font-size: 14px; color: var(--mut); }
.pubbox { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; }
.switch { position: relative; width: 52px; height: 32px; padding: 0; border: 0; border-radius: 999px; background: var(--off); cursor: pointer; flex: none; }
.switch[aria-checked="true"] { background: var(--acc); }
.switch span { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 999px; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0,0,0,0.3); transition: left .15s; }
.switch[aria-checked="true"] span { left: 24px; }
.urlcode { flex: 1 1 260px; display: flex; align-items: center; height: 40px; padding: 0 12px; border-radius: 8px; background: var(--surf2); font-family: var(--mono); font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.progress { height: 10px; border-radius: 999px; background: var(--surf2); overflow: hidden; }
.progress > div { height: 100%; border-radius: 999px; background: var(--acc); transition: width .4s; }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 20px; gap: 24px; position: relative; }
.login .brand { font-size: 32px; gap: 12px; letter-spacing: -0.03em; }
.login form { width: 100%; max-width: 400px; padding: 28px; border-radius: 16px; display: flex; flex-direction: column; gap: 18px; }
.login h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: -0.02em; }
.login .input { height: 46px; padding: 0 14px; }
.login .theme { position: absolute; top: 20px; right: 20px; }
.err { color: var(--dang); font-size: 14px; font-weight: 500; }

/* ---------- Vues publiques ---------- */
.pub-top { border-bottom: 1px solid var(--line); }
.pub-top .top-in { justify-content: space-between; gap: 12px 24px; }
.pub-top .brand { font-size: 20px; }
.pub { padding: 48px 32px 64px; gap: 28px; }
.pub-h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 56px; letter-spacing: -0.04em; line-height: 1; }
.pub .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 36px 28px; }
.pub .cover .ini { font-size: 42px; }
.pub .cover .pills { right: 10px; }
.pub article { display: flex; flex-direction: column; gap: 10px; }
.pub article h2 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; }
.pubnote { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--surf); border: 1px solid var(--line); font-size: 14px; line-height: 1.45; white-space: pre-line; }
.pub-foot { border-top: 1px solid var(--line); }
.pub-foot div { max-width: 1200px; margin: 0 auto; padding: 20px 32px; font-size: 13px; color: var(--mut); }
.pub-foot a { text-decoration: underline; text-underline-offset: 3px; }
a.chip { display: inline-flex; align-items: center; text-decoration: none; }

/* ---------- Mobile (maquettes 390 px, NF-22 : 360 px) ---------- */
@media (max-width: 720px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: revert !important; }
  .top-in { padding: 10px 16px 12px; gap: 10px; }
  .brand { font-size: 20px; gap: 8px; }
  .brand svg { width: 24px; height: 24px; }
  .addform { flex-basis: 100%; order: 3; }
  .addfield { height: 46px; }
  .nav { margin-left: auto; gap: 2px; }
  .nav .iconbtn { border: 0; background: transparent; }
  .offbar { padding: 10px 16px; justify-content: flex-start; }
  .page { padding: 14px 16px 120px; gap: 12px; }
  .tabs { display: flex; width: 100%; }
  .tabs button { flex: 1; justify-content: center; gap: 6px; height: 44px; font-size: 17px; line-height: 44px; padding: 0 8px; }
  .tabs .n { font-size: 12px; }
  .chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .chips.scroll .chip { height: 36px; padding: 0 12px; font-size: 13px; flex: 0 0 auto; }
  .filterbox { flex: 1 1 100%; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
  .tile > a { gap: 7px; }
  .cover { padding: 10px; }
  .cover .ini { font-size: 28px; }
  .cover .pills { top: 8px; left: 8px; right: 46px; gap: 3px; }
  .pill { height: 22px; padding: 0 4px; font-size: 10px; border-radius: 4px; }
  .pill.solid { padding: 0 5px; }
  .pill.heart { padding: 0 5px; gap: 2px; }
  .pill.heart svg { width: 12px; height: 12px; }
  .cover .corner { right: 8px; bottom: 8px; }
  .cover .badge-orph { height: 22px; font-size: 11px; padding: 0 7px; }
  .t-title { font-size: 14px; }
  .t-sub { font-size: 13px; }
  .dots { top: 7px; right: 7px; width: 30px; height: 30px; }
  .result { padding: 12px 16px; gap: 10px 12px; }
  .result > .cover.sm { width: 52px; height: 52px; flex-basis: 52px; padding: 4px 6px; }
  .result > .cover.sm .ini { font-size: 15px; }
  .result .info { flex: 1 1 0; gap: 2px; }
  .result .title { font-size: 15px; line-height: 1.25; }
  .result .acts { width: 100%; display: grid; grid-template-columns: 1.3fr 1.2fr 0.8fr 1fr; gap: 6px; }
  .result .acts .btn { padding: 0 4px !important; font-size: 13px; gap: 4px; }
  .result .acts .added { grid-column: 1 / -1; }
  .result .pfx { display: none; }
  .fiche { gap: 20px; }
  .fiche-l { flex: 1 1 100%; }
  .fiche h1 { font-size: 34px; }
  .cover.big { padding: 18px; }
  .cover.big .ini { font-size: 72px; }
  .sec-h, .sec-row, .sec-foot { padding-left: 14px; padding-right: 14px; }
  .toast { bottom: calc(16px + env(safe-area-inset-bottom)); padding: 10px 10px 10px 14px; border-radius: 12px; }
  .toast .msg { font-size: 14px; flex-basis: 100%; }
  .toast .line { gap: 4px 6px; }
  .toast .ok-ico { display: none !important; }
  .toast .tl { padding: 0 6px; font-size: 13px; }
  .toast .tb { padding: 0 10px; font-size: 13px; margin-left: auto; }
  .pub { padding: 24px 16px 48px; gap: 18px; }
  .pub-h1 { font-size: 36px; }
  .pub .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
  .pub .cover .ini { font-size: 28px; }
  .pub-top .top-in { padding: 10px 16px; }
  .pub-foot div { padding: 16px; }
  .set { padding: 16px; }
}
