
/* Une seule colonne, beaucoup de blanc, noir pour l'action, couleur réservée aux statuts.
   Tout est isolé sous #ps-iptc-app pour cohabiter avec un thème WordPress : aucun style sur html, body ou :root. */
#ps-iptc-app {
  --bg: #ffffff; --text: #141414; --muted: #6e6e6e; --faint: #a3a3a3; --line: #e8e8e8; --soft: #f6f6f6;
  --btn: #141414; --btn-ink: #ffffff;
  --ok: #1a7f4b; --warn: #a86400; --err: #c4302b; --ok-bg: #eef7f1; --warn-bg: #fdf6e9; --err-bg: #fcefee;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sticky-top: 0px;
  margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; text-align: left;
}
@media (prefers-color-scheme: dark) { #ps-iptc-app[data-theme="auto"] {
  --bg: #121212; --text: #ececec; --muted: #9a9a9a; --faint: #666; --line: #2a2a2a; --soft: #1b1b1b;
  --btn: #ececec; --btn-ink: #121212;
  --ok: #4cc38a; --warn: #e3a43f; --err: #ef6b65; --ok-bg: #16241c; --warn-bg: #2a2214; --err-bg: #2c1a19; color-scheme: dark; } }
#ps-iptc-app[data-theme="dark"] {
  --bg: #121212; --text: #ececec; --muted: #9a9a9a; --faint: #666; --line: #2a2a2a; --soft: #1b1b1b;
  --btn: #ececec; --btn-ink: #121212;
  --ok: #4cc38a; --warn: #e3a43f; --err: #ef6b65; --ok-bg: #16241c; --warn-bg: #2a2214; --err-bg: #2c1a19; color-scheme: dark; }

#ps-iptc-app, #ps-iptc-app *, #ps-iptc-app *::before, #ps-iptc-app *::after { box-sizing: border-box; }
#ps-iptc-app [hidden] { display: none !important; }
#ps-iptc-app h1, #ps-iptc-app h2, #ps-iptc-app h3 { margin: 0; padding: 0; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; font-family: var(--font); color: var(--text); line-height: 1.25; }
#ps-iptc-app p { margin: 0; }
#ps-iptc-app a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
#ps-iptc-app .muted { color: var(--muted); } #ps-iptc-app .small { font-size: 13px; }
#ps-iptc-app button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; margin: 0; border-radius: 0; box-shadow: none; text-transform: none; letter-spacing: normal; line-height: normal; }
#ps-iptc-app button:disabled { opacity: .4; cursor: default; }
#ps-iptc-app :focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }
#ps-iptc-app .btn, #ps-iptc-app a.btn { display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 14px; border-radius: 8px; font-size: 14px; font-weight: 500; white-space: nowrap; text-decoration: none; }
#ps-iptc-app .btn.dark { background: var(--btn); color: var(--btn-ink); }
#ps-iptc-app .btn.line { box-shadow: inset 0 0 0 1px var(--line); color: var(--text); }
#ps-iptc-app .btn.line:hover { background: var(--soft); }
#ps-iptc-app .link { color: var(--muted); font-size: 14px; text-decoration: none; } #ps-iptc-app .link:hover { color: var(--text); }
#ps-iptc-app input, #ps-iptc-app textarea, #ps-iptc-app select { width: 100%; margin: 0; font: inherit; font-size: 14px; line-height: 1.4; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; box-shadow: none; }
#ps-iptc-app input:focus, #ps-iptc-app textarea:focus, #ps-iptc-app select:focus { outline: none; border-color: var(--text); }
#ps-iptc-app textarea { resize: vertical; line-height: 1.5; }
#ps-iptc-app ::placeholder { color: var(--faint); }
#ps-iptc-app label.f { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 400; }
#ps-iptc-app .code { font: 11px var(--mono); color: var(--faint); }
#ps-iptc-app .count.bad { color: var(--err); }
#ps-iptc-app img { margin: 0; max-width: 100%; }

/* en-tete */
#ps-iptc-app .top { position: sticky; top: var(--sticky-top); z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
#ps-iptc-app .top .in { max-width: 920px; margin: 0 auto; padding-inline: 24px; height: 56px; display: flex; align-items: center; gap: 24px; }
#ps-iptc-app .brand { font-weight: 600; font-size: 15px; margin-right: auto; }
#ps-iptc-app .brand span { color: var(--muted); font-weight: 400; }
#ps-iptc-app .tabs { display: flex; gap: 20px; }
#ps-iptc-app .tabs button { color: var(--muted); font-size: 14px; height: 56px; position: relative; }
#ps-iptc-app .tabs button.active { color: var(--text); }
#ps-iptc-app .tabs button.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--text); }
#ps-iptc-app .balance { font-size: 14px; color: var(--muted); white-space: nowrap; }
#ps-iptc-app .balance b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* page */
#ps-iptc-app .page { max-width: 920px; margin: 0 auto; padding-block: 40px 96px; padding-inline: 24px; display: grid; gap: 32px; }
#ps-iptc-app .intro h1, #ps-iptc-app .intro .h1 { font-size: 28px; }
#ps-iptc-app .intro p { margin: 6px 0 0; color: var(--muted); max-width: 62ch; }
#ps-iptc-app .intro p b { color: var(--text); }
#ps-iptc-app section.step { display: grid; gap: 10px; margin: 0; padding: 0; }
#ps-iptc-app .step h2 { font-size: 15px; }
#ps-iptc-app .step .hint { font-size: 13px; color: var(--muted); margin: -4px 0 0; }
#ps-iptc-app .seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 10px; background: var(--soft); justify-self: start; }
#ps-iptc-app .seg button { height: 32px; padding: 0 14px; border-radius: 7px; font-size: 14px; color: var(--muted); }
#ps-iptc-app .seg button[aria-pressed="true"] { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); }
#ps-iptc-app .drop { display: grid; gap: 14px; justify-items: center; border: 1px dashed var(--line); border-radius: 10px; padding: 26px 16px; text-align: center; color: var(--muted); font-size: 14px; cursor: pointer; }
#ps-iptc-app .drop:hover, #ps-iptc-app .drop.over { border-color: var(--text); color: var(--text); }
#ps-iptc-app .drop b { color: var(--text); font-weight: 500; }
#ps-iptc-app .drop .actions { justify-content: center; }
#ps-iptc-app .drop .check { margin-left: 6px; }
#ps-iptc-app .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
#ps-iptc-app .progress { height: 2px; background: var(--line); overflow: hidden; flex-basis: 100%; }
#ps-iptc-app .progress i { display: block; height: 100%; width: 0; background: var(--text); transition: width .3s; }

/* liste des photos */
#ps-iptc-app .list-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
#ps-iptc-app .list-head h2 { font-size: 15px; margin-right: auto; }
#ps-iptc-app .stats { font-size: 13px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
#ps-iptc-app .stats b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
#ps-iptc-app .rows { display: grid; }
#ps-iptc-app .prow { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 6px; border-bottom: 1px solid var(--line); text-align: left; width: 100%; border-radius: 6px; }
#ps-iptc-app .prow:hover { background: var(--soft); }
#ps-iptc-app .prow img { width: 84px; height: 56px; object-fit: cover; border-radius: 4px; display: block; background: var(--soft); }
#ps-iptc-app .prow .meta { min-width: 0; display: grid; gap: 2px; }
#ps-iptc-app .prow .name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ps-iptc-app .prow .why { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ps-iptc-app .prow .others { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
#ps-iptc-app .prow .others .on { color: var(--ok); }
#ps-iptc-app .prow .note { font-size: 12px; color: var(--muted); }
#ps-iptc-app .score { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
#ps-iptc-app .score::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
#ps-iptc-app .score.ok { color: var(--ok); } #ps-iptc-app .score.mid { color: var(--warn); } #ps-iptc-app .score.bad { color: var(--err); }
#ps-iptc-app .empty { padding: 28px 0; color: var(--muted); font-size: 14px; }

/* panneau photo */
#ps-iptc-app dialog#detail { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(720px, 100vw); max-width: 100vw; border: 0; border-left: 1px solid var(--line); padding: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); }
#ps-iptc-app dialog::backdrop { background: rgba(0,0,0,.2); }
#ps-iptc-app .pbar { position: sticky; top: 0; z-index: 2; background: var(--bg); display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 24px; border-bottom: 1px solid var(--line); }
#ps-iptc-app .pbar h2 { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ps-iptc-app .pbody { padding: 24px 24px 64px; display: grid; gap: 24px; }
#ps-iptc-app .pbody img.main { width: 100%; max-height: 300px; object-fit: contain; background: var(--soft); border-radius: 8px; display: block; }
#ps-iptc-app .verdict { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#ps-iptc-app .verdict .score { font-size: 15px; }
#ps-iptc-app .gen { display: grid; gap: 10px; }
#ps-iptc-app .notice { font-size: 14px; padding: 12px 14px; border-radius: 8px; background: var(--warn-bg); }
#ps-iptc-app .notice ul { margin: 4px 0 0; padding-left: 18px; }
#ps-iptc-app .notice.err { background: var(--err-bg); }
#ps-iptc-app .notice.soft { background: var(--soft); color: var(--muted); }
#ps-iptc-app .notice .actions { margin-top: 8px; }
#ps-iptc-app .findings { list-style: none; margin: 0; padding: 0; display: grid; }
#ps-iptc-app .findings li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 8px; padding: 8px 0; margin: 0; border-bottom: 1px solid var(--line); font-size: 14px; overflow-wrap: anywhere; }
#ps-iptc-app .findings li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; margin-top: 8px; background: currentColor; }
#ps-iptc-app .findings .error::before { color: var(--err); } #ps-iptc-app .findings .warn::before { color: var(--warn); } #ps-iptc-app .findings .ok::before { color: var(--ok); }
#ps-iptc-app .findings .ok { color: var(--muted); }
#ps-iptc-app .findings .detail { font-size: 13px; color: var(--muted); }
#ps-iptc-app .findings code { font: 12.5px var(--mono); color: var(--text); background: var(--soft); padding: 1px 5px; border-radius: 4px; }
#ps-iptc-app details.okrules summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 8px 0; }
#ps-iptc-app .fields { display: grid; gap: 14px; margin: 0; }
#ps-iptc-app .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#ps-iptc-app .loc { display: grid; grid-template-columns: 1fr 1fr 1fr 80px; gap: 8px; }
#ps-iptc-app .live { font-size: 13px; color: var(--muted); min-height: 1.4em; margin: 0; }

/* credits */
#ps-iptc-app .packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
#ps-iptc-app .pack { border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: grid; gap: 4px; align-content: start; }
#ps-iptc-app .pack.best { border-color: var(--text); }
#ps-iptc-app .pack .name { font-size: 14px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
#ps-iptc-app .pack .qty { font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
#ps-iptc-app .pack .price { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
#ps-iptc-app .facts { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
#ps-iptc-app .facts li { margin: 0; }
#ps-iptc-app .history { list-style: none; margin: 0; padding: 0; font-size: 14px; }
#ps-iptc-app .history li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; margin: 0; border-bottom: 1px solid var(--line); }
#ps-iptc-app .history .plus { color: var(--ok); font-variant-numeric: tabular-nums; } #ps-iptc-app .history .minus { color: var(--err); font-variant-numeric: tabular-nums; }
#ps-iptc-app details.faq { border-bottom: 1px solid var(--line); }
#ps-iptc-app details.faq summary { cursor: pointer; padding: 12px 0; font-size: 14px; font-weight: 500; }
#ps-iptc-app details.faq p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
#ps-iptc-app .pform { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0; }

/* etape Redaction IA */
#ps-iptc-app .steps { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
#ps-iptc-app .steps ol { display: flex; gap: 16px; list-style: none; margin: 0; padding: 0; }
#ps-iptc-app .steps li { margin: 0; } #ps-iptc-app .steps li.on { color: var(--text); font-weight: 500; }
#ps-iptc-app .steps .link { margin-left: auto; }
#ps-iptc-app input[type="checkbox"] { width: 16px; height: 16px; padding: 0; margin: 0; border-radius: 4px; accent-color: var(--text); flex: none; }
#ps-iptc-app label.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); cursor: pointer; }
#ps-iptc-app .airow { display: grid; grid-template-columns: 16px 64px minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 12px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--line); }
#ps-iptc-app .airow img { width: 64px; height: 44px; object-fit: cover; border-radius: 4px; display: block; background: var(--soft); }
#ps-iptc-app .airow .meta { min-width: 0; display: grid; gap: 2px; }
#ps-iptc-app .airow .name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ps-iptc-app .airow .state { font-size: 12px; color: var(--muted); }
#ps-iptc-app .airow .btn { height: 32px; padding: 0 12px; }
#ps-iptc-app .airow.off img, #ps-iptc-app .airow.off .meta { opacity: .45; }
#ps-iptc-app .cost { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 14px; }
#ps-iptc-app .cost b { font-weight: 600; font-variant-numeric: tabular-nums; }
#ps-iptc-app .cost.bad b { color: var(--err); }
#ps-iptc-app .cost .actions { margin-left: auto; }

#ps-iptc-app dialog#confirm-gen, #ps-iptc-app dialog#confirm-write { border: 1px solid var(--line); border-radius: 12px; padding: 0; background: var(--bg); color: var(--text); width: min(440px, calc(100vw - 32px)); font: 15px/1.55 var(--font); }
#ps-iptc-app .confirm { display: grid; gap: 16px; padding: 22px; font-size: 14px; }
#ps-iptc-app .confirm h2 { font-size: 16px; }
#ps-iptc-app .confirm p { color: var(--muted); }
#ps-iptc-app .toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--btn); color: var(--btn-ink); padding: 10px 16px; border-radius: 8px; z-index: 60; max-width: calc(100vw - 32px); font-size: 14px; }

@media (max-width: 720px) {
  #ps-iptc-app .top .in { padding-inline: 16px; gap: 14px; height: auto; flex-wrap: wrap; padding-block: 10px 0; }
  #ps-iptc-app .brand { flex-basis: 100%; } #ps-iptc-app .tabs button { height: 40px; } #ps-iptc-app .balance, #ps-iptc-app #login-top { margin-left: auto; }
  #ps-iptc-app .page { padding-inline: 16px; padding-top: 28px; }
  #ps-iptc-app .prow { grid-template-columns: 64px minmax(0, 1fr); } #ps-iptc-app .prow img { width: 64px; height: 44px; } #ps-iptc-app .prow .score { grid-column: 2; }
  #ps-iptc-app .pbar, #ps-iptc-app .pbody { padding-inline: 16px; }
  #ps-iptc-app .airow { grid-template-columns: 16px 64px minmax(0, 1fr); } #ps-iptc-app .airow input[type="text"], #ps-iptc-app .airow .btn { grid-column: 2 / -1; }
  #ps-iptc-app .cost .actions { margin-left: 0; flex-basis: 100%; }
  #ps-iptc-app .packs, #ps-iptc-app .row2, #ps-iptc-app .pform { grid-template-columns: minmax(0, 1fr); } #ps-iptc-app .loc { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { #ps-iptc-app * { transition: none !important; } }
