:root {
  color-scheme: light;
  --ink: #14213d;
  --muted: #5f6b7a;
  --paper: #f6f3ec;
  --surface: #fffdf7;
  --line: #d9d4c7;
  --accent: #ee6c4d;
  --accent-dark: #ba3f25;
  --navy: #1d3557;
  --real: #18794e;
  --fake: #b42318;
  --unknown: #8a5a00;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(238, 108, 77, 0.16), transparent 28rem),
    linear-gradient(140deg, var(--paper), #e9eef3);
}

main { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 64px 0; }
.hero { max-width: 760px; margin-bottom: 36px; }
.eyebrow { margin: 0 0 10px; color: var(--accent-dark); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
h1 { max-width: 680px; margin: 0; font-family: Georgia, serif; font-size: clamp(2.5rem, 7vw, 5.2rem); font-weight: 500; line-height: 0.98; letter-spacing: -0.045em; }
.intro { max-width: 650px; margin: 24px 0 0; color: var(--muted); font-size: 1.1rem; line-height: 1.65; }
.workspace { display: grid; grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr); min-height: 660px; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 30px 80px rgba(29, 53, 87, 0.12); }
.upload-panel, .status-panel { min-width: 0; padding: clamp(24px, 4vw, 44px); }
.upload-panel { display: flex; flex-direction: column; }
.status-panel { display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--navy); color: #fff; }
h2 { margin: 0 0 22px; font-family: Georgia, serif; font-size: 1.8rem; font-weight: 500; }
.drop-zone { position: relative; display: grid; flex: 1; place-items: center; align-content: center; gap: 12px; min-height: 410px; padding: 28px 20px; border: 2px dashed #a7afba; border-radius: 18px; text-align: center; transition: 150ms ease; cursor: pointer; }
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone[data-dragging="true"] { border-color: var(--accent); background: #fff4ef; outline: none; }
.drop-zone[data-disabled="true"] { border-color: #8b95a3; background: #edf0f3; cursor: wait; opacity: 0.72; pointer-events: none; }
.drop-zone[data-disabled="true"]::after { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 16px; background: rgba(237, 240, 243, 0.92); color: var(--navy); content: "Analyse en cours…"; font-weight: 800; }
.drop-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: white; font-size: 1.8rem; }
button { min-height: 44px; padding: 10px 18px; border: 0; border-radius: 999px; font: inherit; font-weight: 750; cursor: pointer; }
button:focus-visible { outline: 3px solid #79b8ff; outline-offset: 2px; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.secondary { border: 1px solid var(--line); background: transparent; color: inherit; }
.help, .validation { color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
.validation[data-valid="true"] { color: var(--real); }
.validation[data-valid="false"] { color: var(--fake); }
.preview { display: grid; grid-template-columns: minmax(180px, 1fr); align-items: center; gap: 16px; margin: 0 0 28px; }
.preview:empty { display: none; }
.preview img { width: 100%; height: clamp(220px, 34vw, 360px); object-fit: contain; border: 1px solid rgba(255,255,255,0.18); border-radius: 16px; background: rgba(255,255,255,0.06); }
.preview audio { width: 100%; grid-column: 1 / -1; }
.file-summary { display: grid; gap: 5px; overflow-wrap: anywhere; }
.file-summary span { color: var(--muted); font-size: 0.85rem; }
.status-panel .file-summary { color: #fff; }
.status-panel .file-summary span { color: #b8c7d9; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.status { min-height: 52px; margin: 18px 0 30px; font-size: 1.15rem; line-height: 1.5; }
.status[data-state="error"] { color: #ffb4ab; }
.verdict { margin: 0; font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.05; }
.result[data-tone="real"] .verdict { color: #72d6aa; }
.result[data-tone="fake"] .verdict { color: #ff9b8f; }
.result[data-tone="unknown"] .verdict { color: #ffd27b; }
.metrics { display: grid; gap: 8px; margin: 20px 0; color: #dbe7f4; }
.details { margin: 20px 0; }
.details div { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 11px 0; border-top: 1px solid rgba(255,255,255,0.18); }
.details dt { color: #b8c7d9; }
.details dd { margin: 0; text-align: right; }
.details .web-detection { grid-template-columns: 1fr; }
.web-detection dd { margin: 0; text-align: left; }
.web-detection ul { display: grid; gap: 10px; margin: 0; padding-left: 20px; }
.web-detection a { color: #a9d7ff; overflow-wrap: anywhere; text-underline-offset: 3px; }
.web-detection a:hover { color: #fff; }
.json-panel { margin-top: 20px; }
.json-panel summary { cursor: pointer; color: #dbe7f4; }
pre { max-height: 300px; overflow: auto; padding: 14px; border-radius: 10px; background: rgba(0,0,0,0.22); color: #eaf2fa; font-size: 0.78rem; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 780px) {
  main { padding: 38px 0; }
  .workspace { grid-template-columns: 1fr; min-height: 0; }
  .status-panel { border-top: 1px solid var(--line); border-left: 0; }
  .drop-zone { min-height: 300px; }
  .preview img { height: min(70vw, 360px); }
}

@media (max-width: 480px) {
  main { width: min(100% - 20px, 1120px); }
  .upload-panel, .status-panel { padding: 22px 18px; }
  .actions button { width: 100%; }
}
