/* ===== Deepfake detection (Fabio, 11/11: same functions, spaces and archive organized better) =====
   Layout: analyzer panel on the left (sticky), archive of the analyses on the right.
   Radii: 8 controls, 16 panels, 999 pills. Border OR shadow. Numbers in JetBrains Mono.
   State colours only for outcomes. Motion power3-out. */
.df { --df-ease: cubic-bezier(.215, .61, .355, 1); --df-line: var(--ts-border-default, #e2e8ee); --df-soft: #eef1f5; }
.df code { font-family: "JetBrains Mono", monospace; }

.df-back { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-bottom: 4px; font: 600 14px/20px "DM Sans", sans-serif; color: var(--ts-text-link, #0068d9); text-decoration: none; }
.df-back:hover { text-decoration: underline; }
.df-back .hv3-ic { width: 16px; height: 16px; color: currentColor; }

/* Centred column: the analyzer in the middle, recent analyses below (archive page: wider column) */
.df-col { width: 100%; max-width: 760px; margin: 0 auto; }
.df-col.is-wide { max-width: 1040px; }
.df-col > .df-head { text-align: center; }
.df-col.is-wide .df-head { text-align: left; }

/* ---------- Analyzer ---------- */
.df-tool { display: flex; margin-top: 28px; flex-direction: column; border-radius: 16px; border: 1px solid var(--df-line); background: #fff; overflow: hidden; }
.df-zone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 12px; padding: 48px 24px 44px; border-radius: 8px; text-align: center; cursor: pointer;
  border: 1px dashed rgba(0, 122, 254, 0.4); background: radial-gradient(ellipse 80% 110% at 50% 0%, rgba(0, 122, 254, 0.07) 0%, transparent 70%), #fbfdff;
  transition: border-color .35s var(--df-ease), background-color .35s var(--df-ease); }
.df-zone[hidden] { display: none; }
.df-zone:hover, .df-zone.is-over { border-color: #007afe; transition-duration: .5s; }
.df-zone.is-over { background-color: #f2f8ff; }
.df-zone:focus-within { outline: 2px solid var(--ts-focus-ring, #0068d9); outline-offset: 2px; }
.df-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.df-zone-ic { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 4px; border-radius: 999px; background: #eef5ff; }
.df-zone-ic .hv3-ic { width: 20px; height: 20px; color: #007afe; }
.df-zone > b { font: 600 15px/22px "DM Sans", sans-serif; color: var(--ts-text-primary); }
.df-zone-or { font: 400 13px/18px "DM Sans", sans-serif; color: var(--ts-text-muted, #6b7280); }
.df-zone-btn { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 8px; background: var(--ts-interactive-primary, #007afe); color: #fff; font: 600 14px/20px "DM Sans", sans-serif; }

.df-progress { display: flex; align-items: center; gap: 14px; margin: 12px; padding: 28px 16px; border-radius: 8px; background: #f8fafc; }
.df-progress[hidden] { display: none; }
.df-progress-t { min-width: 0; }
.df-progress b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 14px/20px "DM Sans", sans-serif; color: var(--ts-text-primary); }
.df-progress small { font: 400 13px/18px "DM Sans", sans-serif; color: var(--ts-text-muted, #6b7280); }
.df-spin { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 999px; border: 3px solid #e6efff; border-top-color: #007afe; animation: df-spin .9s linear infinite; }
@keyframes df-spin { to { transform: rotate(360deg); } }

.df-res { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 24px 24px 20px; animation: df-rise .45s var(--df-ease) both; }
.df-res[hidden] { display: none; }
.df-k { font: 500 12px/16px "DM Sans", sans-serif; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ts-text-muted, #6b7280); }
.df-r-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 18px; color: var(--ts-text-secondary); }
.df-split { display: flex; gap: 3px; width: 100%; height: 10px; margin-top: 4px; }
.df-split i { display: block; height: 100%; border-radius: 999px; }
.df-split-l { display: flex; justify-content: space-between; width: 100%; font: 500 13px/18px "DM Sans", sans-serif; color: var(--ts-text-secondary); }
.df-split-l span { display: inline-flex; align-items: center; gap: 6px; }
.df-split-l i { width: 8px; height: 8px; border-radius: 999px; }
.df-split-l code { font-size: 13px; line-height: 18px; color: var(--ts-text-primary); }
.df i.is-ai { background: #d64545; } .df i.is-ok { background: #1f9d5c; }
.df-res-text { margin: 0; font: 400 14px/20px "DM Sans", sans-serif; color: var(--ts-text-secondary); }
.df-btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 14px; border: 1px solid var(--df-line); border-radius: 8px; background: #fff;
  font: 600 14px/20px "DM Sans", sans-serif; color: var(--ts-text-primary); cursor: pointer; transition: border-color .35s var(--df-ease); }
.df-btn:hover { border-color: rgba(0, 122, 254, 0.45); transition-duration: .5s; }
.df-btn.is-sm { height: 36px; font-size: 13px; }
.df-again { margin-top: 4px; }

.df-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--df-soft); }
.df-facts[hidden] { display: none; }
.df-facts > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 20px; }
.df-facts > div + div { border-left: 1px solid var(--df-soft); }
.df-facts dt { font: 500 13px/18px "DM Sans", sans-serif; color: var(--ts-text-muted, #6b7280); }
.df-facts dd { display: inline-flex; align-items: center; gap: 6px; margin: 0; font: 500 13px/18px "DM Sans", sans-serif; color: var(--ts-text-secondary); }
.df-facts dd b { font: 500 13px/18px "JetBrains Mono", monospace; color: var(--ts-text-primary); }
.df-coin { width: 16px; height: 16px; background: url(assets/credit-coin.png) center / contain no-repeat; align-self: center; }

.df-about { border-top: 1px solid var(--df-soft); }
.df-about-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 48px; padding: 0 20px; border: 0; background: none; cursor: pointer;
  font: 600 14px/20px "DM Sans", sans-serif; color: var(--ts-text-primary); text-align: left; }
.df-about-btn:hover { color: var(--ts-text-link, #0068d9); }
.df-about-btn:focus-visible { outline: 2px solid var(--ts-focus-ring, #0068d9); outline-offset: -2px; }
.df-about-btn svg { width: 18px; height: 18px; color: var(--ts-text-muted, #6b7280); transition: transform .35s var(--df-ease); }
.df-about-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.df-disc { padding: 0 20px 18px; animation: df-rise .35s var(--df-ease) both; }
.df-disc[hidden] { display: none; }
.df-disc p { margin: 0; font: 400 13px/19px "DM Sans", sans-serif; color: var(--ts-text-secondary); }
.df-disc p + p { margin-top: 8px; }
.df-disc a { color: var(--ts-text-link, #0068d9); font-weight: 600; }

/* ---------- Verdict pill (outcome colours) ---------- */
.df-verdict { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font: 600 12px/20px "DM Sans", sans-serif; white-space: nowrap; }
.df-verdict-lg { padding: 6px 14px; font-size: 16px; line-height: 22px; }
.df-dot { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.df-verdict.is-ok { background: var(--ts-state-success-bg, #e8f7ee); color: var(--ts-state-success, #157f3b); }
.df-verdict.is-ai { background: var(--ts-state-error-bg, #fdecec); color: var(--ts-state-error, #b42318); }
.df-verdict.is-unk { background: var(--ts-state-warning-bg, #fff4e0); color: #9a5b00; }
.df-dot.is-ok { background: #1f9d5c; } .df-dot.is-ai { background: #d64545; } .df-dot.is-unk { background: #d08a00; }

/* ---------- Recent analyses (analyzer page) ---------- */
.df-recent { margin-top: 40px; }
.df-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.df-sec-head h2 { margin: 0; font: 700 20px/26px Raleway, sans-serif; color: var(--ts-text-primary); }
.df-all { display: inline-flex; align-items: center; gap: 6px; font: 600 14px/20px "DM Sans", sans-serif; color: var(--ts-text-link, #0068d9); text-decoration: none; white-space: nowrap; }
.df-all[hidden] { display: none; }
.df-all code { padding: 0 6px; border-radius: 999px; background: #eef5ff; font-size: 12px; line-height: 18px; font-weight: 500; }
.df-all svg { width: 16px; height: 16px; transition: transform .35s var(--df-ease); }
.df-all:hover svg { transform: translateX(3px); transition-duration: .5s; }
.df-all:focus-visible { outline: 2px solid var(--ts-focus-ring, #0068d9); outline-offset: 2px; border-radius: 4px; }
.df-when { font: 500 13px/18px "DM Sans", sans-serif; color: var(--ts-text-muted, #6b7280); white-space: nowrap; }
.df-when code { margin-left: 4px; }

/* ---------- Archive page ---------- */
.df-arc { min-width: 0; margin-top: 28px; }
.df-arc-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.df-arc-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.df-arc-bar .df-tabs { margin: 0; }
.df-btn.is-primary { gap: 8px; border: 0; background: var(--ts-interactive-primary, #007afe); color: #fff; text-decoration: none; }
.df-btn.is-primary:hover { background: #0068d9; }
.df-btn svg { width: 16px; height: 16px; }
.df-search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--ts-border-input, #d5dce4); background: #fff; width: min(280px, 100%);
  transition: border-color .35s var(--df-ease), box-shadow .35s var(--df-ease); }
.df-search:focus-within { border-color: #007afe; box-shadow: 0 0 0 3px rgba(0, 122, 254, 0.12); }
.df-search svg { flex: 0 0 auto; width: 16px; height: 16px; color: var(--ts-text-muted, #6b7280); }
.df-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: 400 14px/20px "DM Sans", sans-serif; color: var(--ts-text-primary); }

.df-tabs { display: flex; gap: 8px; margin: 16px 0 12px; overflow-x: auto; scrollbar-width: none; }
.df-tabs::-webkit-scrollbar { display: none; }
.df-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--df-line); border-radius: 999px; background: #fff; cursor: pointer;
  font: 600 13px/18px "DM Sans", sans-serif; color: var(--ts-text-secondary); transition: border-color .35s var(--df-ease), background-color .35s var(--df-ease), color .35s var(--df-ease); }
.df-tab:hover { border-color: rgba(0, 122, 254, 0.45); color: var(--ts-text-primary); transition-duration: .5s; }
.df-tab code { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ts-text-muted, #6b7280); }
.df-tab.is-on { border-color: #0a1a33; background: #0a1a33; color: #fff; }
.df-tab.is-on code { color: rgba(255, 255, 255, 0.72); }
.df-tab:focus-visible { outline: 2px solid var(--ts-focus-ring, #0068d9); outline-offset: 2px; }

.df-list { border-radius: 16px; border: 1px solid var(--df-line); background: #fff; overflow: hidden; }
.df-group + .df-group { border-top: 1px solid var(--df-line); }
.df-day { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 20px; background: #f8fafc; border-bottom: 1px solid var(--df-soft);
  font: 600 12px/16px "DM Sans", sans-serif; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ts-text-muted, #6b7280); }
.df-day code { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0; color: var(--ts-text-muted, #6b7280); }
.df-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) 150px 56px 44px; align-items: center; gap: 14px; min-height: 64px; padding: 10px 12px 10px 20px;
  transition: background-color .35s var(--df-ease), opacity .28s var(--df-ease), transform .28s var(--df-ease); }
.df-row.has-day { grid-template-columns: 36px minmax(0, 1fr) 150px 120px 44px; }
.df-row + .df-row { border-top: 1px solid var(--df-soft); }
.df-row:hover { background: #fbfdff; }
.df-row.is-fresh { animation: df-fresh 1.6s var(--df-ease) both; }
.df-row.is-leaving { opacity: 0; transform: translateX(12px); }
.df-row.is-confirm { grid-template-columns: 36px minmax(0, 1fr) auto; background: #fff8f8; }
.df-row.is-confirm .df-res-cell, .df-row.is-confirm .df-time { display: none; }
@keyframes df-fresh { from { background-color: #eef5ff; } to { background-color: transparent; } }
@keyframes df-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.df-type { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: #f1f6fd; }
.df-type .hv3-ic { width: 18px; height: 18px; color: #007afe; }
.df-file { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.df-file b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 14px/20px "DM Sans", sans-serif; color: var(--ts-text-primary); }
.df-file small { font: 400 12px/16px "DM Sans", sans-serif; color: var(--ts-text-muted, #6b7280); }
.df-file small code { font-size: 11px; line-height: 16px; }
.df-time code { font-size: 13px; line-height: 18px; color: var(--ts-text-secondary); }
.df-act { display: flex; justify-content: flex-end; }
.df-del { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--ts-text-muted, #6b7280);
  transition: background-color .35s var(--df-ease), color .35s var(--df-ease); }
.df-del svg { width: 16px; height: 16px; }
.df-del:hover { background: #fdecec; color: var(--ts-state-error, #b42318); }
.df-del:focus-visible { outline: 2px solid var(--ts-focus-ring, #0068d9); outline-offset: 1px; }
.df-confirm { display: inline-flex; align-items: center; gap: 8px; font: 600 13px/18px "DM Sans", sans-serif; color: var(--ts-text-primary); white-space: nowrap; animation: df-rise .3s var(--df-ease) both; }
.df-confirm button { height: 32px; padding: 0 12px; border-radius: 8px; font: 600 13px/18px "DM Sans", sans-serif; cursor: pointer; }
.df-confirm-yes { border: 0; background: var(--ts-state-error, #b42318); color: #fff; }
.df-confirm-no { border: 1px solid var(--df-line); background: #fff; color: var(--ts-text-primary); }
.df-confirm button:focus-visible { outline: 2px solid var(--ts-focus-ring, #0068d9); outline-offset: 2px; }

.df-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 20px; text-align: center; }
.df-empty b { font: 600 15px/22px "DM Sans", sans-serif; color: var(--ts-text-primary); }
.df-empty span { font: 400 14px/20px "DM Sans", sans-serif; color: var(--ts-text-muted, #6b7280); }
.df-empty .df-btn { margin-top: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 699px) {
  .df-zone { padding: 32px 16px 28px; }
  .df-facts { grid-template-columns: minmax(0, 1fr); padding: 4px 20px; }
  .df-facts > div { flex-direction: row; justify-content: space-between; align-items: baseline; padding: 10px 0; }
  .df-facts > div + div { border-left: 0; border-top: 1px solid var(--df-soft); }
  .df-arc-bar { flex-direction: column-reverse; align-items: stretch; }
  .df-arc-top .df-btn { width: 100%; }
  .df-sec-head h2 { font-size: 18px; line-height: 24px; }
  .df-row, .df-row.has-day { grid-template-columns: 36px auto minmax(0, 1fr) 40px; grid-template-areas: "t f f a" "t r m a"; gap: 6px 10px; padding: 12px 8px 12px 14px; }
  .df-type { grid-area: t; align-self: start; }
  .df-file { grid-area: f; }
  .df-res-cell { grid-area: r; }
  .df-time { grid-area: m; }
  .df-time code { font-size: 12px; }
  .df-act { grid-area: a; }
  .df-row.is-confirm { grid-template-columns: 36px minmax(0, 1fr); grid-template-areas: "t f" "a a"; }
  .df-row.is-confirm .df-act { justify-content: flex-start; padding-top: 4px; }
  .df-day { padding: 0 14px; }
  .df-search { width: 100%; }
  .df-tabs { flex-wrap: wrap; overflow: visible; }
}
@media (prefers-reduced-motion: reduce) {
  .df-spin { animation-duration: 3s; }
  .df-res, .df-disc, .df-confirm, .df-row.is-fresh { animation: none; }
  .df-row, .df-tab, .df-zone, .df-about-btn svg { transition: none; }
}
