:root {
    --bg: #0f1115;
    --panel: #171a21;
    --panel-2: #1f232c;
    --line: #2b303b;
    --text: #eef0f4;
    --muted: #9aa1b0;
    --accent: #7cf0c8;
    --accent-2: #8c9dff;
    --radius: 14px;
    color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: radial-gradient(1000px 500px at 80% -10%, #1d2540 0%, var(--bg) 60%) fixed; color: var(--text); }
body { font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100vh; }
main { max-width: 1180px; margin: 0 auto; padding: 16px 16px 48px; }

header { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 14px; }
header h1 { font-size: 1.2rem; margin: 0; letter-spacing: .02em; }
header h1::before { content: "◆ "; color: var(--accent); }
header .right { display: flex; gap: 10px; align-items: center; }
h2 { font-size: 1.9rem; line-height: 1.15; margin: .2em 0 .5em; }
h4 { margin: 0 0 8px; font-size: .95rem; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
p { margin: .5em 0; }
section { display: flex; flex-direction: column; gap: 14px; }
.hero { max-width: 680px; }
.kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; color: var(--accent); margin: 0; }
.fine { color: var(--muted); font-size: .85rem; font-weight: 400; }

.btn { appearance: none; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; font-weight: 600; padding: 12px 20px; border-radius: 12px; cursor: pointer; min-height: 46px; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: wait; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #0a1210; border-color: transparent; }
.btn.big { width: 100%; padding: 15px 22px; font-size: 1.05rem; }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: .9rem; }
.btn:focus-visible, .link:focus-visible, textarea:focus-visible, .opt:focus-visible, .chipbtn:focus-visible, .tabs button:focus-visible, summary:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
.link { background: none; border: 0; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; padding: 4px; }
.chip { display: inline-block; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: .85rem; }

label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: .9rem; }
label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); }
label.check input { width: 20px; height: 20px; }
textarea { width: 100%; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; resize: vertical; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; }
.chipbtn { background: var(--panel); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: .85rem; }
.chipbtn:hover { color: var(--text); border-color: var(--accent-2); }

.result { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.tabs { display: flex; gap: 6px; }
.tabs button { flex: 1; background: var(--panel); color: var(--muted); border: 1px solid var(--line); border-radius: 10px; padding: 8px; cursor: pointer; font: inherit; font-weight: 600; }
.tabs button.on { color: var(--text); border-color: var(--accent); }
.panes { display: grid; gap: 14px; }
.panes.preview .inspector, .panes.decisions .previewpane { display: none; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; color: var(--muted); font-size: .9rem; }
iframe { width: 100%; height: 72vh; min-height: 420px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.inspector { display: flex; flex-direction: column; gap: 14px; max-height: 78vh; overflow-y: auto; padding-right: 4px; }
@media (min-width: 980px) {
    .tabs { display: none; }
    .panes { grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr); align-items: start; }
    .panes.preview .inspector, .panes.decisions .previewpane { display: flex; }
    .panes .previewpane { display: block !important; }
}

.callinfo { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; padding: 10px 14px; font-size: .9rem; }
.callinfo pre { max-height: 220px; overflow: auto; background: #0b0d11; padding: 8px; border-radius: 8px; font-size: .75rem; }
.group { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.opts { display: flex; flex-direction: column; gap: 6px; }
.rungs { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 6px; }
.opt { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; font: inherit; font-size: .9rem; min-height: 38px; }
.opt i { position: absolute; inset: 0 auto 0 0; background: rgba(124, 240, 200, .16); }
.opt span, .opt b { position: relative; }
.opt b { color: var(--muted); font-weight: 600; font-size: .8rem; }
.opt.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.rung { justify-content: center; text-align: center; }
.opt i.sw { position: static; display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; }

.error { background: #3a1a1e; border: 1px solid #ff6b7d; color: #ffd6dc; padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; }

.powered { max-width: 860px; margin: 0 auto; padding: 0 16px 28px; color: var(--muted); font-size: .8rem; text-align: center; }
.powered a { color: inherit; }
