:root {
  --bg: #0a0e14;
  --bg-alt: #101722;
  --card: #141c2a;
  --line: #22304a;
  --accent: #00d4ff;
  --accent-hover: #66e5ff;
  --blue: #1f7cff;
  --text: #e8eef7;
  --muted: #9fb0c6;
  --on-accent: #04121a;
  --red: #ff5c6c;
  --red-bg: rgba(255, 92, 108, .14);
  --yellow: #ffc94d;
  --yellow-bg: rgba(255, 201, 77, .14);
  --green: #3ddc84;
  --green-bg: rgba(61, 220, 132, .12);
  --radius: 14px;
  --font-title: "Space Grotesk", Inter, system-ui, sans-serif;
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 10;
  background: var(--accent); color: var(--on-accent);
  padding: 8px 14px; border-radius: 8px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 8px; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }

.demo-banner {
  background: var(--yellow-bg);
  border-bottom: 1px solid rgba(255, 201, 77, .35);
  color: var(--text);
  font-size: 14px;
  padding: 10px 16px;
  text-align: center;
}
.demo-banner strong { color: var(--yellow); }

.topbar { background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
.brand { font-family: var(--font-title); font-weight: 700; font-size: 22px; letter-spacing: -.3px; }
.brand span { color: var(--accent); }
.step { font-size: 14px; color: var(--muted); }

main { flex: 1; }

.intro { padding: 28px 0 20px; }
.intro h1 { font-family: var(--font-title); font-size: 28px; line-height: 1.15; letter-spacing: -.5px; margin-bottom: 8px; }
.intro p { color: var(--muted); }

.layout { display: flex; flex-direction: column; gap: 20px; }

.editor, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}
.editor { display: flex; flex-direction: column; gap: 12px; }

.label { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.field-label { font-size: 14px; color: var(--muted); font-weight: 500; margin-bottom: -6px; }

.examples { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  font: 500 14px var(--font-body);
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 40px;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.chip-btn:hover, .chip-btn.is-active { border-color: var(--accent); color: var(--accent); }

.field {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  font: 400 17px/1.55 var(--font-body);
  resize: vertical;
  min-height: 140px;
}
.field::placeholder { color: #7e8ea5; }
.field:focus { border-color: var(--accent); outline: none; }
.preview { white-space: pre-wrap; word-wrap: break-word; }

mark { color: inherit; border-radius: 4px; padding: 1px 3px; }
mark.red { background: var(--red-bg); color: var(--red); box-shadow: inset 0 -2px 0 var(--red); }
mark.yellow { background: var(--yellow-bg); color: var(--yellow); box-shadow: inset 0 -2px 0 var(--yellow); }
.preview.is-clean { border-color: var(--green); background: var(--green-bg); }

.select {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: 400 16px var(--font-body);
  min-height: 48px;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

.btn {
  font: 600 16px var(--font-body);
  padding: 13px 20px;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: transform .15s, border-color .2s, filter .2s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(90deg, var(--accent), var(--blue)); color: var(--on-accent); border: none; }
.btn-primary:hover { filter: brightness(1.08); }

.panel { display: flex; flex-direction: column; gap: 14px; }
#result { display: flex; flex-direction: column; gap: 14px; }

.light { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dots { display: flex; gap: 8px; padding: 8px 10px; background: var(--bg); border-radius: 999px; }
.dot { width: 16px; height: 16px; border-radius: 50%; background: #1d2636; }
.dot.green { background: var(--green); box-shadow: 0 0 12px var(--green); }
.dot.yellow { background: var(--yellow); box-shadow: 0 0 12px var(--yellow); }
.dot.red { background: var(--red); box-shadow: 0 0 12px var(--red); }

.status { font-family: var(--font-title); font-weight: 700; font-size: 20px; }
.status.green { color: var(--green); }
.status.yellow { color: var(--yellow); }
.status.red { color: var(--red); }

.hint { color: var(--muted); font-size: 15px; }

.block { background: var(--bg-alt); border-radius: 12px; padding: 14px 16px; font-size: 15px; }
.block.red { border-left: 3px solid var(--red); }
.block.yellow { border-left: 3px solid var(--yellow); }
.block-quote { font-weight: 600; margin-bottom: 6px; }
.block-quote.red { color: var(--red); }
.block-quote.yellow { color: var(--yellow); }
.block dt { color: var(--text); font-weight: 600; margin-top: 8px; }
.block dd { color: var(--muted); }

.check-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.check-list li { background: var(--bg-alt); border-radius: 12px; padding: 12px 14px; font-size: 15px; color: var(--muted); }
.check-list b { color: var(--text); }
.check { color: var(--green); font-weight: 700; margin-right: 4px; }

.suggest { border: 1px dashed var(--accent); }
.suggest-title { color: var(--accent); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.suggest-text { color: var(--text); font-size: 16px; }
.manual { color: var(--muted); font-size: 14px; margin-top: 8px; }

.panel-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.note { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }

.about { padding: 32px 0 8px; display: flex; flex-direction: column; gap: 10px; }
.about h2 { font-family: var(--font-title); font-size: 22px; margin-bottom: 4px; }
details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
summary { cursor: pointer; font-weight: 600; }
details p, details ul { color: var(--muted); margin-top: 10px; font-size: 15px; }
details ul { padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }

.footer { border-top: 1px solid var(--line); margin-top: 32px; padding: 20px 0; font-size: 14px; color: var(--muted); text-align: center; }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: 20px; z-index: 20;
  max-width: 420px; margin: 0 auto;
  background: var(--bg-alt); color: var(--text);
  border: 1px solid var(--accent); border-radius: 12px;
  padding: 14px 16px; font-size: 15px; text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  animation: toast-in .25s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media (min-width: 768px) {
  .intro { padding: 40px 0 24px; }
  .intro h1 { font-size: 36px; }
  .editor, .panel { padding: 24px; }
}

@media (min-width: 960px) {
  .layout { flex-direction: row; align-items: flex-start; }
  .editor { flex: 1.1; }
  .panel { flex: 1; position: sticky; top: 20px; }
}
