/* XML Formatter — single stylesheet, no external fonts, no external requests. */

:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --ink: #101828;
  --ink-soft: #344054;
  --muted: #5b6474;
  --line: #e3e7ee;
  --brand: #4338ca;
  --brand-dark: #332ca8;
  --brand-soft: #eef2ff;
  --code-bg: #0f172a;
  --code-bg-soft: #0b1220;
  --code-ink: #e2e8f0;
  --code-line: #1e293b;
  --ok: #047857;
  --ok-soft: #ecfdf5;
  --err: #b42318;
  --err-soft: #fef3f2;
  --warn: #92400e;
  --warn-soft: #fffbeb;
  --radius: 18px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1100px 420px at 50% -140px, #e7e9ff 0%, rgba(245, 246, 250, 0) 70%),
    var(--bg);
}

img, svg { vertical-align: middle; }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 20;
  padding: 8px 14px;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  transition: top .15s ease;
}
.skip-link:focus { top: 10px; color: #fff; }

/* ------------------------------------------------------------------ */
/* header                                                             */
/* ------------------------------------------------------------------ */

.site-header {
  background: rgba(255, 255, 255, .86);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 62px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 750;
  letter-spacing: -.01em;
  font-size: 17px;
}
.brand:hover { color: var(--ink); }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; display: block; }
.brand-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 2px 8px;
}

.site-nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 2px 4px; align-items: center; }
.site-nav a {
  display: inline-block;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 550;
  color: var(--muted);
  text-decoration: none;
}
.site-nav a:hover { color: var(--ink); background: #f2f4f8; }
.site-nav a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); font-weight: 650; }

/* ------------------------------------------------------------------ */
/* hero                                                               */
/* ------------------------------------------------------------------ */

.hero { padding: 26px 0 18px; }

.crumbs {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 10px;
}
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs li { display: inline-flex; align-items: center; gap: 6px; }
.crumbs li + li::before { content: "/"; color: #aab2c0; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--ink-soft); }

h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4.2vw, 2.85rem);
  line-height: 1.08;
  letter-spacing: -.032em;
  font-weight: 800;
}

.lede {
  margin: 0;
  max-width: 76ch;
  font-size: 17px;
  color: var(--ink-soft);
}

.hero-meta {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta .dot { color: #c2c8d4; }

/* ------------------------------------------------------------------ */
/* tool                                                               */
/* ------------------------------------------------------------------ */

.tool {
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 26px 64px -40px rgba(16, 24, 40, .45);
  overflow: hidden;
}

.tool-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 11px 14px;
  background: #fbfcfe;
  border-bottom: 1px solid var(--line);
}

.field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.field label { font-weight: 600; color: var(--ink-soft); }
.field select {
  appearance: none;
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink);
  background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23667085' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 30px 8px 11px;
  cursor: pointer;
}
.field select:hover { border-color: #c6cdd9; }

.tool-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  padding: 10px 15px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, transform .14s ease;
}
.btn:hover { border-color: #b9c1cf; background: #f8fafc; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: progress; transform: none; }
.btn--primary {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 8px 20px -10px rgba(67, 56, 202, .8);
}
.btn--primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn--ghost:hover { background: #f2f4f8; color: var(--ink); }
.btn--small { padding: 7px 11px; font-size: 13px; }

.tool-note {
  display: flex;
  align-items: center;
  gap: 6px 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

/* editor panes */

.editors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--code-bg);
}

.pane { display: flex; flex-direction: column; min-width: 0; }
.pane + .pane { border-left: 1px solid var(--code-line); }

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 14px;
  background: var(--code-bg-soft);
  border-bottom: 1px solid var(--code-line);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.pane-head .meta { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0; text-transform: none; color: #8fa0b8; }
.pane-head .meta.is-over { color: #fca5a5; font-weight: 700; }

.pane textarea {
  width: 100%;
  height: clamp(230px, 35vh, 360px);
  min-height: 190px;
  resize: vertical;
  margin: 0;
  padding: 13px 14px;
  border: 0;
  outline: none;
  background: var(--code-bg);
  color: var(--code-ink);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
  caret-color: #a5b4fc;
}
.pane textarea::placeholder { color: #64748b; }
.pane textarea:focus-visible { box-shadow: inset 0 0 0 2px #6366f1; border-radius: 0; }
.pane textarea[readonly] { color: #dbeafe; }

.tool-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  background: #fbfcfe;
  border-top: 1px solid var(--line);
}
.tool-foot .tool-note { margin-left: auto; }

/* status panel */

.status {
  margin: 12px 14px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  font-size: 14px;
  line-height: 1.55;
}
.status[hidden] { display: none; }
.status h2, .status h3 { margin: 0 0 4px; font-size: 15px; letter-spacing: -.01em; }
.status p { margin: 0; }
.status .status-sub { margin-top: 4px; font-size: 13.5px; opacity: .92; }
.status .status-hint { margin-top: 4px; font-size: 13px; opacity: .8; }
.status .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.status .chip {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid rgba(0, 0, 0, .1);
}
.status[data-kind="ok"] { background: var(--ok-soft); border-color: #a7f3d0; color: var(--ok); }
.status[data-kind="err"] { background: var(--err-soft); border-color: #fecaca; color: var(--err); }
.status[data-kind="warn"] { background: var(--warn-soft); border-color: #fde68a; color: var(--warn); }
.status[data-kind="info"] { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }

.error-item { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(180, 35, 24, .18); }
.error-item:first-of-type { margin-top: 10px; }
.error-item .error-where { font-family: var(--font-mono); font-weight: 700; font-size: 13px; }
.error-item .error-message { margin: 3px 0 0; font-weight: 600; }
.error-item .error-hint { margin: 3px 0 0; font-size: 13px; opacity: .85; }
.error-item pre.frame {
  margin: 8px 0 0;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--code-bg);
  color: #fecaca;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  overflow: auto;
  white-space: pre;
}

/* ------------------------------------------------------------------ */
/* article content                                                    */
/* ------------------------------------------------------------------ */

.content { padding: 8px 0 0; }
.content section { margin-top: 44px; }
.content > section:first-child { margin-top: 40px; }

.content h2 {
  margin: 0 0 14px;
  font-size: clamp(1.35rem, 2.4vw, 1.6rem);
  letter-spacing: -.025em;
  line-height: 1.2;
}
.content h3 {
  margin: 26px 0 8px;
  font-size: 1.08rem;
  letter-spacing: -.01em;
}
.content p {
  margin: 0 0 14px;
  max-width: 78ch;
  color: var(--ink-soft);
  line-height: 1.68;
}
.content ul, .content ol { max-width: 78ch; color: var(--ink-soft); padding-left: 22px; }
.content li { margin: 6px 0; line-height: 1.6; }
.content li strong { color: var(--ink); }
.content code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: #e9edf4;
  color: #1e293b;
  padding: 1px 5px;
  border-radius: 5px;
  word-break: break-word;
}

.callout {
  margin: 20px 0;
  padding: 15px 18px;
  background: var(--brand-soft);
  border-left: 4px solid var(--brand);
  border-radius: 4px 13px 13px 4px;
}
.callout p { margin: 0; color: #312e81; font-size: 15px; max-width: 80ch; }
.callout strong { color: #1e1b4b; }

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 14px;
  margin: 20px 0 6px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  position: relative;
  margin: 0;
  padding: 46px 16px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 14px;
  left: 16px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 750;
}
.steps li h3 { margin: 0 0 5px; font-size: .98rem; }
.steps li p { margin: 0; font-size: 13.5px; line-height: 1.55; }

.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
caption { caption-side: top; text-align: left; padding: 10px 14px 0; font-size: 12.5px; color: var(--muted); }
th, td { padding: 10px 13px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: #f8fafc; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

.example {
  margin: 16px 0;
  padding: 14px 16px;
  overflow: auto;
  border-radius: 12px;
  background: var(--code-bg);
  color: var(--code-ink);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre;
}
.example .errline { color: #fca5a5; }

.faq { margin-top: 18px; border-top: 1px solid var(--line); }
.faq-item { padding: 17px 0 18px; border-bottom: 1px solid var(--line); }
.faq-item h3 { margin: 0 0 6px; font-size: 1.02rem; }
.faq-item p { margin: 0; font-size: 14.5px; color: var(--ink-soft); line-height: 1.65; max-width: 82ch; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 13px;
  margin: 18px 0 0;
}
.tool-card {
  display: block;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tool-card:hover {
  transform: translateY(-2px);
  border-color: #c7cdf7;
  box-shadow: 0 18px 34px -26px rgba(67, 56, 202, .55);
  color: inherit;
}
.tool-card h3 { margin: 0 0 4px; font-size: 1rem; color: var(--ink); }
.tool-card p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.55; max-width: none; }
.tool-card .card-cta { display: inline-block; margin-top: 8px; font-size: 12.5px; font-weight: 700; color: var(--brand); }

/* ------------------------------------------------------------------ */
/* footer                                                             */
/* ------------------------------------------------------------------ */

.site-footer {
  margin-top: 64px;
  padding: 44px 0 26px;
  background: #0b1220;
  color: #cbd5e1;
  font-size: 14px;
}
.site-footer a { color: #cbd5e1; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 30px;
}
.footer-brand .brand { color: #fff; margin-bottom: 10px; }
.footer-brand .brand:hover { color: #fff; }
.footer-brand p { margin: 0; max-width: 44ch; font-size: 13.5px; line-height: 1.65; color: #94a3b8; }
.footer-col h2 {
  margin: 0 0 12px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: #64748b;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 14px; }

.footer-bottom {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid #1e293b;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: #94a3b8;
}
.footer-bottom p { margin: 0; }
.footer-bottom .footer-fineprint { max-width: 70ch; }

/* ------------------------------------------------------------------ */
/* responsive                                                         */
/* ------------------------------------------------------------------ */

@media (max-width: 900px) {
  .editors { grid-template-columns: 1fr; }
  .pane + .pane { border-left: 0; border-top: 1px solid var(--code-line); }
  .pane textarea { height: clamp(180px, 26vh, 260px); min-height: 170px; }
  .tools-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .site-header .container { gap: 8px; min-height: 56px; }
  .site-nav { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; gap: 2px; }
  .site-nav a { white-space: nowrap; padding: 6px 9px; font-size: 13px; }
  .hero { padding: 18px 0 14px; }
  h1 { font-size: 1.85rem; }
  .lede { font-size: 15.5px; }
  .hero-meta { font-size: 12px; gap: 2px 8px; }
  .hero-meta .dot,
  .hero-meta .hero-fineprint { display: none; }
  .tool { margin-top: 16px; border-radius: 14px; }
  .tool-bar { padding: 10px 12px; }
  .tool-actions { width: 100%; margin-left: 0; }
  .tool-actions .btn { flex: 1 1 auto; }
  .tool-foot { padding: 10px 12px; }
  .tool-foot .tool-note { margin-left: 0; width: 100%; }
  .status { margin: 10px 12px; }
  .pane textarea { font-size: 12.5px; }
  .content h2 { margin-top: 34px; }
  .tools-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .site-footer { margin-top: 48px; padding: 34px 0 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* keep the tool inside the first screen on short laptop viewports */
.hero-meta a,
.hero-meta time { white-space: nowrap; }

@media (min-width: 901px) and (max-height: 700px) {
  .hero { padding: 14px 0 10px; }
  .pane textarea { height: clamp(170px, 26vh, 250px); min-height: 160px; }
}
