:root {
  --bg: #f1f3f5;
  --bg-strong: #e6eaee;
  --panel: #ffffff;
  --panel-border: #cfd6dd;
  --text: #26323b;
  --muted: #566774;
  --accent: #2d5f8b;
  --accent-strong: #214766;
  --accent-soft: #e7eef5;
  --success: #2f6b52;
  --error: #9d2f2f;
  --shadow: 0 1px 3px rgba(28, 35, 43, 0.08);
  --body-font: "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --code-font: "GitLab Mono", "JetBrains Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --action-column: 146px;
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body-font);
  color: var(--text);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-strong) 100%);
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
textarea,
input {
  font: inherit;
}

.page-shell {
  width: min(1440px, calc(100% - 20px));
  margin: 0 auto;
  min-height: 100vh;
  padding: 14px 0 28px;
}

.tool-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 12px;
}

.tool-link {
  display: inline-flex;
  align-items: center;
  padding: 0;
  color: var(--accent-strong);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
}

.tool-link::after {
  content: "|";
  margin: 0 10px;
  color: #7a8996;
}

.tool-link:last-child::after {
  content: "";
  margin: 0;
}

.tool-link[aria-current="page"] {
  color: #1d2d39;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.tool-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.trust-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid #bfd7c9;
  border-radius: 6px;
  background: #eef8f1;
  box-shadow: none;
}

.trust-banner strong {
  font-size: 1rem;
  color: #184b39;
}

.trust-banner span {
  color: #2a5f4b;
  font-size: 0.95rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--action-column) minmax(360px, 1fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 12px;
}

.hero-copy,
.hero-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 24px 16px;
  grid-column: 1 / 3;
}

.hero-card {
  grid-column: 3;
}

.eyebrow,
.panel-label,
.card-title {
  margin: 0 0 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-family: var(--body-font);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 20ch;
  font-family: var(--body-font);
  font-size: clamp(1.85rem, 2.8vw, 2.55rem);
  line-height: 1.06;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #27323b;
}

.hero-text {
  max-width: 58ch;
  margin-top: 10px;
  font-size: 0.93rem;
  line-height: 1.42;
  color: var(--muted);
}

.hero-subtext {
  max-width: 58ch;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.42;
}

.hero-card {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
}

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

.tag-list li {
  position: relative;
  padding: 6px 10px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
  font-size: 0.82rem;
  transition: background 160ms ease, color 160ms ease;
  border: 1px solid #c5d4e3;
}

.tag-list button {
  position: absolute;
  top: -5px;
  right: -3px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--accent-strong);
  color: #fff8f1;
  font-size: 0.68rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 140ms ease, transform 140ms ease;
}

.tag-list li:hover button,
.tag-list li:focus-within button {
  opacity: 1;
  transform: scale(1);
}

.custom-keywords {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.custom-keywords input {
  width: 100%;
  border: 1px solid #bcc6d0;
  border-radius: 4px;
  background: #ffffff;
  padding: 10px 12px;
  color: var(--text);
  outline: none;
}

.custom-keywords input:focus {
  border-color: rgba(45, 95, 139, 0.48);
  box-shadow: 0 0 0 3px rgba(45, 95, 139, 0.12);
}

.history-block {
  margin-top: 14px;
}

.history-title {
  margin: 0 0 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-chip {
  padding: 6px 10px;
  border: 1px solid #d0d9e1;
  border-radius: 999px;
  background: #f8fbfd;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.history-chip:hover {
  background: #eef4f9;
}

.history-empty {
  font-size: 0.82rem;
  color: var(--muted);
}

.helper-text {
  margin-top: auto;
  padding-top: 14px;
  font-size: 0.83rem;
  line-height: 1.4;
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--action-column) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.panel {
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 24px;
  content-visibility: auto;
  align-items: stretch;
}

.site-footer {
  display: flex;
  justify-content: center;
  margin-top: 28px;
  padding-bottom: 8px;
}

.policy-header {
  padding: 20px 2px 10px;
}

.policy-layout {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.policy-card {
  padding: 20px 0;
  border: 0;
  border-top: 1px solid #d5dde5;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  max-width: 78ch;
}

.policy-card h2 {
  margin: 0 0 10px;
  font-family: var(--body-font);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #27323b;
}

.policy-card p {
  color: var(--muted);
  line-height: 1.72;
}

.policy-list {
  margin: 12px 0 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.72;
}

.policy-list li + li {
  margin-top: 8px;
}

.policy-list strong,
.policy-card p strong {
  color: var(--text);
}

.guide-tool-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}

.guide-tool-list li + li {
  margin-top: 8px;
}

.guide-tool-list .directory-link {
  font-weight: 600;
}

.footer-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  color: var(--text);
  font-size: 0.82rem;
}

.footer-link {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 700;
}

.footer-link:hover {
  text-decoration: underline;
}

.technical-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--text);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 20px;
}

.technical-list code {
  font-family: var(--code-font);
}

.info-card {
  padding: 20px 22px;
  border: 1px solid #d8e0e7;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 2px rgba(28, 35, 43, 0.04);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-card h2 {
  margin-bottom: 0;
  font-family: var(--body-font);
  font-size: 1.1rem;
  line-height: 1.22;
  max-width: 24ch;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #27323b;
}

.info-card p {
  color: var(--muted);
  line-height: 1.55;
  max-width: 68ch;
}

.support-section {
  margin-top: 26px;
  padding: 8px 0 0;
  border: 0;
  border-top: 1px solid #d5dde5;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  max-width: 84ch;
}

.support-section h2 {
  margin: 0 0 10px;
  font-family: var(--body-font);
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #27323b;
}

.support-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.support-section p + p,
.support-section ul {
  margin-top: 12px;
}

.support-section ul {
  padding-left: 18px;
  color: var(--text);
}

.support-section li + li {
  margin-top: 8px;
}

.tool-directory {
  margin-top: 28px;
  padding: 18px 18px 20px;
  border: 1px solid #dce5ec;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(248, 251, 253, 0.96) 0%, rgba(240, 245, 249, 0.92) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.directory-lead h2 {
  margin: 0 0 10px;
  font-family: var(--body-font);
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #27323b;
}

.directory-lead p:last-child {
  color: var(--muted);
  line-height: 1.55;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.directory-card {
  padding: 18px;
  border: 1px solid #d4dde5;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(239, 244, 248, 0.96) 0%, rgba(233, 239, 244, 0.94) 100%);
}

.directory-card h3 {
  margin: 0 0 10px;
  font-size: 1.12rem;
  line-height: 1.2;
}

.directory-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.directory-link,
.directory-link:visited {
  color: var(--accent-strong);
  font-weight: 600;
  text-decoration: none;
  transition: color 140ms ease;
}

.directory-link:hover,
.directory-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.14em;
  text-decoration-thickness: 1px;
  color: #1f4461;
}

.example-section {
  margin-top: 24px;
  margin-bottom: 12px;
  padding: 8px 0 0;
  border: 0;
  border-top: 1px solid #d5dde5;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.example-lead {
  margin-bottom: 14px;
}

.example-lead h2 {
  margin: 0 0 6px;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.example-lead p {
  color: var(--muted);
  line-height: 1.5;
}

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

.example-card {
  border: 1px solid #d7dee5;
  border-radius: 6px;
  background: #fbfcfd;
  overflow: hidden;
}

.example-card-head {
  padding: 10px 12px;
  border-bottom: 1px solid #dde4eb;
  background: #f4f7fa;
}

.example-card-head strong {
  display: block;
  font-size: 0.96rem;
}

.example-card-head span {
  display: block;
  margin-top: 3px;
  font-size: 0.8rem;
  color: var(--muted);
}

.example-code {
  margin: 0;
  padding: 12px 14px;
  background: #ffffff;
  color: #30404d;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  font-family: var(--code-font);
  font-size: 0.85rem;
  line-height: 1.48;
}

.example-code .masked-fragment {
  display: inline-block;
  padding: 0 3px;
  border-radius: 3px;
  background: #dff5e5;
  color: #1f5130;
}

.guide-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.guide-list li {
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8ee;
}

.guide-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.guide-list a,
.guide-list a:visited {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 0.14em;
  text-decoration-thickness: 1px;
  font-weight: 700;
}

.guide-list a:hover,
.guide-list a:focus-visible {
  color: #1f4461;
}

.contact-form {
  display: grid;
  gap: 14px;
  max-width: 78ch;
}

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

.form-field {
  display: grid;
  gap: 6px;
}

.form-field label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #33424d;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #bcc6d0;
  border-radius: 4px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: rgba(45, 95, 139, 0.48);
  box-shadow: 0 0 0 3px rgba(45, 95, 139, 0.12);
}

.form-field textarea {
  min-height: 180px;
  resize: vertical;
}

.contact-note {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--muted);
}

.contact-submit {
  justify-self: start;
}

.feature-list {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--text);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 20px;
}

.faq-card details {
  padding: 10px 0;
  border-top: 1px solid rgba(65, 43, 27, 0.1);
}

.faq-card details:first-of-type {
  margin-top: 2px;
}

.faq-card summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.4;
}

.faq-card summary::-webkit-details-marker {
  display: none;
}

.faq-card details p {
  margin-top: 8px;
}

.panel-head,
.button-row,
.option-bar,
.action-strip {
  display: flex;
  align-items: center;
}

.panel-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-head h2 {
  font-size: 1.2rem;
}

.button-row {
  gap: 12px;
  flex-wrap: wrap;
}

.icon-button {
  min-width: 88px;
  padding: 9px 12px;
  gap: 8px;
}

.icon-button,
.icon-button span {
  display: inline-flex;
  align-items: center;
}

.icon-button span {
  font-size: 0.95rem;
  line-height: 1;
}

textarea {
  width: 100%;
  min-height: 0;
  height: clamp(360px, 60vh, 620px);
  resize: none;
  border: 1px solid #bcc6d0;
  border-radius: 4px;
  background: #ffffff;
  padding: 14px;
  color: var(--text);
  font-family: var(--code-font);
  font-size: 0.88rem;
  line-height: 1.45;
  outline: none;
}

.editor-shell {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  height: clamp(360px, 60vh, 620px);
  border: 1px solid #bcc6d0;
  border-radius: 4px;
  background: #ffffff;
  overflow: hidden;
}

.editor-shell.is-drag-over {
  border-color: rgba(45, 95, 139, 0.7);
  box-shadow: inset 0 0 0 2px rgba(45, 95, 139, 0.12);
  background: #f7fbfe;
}

.editor-shell:focus-within {
  border-color: rgba(45, 95, 139, 0.48);
  box-shadow: 0 0 0 3px rgba(45, 95, 139, 0.12);
}

.editor-gutter {
  padding: 14px 10px;
  overflow: hidden;
  text-align: right;
  color: #8491a0;
  background: #f6f8fa;
  border-right: 1px solid #e1e6eb;
  font-family: var(--code-font);
  font-size: 0.88rem;
  line-height: 1.45;
  user-select: none;
  white-space: pre;
}

.editor-shell textarea {
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.sr-only-output {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

textarea:focus {
  border-color: rgba(45, 95, 139, 0.48);
  box-shadow: 0 0 0 3px rgba(45, 95, 139, 0.12);
}

.editor-shell textarea:focus {
  border-color: transparent;
  box-shadow: none;
}

.drop-help {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 10px 2px 0;
  padding: 6px 10px;
  border: 1px solid #d7e1ea;
  border-radius: 999px;
  background: #f7fafc;
  font-size: 0.81rem;
  font-weight: 600;
  color: #49606f;
}

.code-viewer {
  height: clamp(360px, 60vh, 620px);
  overflow: auto;
  border: 1px solid #bcc6d0;
  border-radius: 4px;
  background: #ffffff;
  font-family: var(--code-font);
  font-size: 0.88rem;
  line-height: 1.45;
}

.code-viewer-empty {
  padding: 14px;
  color: var(--muted);
}

.code-line {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
}

.code-line.is-masked {
  background: #e6f4ea;
}

.code-line.is-masked .code-line-number {
  background: #d8f0dc;
}

.code-line-number {
  padding: 0 10px;
  text-align: right;
  color: #8491a0;
  background: #f6f8fa;
  border-right: 1px solid #e1e6eb;
  user-select: none;
}

.code-line-content {
  padding: 0 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.option-bar {
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.select-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.select-field select {
  min-width: 150px;
  border: 1px solid #bcc6d0;
  border-radius: 4px;
  background: #ffffff;
  padding: 7px 10px;
  color: var(--text);
}

.action-strip {
  flex-direction: column;
  justify-content: center;
  justify-self: center;
  gap: 10px;
  width: var(--action-column);
  min-width: 0;
  padding: 0;
}

.action-feedback {
  display: grid;
  gap: 6px;
  text-align: center;
  justify-items: center;
}

.primary-button,
.ghost-button {
  appearance: none;
  border: 1px solid #b7c2cc;
  border-radius: 4px;
  padding: 9px 12px;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
  font-weight: 700;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border-color: #214766;
  color: #ffffff;
  white-space: nowrap;
  line-height: 1.15;
}

.action-strip .primary-button {
  min-width: 132px;
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.ghost-button {
  background: #f8fafc;
  color: var(--text);
}

.status-message {
  color: #435564;
  max-width: 18ch;
  text-align: center;
  font-size: 0.86rem;
  line-height: 1.45;
  font-weight: 400;
}

.status-message.success {
  color: var(--success);
}

.status-message.error {
  color: var(--error);
}

.format-hint {
  margin: 0;
  max-width: 18ch;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--muted);
}

.format-hint a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.format-hint a:hover {
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 860px) {
  .page-shell {
    width: min(100% - 12px, 1440px);
    padding-top: 10px;
    min-height: auto;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .hero-card {
    grid-column: auto;
  }

  .tool-nav {
    margin-bottom: 10px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .directory-grid {
    grid-template-columns: 1fr;
  }

  .example-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .feature-list,
  .technical-list {
    grid-template-columns: 1fr;
  }

  .site-footer {
    justify-content: stretch;
  }

  .footer-bar {
    width: 100%;
    justify-content: flex-start;
  }

  .deep-dive-card {
    padding: 18px;
  }

  .panel-head,
  .action-strip {
    flex-direction: column;
    align-items: flex-start;
  }

  textarea {
    height: 260px;
    resize: vertical;
  }

  .status-message {
    max-width: none;
    text-align: left;
  }
}
