/* AI Detector widget (embed/ai-detector.html). Self-contained: the page loads no other stylesheet,
   because it sits inside other people's sites and has to look the same everywhere. */
:root {
  --dte-bg: #ffffff; --dte-card: #f7f9f7; --dte-ink: #17211b; --dte-text: #344039; --dte-muted: #526057;
  --dte-line: #d9e1dc; --dte-brand: #137a3d; --dte-brand-dark: #0e6230; --dte-focus: #2563eb;
  --dte-low: #137a3d; --dte-low-soft: #dff2e5; --dte-med: #8a5300; --dte-med-soft: #fff1cc; --dte-high: #b42318; --dte-high-soft: #fbe0dc;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --dte-bg: #121815; --dte-card: #1a221e; --dte-ink: #eef3f0; --dte-text: #d3ddd7; --dte-muted: #9fb0a6;
    --dte-line: #2e3a34; --dte-brand: #34b26a; --dte-brand-dark: #2a9a59; --dte-focus: #7aa7ff;
    --dte-low: #5fd08f; --dte-low-soft: #173a26; --dte-med: #f0b54f; --dte-med-soft: #3d2f12; --dte-high: #ff8a7a; --dte-high-soft: #4a1d18;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --dte-bg: #121815; --dte-card: #1a221e; --dte-ink: #eef3f0; --dte-text: #d3ddd7; --dte-muted: #9fb0a6;
  --dte-line: #2e3a34; --dte-brand: #34b26a; --dte-brand-dark: #2a9a59; --dte-focus: #7aa7ff;
  --dte-low: #5fd08f; --dte-low-soft: #173a26; --dte-med: #f0b54f; --dte-med-soft: #3d2f12; --dte-high: #ff8a7a; --dte-high-soft: #4a1d18;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.dte { background: var(--dte-bg); color: var(--dte-text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--dte-brand); }
a:focus-visible, button:focus-visible, textarea:focus-visible { outline: 2px solid var(--dte-focus); outline-offset: 2px; }
.dte-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dte-app { display: flex; flex-direction: column; height: 100%; min-height: 360px; padding: 12px; gap: 10px; }
.dte-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.dte-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--dte-ink); font-weight: 700; text-decoration: none; font-size: 16px; }
.dte-brand img { border-radius: 5px; }
.dte-by { color: var(--dte-muted); font-size: 13px; }
.dte-input, .dte-result { flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.dte-input[hidden], .dte-result[hidden] { display: none; }
#dteText { flex: 1 1 auto; min-height: 160px; width: 100%; resize: none; padding: 12px; border: 1px solid var(--dte-line); border-radius: 10px; background: var(--dte-card); color: var(--dte-ink); font: inherit; }
#dteText::placeholder { color: var(--dte-muted); }
.dte-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.dte-actions { display: inline-flex; gap: 8px; }
.dte-count { color: var(--dte-muted); font-size: 13px; }
.dte-count.is-over { color: var(--dte-high); }
.dte-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid transparent; font: 600 14px/1 inherit; font-family: inherit; cursor: pointer; text-decoration: none; }
.dte-primary { background: var(--dte-brand); color: #fff; }
.dte-primary:hover { background: var(--dte-brand-dark); }
.dte-primary:disabled { opacity: .7; cursor: progress; }
.dte-ghost { background: transparent; color: var(--dte-text); border-color: var(--dte-line); }
.dte-note { margin: 0; min-height: 0; color: var(--dte-high); font-size: 13px; }
.dte-note:empty { display: none; }
.dte-result { overflow-x: hidden; overflow-y: auto; }
.dte-hero { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--dte-line); border-radius: 12px; background: var(--dte-card); }
.dte-score { display: flex; flex-direction: column; align-items: center; min-width: 96px; }
.dte-score strong { font-size: 34px; line-height: 1.1; color: var(--dte-ink); }
.dte-score strong.low { color: var(--dte-low); } .dte-score strong.medium { color: var(--dte-med); } .dte-score strong.high { color: var(--dte-high); }
.dte-score span { font-size: 12px; color: var(--dte-muted); }
.dte-verdict { flex: 1; min-width: 0; }
.dte-verdict p { margin: 6px 0 0; font-size: 14px; }
.dte-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; margin-right: 6px; }
.dte-pill.low { background: var(--dte-low-soft); color: var(--dte-low); } .dte-pill.medium { background: var(--dte-med-soft); color: var(--dte-med); } .dte-pill.high { background: var(--dte-high-soft); color: var(--dte-high); }
.dte-conf { font-size: 12px; color: var(--dte-muted); }
.dte-range p { margin: 4px 0 0; font-size: 13px; color: var(--dte-muted); }
.dte-track { position: relative; height: 10px; margin: 0 7px; border-radius: 999px; background: linear-gradient(90deg, var(--dte-low-soft) 0 45%, var(--dte-med-soft) 45% 70%, var(--dte-high-soft) 70% 100%); }
.dte-band { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: color-mix(in srgb, var(--dte-ink) 22%, transparent); }
.dte-dot { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--dte-ink); border: 2px solid var(--dte-bg); }
.dte-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--dte-muted); margin-top: 3px; }
.dte-doc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--dte-ink); }
.dte-legend { color: var(--dte-muted); display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.dte-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 6px; }
.dte-legend i.low, .dte-s.low { background: var(--dte-low-soft); } .dte-legend i.medium, .dte-s.medium { background: var(--dte-med-soft); } .dte-legend i.high, .dte-s.high { background: var(--dte-high-soft); }
.dte-doc { padding: 10px 12px; border: 1px solid var(--dte-line); border-radius: 10px; max-height: 260px; overflow: auto; color: var(--dte-ink); font-size: 14px; line-height: 1.7; }
.dte-s { border-radius: 4px; padding: 1px 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.dte-foot { font-size: 12px; color: var(--dte-muted); }
@media (max-width: 420px) { .dte-hero { flex-direction: column; align-items: flex-start; } .dte-score { align-items: flex-start; } }
