:root {
  color-scheme: light;
  --bg: #f5f5ef;
  --surface: #fffef9;
  --surface-alt: #f0f0e9;
  --ink: #1d211d;
  --muted: #6f746d;
  --line: #d9dbd2;
  --green: #b9f272;
  --green-strong: #78b82e;
  --green-ink: #203412;
  --trust-bg: #edf7fb;
  --trust-border: #9bc7d8;
  --trust-icon: #287895;
  --error: #cf463e;
  --shadow: 0 20px 60px rgba(30, 35, 28, 0.08);
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141714;
  --surface: #1b1f1a;
  --surface-alt: #222720;
  --ink: #eef2e9;
  --muted: #a1a99b;
  --line: #343b31;
  --green: #a8e85b;
  --green-strong: #90d140;
  --green-ink: #17220d;
  --trust-bg: #1d3039;
  --trust-border: #49788b;
  --trust-icon: #80c8df;
  --error: #ff7e74;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); }
button, textarea, select { font: inherit; }
button, select { color: inherit; }
button { cursor: pointer; }

.site-header, main, footer { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.site-header { height: 78px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -0.03em; }
.brand-logo { position: relative; display: block; width: 205px; height: 49px; overflow: hidden; border-radius: 7px; background: #fff; }
.brand-logo img { position: absolute; width: 210px; max-width: none; height: auto; left: -8px; top: -44px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.privacy-pill { padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 600; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--green-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 30%, transparent); }
.icon-button { width: 38px; height: 38px; padding: 9px; border: 1px solid var(--line); border-radius: 50%; background: transparent; }
.icon-button svg, button svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button svg { width: 18px; height: 18px; }
.moon-icon, [data-theme="dark"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: block; }

.hero { padding: 76px 0 48px; text-align: center; }
.eyebrow { display: inline-block; margin-bottom: 20px; padding: 8px 13px; border-radius: 999px; background: color-mix(in srgb, var(--green) 35%, transparent); color: var(--ink); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.hero h1 { max-width: 760px; margin: 0 auto; font-size: clamp(42px, 7vw, 74px); line-height: .98; letter-spacing: -.065em; }
.hero h1 span { color: var(--muted); font-weight: 500; }
.hero-privacy-message { width: fit-content; max-width: min(680px, 100%); margin: 28px auto 0; padding: 13px 18px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--trust-border); border-radius: 12px; background: var(--trust-bg); color: var(--ink); font-size: 14px; line-height: 1.5; box-shadow: 0 4px 14px rgba(40, 120, 149, 0.08); }
.hero-privacy-message svg { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: var(--trust-icon); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hero-privacy-message strong { font-weight: 800; }
.hero > p { max-width: 620px; margin: 18px auto 20px; color: var(--muted); font-size: 17px; line-height: 1.7; }
.trust-row { display: flex; justify-content: center; gap: 25px; color: var(--muted); font-size: 12px; font-weight: 600; }

.workspace { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.workspace-toolbar { min-height: 84px; padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.tool-title { display: flex; align-items: center; gap: 13px; }
.tool-icon { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 12px; background: var(--surface-alt); font-family: var(--mono); font-size: 12px; }
.tool-title h2, .tool-title p, .panel-header h3 { margin: 0; }
.tool-title h2 { font-size: 15px; }
.tool-title p { margin-top: 3px; color: var(--muted); font-size: 11px; }
.indent-control { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; font-weight: 600; }
select { padding: 8px 28px 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 11px; }

.editor-grid { display: grid; grid-template-columns: 1fr; min-height: 500px; }
.editor-panel { min-width: 0; display: grid; grid-template-rows: auto 1fr auto; }
.input-panel { grid-template-rows: auto 1fr auto auto; }
.editor-panel + .editor-panel { border-top: 1px solid var(--line); }
.panel-header { height: 70px; padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-kicker { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.panel-header h3 { margin-top: 3px; font-size: 13px; }
.panel-actions { display: flex; gap: 5px; align-items: center; }
.text-button, .icon-text-button { padding: 7px 9px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; text-decoration: none; }
.text-button:hover, .icon-text-button:hover { background: var(--surface-alt); color: var(--ink); }
.text-button svg, .icon-text-button svg { width: 13px; height: 13px; vertical-align: -3px; margin-right: 4px; }
.utility-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 800; box-shadow: 0 3px 10px rgba(30, 35, 28, 0.09); }
.utility-button:hover { border-color: var(--green-strong); background: color-mix(in srgb, var(--green) 16%, var(--surface)); transform: translateY(-1px); }
.utility-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--green-strong) 30%, transparent); outline-offset: 2px; }
.utility-button-primary { border-color: var(--green-strong); background: var(--green); color: var(--green-ink); }
.utility-button svg { width: 18px; height: 18px; flex: 0 0 auto; }
.drop-zone, .output-area { position: relative; min-height: 390px; background: color-mix(in srgb, var(--surface) 90%, var(--surface-alt)); }
textarea { width: 100%; height: 100%; min-height: 390px; padding: 21px; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); font-family: var(--mono); font-size: 12px; line-height: 1.75; tab-size: 2; }
textarea::placeholder { color: var(--muted); opacity: 1; font-weight: 500; }
.drop-zone.dragging { outline: 2px solid var(--green-strong); outline-offset: -8px; }
.drop-overlay { position: absolute; inset: 8px; display: none; place-content: center; text-align: center; border-radius: 10px; background: color-mix(in srgb, var(--surface) 94%, var(--green)); pointer-events: none; }
.drop-overlay strong { margin-bottom: 7px; }
.drop-overlay span { color: var(--muted); font-size: 12px; }
.dragging .drop-overlay { display: grid; }
.panel-footer { height: 38px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.output-area { overflow: auto; }
.empty-state { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 17px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); font-family: var(--mono); }
.empty-state strong { font-size: 12px; }
.empty-state span { margin-top: 7px; color: var(--muted); font-size: 10px; }
pre { min-height: 390px; margin: 0; padding: 21px; color: var(--ink); font-family: var(--mono); font-size: 12px; line-height: 1.75; white-space: pre; tab-size: 2; }
.xml-punctuation { color: #69736a; }
.xml-tag { color: #087f75; font-weight: 500; }
.xml-attribute { color: #7556b8; }
.xml-value { color: #a85418; }
.xml-text { color: #2457a6; }
.xml-comment { color: #778078; font-style: italic; }
.xml-cdata { color: #9a4f11; }
.xml-declaration { color: #7252ad; }
[data-theme="dark"] .xml-punctuation { color: #9ca69c; }
[data-theme="dark"] .xml-tag { color: #5eead4; }
[data-theme="dark"] .xml-attribute { color: #c4b5fd; }
[data-theme="dark"] .xml-value { color: #fdba74; }
[data-theme="dark"] .xml-text { color: #93c5fd; }
[data-theme="dark"] .xml-comment { color: #9ca3af; }
[data-theme="dark"] .xml-cdata { color: #fbbf24; }
[data-theme="dark"] .xml-declaration { color: #d8b4fe; }
.error-state { margin: 25px; padding: 16px; display: flex; align-items: flex-start; gap: 12px; border: 1px solid color-mix(in srgb, var(--error) 35%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--error) 7%, transparent); color: var(--error); }
.error-icon { display: grid; flex: 0 0 25px; height: 25px; place-items: center; border-radius: 50%; background: var(--error); color: white; font-weight: 700; }
.error-state strong { font-size: 12px; }
.error-state p { margin: 5px 0 0; font-family: var(--mono); font-size: 10px; line-height: 1.6; }
.valid { color: var(--green-strong); }

.input-command-bar { padding: 16px 20px 18px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 84%, var(--green)); }
.command-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.command-meta p { margin: 0; color: var(--muted); font-size: 10px; }
.command-buttons { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.result-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-left: 10px; border-left: 1px solid var(--line); }
.lock-icon { color: var(--green-strong); }
.live-toggle { display: flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 600; }
.live-toggle input { position: absolute; opacity: 0; }
.live-toggle span { position: relative; width: 31px; height: 18px; border-radius: 99px; background: var(--line); transition: .2s; }
.live-toggle span::after { content: ""; position: absolute; width: 12px; height: 12px; top: 3px; left: 3px; border-radius: 50%; background: white; transition: .2s; }
.live-toggle input:checked + span { background: var(--green-strong); }
.live-toggle input:checked + span::after { transform: translateX(13px); }
.primary-button { min-height: 46px; display: flex; align-items: center; gap: 20px; padding: 12px 18px 12px 20px; border: 2px solid var(--green-strong); border-radius: 10px; background: var(--green); color: var(--green-ink); font-size: 14px; font-weight: 800; box-shadow: 0 6px 15px color-mix(in srgb, var(--green) 25%, transparent); }
.primary-button:hover { background: color-mix(in srgb, var(--green) 90%, white); transform: translateY(-1px); }
.primary-button svg { width: 14px; height: 14px; }
.secondary-button { min-height: 46px; display: flex; align-items: center; gap: 10px; padding: 11px 16px; border: 2px solid var(--green-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 800; }
.secondary-button:hover { border-color: var(--green-strong); background: color-mix(in srgb, var(--green) 12%, var(--surface)); }
.secondary-button svg { width: 14px; height: 14px; }
.result-button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; border: 2px solid var(--green-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 800; text-decoration: none; box-shadow: 0 3px 10px color-mix(in srgb, var(--green) 14%, transparent); }
.result-button:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--green) 18%, var(--surface)); box-shadow: 0 6px 15px color-mix(in srgb, var(--green) 22%, transparent); }
.result-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--green-strong) 35%, transparent); outline-offset: 2px; }
.result-button-primary { background: var(--green); color: var(--green-ink); border-color: var(--green-strong); }
.result-button svg { width: 16px; height: 16px; flex: 0 0 auto; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 70px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.features article { padding: 36px; }
.features article + article { border-left: 1px solid var(--line); }
.features span { color: var(--green-strong); font-family: var(--mono); font-size: 10px; }
.features h3 { margin: 20px 0 10px; font-size: 14px; }
.features p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.seo-intro, .how-to, .faq { padding: 68px 0; border-bottom: 1px solid var(--line); }
.section-heading { max-width: 760px; margin-bottom: 34px; }
.section-kicker { display: block; margin-bottom: 12px; color: var(--green-strong); font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.section-heading h2 { margin: 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.045em; line-height: 1.1; }
.section-heading > p { margin: 18px 0 0; color: var(--muted); font-size: 16px; line-height: 1.8; }
.content-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.content-grid article { padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.content-grid h3, .steps h3 { margin: 0 0 10px; font-size: 16px; }
.content-grid p, .steps p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; align-items: flex-start; gap: 15px; padding: 24px; border-top: 2px solid var(--green-strong); background: var(--surface); }
.steps li > span { display: grid; flex: 0 0 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--green); color: var(--green-ink); font-family: var(--mono); font-size: 11px; font-weight: 700; }
.faq-list { border-top: 1px solid var(--line); }
.faq details { padding: 21px 0; border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; gap: 20px; cursor: pointer; font-size: 15px; font-weight: 700; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--green-strong); font-family: var(--mono); font-size: 20px; }
.faq details[open] summary::after { content: "−"; }
.faq details p { max-width: 850px; margin: 13px 0 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.page-back, .footer-links a, .content-page a { color: var(--ink); font-weight: 700; text-decoration-color: var(--green-strong); text-underline-offset: 4px; }
.page-back { font-size: 13px; }
.content-page { max-width: 820px; padding: 80px 0 100px; }
.content-page h1 { max-width: 760px; margin: 0 0 24px; font-size: clamp(40px, 7vw, 68px); line-height: 1; letter-spacing: -.055em; }
.content-page .lead { margin-bottom: 55px; color: var(--muted); font-size: 19px; line-height: 1.7; }
.content-page h2 { margin: 44px 0 12px; font-size: 25px; letter-spacing: -.025em; }
.content-page h3 { font-size: 14px; }
.content-page p, .content-page li { color: var(--muted); font-size: 15px; line-height: 1.85; }
.content-page li + li { margin-top: 7px; }
.updated { margin-top: 55px; font-size: 12px !important; }
.example-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin: 28px 0; }
.example-grid > div { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.example-grid h3 { margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.example-grid pre { min-height: 0; padding: 16px; overflow: auto; font-size: 11px; }
.guide-cta { margin-top: 60px; padding: 34px; border: 1px solid var(--trust-border); border-radius: 16px; background: var(--trust-bg); }
.guide-cta h2 { margin-top: 0; }
.primary-link { display: inline-flex; margin-top: 10px; padding: 12px 18px; border-radius: 9px; background: var(--green); color: var(--green-ink) !important; text-decoration: none; }
footer { min-height: 120px; display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 10px; }
footer > span { margin-left: auto; }
.footer-links { display: flex; gap: 16px; margin-left: 10px; }
.footer-links a { color: var(--muted); font-size: 11px; }
.footer-text-logo { color: var(--ink); font-size: 14px; font-weight: 800; text-decoration: none; }
.footer-brand { color: var(--ink); font-size: 12px; }
.footer-brand .brand-logo { width: 176px; height: 42px; }
.footer-brand .brand-logo img { width: 180px; left: -7px; top: -38px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; padding: 11px 16px; transform: translate(-50%, 20px); border-radius: 9px; background: var(--ink); color: var(--surface); font-size: 11px; font-weight: 600; opacity: 0; pointer-events: none; transition: .2s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 780px) {
  .site-header, main, footer { width: min(100% - 24px, 620px); }
  .privacy-pill { display: none; }
  .hero { padding-top: 55px; }
  .hero h1 { font-size: clamp(38px, 13vw, 58px); }
  .trust-row { flex-wrap: wrap; gap: 8px 18px; }
  .workspace-toolbar { align-items: flex-start; gap: 20px; }
  .editor-grid { grid-template-columns: 1fr; }
  .drop-zone, textarea, .output-area, pre { min-height: 330px; }
  .command-meta { align-items: flex-start; flex-direction: column; }
  .command-buttons { align-items: stretch; }
  .result-actions { width: 100%; padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .result-button { flex: 1 1 145px; }
  .features { grid-template-columns: 1fr; }
  .features article + article { border-left: 0; border-top: 1px solid var(--line); }
  .content-grid, .steps { grid-template-columns: 1fr; }
  .seo-intro, .how-to, .faq { padding: 50px 0; }
  .content-page { padding: 55px 0 75px; }
  .example-grid { grid-template-columns: 1fr; }
  footer { flex-wrap: wrap; padding: 30px 0; }
  footer > span { width: 100%; margin-left: 0; }
  .footer-links { order: 3; width: 100%; margin-left: 0; }
}

@media (max-width: 480px) {
  .workspace-toolbar { flex-direction: column; }
  .hero-privacy-message { align-items: flex-start; padding: 12px 14px; text-align: left; }
  .indent-control { width: 100%; justify-content: space-between; }
  .panel-header { height: auto; min-height: 70px; gap: 10px; }
  .output-panel .panel-header { align-items: flex-start; flex-direction: column; }
  .output-actions { width: 100%; justify-content: space-between; }
  .input-panel .panel-header { align-items: flex-start; flex-direction: column; }
  .input-panel .panel-actions { width: 100%; }
  .utility-button { flex: 1; }
  .icon-text-button span { display: none; }
  .command-buttons { gap: 8px; }
  .primary-button, .secondary-button { flex: 1 1 100%; justify-content: center; }
  .result-button { flex: 1 1 100%; }
}

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