:root {
  color-scheme: dark;
  --bg: #100e17;
  --panel: #191522;
  --line: #392e48;
  --ink: #f4efff;
  --muted: #b8aecb;
  --purple: #c69bff;
  --lime: #d7fb78;
  --mono: ui-monospace, Consolas, monospace;
  font-family: system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse 70% 420px at 50% 140px, #2e1c45, transparent), var(--bg); }
[hidden] { display: none !important; }
button, textarea, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: default; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }
.shell { width: min(1024px, calc(100% - 36px)); margin-inline: auto; }
.nav { min-height: 68px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 7px; font: 800 1rem var(--mono); letter-spacing: .07em; }
.brand-icon { display: block; flex: none; margin-inline-end: 4px; }
.ui-icon { display: inline-block; width: 1.15em; height: 1.15em; flex: none; vertical-align: -.19em; }
.primary .ui-icon, .secondary .ui-icon { margin-inline-end: 4px; }
.sliders .ui-icon { color: var(--purple); }
.lab, nav { color: var(--muted); }
nav { display: flex; gap: 20px; font-size: .9rem; }
nav a:hover { color: var(--ink); }
.nav nav { align-items: center; }
.nav .language-menu { position: relative; padding: 5px 8px; background: var(--panel); }
.language-menu summary { white-space: nowrap; }
.language-menu ul {
  position: absolute;
  z-index: 2;
  inset-inline-end: 0;
  top: calc(100% + 4px);
  width: min(330px, calc(100vw - 36px));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 14px 30px #0007;
}
.language-menu a { display: block; padding: 8px; border-radius: 6px; }
.language-menu a:hover, .language-menu a[aria-current="page"] { color: var(--lime); background: #292039; }
.hero { padding: 42px 0 30px; text-align: center; }
.eyebrow, .tag, .tool-bar, .editor-foot, .guide li > span { font: 700 .73rem var(--mono); letter-spacing: .075em; }
.eyebrow { color: var(--purple); margin: 0 0 12px; }
.eyebrow span, .tool-bar i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--lime); }
h1 { margin: 0; font-size: clamp(2.1rem, 7vw, 4.5rem); line-height: 1.08; letter-spacing: -.065em; }
h1 span { color: var(--purple); }
.hero > p:last-child { max-width: 520px; margin: 13px auto 0; color: var(--muted); line-height: 1.6; }
.tool { border: 1px solid var(--line); border-radius: 19px; background: var(--panel); box-shadow: 0 18px 65px #0005; overflow: hidden; }
.tool-bar { display: flex; justify-content: space-between; gap: 12px; padding: 13px 20px; color: var(--muted); border-bottom: 1px solid var(--line); }
.local { color: var(--lime); text-align: right; }
.editors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.editor { min-width: 0; padding: 16px; }
.editor + .editor { border-left: 1px solid var(--line); }
.editor-head, .editor-foot, .control-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.editor-head { min-height: 32px; margin-bottom: 8px; font-weight: 750; }
small { color: var(--purple); font: 700 .73rem var(--mono); }
.editor-head small { margin-right: 5px; }
.tag { color: var(--purple); }
textarea, #output { display: block; width: 100%; height: 156px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #100d18; color: var(--ink); font-size: 1rem; }
textarea { resize: none; }
#output { overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1.18rem; color: var(--lime); }
#output:empty::before { content: attr(data-placeholder); color: var(--muted); font-size: 1rem; }
.editor-foot { min-height: 46px; padding-top: 8px; color: var(--muted); letter-spacing: 0; }
button { min-height: 38px; border-radius: 8px; font-size: .88rem; font-weight: 750; }
.quiet { padding: 0 8px; border: 0; background: transparent; color: var(--muted); }
.quiet:hover { color: var(--ink); }
.primary { padding: 0 13px; border: 0; background: var(--lime); color: #151a0e; white-space: nowrap; }
.primary:not(:disabled):hover { background: #e7ffab; }
.controls { padding: 15px 16px 17px; border-top: 1px solid var(--line); }
h2 { margin: 0; letter-spacing: -.035em; }
.controls h2 { font-size: 1.08rem; }
.controls p { color: var(--muted); font-size: .85rem; margin: 4px 0 0; }
.presets { display: flex; gap: 5px; }
.presets button, .secondary { border: 1px solid var(--line); padding: 0 11px; background: #211a2e; color: var(--ink); }
.presets button:hover, .secondary:hover { border-color: var(--purple); }
.presets [aria-pressed="true"] { color: #1b1028; background: var(--purple); border-color: var(--purple); }
.sliders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; margin: 16px 0 12px; }
.sliders label { display: flex; align-items: center; gap: 7px; font-size: .88rem; font-weight: 700; }
.sliders output { margin-left: auto; color: var(--purple); font: 700 .83rem var(--mono); }
.sliders input { width: 100%; height: 24px; margin: 4px 0 0; accent-color: var(--purple); cursor: pointer; }
.guide, .faq { margin-top: 44px; scroll-margin-top: 20px; }
.guide h2, .faq h2 { font-size: clamp(1.6rem, 4vw, 2.1rem); margin-bottom: 14px; }
.guide ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; list-style: none; padding: 0; margin: 0; }
.guide li, details { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 15px; }
.guide li > span { color: var(--lime); }
.guide h3 { margin: 7px 0; font-size: 1rem; }
.guide li p, details p { margin: 0; color: var(--muted); line-height: 1.55; font-size: .93rem; }
.guide-intro { max-width: 65ch; color: var(--muted); line-height: 1.6; }
details + details { margin-top: 8px; }
summary { cursor: pointer; font-weight: 700; }
details p { margin-top: 10px; }
footer { border-top: 1px solid var(--line); margin-top: 36px; padding: 18px 0 25px; color: var(--muted); font-size: .84rem; }
.footer-mark { color: var(--lime); margin-inline: 5px; }
@media (max-width: 640px) {
  .nav nav { gap: 9px; font-size: .8rem; }
  .nav nav > a { display: none; }
  .hero { padding-top: 30px; }
  .editors, .guide ol { grid-template-columns: 1fr; }
  .editor + .editor { border-left: 0; border-top: 1px solid var(--line); }
  .editor, .controls { padding-inline: 12px; }
  .control-head { align-items: flex-start; flex-direction: column; }
  .sliders { gap: 9px; }
  .sliders small { display: none; }
  .tool-bar { padding-inline: 12px; font-size: .65rem; }
}

.ad-slot { margin-block: 16px; }
.ad-slot iframe { display: block; width: 100%; border: 0; }
.ad-admin { padding-block: 30px; }
.ad-admin h1 { font-size: clamp(2rem, 5vw, 3rem); }
.ad-admin p { color: var(--muted); }
.admin-form { display: grid; gap: 12px; max-width: 760px; margin-top: 20px; }
.admin-form fieldset { min-width: 0; display: grid; gap: 9px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.admin-form legend { padding-inline: 5px; font-weight: 700; }
.admin-form textarea { resize: vertical; font-family: var(--mono); }
.admin-form input:not([type="hidden"]) { width: min(100%, 300px); padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.admin-form button { justify-self: start; }

.policy-links { flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; }
.policy-links a, .policy-page a, .language-suggestion a { text-decoration: underline; text-underline-offset: 3px; }
.policy-page { max-width: 70ch; margin-inline: auto; padding-top: 36px; line-height: 1.65; }
.policy-page h1 { font-size: clamp(2rem, 6vw, 3.5rem); }
.policy-page h2 { margin-top: 24px; font-size: 1.25rem; }
.policy-page p:not(.eyebrow) { margin-top: 6px; color: var(--muted); }
.language-suggestion {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  margin-top: 14px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--muted);
}
.language-suggestion a { color: var(--lime); font-weight: 700; }
