* { box-sizing: border-box; }

body {
    margin: 0;
    background: #f3f6f9;
    color: #1f2937;
    font-family: Arial, sans-serif;
}

.topbar {
    background: #172033;
    color: #fff;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.topbar h1 { margin: 0 0 4px; font-size: 25px; }
.topbar p { margin: 0; opacity: .75; }

.badge {
    padding: 7px 12px;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 20px;
    font-size: 13px;
}

.container {
    width: min(1220px, calc(100% - 28px));
    margin: 24px auto 50px;
}

.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    margin-bottom: 18px;
}

.intro {
    padding: 17px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

h2 { margin: 0 0 7px; font-size: 19px; }
.intro p { margin: 0; color: #64748b; }

.mode-note {
    white-space: nowrap;
    color: #475569;
    font-size: 13px;
}

.dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    background: #22c55e;
    border-radius: 50%;
    margin-right: 6px;
}

.workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.panel { overflow: hidden; }

.panel-title {
    min-height: 50px;
    padding: 10px 14px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-weight: 700;
    font-size: 13px;
}

.actions {
    display: flex;
    gap: 7px;
    align-items: center;
}

select {
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 8px 9px;
    background: #fff;
    color: #334155;
}

textarea {
    display: block;
    width: 100%;
    height: 410px;
    resize: vertical;
    border: 0;
    outline: 0;
    padding: 16px;
    background: #111827;
    color: #e5e7eb;
    font: 15px/1.6 Consolas, "Courier New", monospace;
    tab-size: 4;
}

pre {
    margin: 0;
    height: 410px;
    overflow: auto;
    padding: 16px;
    background: #0b1220;
    color: #dbeafe;
    font: 15px/1.6 Consolas, "Courier New", monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.editor-footer {
    min-height: 58px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.btn {
    border: 0;
    border-radius: 7px;
    padding: 9px 13px;
    cursor: pointer;
    font-weight: 600;
}

.btn.primary {
    background: #2563eb;
    color: #fff;
    padding: 10px 18px;
}

.btn.light {
    background: #eef2f7;
    color: #334155;
}

.btn:disabled { opacity: .6; cursor: wait; }

#status {
    margin-left: 3px;
    color: #64748b;
    font-size: 13px;
}

.input-area {
    margin: 12px;
    padding: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #f8fafc;
}

.hidden { display: none !important; }

.input-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
}

.input-prompt {
    margin-bottom: 9px;
    color: #334155;
    white-space: pre-wrap;
}

.input-row {
    display: flex;
    gap: 8px;
}

.input-row input {
    flex: 1;
    min-width: 0;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 10px 11px;
    font-size: 15px;
    outline: none;
}

.input-row input:focus {
    border-color: #2563eb;
}

.input-help {
    margin-top: 7px;
    color: #64748b;
    font-size: 12px;
}

.examples, .guide, .compare {
    padding: 18px 20px;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.example {
    border: 1px solid #dbe2ea;
    background: #fff;
    border-radius: 9px;
    padding: 13px;
    text-align: left;
    cursor: pointer;
}

.example:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.example b {
    display: block;
    margin-bottom: 5px;
}

.example span {
    color: #64748b;
    font-size: 13px;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
}

.guide-grid div {
    padding: 11px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.guide-grid code {
    display: block;
    font-weight: 700;
    margin-bottom: 5px;
}

.guide-grid span {
    display: block;
    color: #64748b;
    font-size: 13px;
}

.compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.compare h3 {
    font-size: 14px;
    margin: 8px 0;
}

.compare pre {
    height: auto;
    min-height: 250px;
    background: #111827;
}

@media (max-width: 850px) {
    .workspace, .compare-grid { grid-template-columns: 1fr; }
    .example-grid, .guide-grid { grid-template-columns: 1fr 1fr; }
    .intro { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 540px) {
    .example-grid, .guide-grid { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; flex-direction: column; }
    .container { width: calc(100% - 18px); margin-top: 12px; }
    .actions { flex-wrap: wrap; justify-content: flex-end; }
    .input-row { flex-direction: column; }
}
