.tools-page {
  min-height: 100vh;
  padding: clamp(64px, 7vw, 112px) max(20px, calc((100vw - 1280px) / 2));
  color: #172033;
  background: #f5f8f7;
}

.tools-eyebrow,
.tools-step {
  margin: 0 0 16px;
  color: #176c69;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.tools-page h1 {
  max-width: 17ch;
  margin: .18em 0 .28em;
  font-size: clamp(2.8rem, 5.5vw, 5.5rem);
  line-height: .98;
}

.tools-page h2 {
  margin: 0;
  font-size: clamp(2rem, 3.5vw, 3.8rem);
  line-height: 1.02;
}

.tools-page p,
.tools-page li {
  font-size: 1.05rem;
  line-height: 1.65;
}

.tools-intro {
  max-width: 940px;
}

.tools-intro > p:not(.tools-eyebrow) {
  max-width: 720px;
}

.tools-intro-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: 28px;
  color: #176c69;
  font-weight: 800;
}

.tools-intro-meta span::before {
  content: "✓";
  margin-right: 8px;
}

.tools-catalog,
.tools-principles,
.tool-documentation {
  margin-top: clamp(72px, 10vw, 144px);
}

.tools-section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
  gap: 48px;
  align-items: end;
  padding-bottom: 28px;
  border-bottom: 1px solid #aebdbb;
}

.tools-section-heading > p {
  margin: 0;
}

.tool-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 28px;
}

.tool-card {
  position: relative;
  min-height: 360px;
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid #9fb1af;
  background: #fff;
}

.tool-card-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  color: #176c69;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.tool-card-local {
  color: #4c5a68;
}

.tool-card h3 {
  margin: 34px 0 16px;
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.tool-card h3 a {
  color: inherit;
  text-decoration: none;
}

.tool-card h3 a::after {
  position: absolute;
  inset: 0;
  content: "";
}

.tool-card ul {
  padding-left: 1.2em;
}

.tool-card-action {
  position: relative;
  z-index: 1;
  display: inline-flex;
  gap: 8px;
  margin-top: 12px;
  color: #176c69;
  font-weight: 800;
}

.tool-card:has(a:focus-visible),
.tool-card:hover {
  border-color: #176c69;
  box-shadow: 0 18px 45px rgb(23 32 51 / 9%);
}

.tools-principle-grid,
.tool-documentation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 40px;
  background: #aebdbb;
  border: 1px solid #aebdbb;
}

.tools-principle-grid article,
.tool-documentation-grid article {
  padding: 32px;
  background: #f5f8f7;
}

.tools-principle-grid h3,
.tool-documentation-grid h3 {
  margin-top: 0;
  font-size: 1.35rem;
}

.tools-empty {
  margin-top: 28px;
  padding: 32px;
  background: #fff;
  border: 1px solid #aebdbb;
}

.tools-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 48px;
  color: #4c5a68;
  font-size: .9rem;
}

.tools-breadcrumb a {
  color: #176c69;
}

.tool-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr);
  gap: 48px;
  align-items: end;
}

.tool-heading > div > p:last-child {
  max-width: 720px;
}

.tool-privacy-card {
  padding: 24px;
  border-left: 4px solid #176c69;
  background: #e8f2f1;
}

.tool-privacy-card strong,
.tool-privacy-card span {
  display: block;
}

.tool-privacy-card span {
  margin-top: 8px;
  line-height: 1.55;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 52px;
  border: 1px solid #819390;
  background: #fff;
  box-shadow: 0 22px 60px rgb(23 32 51 / 8%);
}

.tool-input-panel,
.tool-output-panel {
  min-width: 0;
  padding: clamp(22px, 3vw, 40px);
}

.tool-input-panel {
  border-right: 1px solid #aebdbb;
}

.tool-panel-heading {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 800;
}

.tool-panel-heading span:last-child {
  color: #63716f;
  font-size: .82rem;
  font-weight: 650;
}

.tool-input-panel textarea,
.tool-code-result {
  box-sizing: border-box;
  width: 100%;
  min-height: 390px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  border: 1px solid #6f807e;
  border-radius: 2px;
  background: #fbfdfd;
  color: #172033;
  font: 500 .95rem/1.55 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  tab-size: 2;
  white-space: pre;
}

.schema-input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 52px;
  border: 1px solid #819390;
  background: #fff;
  box-shadow: 0 22px 60px rgb(23 32 51 / 8%);
}

.schema-input-grid .tool-input-panel:first-child { border-right: 1px solid #aebdbb; }
.schema-input-grid textarea { min-height: 360px; }
.schema-result-panel { margin-top: 28px; padding: clamp(22px, 3vw, 40px); border: 1px solid #819390; background: #fff; }
.schema-error-list { margin: 18px 0 0; padding: 0; list-style: none; }
.schema-error-list li { padding: 15px 16px; border-bottom: 1px solid #d8e0df; overflow-wrap: anywhere; }
.schema-error-list li:first-child { border-top: 1px solid #d8e0df; }
.schema-error-list code { color: #176c69; font-weight: 750; }
.schema-error-list .schema-valid { border-left: 4px solid #176c69; background: #eef8f7; }

.tool-input-panel textarea {
  resize: vertical;
}

.tool-code-result {
  border-color: #aebdbb;
  background: #101b2d;
  color: #eaf4f3;
}

.tool-input-panel textarea:focus-visible,
.tool-code-result:focus-visible,
.tool-workbench button:focus-visible,
.tool-workbench select:focus-visible,
.tool-card a:focus-visible,
.tools-breadcrumb a:focus-visible {
  outline: 3px solid #27b9b1;
  outline-offset: 3px;
}

.tool-limit,
.tool-notice,
.tool-status {
  color: #4c5a68;
  font-size: .88rem !important;
}

.tool-options {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.tool-options label {
  font-weight: 800;
}

.tool-options select {
  min-height: 42px;
  padding: 0 36px 0 12px;
  border: 1px solid #6f807e;
  background: #fff;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.tool-actions .button {
  min-height: 46px;
}

.tool-actions button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.tool-text-action {
  padding: 10px 6px;
  border: 0;
  background: transparent;
  color: #176c69;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.tool-field-error {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-left: 4px solid #a12b3b;
  background: #fff0f2;
  color: #761827;
  font-size: .92rem !important;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.tool-workbench[data-state="success"] .tool-status { color: #176c69; font-weight: 800; }
.tool-workbench[data-state="corrected"] .tool-status { color: #8a5a00; font-weight: 800; }
.tool-workbench[data-state="validation-error"] .tool-status,
.tool-workbench[data-state="technical-error"] .tool-status { color: #8b1e2d; font-weight: 800; }

.tool-documentation-intro {
  max-width: 780px;
}

@media (prefers-reduced-motion: reduce) {
  .tools-page * { scroll-behavior: auto !important; transition: none !important; }
}

@media (max-width: 900px) {
  .tools-section-heading,
  .tool-heading {
    grid-template-columns: 1fr;
  }

  .tool-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .tools-page {
    padding-top: 48px;
  }

  .tool-grid,
  .schema-input-grid,
  .tools-principle-grid,
  .tool-documentation-grid {
    grid-template-columns: 1fr;
  }

  .tool-input-panel {
    border-right: 0;
    border-bottom: 1px solid #aebdbb;
  }

  .schema-input-grid .tool-input-panel:first-child { border-right: 0; border-bottom: 1px solid #aebdbb; }

  .tool-input-panel textarea,
  .tool-code-result {
    min-height: 300px;
  }
}
