/* PAE Pro mobile layout v2.
   This file intentionally comes last so the detector page behaves like a
   purpose-built mobile experience instead of a scaled desktop layout. */
@media (max-width: 680px) {
  .detector-page {
    --mobile-edge: 14px;
    background: #f4f2ee;
  }

  /* Inherit the same complete mobile header and navigation as Appeal Radar. */

  /* Give the actual detector more room and remove desktop-scale padding. */
  .detector-page .detector-main {
    width: 100%;
    padding: 14px var(--mobile-edge) 42px;
    box-sizing: border-box;
  }

  .detector-page .detector-intro {
    min-height: 0;
    margin-bottom: 12px;
    padding: 24px 20px;
    gap: 22px;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(18, 18, 18, .12);
  }

  .detector-page .detector-intro h1 {
    font-size: clamp(30px, 8.6vw, 38px);
    line-height: 1.08;
  }

  .detector-page .detector-intro > div:first-child > p:last-child {
    font-size: 12px;
    line-height: 1.68;
  }

  .detector-page .detector-limit-card,
  .detector-page .pae-membership,
  .detector-page .detector-workspace {
    border-radius: 12px;
  }

  .detector-page .detector-method {
    margin-top: 36px;
  }

  .detector-page .detector-method-header {
    gap: 8px;
    margin-bottom: 14px;
    padding: 0 2px;
  }

  .detector-page .detector-method-header h2 {
    margin: 0;
    font-size: 25px;
    line-height: 1.16;
    letter-spacing: -.025em;
  }

  .detector-page .detector-method-header > p {
    margin: 0;
    font-size: 11px;
    line-height: 1.6;
  }

  .detector-page .detector-method-shell {
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(20, 20, 20, .08);
  }

  .detector-page .detector-method-tabs {
    gap: 0;
    padding: 8px 8px 0;
  }

  .detector-page .detector-method-tabs button {
    min-height: 48px;
    padding: 6px 4px 9px;
    border-bottom-width: 2px;
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
  }

  .detector-page .detector-method-tabs button span {
    margin-bottom: 3px;
    font-size: 8px;
  }

  .detector-page .detector-method-tabs button::after {
    bottom: -2px;
    height: 2px;
  }

  .detector-page .detector-method-panel {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 15px;
    min-height: 0;
    padding: 16px;
  }

  /* Keep the established content order on mobile: graphic first, copy below. */
  .detector-page .detector-method-copy {
    order: 2;
    padding: 2px 2px 0;
  }

  .detector-page .detector-method-visual {
    order: 1;
    min-height: 0;
    border-radius: 9px;
    box-shadow: 4px 4px 0 #ece9e4;
  }

  .detector-page .detector-method-copy > span {
    font-size: 9px;
  }

  .detector-page .detector-method-copy h3 {
    margin: 5px 0 8px;
    font-size: 22px;
    line-height: 1.18;
  }

  .detector-page .detector-method-copy p {
    font-size: 11px;
    line-height: 1.62;
  }

  .detector-page .detector-method-copy p + p {
    margin-top: 8px;
    padding-top: 8px;
  }

  .detector-page .method-input-visual {
    min-height: 210px;
    padding: 18px 16px 58px;
  }

  .detector-page .method-input-card {
    padding: 14px;
  }

  .detector-page .method-card-top {
    margin-bottom: 12px;
    font-size: 7px;
  }

  .detector-page .method-text-line {
    height: 6px;
    margin: 9px 0;
  }

  .detector-page .method-token-row {
    gap: 5px;
    margin: 13px 0;
  }

  .detector-page .method-token-row i {
    padding: 5px 6px;
    font-size: 8px;
  }

  .detector-page .method-input-stats {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .detector-page .method-input-stats span {
    padding: 7px 4px;
    font-size: 7px;
    text-align: center;
  }

  .detector-page .method-input-stats strong {
    display: block;
    margin: 0 0 2px;
  }

  .detector-page .method-signal-visual {
    min-height: 220px;
  }

  .detector-page .method-signal-visual svg {
    inset: 8px;
    width: calc(100% - 16px);
    height: calc(100% - 16px);
  }

  .detector-page .method-signal-label {
    padding: 7px 8px;
  }

  .detector-page .method-signal-label.label-a {
    top: 18px;
    left: 18px;
  }

  .detector-page .method-signal-label.label-b {
    right: 16px;
    bottom: 16px;
  }

  /* Stage 03: one compact report, no giant stacked poster. */
  .detector-page .method-report-visual {
    display: grid !important;
    grid-template-columns: 60px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
    min-height: 0 !important;
    padding: 14px !important;
  }

  .detector-page .method-score-mini {
    position: relative !important;
    inset: auto !important;
    align-self: center !important;
    justify-self: center !important;
    width: 58px !important;
    margin: 0 !important;
  }

  .detector-page .method-score-mini::before {
    width: 43px !important;
  }

  .detector-page .method-score-mini strong {
    font-size: 19px !important;
  }

  .detector-page .method-score-mini span {
    font-size: 7px !important;
  }

  .detector-page .method-report-paper {
    position: relative !important;
    width: 100% !important;
    padding: 11px !important;
    box-sizing: border-box !important;
    border-radius: 6px;
  }

  .detector-page .method-report-paper .method-card-top {
    gap: 8px;
    margin-bottom: 7px;
    font-size: 7px;
  }

  .detector-page .method-report-paper p {
    margin: 5px 0;
    padding: 5px 6px;
    font-size: 9px;
    line-height: 1.42;
  }

  .detector-page .method-report-paper p b {
    margin-left: 5px;
    padding: 1px 4px;
    font-size: 6px;
  }

  .detector-page .method-report-key {
    flex-wrap: wrap;
    gap: 4px 9px;
    margin-top: 8px;
    font-size: 8px;
  }

  .detector-page .method-report-key span::before {
    width: 5px;
    height: 5px;
    margin-right: 4px;
  }
}

@media (max-width: 370px) {
  .detector-page .nav,
  html[lang="en"] .detector-page .nav {
    font-size: 10px;
  }

  .detector-page .method-report-visual {
    grid-template-columns: 50px minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 11px !important;
  }

  .detector-page .method-score-mini {
    width: 48px !important;
  }

  .detector-page .method-score-mini::before {
    width: 36px !important;
  }
}
