:root {
  --bg: #090b10;
  --surface: #0f1218;
  --surface-2: #141821;
  --line: #252a35;
  --line-soft: #1c212b;
  --text: #f4f6fa;
  --muted: #8b93a3;
  --accent: #d5ff42;
  --accent-dark: #1a2108;
  --radius: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.ambient { position: fixed; width: 520px; height: 520px; border-radius: 50%; filter: blur(150px); opacity: .07; pointer-events: none; z-index: -1; }
.ambient-one { background: var(--accent); top: -280px; right: -120px; }
.ambient-two { background: #5568ff; top: 55%; left: -380px; }

.site-header, main, footer { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.site-header { height: 84px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -.03em; }
.brand b { color: var(--muted); font-weight: 500; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--accent); color: #0a0c08; font-size: 12px; font-weight: 800; letter-spacing: -.05em; transform: rotate(-4deg); }
.help-link { color: var(--muted); text-decoration: none; font-size: 14px; transition: color .2s; }
.help-link:hover { color: var(--text); }

.hero { padding: 96px 0 68px; text-align: center; }
.eyebrow, .step-label { color: var(--accent); text-transform: uppercase; letter-spacing: .13em; font-size: 11px; font-weight: 800; }
.eyebrow { display: flex; align-items: center; justify-content: center; gap: 9px; margin-bottom: 22px; }
.eyebrow span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.hero h1 { max-width: 890px; margin: 0 auto; font-size: clamp(45px, 7vw, 82px); line-height: .98; letter-spacing: -.065em; font-weight: 700; }
.hero h1 em { color: var(--muted); font-style: normal; font-weight: 500; }
.hero p { max-width: 590px; margin: 28px auto 0; color: var(--muted); font-size: 17px; line-height: 1.7; }

.builder { border: 1px solid var(--line); border-radius: 28px; background: rgba(15,18,24,.88); box-shadow: 0 28px 100px rgba(0,0,0,.22); overflow: hidden; }
.builder-head { padding: 30px 34px 24px; display: flex; align-items: end; justify-content: space-between; }
.builder h2, .saved-section h2, .guide h2 { margin: 7px 0 0; letter-spacing: -.035em; font-size: 27px; }
.selected-chip { border: 1px solid #36401d; background: var(--accent-dark); color: #aab58a; border-radius: 99px; padding: 8px 13px; font-size: 12px; }
.selected-chip strong { color: var(--accent); margin-left: 4px; }

.keyboard-wrap { padding: 10px 28px 34px; overflow-x: auto; scrollbar-color: var(--line) transparent; }
.keyboard { width: 100%; min-width: 840px; display: flex; flex-direction: column; gap: 7px; padding: 13px; border-radius: 18px; background: #0a0d12; border: 1px solid #1c2029; }
.key-row { display: flex; gap: 7px; }
.key { position: relative; height: 50px; min-width: 0; flex: 1; color: #a3aab6; background: linear-gradient(180deg, #191e27, #13171e); border: 1px solid #2a303c; border-bottom-color: #090b0e; border-radius: 8px; box-shadow: 0 3px 0 #090b0e; font-family: "DM Mono", monospace; font-size: 11px; transition: border-color .15s, color .15s, transform .15s, background .15s; }
.key:hover { border-color: #626b38; color: var(--text); transform: translateY(-1px); }
.key.selected { color: #0b0e07; background: var(--accent); border-color: #e6ff86; box-shadow: 0 3px 0 #72891e, 0 0 24px rgba(213,255,66,.17); font-weight: 600; }
.key.w125 { flex: 1.25; } .key.w15 { flex: 1.5; } .key.w175 { flex: 1.75; } .key.w2 { flex: 2; } .key.w225 { flex: 2.25; } .key.w275 { flex: 2.75; } .key.w625 { flex: 6.25; }
.key-spacer { flex: .65; }

.config-grid { display: grid; grid-template-columns: 1.05fr .95fr; border-top: 1px solid var(--line); }
.editor-panel, .result-panel { padding: 36px; }
.editor-panel { border-right: 1px solid var(--line); }
.field-group { margin-top: 26px; }
.field-group label { display: block; font-size: 13px; color: #c5cad3; margin-bottom: 9px; font-weight: 600; }
.label-row { display: flex; align-items: center; justify-content: space-between; color: #677080; font-size: 11px; }
.label-row label { margin: 0; }
select, textarea, input { width: 100%; color: var(--text); background: #0b0e13; border: 1px solid var(--line); border-radius: 11px; transition: border-color .2s; }
select:hover, textarea:hover, input:hover, select:focus, textarea:focus, input:focus { border-color: #424957; }
select { height: 48px; padding: 0 44px 0 14px; appearance: none; }
.select-wrap { position: relative; }
.select-wrap::after { content: "⌄"; position: absolute; right: 15px; top: 11px; color: var(--muted); pointer-events: none; }
textarea { padding: 14px; resize: vertical; min-height: 106px; line-height: 1.55; }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; top: 12px; left: 14px; color: var(--accent); }
.input-prefix input { height: 48px; padding: 0 14px 0 28px; }
.text-button { border: 0; padding: 0; color: var(--muted); background: none; font-size: 11px; }
.text-button:hover { color: var(--text); }
.colors { display: flex; flex-wrap: wrap; gap: 8px; }
.color-button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #292f39; background: var(--swatch); box-shadow: inset 0 0 0 3px #0f1218; transition: transform .15s, border-color .15s; }
.color-button:hover { transform: scale(1.12); border-color: #68707e; }
.format-button { height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: #171b23; color: #c6ccd7; font-family: "DM Mono", monospace; font-size: 11px; }
.field-hint { color: #646c7b; font-size: 11px; line-height: 1.5; margin: 10px 0 0; }
.field-hint code { color: var(--accent); }

.result-panel { background: #0c0f14; }
.preview-card { margin-top: 24px; padding: 18px; border: 1px solid var(--line-soft); border-radius: 14px; background: #11151c; min-height: 104px; }
.preview-label, .output-top { color: #697282; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; }
.chat-preview { display: flex; gap: 11px; align-items: flex-start; margin-top: 15px; }
.chat-preview p { margin: 0; color: #e3e7ed; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.chat-icon { display: grid; place-items: center; flex: 0 0 auto; width: 25px; height: 25px; border-radius: 7px; background: #242a35; color: var(--accent); font-size: 11px; }
.output-block { margin-top: 14px; border: 1px solid #2b3220; border-radius: 14px; background: #0a0d0b; overflow: hidden; }
.output-top { padding: 10px 13px; display: flex; justify-content: space-between; border-bottom: 1px solid #20251b; }
.status-dot { color: #869161; }
.status-dot::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: var(--accent); }
#bind-output { display: block; min-height: 70px; padding: 17px 14px; color: #d7e2b4; font-family: "DM Mono", monospace; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.copy-button, .save-button { width: 100%; height: 50px; border-radius: 11px; font-weight: 800; }
.copy-button { margin-top: 14px; color: #0b0d08; background: var(--accent); border: 0; box-shadow: 0 8px 26px rgba(213,255,66,.11); transition: transform .15s, filter .15s; }
.copy-button:hover { filter: brightness(1.07); transform: translateY(-1px); }
.copy-button.copied { background: #bbf7d0; }
.copy-icon { margin-right: 8px; }
.save-button { margin-top: 9px; color: #b1b8c5; background: transparent; border: 1px solid var(--line); }
.save-button:hover { color: var(--text); border-color: #454c59; }
.unbind-row { display: flex; justify-content: space-between; gap: 15px; margin-top: 18px; color: #626a78; font-size: 10px; }
.unbind-row button { border: 0; background: none; color: #8e97a6; padding: 0; font-size: 10px; text-decoration: underline; text-underline-offset: 3px; }

.saved-section { margin-top: 28px; padding: 32px 36px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.section-heading { display: flex; justify-content: space-between; align-items: end; }
.saved-list { display: grid; gap: 9px; margin-top: 24px; }
.saved-item { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 12px; background: #0b0e13; }
.saved-key { display: grid; place-items: center; height: 38px; border-radius: 8px; background: var(--accent-dark); color: var(--accent); font-family: "DM Mono", monospace; font-size: 12px; border: 1px solid #34401a; }
.saved-command { min-width: 0; color: #b7beca; font-family: "DM Mono", monospace; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-actions { display: flex; gap: 7px; }
.saved-actions button { border: 1px solid var(--line); background: #151921; color: #9ca4b2; border-radius: 7px; height: 30px; padding: 0 10px; font-size: 10px; }
.saved-actions button:hover { color: var(--text); }
.privacy-note { color: #5e6674; font-size: 10px; margin: 14px 0 0; }

.guide { display: grid; grid-template-columns: .8fr 1.2fr; gap: 70px; align-items: start; padding: 120px 40px; }
.guide-copy p { color: var(--muted); line-height: 1.7; font-size: 14px; }
.guide-steps { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.guide-steps li { display: grid; grid-template-columns: 42px 1fr; gap: 16px; padding: 21px 0; border-bottom: 1px solid var(--line); }
.guide-steps li > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--accent); background: var(--accent-dark); border: 1px solid #303a18; font-family: "DM Mono", monospace; font-size: 11px; }
.guide-steps strong { font-size: 14px; }
.guide-steps p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
footer { min-height: 110px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; color: #646c78; font-size: 11px; }
footer > span { color: #a4abb6; font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 10; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; padding: 11px 15px; border: 1px solid #39431f; border-radius: 9px; background: #171d0c; color: #d8f887; font-size: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.35); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 820px) {
  .hero { padding-top: 72px; }
  .config-grid, .guide { grid-template-columns: 1fr; }
  .editor-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .guide { gap: 38px; padding: 80px 10px; }
}
@media (max-width: 560px) {
  .site-header, main, footer { width: min(100% - 24px, 1180px); }
  .site-header { height: 70px; }
  .help-link { display: none; }
  .hero { padding: 60px 4px 48px; }
  .hero h1 { font-size: 43px; }
  .hero p { font-size: 14px; }
  .builder { border-radius: 20px; }
  .builder-head { padding: 24px 20px 16px; }
  .builder-head h2 { font-size: 22px; }
  .keyboard-wrap { padding: 8px 14px 25px; }
  .editor-panel, .result-panel { padding: 27px 20px; }
  .saved-section { padding: 25px 20px; }
  .saved-item { grid-template-columns: 46px 1fr; }
  .saved-actions { grid-column: 1 / -1; justify-content: flex-end; }
  footer { flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; }
  footer p { margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
