/* Free tool pages (/tools/<slug>) and their guides.
   Everything is scoped under .xt: style.css paints .form-control text white
   and buttons blue site-wide (made for the dark glass cards), which left
   inputs and outline buttons invisible on these white panels. */

.xt {
  --xt-ink: #1d1d22;
  --xt-muted: #5b5b66;
  --xt-line: #e4e4ea;
  --xt-soft: #f6f6f9;
  --xt-accent: #ff7722;
  --xt-accent-dark: #c2530a;
  --xt-brand: #76135e;
  --xt-ok: #157f3b;
  --xt-bad: #b42318;
  --xt-radius: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 20px 8px;
  color: var(--xt-ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  text-align: left;
}
.xt *, .xt *::before, .xt *::after { box-sizing: border-box; }
.xt h1, .xt h2, .xt h3, .xt h4, .xt p, .xt li, .xt label { text-align: left; }

/* breadcrumb + hero sit on the site's dark gradient */
.xt-crumbs { font-size: 14px; color: rgba(255,255,255,.78); margin: 0 0 14px; }
.xt-crumbs a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.xt-crumbs span[aria-current] { color: rgba(255,255,255,.92); }
.xt-hero { color: #fff; margin: 0 0 28px; max-width: 860px; }
.xt-hero h1 { margin: 0 0 12px; color: #fff; font: 800 clamp(30px, 4.4vw, 46px)/1.1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -.02em; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
.xt-lead { margin: 0; font-size: clamp(16px, 1.6vw, 19px); color: rgba(255,255,255,.9); }
.xt-badges { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 18px 0 0; }
.xt-badges li { font-size: 13px; font-weight: 600; color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  padding: 4px 12px; border-radius: 999px; }

/* cards */
.xt-panel { background: #fff; border-radius: var(--xt-radius); box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 24px; margin: 0 0 20px; }
.xt-panel-title { margin: 0 0 14px; font: 700 12.5px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: .1em;
  text-transform: uppercase; color: var(--xt-brand); }
.xt-grid { display: grid; gap: 20px; }
.xt-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.xt-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.xt-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.xt-grid-side { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); align-items: start; }
.xt-fields { display: grid; gap: 14px 16px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.xt-field { min-width: 0; }
.xt-hint { display: block; margin-top: 4px; font-size: 13px; color: var(--xt-muted); }
@media (max-width: 960px) {
  .xt-grid-3, .xt-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xt-grid-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .xt { padding: 40px 14px 8px; }
  .xt-panel { padding: 18px 16px; border-radius: 14px; }
  .xt-grid-2, .xt-grid-3, .xt-grid-4 { grid-template-columns: minmax(0, 1fr); }
}

/* form controls (readable whatever style.css / Bootstrap say) */
.xt label, .xt .xt-label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--xt-ink); }
.xt input[type="text"], .xt input[type="number"], .xt input[type="email"], .xt input[type="search"], .xt select, .xt textarea, .xt .form-control {
  display: block; width: 100%; min-height: 42px; margin: 0; padding: 9px 12px; color: var(--xt-ink) !important; background: #fff !important;
  border: 1px solid #cfd0d8; border-radius: 10px; box-shadow: none; font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.xt select, .xt select.form-control { padding-right: 32px; }
.xt textarea { min-height: 140px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; }
.xt input::placeholder, .xt textarea::placeholder { color: #8b8b96; opacity: 1; }
.xt input:focus, .xt select:focus, .xt textarea:focus, .xt .form-control:focus {
  outline: none; border-color: var(--xt-accent); box-shadow: 0 0 0 3px rgba(255,119,34,.22); }
.xt input[type="range"] { width: 100%; accent-color: var(--xt-accent); }
.xt input[type="checkbox"], .xt input[type="radio"] { accent-color: var(--xt-accent); width: 18px; height: 18px; vertical-align: -3px; margin: 0 6px 0 0; }
.xt .xt-check { display: inline-flex; align-items: center; gap: 2px; font-weight: 500; margin: 0 16px 0 0; cursor: pointer; }
.xt .input-group { display: flex; flex-wrap: nowrap; }
.xt .input-group > .form-control, .xt .input-group > input { flex: 1 1 auto; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.xt .input-group > .input-group-append { display: flex; }
.xt .input-group > .input-group-append > select, .xt .input-group > .input-group-append > .form-control { width: auto; border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
.xt .form-row { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.xt .form-row > [class*="col"] { padding: 0 8px; }
.xt .form-group { margin-bottom: 14px; }
.xt .table { width: 100%; margin: 0 0 12px; color: var(--xt-ink); border-collapse: collapse; }
.xt .table th { font-size: 13px; font-weight: 700; color: var(--xt-muted); border-bottom: 1px solid var(--xt-line); padding: 8px 6px; text-align: left; vertical-align: bottom; }
.xt .table td { border-top: 1px solid var(--xt-line); padding: 8px 6px; vertical-align: middle; }
.xt .table td .form-control { min-width: 76px; min-height: 38px; padding: 7px 9px; }
.xt .text-muted { color: var(--xt-muted) !important; }

/* buttons */
.xt .xt-btn, .xt .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: auto; min-height: 42px; padding: 9px 16px; margin: 0;
  border: 1px solid transparent; border-radius: 10px; cursor: pointer; text-decoration: none; white-space: nowrap; box-shadow: none;
  font: 600 15px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; transition: background-color .15s, border-color .15s, color .15s; }
.xt .xt-btn-primary, .xt .btn-primary { background: var(--xt-accent); border-color: var(--xt-accent); color: #fff; }
.xt .xt-btn-primary:hover, .xt .btn-primary:hover { background: var(--xt-accent-dark); border-color: var(--xt-accent-dark); color: #fff; }
.xt .xt-btn-ghost, .xt .btn-outline-primary, .xt .btn-outline-secondary, .xt .btn-light, .xt .btn-secondary {
  background: #fff; border-color: #cfd0d8; color: var(--xt-ink); }
.xt .xt-btn-ghost:hover, .xt .btn-outline-primary:hover, .xt .btn-outline-secondary:hover, .xt .btn-light:hover, .xt .btn-secondary:hover {
  border-color: #8f909c; background: var(--xt-soft); color: var(--xt-ink); }
.xt .btn-outline-danger { background: #fff; border-color: #f1c4c0; color: var(--xt-bad); }
.xt .btn-outline-danger:hover { background: #fff3f2; color: var(--xt-bad); }
.xt .btn-sm, .xt .xt-btn-sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.xt .btn-block { display: flex; width: 100%; margin-top: 10px; }
.xt .xt-btn:disabled, .xt .btn:disabled { opacity: .5; cursor: not-allowed; }
.xt .xt-btn:focus-visible, .xt .btn:focus-visible { outline: 3px solid #ffb27d; outline-offset: 2px; }
.xt .xt-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.xt .nav-pills { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; }
.xt .nav-pills .nav-link { display: block; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--xt-ink); font-weight: 600; cursor: pointer; text-decoration: none; }
.xt .nav-pills .nav-link.active { background: var(--xt-accent); color: #fff; }
.xt .xt-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 4px; background: var(--xt-soft); border-radius: 12px; }
.xt .xt-tabs button { flex: 1 1 auto; min-height: 40px; padding: 8px 14px; border: 0; border-radius: 9px; background: transparent; color: var(--xt-muted);
  font: 600 14.5px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; cursor: pointer; }
.xt .xt-tabs button[aria-selected="true"] { background: #fff; color: var(--xt-ink); box-shadow: 0 1px 4px rgba(0,0,0,.12); }

/* results */
.xt-result { margin-top: 14px; font-size: 17px; font-weight: 600; color: var(--xt-brand); }
.xt-stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.xt-stat { background: var(--xt-soft); border: 1px solid var(--xt-line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.xt-stat span { display: block; font-size: 12.5px; font-weight: 600; color: var(--xt-muted); text-transform: uppercase; letter-spacing: .04em; }
.xt-stat strong { display: block; margin-top: 2px; font-size: 22px; line-height: 1.2; color: var(--xt-ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.xt-stat small { display: block; font-size: 13px; color: var(--xt-muted); }
.xt-stat.is-good strong { color: var(--xt-ok); }
.xt-stat.is-bad strong { color: var(--xt-bad); }
.xt-note, .xt-warn, .xt-ok, .xt-error { border-radius: 10px; padding: 10px 14px; margin: 12px 0 0; font-size: 14.5px; }
.xt-note { background: #f1f5ff; border: 1px solid #cdd9f8; color: #213a77; }
.xt-warn { background: #fff7e6; border: 1px solid #f6d58e; color: #6b4a00; }
.xt-ok { background: #ecfaf0; border: 1px solid #b4e5c3; color: #0f5c2b; }
.xt-error { background: #fff1f0; border: 1px solid #f4c4bf; color: #8d1c12; }
.xt-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.xt-code { position: relative; margin: 10px 0 0; }
.xt-code pre { margin: 0; padding: 14px 16px; background: #15151c; color: #e9e9f1; border-radius: 12px; overflow: auto; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }
.xt-code .xt-copy { position: absolute; top: 8px; right: 8px; min-height: 30px; padding: 4px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08); color: #fff; font: 600 12.5px/1 system-ui, sans-serif; cursor: pointer; }
.xt-code .xt-copy:hover { background: rgba(255,255,255,.18); }
.xt-canvas { display: block; width: 100%; height: 340px; background: #fff; border: 1px solid var(--xt-line); border-radius: 12px; }

/* guide article under the tool */
.xt-guide { padding: 32px clamp(18px, 4vw, 48px); }
.xt-guide > *:first-child { margin-top: 0; }
.xt-guide h2 { margin: 36px 0 12px; font: 750 clamp(22px, 2.4vw, 27px)/1.25 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #15151a; letter-spacing: -.01em; }
.xt-guide h3 { margin: 26px 0 8px; font: 700 19px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #15151a; }
.xt-guide p { margin: 0 0 14px; color: #2c2c33; }
.xt-guide ul, .xt-guide ol { margin: 0 0 16px; padding-left: 22px; color: #2c2c33; }
.xt-guide li { margin: 0 0 6px; }
.xt-guide a { color: #b4480a; text-decoration: underline; text-underline-offset: 2px; }
.xt-guide code { padding: 1px 6px; background: #f1f1f5; border-radius: 6px; font: .9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #6b1350; }
.xt-guide pre { margin: 0 0 16px; padding: 14px 16px; background: #15151c; color: #e9e9f1; border-radius: 12px; overflow: auto; font: 13.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.xt-guide pre code { padding: 0; background: none; color: inherit; font-size: inherit; }
.xt-guide table { width: 100%; margin: 0 0 18px; border-collapse: collapse; font-size: 15px; }
.xt-guide th, .xt-guide td { padding: 9px 10px; border: 1px solid var(--xt-line); text-align: left; vertical-align: top; }
.xt-guide th { background: var(--xt-soft); font-weight: 700; }
.xt-guide .xt-table-wrap { overflow-x: auto; margin: 0 0 18px; }
.xt-guide .xt-table-wrap table { margin: 0; min-width: 520px; }
.xt-guide .formula { margin: 0 0 16px; padding: 12px 16px; background: var(--xt-soft); border-left: 4px solid var(--xt-accent); border-radius: 8px;
  font: 15px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-x: auto; white-space: pre-wrap; }
.xt-guide blockquote { margin: 0 0 16px; padding: 10px 16px; border-left: 4px solid var(--xt-brand); background: #fbf4f9; color: #3b2236; border-radius: 8px; }
.xt-guide .xt-steps { counter-reset: xtstep; list-style: none; padding-left: 0; }
.xt-guide .xt-steps > li { position: relative; padding-left: 40px; margin-bottom: 12px; }
.xt-guide .xt-steps > li::before { counter-increment: xtstep; content: counter(xtstep); position: absolute; left: 0; top: 0; width: 28px; height: 28px;
  border-radius: 50%; background: var(--xt-accent); color: #fff; font: 700 14px/28px system-ui, sans-serif; text-align: center; }

/* FAQ, guides, project and other tools */
.xt-section-title { margin: 0 0 6px; font: 750 clamp(22px, 2.4vw, 27px)/1.25 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #15151a; }
.xt-section-lead { margin: 0 0 18px; color: var(--xt-muted); }
.xt-faq details { border-top: 1px solid var(--xt-line); }
.xt-faq details:last-child { border-bottom: 1px solid var(--xt-line); }
.xt-faq summary { list-style: none; cursor: pointer; position: relative; padding: 16px 36px 16px 0; font-weight: 650; font-size: 16.5px; color: #15151a; }
.xt-faq summary::-webkit-details-marker { display: none; }
.xt-faq summary::after { content: "+"; position: absolute; right: 6px; top: 12px; font-size: 24px; line-height: 1; color: var(--xt-accent); transition: transform .2s; }
.xt-faq details[open] summary::after { transform: rotate(45deg); }
.xt-faq details p { margin: 0 0 16px; color: #2c2c33; }
.xt-guides { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.xt-guide-card { display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid var(--xt-line); border-radius: 14px;
  text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.xt-guide-card:hover { border-color: #b9b9c6; transform: translateY(-2px); text-decoration: none; color: inherit; }
.xt-guide-card img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; background: var(--xt-soft); }
.xt-guide-card div { padding: 14px 16px 16px; }
.xt-guide-card h3 { margin: 0 0 6px; font: 700 16.5px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #15151a; }
.xt-guide-card p { margin: 0; font-size: 14px; color: var(--xt-muted); }
.xt-callout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.xt-callout p { margin: 0; color: #2c2c33; max-width: 70ch; }
.xt-tools { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.xt-tool-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--xt-line); border-radius: 12px; text-decoration: none; color: var(--xt-ink); background: #fff; }
.xt-tool-link:hover { border-color: #b9b9c6; background: var(--xt-soft); color: var(--xt-ink); text-decoration: none; }
.xt-tool-link .xt-tool-icon { font-size: 24px; line-height: 1; }
.xt-tool-link strong { display: block; font-size: 15px; }
.xt-tool-link small { display: block; font-size: 13px; color: var(--xt-muted); line-height: 1.35; }

.xt-visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) { .xt-guide-card, .xt-faq summary::after { transition: none; } }
