.detector-main {
  width: min(100%, 1160px);
  margin-inline: auto;
  padding-block: clamp(1rem, 3.7vw, 3.25rem) 2rem;
}

.detector-intro {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: clamp(1.25rem, 3vw, 1.85rem);
}

.detector-intro-mark,
.detector-empty-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid #e7e3ff;
  border-radius: 13px;
  background: #f3f0ff;
  color: #5145c8;
}

.detector-intro-mark .icon,
.detector-empty-mark .icon {
  width: 1.35rem;
  height: 1.35rem;
}

.detector-intro h1 {
  margin: 0 0 .35rem;
  font-size: clamp(1.8rem, 4vw, 2.65rem);
  font-weight: 690;
  line-height: 1.08;
  letter-spacing: -.045em;
}

.detector-intro p {
  max-width: 62ch;
  margin: 0;
  color: #5e5e64;
  font-size: 1rem;
}

.detector-grid {
  display: grid;
  align-items: stretch;
  grid-template-columns: minmax(0, 1.6fr) minmax(270px, 1fr);
  gap: 1rem;
}

.detector-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--page);
}

.detector-card-header {
  display: flex;
  min-height: 59px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1rem;
  padding: .85rem 1.15rem;
  border-bottom: 1px solid #ececef;
}

.detector-card-header :is(h2, label) {
  margin: 0;
  font-size: .985rem;
  font-weight: 650;
}

.detector-input {
  width: 100%;
  min-height: clamp(245px, 40vh, 415px);
  flex: 1 1 auto;
  padding: 1.1rem 1.15rem;
  resize: vertical;
  border: 0;
  border-radius: 0;
  outline: none;
  background: var(--page);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.7;
}

.detector-input::placeholder { color: #66666f; opacity: 1; }
.detector-input:focus-visible { outline: 2px solid #a39af3; outline-offset: -3px; }

.detector-card-footer {
  display: flex;
  min-height: 70px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  padding: .8rem 1.15rem;
  border-top: 1px solid #ececef;
}

.detector-input-actions { display: flex; flex-wrap: wrap; gap: .2rem; }
.detector-input-actions .button { padding-inline: .6rem; }
.detector-input-actions .button:disabled { opacity: .55; }

.detector-run {
  padding-inline: 1rem;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.detector-run:hover:not(:disabled) {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.detector-run:disabled {
  border-color: #e6e0fa;
  background: #eeeaf9;
  color: #635b79;
}

.detector-help {
  margin: 0;
  padding: .75rem 1.15rem;
  border-top: 1px solid #ececef;
  background: #faf9fc;
  color: #5e5e65;
  font-size: .875rem;
}

.detector-results-body {
  display: flex;
  min-height: 290px;
  flex: 1 0 auto;
  flex-direction: column;
}

.detector-empty {
  display: grid;
  flex: 1 0 auto;
  align-content: center;
  justify-items: center;
  gap: .65rem;
  padding: 1.5rem;
  text-align: center;
}

.detector-empty :is(h3, p) { margin: 0; }
.detector-empty h3 { margin-top: .2rem; font-size: 1rem; font-weight: 640; }
.detector-empty p { max-width: 29ch; color: #5e5e64; font-size: .94rem; }

.detector-result {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 1rem;
  padding: clamp(1.15rem, 3vw, 1.6rem);
}

.detector-result :is(h3, p) { margin: 0; }
.detector-result h3 { font-size: 1.2rem; font-weight: 680; letter-spacing: -.015em; }
.detector-result p { color: #55555e; font-size: .94rem; }

.detector-score {
  display: block;
  font-size: clamp(1.95rem, 4.5vw, 3.25rem);
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.055em;
  line-height: 1;
}

.detector-meter,
.detector-progress {
  display: block;
  width: 100%;
  height: 9px;
  appearance: none;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #ebe8f8;
  color: #635bdb;
}

.detector-meter::-webkit-progress-bar,
.detector-progress::-webkit-progress-bar { background: #ebe8f8; }
.detector-meter::-webkit-progress-value,
.detector-progress::-webkit-progress-value { border-radius: 999px; background: #635bdb; }
.detector-meter::-moz-progress-bar,
.detector-progress::-moz-progress-bar { border-radius: 999px; background: #635bdb; }

.detector-status {
  display: grid;
  align-items: start;
  color: #5e5e64;
  font-size: .9rem;
}

.detector-status:has(p:not(:empty), progress:not([hidden])) {
  gap: .7rem;
  padding: 1rem 1.15rem;
}

.detector-status :is(p, output) { margin: 0; }
.detector-status :is(p, output)[data-error='true'] { color: #a12214; }

.detector-note {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin: 1rem 0 0;
  color: #5e5e65;
  font-size: .875rem;
}

.detector-note .icon { margin-top: .13rem; }
.detector-note a { color: #5145c8; text-underline-offset: .12em; }

@media (max-width: 985px) {
  .detector-grid { grid-template-columns: minmax(0, 1fr); }
  .detector-results-body { min-height: 220px; }
}

@media (max-width: 540px) {
  .detector-intro { gap: .7rem; }
  .detector-intro-mark { width: 2.55rem; height: 2.55rem; border-radius: 10px; }
  .detector-card-header,
  .detector-card-footer,
  .detector-help { padding-inline: .85rem; }
  .detector-input { padding: .9rem .85rem; }
  .detector-run { padding-inline: .8rem; }
}
