:root {
  color-scheme: dark;
  --bg: #121513;
  --black: #080b09;
  --line: #334138;
  --text: #ebf1eb;
  --muted: #b0bcb2;
  --accent: #91e751;
  --leaf: #d3f4ad;
  --mono: ui-monospace, "Cascadia Code", "Liberation Mono", monospace;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 290px; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid #d5f18e; outline-offset: 3px; }
::selection { color: #080b09; background: #d5f18e; }
:target { scroll-margin-top: 1.5rem; }

.wrap { width: min(940px, calc(100% - 48px)); margin-inline: auto; }
.site-header { background: #080a08; border-bottom: 1px solid #272f28; }
.header-inner { min-height: 3rem; padding-inline: clamp(.85rem, 3vw, 2rem); display: flex; justify-content: space-between; align-items: center; gap: .55rem; }
.brand { display: grid; width: 1.8rem; height: 1.8rem; flex: 0 0 auto; place-items: center; background: #1a251b; border: 1px solid #496941; border-radius: .3rem; color: var(--accent); font: 800 1rem var(--mono); }
.brand:hover { background: #2f462c; }
.language-menu, .socials { display: flex; flex-wrap: wrap; align-items: center; list-style: none; gap: .3rem; margin: 0; padding: 0; }
.language-menu { justify-content: end; }
.language-menu a { display: grid; min-width: 1.9rem; min-height: 1.9rem; place-items: center; border: 1px solid transparent; border-radius: .34rem; font-size: 1.12rem; }
.language-menu a:hover, .language-menu a[aria-current] { border-color: #506849; background: #1e2a20; }

.hero { text-align: center; padding-top: 3.2rem; }
.wordmark { position: relative; display: grid; isolation: isolate; place-items: center; overflow: hidden; min-height: 8.15rem; }
.glyph-field, .wordmark-title { grid-area: 1 / 1; }
.glyph-field {
  transform: rotate(-4deg);
  color: var(--accent);
  font: 740 clamp(2.65rem, 9.2vw, 6.8rem)/1 var(--mono);
  letter-spacing: -.13em;
  opacity: .31;
  white-space: nowrap;
  user-select: none;
  filter: drop-shadow(0 0 12px #61e53989);
}
.wordmark-title {
  color: #f7fbf5;
  font: 920 clamp(2.55rem, 8.3vw, 5.2rem)/1 system-ui, sans-serif;
  letter-spacing: -.085em;
  white-space: nowrap;
  text-shadow: 0 3px 12px #0b130d, 0 1px 3px #000;
}
.wordmark-title span { margin-left: .13em; color: var(--accent); }
.hero h1 { margin: .35rem 0 0; color: #e4f0e2; font-size: clamp(1.2rem, 3.1vw, 1.65rem); line-height: 1.3; letter-spacing: -.025em; }
.hero p { max-width: 38rem; margin: .65rem auto 0; color: var(--muted); line-height: 1.57; }

.socials { justify-content: center; margin: 3.05rem 0 1.45rem; gap: .44rem; }
.socials a { display: grid; place-items: center; min-width: 2.2rem; min-height: 2.1rem; border: 1px solid #3c5742; border-radius: .35rem; background: #1d2b20; color: #cbf49e; font-weight: 780; }
.socials a:hover { background: #2d432d; border-color: var(--accent); }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; min-height: 2rem; padding-inline: .12rem; margin-bottom: .28rem; }
.panel-head label { color: var(--muted); font-size: .9rem; font-weight: 650; }
.subtle { border: 0; color: var(--muted); background: transparent; padding: .3rem .1rem; font-size: .875rem; }
.subtle:hover:not(:disabled) { color: var(--accent); }
.panel { position: relative; }
.panel textarea { display: block; width: 100%; padding: 1rem; outline-offset: 3px; border: 2px solid #6cc63b; border-radius: .3rem; font-size: 1.2rem; }
.source textarea { min-height: 6.25rem; resize: vertical; background: var(--leaf); color: #142210; padding-bottom: 1.55rem; }
.source textarea::placeholder { color: #384b32; }
.count { font: .78rem var(--mono); white-space: nowrap; }
.source .count { position: absolute; bottom: .45rem; right: 1.28rem; pointer-events: none; color: #34472e; }
.result textarea { --preview-height: clamp(15rem, 36vw, 23rem); height: var(--preview-height); padding: calc(var(--preview-height) / 2 - 2.15rem) 1rem 2rem; resize: none; background: var(--black); color: #d2f3ad; text-align: center; line-height: 2.55; }
.result textarea::placeholder { color: #a7bba2; opacity: 1; }
.result textarea.long-result { padding-top: 2rem; }
.result-frame { position: relative; }
.result .count { position: absolute; bottom: .62rem; right: 1rem; pointer-events: none; color: #a0de6c; background: var(--black); }
.status { color: var(--accent); font-size: .875rem; margin: 0; }
.result-status { text-align: center; margin-top: .45rem; min-height: 1.25rem; }

button { color: inherit; }
.actions { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.result-actions { justify-content: center; margin-top: .9rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .46rem; min-height: 2.45rem; padding: .4rem .82rem; border: 1px solid transparent; border-radius: .3rem; font-size: .9rem; font-weight: 750; text-align: center; }
.button:disabled, .button[aria-disabled], .subtle:disabled, .slider button:disabled { opacity: .5; cursor: default; }
.primary { background: var(--accent); color: #192515; }
.regenerate { background: #dddfac; color: #222514; }
.post { background: #c1e1dc; color: #152b2a; }
.quiet { color: var(--text); background: #243229; border-color: #536758; }
.button:hover:not(:disabled):not([aria-disabled]) { filter: brightness(1.12); }

.settings { margin: .35rem 0 .45rem; }
.settings-row, .shape-control, .option-control { border-bottom: 1px dashed var(--line); padding-block: .48rem; }
.settings-row { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem 1rem; }
.primary-settings { justify-content: space-between; }
fieldset { min-width: 0; margin: 0; padding-inline: 0; border: 0; }
fieldset.shape-control, fieldset.option-control { border-bottom: 1px dashed var(--line); }
.setting-label { color: var(--muted); font-size: .875rem; font-weight: 650; }
.range-control { display: flex; align-items: center; gap: .65rem; }
.slider { display: flex; align-items: center; gap: .38rem; }
.slider button { display: grid; place-items: center; flex: 0 0 auto; width: 1.85rem; height: 1.85rem; padding: 0; border: 1px solid #6dba42; border-radius: .27rem; background: #253b23; color: #c6f2a0; }
.slider button:hover:not(:disabled) { background: #385633; }
.slider input { width: clamp(3.35rem, 12vw, 7.5rem); margin: 0; accent-color: var(--accent); height: 1.75rem; cursor: pointer; }
.slider output { color: var(--accent); min-width: 1.6rem; text-align: center; font: 700 .9rem var(--mono); }
.checks { display: flex; flex-wrap: wrap; gap: .25rem 1.05rem; align-items: center; }
.check { display: inline-flex; align-items: center; gap: .4rem; min-height: 1.95rem; font-size: .92rem; cursor: pointer; }
.check input, .shape input { margin: 0; width: .96rem; height: .96rem; accent-color: var(--accent); cursor: inherit; }
.zones .check { font-family: var(--mono); font-weight: 750; }
.check input:checked + span { color: #ccf396; }
.select { position: relative; }
.select select { appearance: none; width: min(15rem, 60vw); min-height: 2.05rem; border: 1px solid #5b7d53; border-radius: .27rem; background: #26382a; color: var(--text); padding: .3rem 1.45rem .3rem .55rem; font-size: .9rem; }
.select::after { content: ''; pointer-events: none; position: absolute; top: .76rem; right: .69rem; width: .4rem; height: .4rem; border: solid var(--accent); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.shapes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .2rem .55rem; }
.shape { display: flex; align-items: center; gap: .4rem; min-height: 1.85rem; cursor: pointer; font-size: .9rem; }
.shape span { display: flex; align-items: center; gap: .35rem; overflow-wrap: anywhere; min-width: 0; }
.shape input { flex: 0 0 auto; }
.shape input:checked + span { color: #ccf396; }
.shape b { flex: 0 0 auto; font: 1.12rem/1 var(--mono); color: var(--accent); }
.options { justify-content: space-between; padding-right: .25rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.guide { max-width: 45rem; margin: 2.2rem auto 3rem; text-align: center; }
.guide > div + div { margin-top: 1.85rem; }
.guide h2 { font-size: 1.16rem; margin: 0 0 .5rem; }
.guide p, .guide ol { margin: 0; color: var(--muted); line-height: 1.62; }
.guide ol { list-style-position: inside; padding: 0; }
.guide li::marker { color: var(--accent); }
.site-footer { background: var(--black); border-top: 1px solid #273427; color: var(--muted); font-size: .875rem; }
.footer-inner { min-height: 3rem; display: flex; justify-content: center; align-items: center; gap: 1.1rem; }
.footer-inner a:hover { color: var(--accent); }
dialog { width: min(30rem, calc(100% - 2rem)); border: 1px solid #52654e; border-radius: .55rem; color: var(--text); background: #1d2a20; padding: 0; }
dialog::backdrop { background: #050805c9; }
.dialog-inner { padding: 1.15rem; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.dialog-head h2 { margin: 0; font-size: 1.1rem; }
.dialog-inner .status:not(:empty), #share-url:not([hidden]) { margin-top: .75rem; }
#share-url { width: 100%; padding: .5rem; }
.noscript { color: var(--accent); }

@media (max-width: 680px) {
  .wrap { width: calc(100% - 30px); }
  .hero { padding-top: 1.8rem; }
  .wordmark { min-height: 5.85rem; }
  .socials { margin-block: 1.7rem 1rem; }
  .shapes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .options { justify-content: start; }
}
@media (max-width: 440px) {
  .header-inner { padding-inline: .48rem; }
  .brand { width: 1.6rem; height: 1.6rem; }
  .language-menu { gap: .04rem; }
  .language-menu a { min-width: 1.62rem; min-height: 1.85rem; font-size: 1rem; }
  .shapes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
