:root {
    --panel-bg: #0b0f14;
    --card-bg: #0e1116;
    --muted: #9aa4b2;
    --accent: #00367e;
}

* { box-sizing: border-box; }
body {
    margin:0;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    background: linear-gradient(180deg,#f9fafb 0%, #eef1f6 100%);
    color:#111827;
    min-height:100vh;
    display:flex;
    flex-direction:column;
}

header {
    background:rgb(0, 54, 126);
    color: white;
    box-shadow: 0 2px 8px rgba(16,24,40,0.08);
    padding:16px 32px;
    font-weight:600;
    font-size:18px;
    letter-spacing:0.3px;
    display:flex;
    align-items:center;
    justify-content:center;
}

.app {
    flex:1;
    width: 100%;
    max-width: 1200px;
    margin: 32px auto;
    display:grid;
    grid-template-columns: 1fr 540px;
    gap: 24px;
    padding:0 20px;
}

.controls {
    background:white;
    border-radius:14px;
    padding:20px;
    box-shadow: 0 8px 24px rgba(16,24,40,0.08);
}
.controls h2 {
    margin:0 0 14px 0;
    font-size:18px;
    font-weight:600;
}
.row {
    display:flex;
    gap:10px;
    align-items:center;
    margin-bottom:14px;
}

.row label { 
    width:90px;
    font-size:13px;
    color:var(--muted);
}

textarea#codeInput {
    width:100%;
    min-height:300px;
    resize:vertical;
    padding:14px;
    border-radius:10px;
    border:1px solid #e5e7eb;
    font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    font-size:13px;
    line-height:1.55;
    background:#fff;
    color:#111;
}
select, input[type="text"], input[type="number"] {
    padding:8px 10px;
    border-radius:8px;
    border:1px solid #e5e7eb;
    font-size:13px;
    background:white;
}

.btn {
    background:var(--accent);
    color:white;
    border:none;
    padding:10px 14px;
    border-radius:10px;
    cursor:pointer;
    font-weight:600;
    font-size:14px;
    box-shadow: 0 6px 14px rgba(92,78,255,0.12);
    transition: background 0.2s ease;
}
.btn:hover { background:#4f46e5; }
.btn:active { transform: translateY(1px); }

.small {
    padding:8px 12px;
    border-radius:8px;
    border:1px solid #e5e7eb;
    background:transparent;
    cursor:pointer;
    font-size:13px;
    transition: background 0.2s ease;
}
.small:hover { background:#f3f4f6; }

.preview-wrap {
    display:flex;
    flex-direction:column;
    gap:12px;
}

.preview {
    background: linear-gradient(180deg, #0b0f14 0%, #0e1116 100%);
    color:#e6eef6;
    padding:20px;
    border-radius:14px;
    min-height:200px;
    box-shadow: 0 10px 30px rgba(2,6,23,0.35);
    width:100%;
    overflow:auto;
    position:relative;
}

.preview .meta {
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:12px;
    gap:12px;
}

.title {
    font-family: "Roboto Mono", monospace;
    font-size:14px;
    color:#cbd5e1;
    opacity:0.95;
}

.window-dots {
    display:flex; gap:6px; align-items:center;
}
.dot { width:10px; height:10px; border-radius:50%; background:#ff5f56; }
.dot.yellow { background:#ffbd2e; }
.dot.green { background:#2ecc40; }

pre {
    margin:0;
    font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    font-size:13px;
    line-height:1.55;
    white-space:pre-wrap;
    word-break:break-word;
}

.footer {
    font-size:13px;
    color:#475569;
    background:white;
    border-radius:12px;
    padding:10px 12px;
    box-shadow: 0 6px 20px rgba(16,24,40,0.06);
    display:flex;
    justify-content:space-between;
    align-items:center;
}

@media (max-width:980px){
    .app { grid-template-columns: 1fr; }
    .preview { min-height:260px; }
}