/* Charte Agentic Solutions : gris neutres et blanc, une seule action principale par écran, pas d'ombre. */
@font-face { font-family: 'Schibsted Grotesk'; src: url('/fonts/schibsted-grotesk.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Karla'; src: url('/fonts/karla.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }

:root {
  --page: #f4f5f6; --surface: #ffffff; --hover: #f1f2f4; --line: #edeef0; --line-strong: #e2e4e7;
  --text: #1f2225; --body: #6b7075; --muted: #82878c; --label: #9aa0a6; --off: #c2c7cc;
  --accent: #d85a30; --accent-hover: #b8461f; --ok: #7c9a57; --ok-dark: #5b7042; --warn: #d89a30; --warn-dark: #b0791f;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font: 16px/1.5 Karla, system-ui, -apple-system, 'Segoe UI', sans-serif; }
h1 { font-family: 'Schibsted Grotesk', system-ui, sans-serif; font-weight: 500; font-size: 36px; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 8px; }
h2 { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
p { margin: 0 0 12px; color: var(--body); }
a { color: inherit; }
.lead { font-size: 18px; color: var(--body); margin-bottom: 28px; max-width: 60ch; }
.small { font-size: 14px; color: var(--muted); }
.hide { display: none !important; }

/* mise en page : navigation à gauche sur grand écran, en haut sur téléphone */
.shell { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.nav { display: flex; gap: 4px; padding: 12px 16px; overflow-x: auto; background: var(--page); position: sticky; top: 0; z-index: 5; }
.nav .brand { display: none; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 100px; text-decoration: none; color: var(--body); white-space: nowrap; font-size: 15px; }
.nav a:hover { background: var(--hover); }
.nav a[aria-current='page'] { background: var(--line); color: var(--text); }
.nav svg { width: 18px; height: 18px; flex: none; }
main { padding: 16px 16px 64px; max-width: 980px; width: 100%; }
@media (min-width: 900px) {
  .shell { grid-template-columns: 236px 1fr; }
  .nav { flex-direction: column; height: 100vh; padding: 28px 16px; }
  .nav .brand { display: block; font-weight: 600; padding: 0 14px 20px; color: var(--text); }
  main { padding: 40px 48px 80px; }
}

/* cartes, listes */
.card { background: var(--surface); border-radius: 26px; padding: 24px; margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; }
.row .meta { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }

/* boutons : secondaire par défaut, un seul principal par écran */
button, .btn { font: inherit; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border-radius: 100px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; }
button:hover, .btn:hover { background: var(--hover); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.quiet { border-color: transparent; background: transparent; color: var(--body); padding: 0 12px; }
button.quiet:hover { background: var(--hover); }
button:disabled { color: var(--off); background: var(--surface); border-color: var(--line); cursor: default; }
button.primary:disabled { background: var(--off); border-color: var(--off); color: #fff; }
button svg, .btn svg { width: 18px; height: 18px; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* champs */
label { display: block; font-size: 14px; color: var(--body); margin: 0 0 6px; }
.field { margin-bottom: 16px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  font: inherit; font-size: 16px; width: 100%; min-height: 44px; padding: 10px 16px; border-radius: 14px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); }
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
input[type=color] { width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 14px; padding: 4px; background: var(--surface); cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.colors { display: flex; gap: 14px; flex-wrap: wrap; }
.colors label { text-align: center; font-size: 13px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text); }
.check input { width: 20px; height: 20px; accent-color: var(--text); }

/* pastilles d'état */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 12px; border-radius: 100px; background: var(--hover); color: var(--body); white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--label); }
.pill.ok { color: var(--ok-dark); } .pill.ok::before { background: var(--ok); }
.pill.warn { color: var(--warn-dark); } .pill.warn::before { background: var(--warn); }

/* choix en pastilles (mode) */
.seg { display: inline-flex; background: var(--hover); border-radius: 100px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { min-height: 36px; border: 0; background: transparent; color: var(--body); padding: 0 16px; }
.seg button[aria-pressed='true'] { background: var(--surface); color: var(--text); }

/* visages */
.faces { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.face { background: var(--surface); border-radius: 26px; padding: 12px; text-align: left; border: 1px solid transparent; cursor: pointer; display: block; min-height: 0; color: var(--text); }
.face:hover { background: var(--surface); border-color: var(--line-strong); }
.face[aria-pressed='true'] { border-color: var(--text); }
.face .pic { aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: var(--hover); margin-bottom: 10px; }
.face .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.face .n { font-weight: 600; }
.face .d { font-size: 13px; color: var(--muted); }

/* clé montrée une seule fois */
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 14px; background: var(--hover); border-radius: 14px; padding: 14px 16px; overflow-wrap: anywhere; margin: 12px 0; color: var(--text); }
pre.code { white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.5 ui-monospace, Menlo, monospace; background: var(--hover); border-radius: 14px; padding: 16px; margin: 12px 0; color: var(--text); }
.msg { min-height: 24px; font-size: 15px; color: var(--body); }
.msg.err { color: var(--warn-dark); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 14px; padding: 10px 8px; border-bottom: 1px solid var(--line); }
td { padding: 12px 8px; border-bottom: 1px solid var(--line); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }

/* panneau d'édition */
dialog { border: 0; border-radius: 26px; padding: 0; width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 24px); background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgba(31, 34, 37, 0.32); }
dialog .in { padding: 24px; }
dialog .actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.preview { width: 160px; height: 160px; border-radius: 26px; overflow: hidden; background: var(--hover); flex: none; }
.editor { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.editor .grow { flex: 1; min-width: 240px; }

/* champ fichier : bouton lisible à la place du bouton du navigateur */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.vh:focus-visible + label { outline: 2px solid var(--text); outline-offset: 2px; }
.label { display: block; font-size: 14px; color: var(--body); margin: 0 0 6px; }
label.btn { margin: 0; font-size: 15px; color: var(--text); }
input:disabled, select:disabled { background: var(--hover); color: var(--muted); }
