:root {
    --bg: #f5f6f8;
    --panel: #ffffff;
    --accent: #0b67b2;
    --muted: #6b7280;
    --border: #e6e8eb;
    --radius: 10px;
    --max-width: 1100px;
    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Segoe UI Mono", monospace;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--sans);
    background: linear-gradient(180deg, var(--bg), #eef2f7);
    color: #111827;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: 24px;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
}

.site-header {
    margin-bottom: 18px;
}

.site-header h1 {
    margin: 0;
    font-size: 1.4rem;
}

.subtitle {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.main-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 18px;
    align-items: start;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 18px;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.options .row,
.options .checkbox-grid {
    margin-bottom: 12px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

input[type="text"],
input[type="number"],
select,
input[readonly] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.fieldset {
    border: 1px dashed var(--border);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.preset-row {
    display: flex;
    gap: 8px;
}

.btn-preset {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
}

.action-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.btn {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
}

.btn.primary {
    background: var(--accent);
    color: #fff;
    border: 0;
}

.small {
    font-size: 0.85rem;
}

.muted {
    color: var(--muted);
}

.preview h3 {
    margin-top: 0;
}

.password-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

#passwordOutput {
    font-family: var(--mono);
    font-size: 1rem;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    flex: 1;
}

.pw-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pw-actions .btn {
    min-width: 86px;
}

.post-estimate,
.estimate {
    margin-top: 12px;
}

.history {
    margin-top: 12px;
}

.history ul {
    margin: 6px 0 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 0.95rem;
}

footer {
    margin-top: 18px;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

/* responsive */
@media (max-width:900px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .pw-actions {
        flex-direction: row;
    }
}