:root {
    --bg: #0d1827;
    --panel: #121f32;
    --panel-soft: #15263f;
    --accent: #5be9c8;
    --accent-strong: #2fc6a1;
    --text: #e8eef5;
    --muted: #9bb0c7;
    --stroke: #1f3148;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    --radius: 14px;
    --font: "Gill Sans", "Trebuchet MS", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: radial-gradient(circle at 20% 20%, rgba(91, 233, 200, 0.08), transparent 30%),
        radial-gradient(circle at 80% 0%, rgba(47, 198, 161, 0.1), transparent 35%),
        var(--bg);
    min-height: 100vh;
}

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

p {
    margin: 0;
}

a {
    color: var(--accent);
}

.hero {
    padding: 48px 20px 32px;
    text-align: center;
    background: linear-gradient(135deg, rgba(91, 233, 200, 0.15), rgba(13, 24, 39, 0.7));
    border-bottom: 1px solid var(--stroke);
}

.hero__content {
    max-width: 900px;
    margin: 0 auto;
}

.hero__actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #1f3148;
    border: 1px solid #284360;
    transition: 0.2s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text);
    transition: 0.2s;
    border-radius: 50%;
}

.switch input:checked + .slider {
    background-color: var(--accent);
    border-color: var(--accent-strong);
}

.switch input:checked + .slider:before {
    transform: translateX(18px);
}

.lang-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--stroke);
    border-radius: 10px;
    padding: 6px 10px;
}

.lang-select option {
    background: #0f1c2d;
    color: var(--text);
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}

.lede {
    color: var(--muted);
    margin-top: 8px;
    font-size: 18px;
}

.page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 20px 80px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 22px;
}

.panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.small {
    font-size: 14px;
    color: var(--muted);
}

.base-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.card {
    background: var(--panel-soft);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.card__title {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.pill {
    background: #1f3148;
    border: 1px solid #284360;
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
}

.formula {
    font-size: 12px;
    color: var(--muted);
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-size: 14px;
    color: var(--muted);
}

input, textarea, button {
    font-family: var(--font);
}

input, textarea {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--stroke);
    border-radius: 10px;
    padding: 10px;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

input:focus, textarea:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(91, 233, 200, 0.15);
}

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

.summary-inputs {
    background: var(--panel-soft);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-totals {
    background: var(--panel-soft);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 10px;
}

@media (max-width: 680px) {
    .resource-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.actions--below {
    margin-top: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
}

.btn.primary {
    background: var(--accent);
    color: #052122;
    box-shadow: 0 10px 30px rgba(91, 233, 200, 0.35);
}

.btn.secondary {
    background: #1f3148;
    border-color: #284360;
    color: var(--text);
}

.btn.ghost {
    background: transparent;
    border-color: #284360;
    color: var(--text);
}

.btn-small {
    padding: 8px 12px;
    font-size: 14px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.totals .label {
    color: var(--muted);
    font-size: 13px;
    margin: 0;
}

.totals .value {
    font-size: 20px;
    margin: 2px 0 0;
    font-weight: 700;
    color: var(--accent);
}

.summary-output {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

textarea {
    min-height: 260px;
    flex: 1;
    resize: vertical;
}

.footer {
    text-align: center;
    padding: 18px 12px 26px;
    color: var(--muted);
    font-size: 14px;
}

.footer-actions {
    display: flex;
    justify-content: center;
    padding: 8px 0 0;
}

.collapsible {
    transition: max-height 0.25s ease, opacity 0.2s ease;
    overflow: hidden;
    opacity: 1;
}

.collapsible.is-collapsed {
    max-height: 0 !important;
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 960px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
}
