/* --------------------------------------------------------------------------
   CWN Keyword Match

   Two paste boxes, one comparison, three lists of terms. Chips are rectangles
   with hairline edges like everything else on the site — no pills, no shadows.
   -------------------------------------------------------------------------- */

.cwnkeywordmatch-block {
  background: #fff;
  padding-top: var(--section-padding-top);
  padding-bottom: var(--section-padding-bottom);
}

/* `hidden` comes from the user-agent sheet and loses to any author class. */
.cwnkeywordmatch-block [hidden] {
  display: none !important;
}

.cwnkeywordmatch-header {
  max-width: 760px;
  margin-bottom: 40px;
}

.cwnkeywordmatch-heading {
  font-size: 38px;
  line-height: 1.12;
  margin: 0 0 16px;
}

.cwnkeywordmatch-intro {
  font-size: 17px;
  line-height: 1.65;
  font-weight: 300;
  color: var(--body-text);
  margin: 0;
  max-width: 60ch;
}

.cwnkeywordmatch-tool {
  border: 1px solid var(--hairline);
  padding: 40px;
  background: #fff;
}

.cwnkeywordmatch-privacy {
  margin: 0 0 28px;
  padding: 16px 20px;
  background: var(--surface-card);
  border-left: 3px solid var(--primary);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 300;
  color: var(--body-text);
  max-width: 78ch;
}

.cwnkeywordmatch-panes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.cwnkeywordmatch-label {
  display: block;
  font-family: var(--font1);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 8px;
}

.cwnkeywordmatch-textarea {
  width: 100%;
  min-height: 240px;
  resize: vertical;
  border: 1px solid var(--hairline);
  border-radius: 0;
  box-shadow: none;
  padding: 14px 16px;
  font-family: var(--font2);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 300;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.18s ease;
}

.cwnkeywordmatch-textarea:focus {
  border-color: var(--ink);
  border-width: 2px;
  outline: none;
}

.cwnkeywordmatch-actions {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.cwnkeywordmatch-error {
  margin: 0;
  font-size: 14px;
  font-weight: 300;
  color: #B3261E;
}

.cwnkeywordmatch-results {
  margin-top: 40px;
  border-top: 1px solid var(--hairline);
  padding-top: 36px;
}

.cwnkeywordmatch-score {
  display: grid;
  gap: 8px;
  margin-bottom: 34px;
}

.cwnkeywordmatch-score-label {
  font-family: var(--font1);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
}

.cwnkeywordmatch-score-value {
  font-family: var(--font1);
  font-size: 46px;
  font-weight: 700;
  line-height: 1;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.cwnkeywordmatch-score-sub {
  font-size: 16px;
  line-height: 1.65;
  font-weight: 300;
  color: var(--body-text);
  max-width: 62ch;
}

.cwnkeywordmatch-group {
  margin-bottom: 30px;
}

.cwnkeywordmatch-group-heading {
  font-size: 17px;
  line-height: 1.35;
  margin: 0 0 6px;
}

.cwnkeywordmatch-group-note {
  font-size: 14px;
  line-height: 1.6;
  font-weight: 300;
  color: var(--muted);
  margin: 0 0 14px;
  max-width: 66ch;
}

.cwnkeywordmatch-terms {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cwnkeywordmatch-term {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  border: 1px solid var(--hairline-strong);
  border-radius: 0;
  padding: 8px 14px;
  background: #fff;
}

.cwnkeywordmatch-term-text {
  font-size: 15px;
  font-weight: 300;
  color: var(--ink);
}

.cwnkeywordmatch-term-count {
  font-family: var(--font1);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.cwnkeywordmatch-terms--priority .cwnkeywordmatch-term {
  border-color: var(--primary);
  background: var(--surface-card);
}

.cwnkeywordmatch-terms--priority .cwnkeywordmatch-term-text {
  font-weight: 700;
  font-family: var(--font1);
}

.cwnkeywordmatch-terms--matched .cwnkeywordmatch-term {
  border-color: var(--hairline);
  background: var(--surface-soft);
  color: var(--muted);
}

.cwnkeywordmatch-terms--matched .cwnkeywordmatch-term-text {
  color: var(--muted);
}

.cwnkeywordmatch-empty {
  font-size: 15px;
  line-height: 1.6;
  font-weight: 300;
  color: var(--muted);
  margin: 0;
}

.cwnkeywordmatch-guidance {
  margin-top: 34px;
  background: var(--secondary);
  padding: 30px 32px;
}

.cwnkeywordmatch-guidance-heading {
  font-size: 18px;
  line-height: 1.3;
  color: #fff;
  margin: 0 0 12px;
}

.cwnkeywordmatch-guidance-body {
  font-size: 17px;
  line-height: 1.75;
  font-weight: 300;
  color: #fff;
  margin: 0;
  max-width: 68ch;
}

.cwnkeywordmatch-noscript,
.cwnkeywordmatch-note {
  font-size: 13px;
  line-height: 1.65;
  font-weight: 300;
  color: var(--muted);
  margin: 20px 0 0;
  max-width: 74ch;
}

@media (max-width: 1199px) {
  .cwnkeywordmatch-heading { font-size: 32px; }
  .cwnkeywordmatch-tool { padding: 32px; }
  .cwnkeywordmatch-guidance { padding: 26px; }
}

@media (max-width: 767px) {
  .cwnkeywordmatch-heading { font-size: 26px; }
  .cwnkeywordmatch-intro { font-size: 16px; }
  .cwnkeywordmatch-tool { padding: 24px 20px; }
  .cwnkeywordmatch-panes { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .cwnkeywordmatch-textarea { min-height: 180px; }
  .cwnkeywordmatch-score-value { font-size: 38px; }
  .cwnkeywordmatch-guidance { padding: 22px 20px; }
  .cwnkeywordmatch-guidance-body { font-size: 16px; }
  .cwnkeywordmatch-actions .btn { width: 100%; text-align: center; }
}
