:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #eef3f8;
    --text: #16202a;
    --muted: #607080;
    --border: #d8e0e9;
    --primary: #0f7b63;
    --primary-dark: #0a604d;
    --accent: #c53f3f;
    --shadow: 0 18px 45px rgba(22, 32, 42, 0.09);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.app-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0;
}

.header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    letter-spacing: 0;
}

h1 {
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.05;
}

h2 {
    font-size: 18px;
}

.status-panel {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    font-size: 14px;
    white-space: nowrap;
}

.dot {
    width: 10px;
    height: 10px;
    margin-right: 8px;
    border-radius: 50%;
    background: #d6a221;
}

.status-panel.ready .dot {
    background: var(--primary);
}

.status-panel.error .dot {
    background: var(--accent);
}

.grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 18px;
    align-items: start;
}

.panel {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

form.panel,
.result {
    padding: 22px;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

label {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 650;
}

.toggle-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 14px;
    align-items: end;
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    min-height: 44px;
    margin: 0;
    color: var(--text);
}

.checkbox-label input {
    width: 18px;
    min-height: 18px;
    margin-right: 10px;
}

.compact-field {
    margin: 0;
}

input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--surface-soft);
    color: var(--text);
    font: inherit;
}

input:focus {
    outline: 3px solid rgba(15, 123, 99, 0.18);
    border-color: var(--primary);
    background: #ffffff;
}

input:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

button {
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.primary {
    width: 100%;
    background: var(--primary);
    color: #ffffff;
}

.primary:hover {
    background: var(--primary-dark);
}

.secondary {
    background: #234f78;
}

.secondary:hover {
    background: #1b3d5d;
}

.ghost {
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
}

.ghost:hover {
    background: var(--surface-soft);
}

.result {
    margin-top: 18px;
}

pre {
    overflow: auto;
    min-height: 240px;
    max-height: 520px;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    background: #0f1822;
    color: #d8e8ec;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
}

@media (max-width: 760px) {
    .app-shell {
        width: min(100% - 20px, 1180px);
        padding: 20px 0;
    }

    .header {
        display: grid;
        align-items: start;
    }

    .status-panel {
        white-space: normal;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .toggle-row {
        grid-template-columns: 1fr;
    }
}
