:root {
    color-scheme: light;
    --bg: #f5f7f4;
    --panel: #ffffff;
    --text: #17211d;
    --muted: #5f6d66;
    --line: #dbe3de;
    --primary: #1f6f5b;
    --primary-dark: #155040;
    --danger: #a33a32;
    --focus: #d59f2a;
}

* {
    box-sizing: border-box;
}

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

.app-shell {
    width: min(1120px, calc(100% - 24px));
    margin: 0 auto;
    padding: 16px 0 40px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
}

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

h1 {
    font-size: 1.35rem;
}

h2 {
    margin-bottom: 14px;
    font-size: 1.05rem;
}

p {
    margin: 6px 0 0;
    color: var(--muted);
}

.panel {
    margin-top: 14px;
    padding: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    align-items: end;
}

.form-grid.compact {
    margin-top: 14px;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.9rem;
}

input,
select,
button {
    min-height: 42px;
    border-radius: 6px;
    font: inherit;
}

input,
select {
    width: 100%;
    border: 1px solid var(--line);
    padding: 9px 10px;
    background: #fff;
    color: var(--text);
}

input:focus,
select:focus,
button:focus {
    outline: 3px solid color-mix(in srgb, var(--focus) 35%, transparent);
    outline-offset: 2px;
}

button {
    border: 0;
    padding: 0 14px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
}

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

button.secondary {
    background: #e7ede9;
    color: var(--text);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox input {
    width: 18px;
    min-height: 18px;
}

.summary {
    display: grid;
    gap: 4px;
    color: var(--muted);
}

.output {
    min-height: 120px;
    max-height: 420px;
    overflow: auto;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #111a16;
    color: #e8f2ed;
    white-space: pre-wrap;
}

.message {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: min(420px, calc(100% - 32px));
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 12px 30px rgb(0 0 0 / 18%);
}

.message.error {
    background: var(--danger);
}

.hidden {
    display: none !important;
}

@media (max-width: 640px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .panel {
        padding: 14px;
    }
}

