.ai-detector-page { --detector-human: #137a3d; --detector-human-soft: #dff2e5; --detector-human-border: #b8ddc4; --detector-mixed: #b26a00; --detector-mixed-soft: #ffedbd; --detector-mixed-border: #ead083; --detector-mixed-ink: #7b4b0f; --detector-ai: #b42318; --detector-ai-soft: #f8d9d5; --detector-ai-border: #e6aaa2; --detector-neutral: #64736a; }
.ai-detector-page main { background: #fff; }
.detector-command-inner { min-height: 72px; justify-content: flex-start; }
.detector-language-control, .detector-command-controls, .detector-minimum { min-width: 0; display: flex; align-items: center; gap: 8px; }
.detector-language-select { border-color: var(--aiwa-line); }
.detector-language-select select { width: 148px; }
.detector-command-controls { margin-left: auto; }
.detector-minimum { color: var(--aiwa-muted); font-size: 11px; font-weight: 650; white-space: nowrap; }
.detector-minimum .aiwa-ui-icon { width: 16px; height: 16px; opacity: .72; }
.detector-panel { border-color: var(--aiwa-line); }
.detector-editor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detector-editor-grid .editor-pane { min-height: calc(100vh - 64px - 72px - 88px - 18px); display: flex; flex-direction: column; }
.detector-editor-grid .aiwa-textarea { min-height: 0; flex: 1; resize: none; }
.detector-input-status { justify-content: space-between; }
.ai-detector-page #editSourceBtn[hidden] { display: none; }
.ai-detector-page #humanizeBtn[hidden] { display: none; }
.detector-readiness { color: #7b4b0f; font-size: 11px; font-weight: 700; }
.detector-readiness.ready { color: var(--aiwa-brand-dark); }
.detector-evidence-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; min-height: 42px; padding: 8px 28px; border-bottom: 1px solid var(--aiwa-line); background: #fbfcfb; color: var(--aiwa-muted); font-size: 11px; font-weight: 650; }
.detector-evidence-legend[hidden] { display: none; }
.detector-evidence-legend span { display: inline-flex; align-items: center; gap: 5px; }
.detector-evidence-legend i { width: 10px; height: 10px; border-radius: 8px; background: var(--detector-human-soft); box-shadow: inset 0 0 0 1px var(--detector-human-border); }
.detector-evidence-legend .medium i { background: var(--detector-mixed-soft); box-shadow: inset 0 0 0 1px var(--detector-mixed-border); }
.detector-evidence-legend .high i { background: var(--detector-ai-soft); box-shadow: inset 0 0 0 1px var(--detector-ai-border); }
.detector-evidence-legend small { margin-left: auto; color: var(--aiwa-muted); font-size: 10px; font-weight: 600; }
.detector-evidence-document { min-height: 0; flex: 1; overflow: auto; padding: 24px 28px; background: #fff; color: var(--aiwa-text); font-size: 16px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.detector-evidence-document[hidden] { display: none; }
.detector-evidence-sentence { display: inline; margin: 0; padding: 2px 1px; border: 0; border-radius: 8px; background: var(--detector-human-soft); color: inherit; font: inherit; line-height: inherit; text-align: inherit; cursor: pointer; box-decoration-break: clone; -webkit-box-decoration-break: clone; transition: background-color 160ms cubic-bezier(.25,1,.5,1), box-shadow 160ms cubic-bezier(.25,1,.5,1); }
.detector-evidence-sentence.medium { background: var(--detector-mixed-soft); }
.detector-evidence-sentence.high { background: var(--detector-ai-soft); }
.detector-evidence-sentence:hover, .detector-evidence-sentence.active { box-shadow: inset 0 -2px 0 rgba(23,33,27,.34), 0 0 0 1px rgba(23,33,27,.18); }
.detector-evidence-sentence:focus-visible { outline: 2px solid var(--aiwa-focus, #2563eb); outline-offset: 2px; }
.detector-evidence-popover { position: fixed; z-index: 320; width: min(360px, calc(100vw - 24px)); padding: 0; border: 0; border-radius: 16px; background: #fff; color: var(--aiwa-text); box-shadow: 0 8px 24px rgba(23,33,27,.16); opacity: 0; transform: translateY(-4px) scale(.985); transition: opacity 180ms cubic-bezier(.25,1,.5,1), transform 180ms cubic-bezier(.25,1,.5,1); }
.detector-evidence-popover[hidden] { display: none; }
.detector-evidence-popover.is-open { opacity: 1; transform: translateY(0) scale(1); }
.detector-evidence-popover[data-placement="above"] { transform-origin: bottom center; }
.detector-evidence-popover[data-placement="below"] { transform-origin: top center; }
.detector-evidence-popover-head { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 8px 7px 15px; border-bottom: 1px solid var(--aiwa-line); }
.detector-evidence-identity { min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.detector-evidence-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--detector-human); }
.detector-evidence-popover[data-level="medium"] .detector-evidence-dot { background: var(--detector-mixed); }
.detector-evidence-popover[data-level="high"] .detector-evidence-dot { background: var(--detector-ai); }
.detector-evidence-close { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.detector-evidence-close:hover { background: #eef2ef; }
.detector-evidence-close:focus-visible, .detector-evidence-nav:focus-visible { outline: 2px solid var(--aiwa-focus, #2563eb); outline-offset: 2px; }
.detector-evidence-close .aiwa-ui-icon { width: 14px; height: 14px; }
.detector-evidence-score-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 15px 0; }
.detector-evidence-title { font-size: 14px; line-height: 1.35; }
.detector-evidence-score { flex: 0 0 auto; padding: 5px 8px; border-radius: 8px; background: #eef2ef; color: var(--aiwa-text); font-size: 11px; font-weight: 750; font-variant-numeric: tabular-nums; }
.detector-evidence-popover[data-level="medium"] .detector-evidence-score { background: var(--detector-mixed-soft); color: var(--detector-mixed-ink); }
.detector-evidence-popover[data-level="high"] .detector-evidence-score { background: var(--detector-ai-soft); color: var(--detector-ai); }
.detector-evidence-question { margin: 10px 15px 7px; color: var(--aiwa-muted); font-size: 11px; line-height: 1.45; }
.detector-evidence-reasons { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 15px; }
.detector-evidence-reasons span { padding: 6px 9px; border-radius: 8px; background: #f1f4f2; color: #34423a; font-size: 11px; font-weight: 650; }
.detector-evidence-caution { margin: 12px 15px 14px; color: var(--aiwa-muted); font-size: 10px; line-height: 1.5; }
.detector-evidence-footer { min-height: 46px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 6px 8px; border-top: 1px solid var(--aiwa-line); }
.detector-evidence-position { color: var(--aiwa-muted); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.detector-evidence-nav { min-height: 34px; padding: 6px 9px; border: 0; border-radius: 8px; background: transparent; color: var(--aiwa-brand-dark); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.detector-evidence-nav:last-child { justify-self: end; }
.detector-evidence-nav:hover:not(:disabled) { background: var(--aiwa-brand-soft); }
.detector-evidence-nav:disabled { color: var(--aiwa-muted); opacity: .55; cursor: default; }
.detector-report { min-height: 0; flex: 1; overflow: auto; background: #fff; color: var(--aiwa-text); }
.detector-report.empty { display: grid; place-items: center; padding: 28px; color: var(--aiwa-muted); }
.detector-report .result-empty { max-width: 390px; }
.detector-report .result-empty-icon { width: 52px; height: 52px; }
.detector-report .result-empty strong { font-size: 15px; }
.detector-report .result-empty span:last-child { max-width: 42ch; font-size: 12px; line-height: 1.6; }
.detector-report.loading { display: block; padding: 26px; }
.detector-loading { display: grid; gap: 20px; }
.detector-loading-head { display: grid; grid-template-columns: 88px 1fr; align-items: center; gap: 18px; }
.detector-loading-ring { width: 82px; height: 82px; border-radius: 50%; background: #edf1ee; animation: detector-pulse 1.4s ease-in-out infinite; }
.detector-loading-lines { display: grid; gap: 10px; }
.detector-loading-line { height: 11px; border-radius: 8px; background: #edf1ee; animation: detector-pulse 1.4s ease-in-out infinite; }
.detector-loading-line:nth-child(2) { width: 76%; animation-delay: 90ms; }
.detector-loading-line:nth-child(3) { width: 58%; animation-delay: 180ms; }
.detector-report-content { padding: 28px; }
.detector-overview { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 18px 24px; align-items: center; padding-bottom: 20px; border-bottom: 1px solid var(--aiwa-line); }
.detector-score-gauge { --gauge-progress: 0deg; --score-color: var(--detector-neutral); position: relative; width: 148px; height: 84px; margin-top: 8px; overflow: hidden; }
.detector-score-gauge::before { content: ""; position: absolute; top: 0; left: 0; width: 148px; height: 148px; border-radius: 50%; background: conic-gradient(from 270deg, var(--score-color) 0 var(--gauge-progress), #e4eae6 var(--gauge-progress) 180deg, transparent 180deg 360deg); }
.detector-score-gauge::after { content: ""; position: absolute; top: 18px; left: 18px; width: 112px; height: 112px; border-radius: 50%; background: #fff; }
.detector-score-value { position: absolute; z-index: 1; right: 0; bottom: 1px; left: 0; display: grid; justify-items: center; color: var(--aiwa-ink); line-height: 1; text-align: center; }
.detector-score-value strong { font-size: 26px; letter-spacing: -.03em; }
.detector-score-value span { max-width: 100%; margin-top: 5px; color: var(--aiwa-muted); font-size: 10px; font-weight: 750; line-height: 1.15; white-space: nowrap; }
.detector-summary { min-width: 0; }
.detector-score-breakdown { display: grid; gap: 3px; }
.detector-score-row { min-height: 30px; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 4px 8px; border-radius: 8px; color: #435047; }
.detector-score-row.active { font-weight: 750; }
.detector-score-row.high.active { background: #fff0ee; color: #8f1f17; }
.detector-score-row.medium.active { background: #fff7e1; color: var(--detector-mixed-ink); }
.detector-score-row.low.active { background: #eaf7ee; color: #0e6230; }
.detector-score-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--detector-neutral); }
.detector-score-row.high .detector-score-dot { background: #ef5c54; }
.detector-score-row.medium .detector-score-dot { background: #ef9139; }
.detector-score-row.low .detector-score-dot { background: #36a765; }
.detector-score-label { min-width: 0; font-size: 12px; line-height: 1.3; }
.detector-score-row-value { color: currentColor; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.detector-overview-footer { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 14px; border-top: 1px solid #edf1ee; }
.detector-overview-copy { min-width: 0; display: grid; gap: 3px; }
.detector-overview-copy strong { color: var(--aiwa-ink); font-size: 14px; line-height: 1.35; letter-spacing: -.01em; }
.detector-overview-copy span { overflow: hidden; color: var(--aiwa-muted); font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.detector-overview-actions { display: flex; flex: 0 0 auto; }
.detector-section { padding-top: 24px; }
.detector-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.detector-section-heading h3 { margin: 0; font-size: 15px; line-height: 1.35; }
.detector-section-heading p { max-width: 52ch; margin: 3px 0 0; color: var(--aiwa-muted); font-size: 11px; line-height: 1.45; }
.detector-signal-list { display: grid; gap: 16px; }
.detector-signal { display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 7px 12px; align-items: center; }
.detector-signal-copy strong { display: block; font-size: 12px; }
.detector-signal-copy span { display: block; max-width: 52ch; margin-top: 2px; color: var(--aiwa-muted); font-size: 10px; line-height: 1.4; }
.detector-signal-track { grid-column: 1 / -1; grid-row: 2; height: 7px; overflow: hidden; border-radius: 8px; background: #e8eeea; }
.detector-signal-track span { display: block; width: var(--signal); height: 100%; border-radius: inherit; background: var(--signal-color); }
.detector-signal > output { grid-column: 2; grid-row: 1; color: var(--aiwa-muted); font-size: 11px; font-weight: 750; text-align: right; }
.detector-disclaimer { display: flex; gap: 9px; margin: 20px 0 0; padding: 12px; border-radius: 12px; background: #f4f6f4; color: var(--aiwa-text); font-size: 11px; line-height: 1.55; }
.detector-disclaimer .aiwa-ui-icon { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px; }
.detector-action-bar { grid-template-columns: minmax(170px, 1fr) auto minmax(260px, 1fr); }
.detector-result-actions { display: flex; }
.detector-overview-actions .detector-humanize-action { min-height: 40px; padding: 8px 14px; border-color: var(--aiwa-brand); background: var(--aiwa-brand); color: #fff; font-size: 12px; }
.detector-overview-actions .detector-humanize-action:hover:not(:disabled) { border-color: var(--aiwa-brand-dark); background: var(--aiwa-brand-dark); }
.detector-humanize-action:focus-visible { outline: 2px solid var(--aiwa-brand); outline-offset: 2px; }
.detector-overview-actions .detector-humanize-action span { display: inline; }
.detector-caution { max-width: 800px; display: flex; align-items: flex-start; gap: 10px; margin: 24px auto 0; padding: 13px 14px; border-radius: 12px; background: #f2f5f3; color: var(--aiwa-text); }
.detector-caution .aiwa-ui-icon { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 2px; }
.detector-caution p { margin: 0; font-size: 12px; line-height: 1.55; }
@keyframes detector-pulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

@media (max-width: 1020px) {
  .detector-action-bar { grid-template-columns: 1fr auto; }
  .detector-result-actions { grid-column: 1 / -1; grid-row: 1; justify-content: center; }
}
@media (max-width: 900px) {
  .detector-command-inner { min-height: 58px; display: flex; padding: 6px 12px; }
  .detector-command-controls { min-width: 0; margin-left: auto; }
  .detector-command-controls .command-language { display: inline-flex; }
  .ai-detector-page[data-mobile-editor-view="input"] .output-pane, .ai-detector-page[data-mobile-editor-view="output"] .input-pane { display: none; }
  .detector-editor-grid { display: block; }
  .detector-editor-grid .editor-pane { min-height: max(390px, calc(100dvh - 56px - 58px - 48px - 74px)); }
  .detector-editor-grid .aiwa-textarea { min-height: 300px; }
  .detector-evidence-document { min-height: 300px; }
  .detector-report { min-height: 420px; }
  .detector-report-content { padding: 18px 16px; }
  .detector-action-bar { position: sticky; z-index: 70; bottom: 0; min-height: 74px; grid-template-columns: minmax(0, 1fr) minmax(148px, 1.15fr); gap: 10px; padding: 10px 12px max(10px, env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -6px 12px rgba(23,33,27,.06); }
  .detector-result-actions { display: none; }
  .ai-detector-page.has-detector-result .detector-result-actions { grid-column: 1 / -1; grid-row: 1; display: grid; grid-template-columns: 1fr 1fr; }
  .ai-detector-page.has-detector-result .detector-action-bar .word-budget, .ai-detector-page.has-detector-result .detector-action-bar .para-actions { grid-row: 2; }
}
@media (max-width: 620px) {
  .detector-language-control { gap: 3px; }
  .detector-language-select { min-height: 38px; padding-inline: 3px; }
  .detector-language-select select { width: 124px; min-height: 34px; }
  .detector-minimum span { display: none; }
  .detector-minimum::after { content: "80 words minimum"; }
  .detector-evidence-legend { gap: 7px 10px; padding-inline: 12px; }
  .detector-evidence-legend small { width: 100%; margin-left: 0; }
  .detector-evidence-document { padding: 15px 14px; font-size: 16px; line-height: 1.85; }
  .detector-evidence-popover { width: auto; max-height: min(70dvh, 460px); overflow: auto; border-radius: 16px 16px 12px 12px; transform: translateY(8px); }
  .detector-evidence-popover.is-open { transform: translateY(0); }
  .detector-overview { grid-template-columns: 116px minmax(0, 1fr); gap: 14px; }
  .detector-score-gauge { width: 112px; height: 66px; margin-top: 6px; }
  .detector-score-gauge::before { width: 112px; height: 112px; }
  .detector-score-gauge::after { top: 14px; left: 14px; width: 84px; height: 84px; }
  .detector-score-value strong { font-size: 22px; }
  .detector-score-row { min-height: 29px; padding-inline: 7px; }
  .detector-overview-footer { align-items: stretch; }
  .detector-overview-copy { align-self: center; }
  .detector-overview-actions .detector-humanize-action { width: 100%; justify-content: center; }
  .detector-signal { grid-template-columns: minmax(0, 1fr) 32px; gap: 6px 10px; }
  .detector-section-heading { display: block; }
}
@media (max-width: 380px) {
  .detector-overview { grid-template-columns: 96px minmax(0, 1fr); gap: 10px; }
  .detector-score-gauge { width: 96px; height: 57px; margin-top: 5px; }
  .detector-score-gauge::before { width: 96px; height: 96px; }
  .detector-score-gauge::after { top: 12px; left: 12px; width: 72px; height: 72px; }
  .detector-score-value strong { font-size: 20px; }
  .detector-score-value span { font-size: 9px; }
  .detector-score-breakdown { margin-top: 8px; }
  .detector-score-row { min-height: 27px; gap: 7px; padding-inline: 6px; }
  .detector-score-label, .detector-score-row-value { font-size: 10px; }
  .detector-overview-footer { display: grid; gap: 10px; }
  .detector-overview-copy span { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .detector-loading-ring, .detector-loading-line { animation: none; }
  .detector-evidence-sentence, .detector-evidence-popover { transition: none; }
}
@media (pointer: coarse) {
  .detector-evidence-close { width: 44px; height: 44px; }
  .detector-evidence-nav { min-height: 44px; padding-inline: 12px; }
}
