.astro-tools-page .compatibility-article {
  overflow: visible;
}

.astro-tools-page .compatibility-hero--featured {
  min-height: 0;
  padding: clamp(24px, 4vw, 46px);
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
}

.astro-tools-page .compatibility-hero__art img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.astro-trust-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 20px;
  color: var(--m3-text-soft);
  font-size: .78rem;
  font-weight: 700;
}

.astro-trust-line span {
  position: relative;
  padding-left: 15px;
}

.astro-trust-line span::before {
  content: "";
  position: absolute;
  left: 0;
  top: .4em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--m3-primary);
}

.astro-tool-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: clamp(26px, 5vw, 64px);
  align-items: start;
  margin-top: clamp(28px, 5vw, 52px);
}

.astro-tool-form,
.astro-tool-result,
.astro-tool-note {
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--m3-outline);
  border-radius: 24px;
  background: var(--m3-surface-2);
}

.astro-tool-form {
  display: grid;
  gap: 18px;
  box-shadow: var(--m3-shadow);
}

.astro-tool-form h2,
.astro-tool-result h2,
.astro-tool-note h2 {
  margin: 0 !important;
}

.astro-tool-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.astro-tool-form[data-tool="compatibility"] > .astro-tool-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.astro-person {
  min-width: 0;
  min-inline-size: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--m3-outline-strong) 72%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--m3-surface) 56%, transparent);
}

.astro-person legend {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 8px 0 0;
  color: var(--m3-text);
  font-size: .88rem;
  font-weight: 850;
}

.astro-person legend span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #1a0e12;
  background: var(--m3-secondary);
  font-size: .75rem;
}

.astro-tool-field {
  display: grid;
  width: 100%;
  min-width: 0;
  min-inline-size: 0;
  gap: 7px;
}

.astro-tool-field--wide { grid-column: 1 / -1; }

.astro-tool-field label {
  color: #ded6e2;
  font-size: .8rem;
  font-weight: 800;
}

.astro-tool-field input {
  --astro-field-inner-height: 52px;
  display: block;
  min-width: 0;
  min-inline-size: 0;
  max-inline-size: 100%;
  inline-size: 100%;
  width: 100%;
  height: 54px;
  min-height: 54px;
  max-height: 54px;
  box-sizing: border-box;
  padding: 0 14px;
  border: 1px solid #8e6970;
  border-radius: 13px;
  color: var(--m3-text);
  background: #1d1f26;
  font: inherit;
  font-size: 16px;
  line-height: 1.2;
  color-scheme: dark;
}

.astro-tool-field input::placeholder {
  color: #c9c1cb;
  opacity: 1;
}

.astro-tool-field input[type="date"],
.astro-tool-field input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  min-width: 0 !important;
  min-inline-size: 0 !important;
  max-width: 100% !important;
  max-inline-size: 100% !important;
  inline-size: 100% !important;
  padding-block: 0;
  line-height: normal;
}

.astro-tool-field input::-webkit-calendar-picker-indicator {
  opacity: .9;
}

.astro-tool-field input::-webkit-date-and-time-value {
  display: flex;
  align-items: center;
  width: 100%;
  height: var(--astro-field-inner-height);
  min-height: var(--astro-field-inner-height);
  margin: 0;
  padding: 0;
  line-height: normal;
  text-align: left;
}

.astro-tool-field input::-webkit-datetime-edit {
  display: flex;
  align-items: center;
  height: var(--astro-field-inner-height);
  margin: 0;
  padding: 0;
  line-height: normal;
}

.astro-tool-field input::-webkit-datetime-edit-fields-wrapper {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0;
}

.astro-tool-field input:focus {
  outline: 3px solid rgba(255, 128, 132, .36);
  outline-offset: 2px;
  border-color: var(--m3-primary);
}

.astro-tool-submit {
  min-height: 54px;
  border: 0;
  border-radius: 15px;
  color: #1a0e12;
  background: var(--m3-primary);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.astro-tool-submit:disabled { opacity: .58; cursor: wait; }
.astro-tool-status { min-height: 1.3em; margin: 0 !important; color: var(--m3-text-soft) !important; font-size: .82rem !important; }
.astro-tool-status[data-state="error"] { color: #ffaaa7 !important; }

.astro-tool-preview {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 16px;
}

.astro-tool-result[hidden] { display: none; }

.astro-tool-result {
  border-color: rgba(255, 128, 132, .32);
  background:
    radial-gradient(circle at 90% 8%, rgba(255, 128, 132, .18), transparent 42%),
    var(--m3-surface-2);
}

.astro-tool-result__sign {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 8px;
  color: var(--m3-primary);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 900;
}

.astro-tool-score {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  margin: 16px 0;
}

.astro-tool-score strong { color: var(--m3-primary); font-size: 2.2rem; }
.astro-tool-score span { color: var(--m3-text-soft); }
.astro-tool-result p { margin: 8px 0 !important; }
.astro-tool-result .compatibility-button { width: 100%; min-height: 54px; margin-top: 14px; box-sizing: border-box; }

.astro-tool-note ul { margin: 14px 0 0; padding-left: 1.15rem; }
.astro-tool-note li { margin-bottom: 8px; color: var(--m3-text-soft); }

.astro-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: clamp(28px, 5vw, 48px);
}

.astro-tools-card {
  display: grid;
  gap: 12px;
  min-height: 250px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--m3-outline);
  border-radius: 24px;
  color: var(--m3-text);
  background: var(--m3-surface-2);
  text-decoration: none;
  transition: transform 170ms ease, border-color 170ms ease;
}

.astro-tools-card:hover { transform: translateY(-4px); border-color: var(--m3-primary); }
.astro-tools-card span:first-child { color: var(--m3-primary); font-size: .76rem; font-weight: 850; text-transform: uppercase; }
.astro-tools-card strong { font-size: clamp(1.35rem, 3vw, 2rem); line-height: 1.08; }
.astro-tools-card p { margin: 0 !important; color: var(--m3-text-soft) !important; }
.astro-tools-card span:last-child { margin-top: auto; color: var(--m3-secondary); font-weight: 800; }

@media (max-width: 820px) {
  .astro-tool-shell { grid-template-columns: 1fr; }
  .astro-tool-preview { position: static; }
  .astro-tools-page .compatibility-hero--featured { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .astro-tool-fields,
  .astro-tools-grid { grid-template-columns: 1fr; }
  .astro-tool-form[data-tool="compatibility"] > .astro-tool-fields { grid-template-columns: 1fr; }
  .astro-tool-field--wide { grid-column: auto; }
  .astro-tool-result,
  .astro-tool-note,
  .astro-tools-card { border-radius: 18px; }
  .astro-tool-form {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 22px 0 0;
    gap: 18px;
    border: 0;
    border-top: 1px solid var(--m3-outline);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .astro-tools-page .compatibility-hero__copy { order: 0; }
  .astro-tools-page .compatibility-hero__art { order: 1; }
  .astro-tools-page .compatibility-hero__art img { aspect-ratio: 16 / 9; max-height: 210px; }
  .astro-tools-page--tool .compatibility-hero__art { display: none; }
  .astro-tool-form h2 { font-size: clamp(1.45rem, 7vw, 1.9rem) !important; }
  .astro-tool-fields { width: 100%; min-width: 0; gap: 16px; }
  .astro-tool-field { width: 100%; min-width: 0; gap: 7px; }
  .astro-tool-field label { font-size: .8rem; line-height: 1.3; }
  .astro-tool-field input {
    --astro-field-inner-height: 48px;
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 50px;
    min-height: 50px;
    max-height: 50px;
    padding: 0 13px;
    border-color: #8e6970;
    border-radius: 11px;
    background: #1d1f26;
    -webkit-text-fill-color: var(--m3-text);
  }
  @supports (-webkit-touch-callout: none) {
    .astro-tool-field { overflow: hidden; }
    .astro-tool-field input {
      width: -webkit-fill-available !important;
      inline-size: -webkit-fill-available !important;
    }
  }
  .astro-person {
    width: 100%;
    box-sizing: border-box;
    padding: 18px 0 0;
    border: 0;
    border-top: 1px solid var(--m3-outline-strong);
    border-radius: 0;
    background: transparent;
  }
  .astro-person:first-child { padding-top: 6px; border-top: 0; }
  .astro-person legend { padding-right: 6px; }
  .astro-tool-submit { width: 100%; min-height: 50px; border-radius: 12px; padding: 0 14px; line-height: 1.2; }
  .astro-trust-line {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--m3-outline);
    font-size: .74rem;
  }
}
