:root {
    --bg: #eef3f8;
    --card: #ffffff;
    --card-soft: #f7fafc;
    --text: #162330;
    --muted: #5d7286;
    --brand: #0c5f4f;
    --brand-dark: #08483d;
    --brand-soft: #dff3ed;
    --accent: #cb7a18;
    --accent-soft: #fff0dc;
    --line: #d6e1ea;
    --shadow: 0 16px 38px rgba(18, 38, 54, 0.08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(12, 95, 79, 0.08), transparent 30%),
        radial-gradient(circle at top right, rgba(203, 122, 24, 0.08), transparent 32%),
        linear-gradient(180deg, #f5f8fb 0%, var(--bg) 42%, #e8eef5 100%);
    color: var(--text);
    font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
    line-height: 1.5;
}

.container {
    width: min(1120px, 94vw);
    margin: 0 auto;
}

.stack > * + * {
    margin-top: 1rem;
}

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wrap {
    flex-wrap: wrap;
}

.gap-sm {
    gap: 0.5rem;
}

.mt-sm {
    margin-top: 0.7rem;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(214, 225, 234, 0.85);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
}

.app-header h1 {
    margin: 0;
    font-size: 1.35rem;
    letter-spacing: 0.01em;
}

.page-shell {
    padding: 1.35rem 0 2.5rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.15rem;
    box-shadow: var(--shadow);
}

.card h2 {
    margin-top: 0;
    margin-bottom: 0.55rem;
    font-size: 1.12rem;
}

.card-accent {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdfd 100%);
    border-color: rgba(12, 95, 79, 0.14);
}

.card-soft {
    background: var(--card-soft);
}

.muted {
    color: var(--muted);
}

.page-intro {
    position: relative;
    overflow: hidden;
    padding: 1.4rem;
    background:
        linear-gradient(135deg, rgba(12, 95, 79, 0.98), rgba(8, 72, 61, 0.96) 54%, rgba(16, 40, 64, 0.96));
    color: #f6fbfa;
}

.page-intro::after {
    content: "";
    position: absolute;
    inset: auto -8% -20% auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 68%);
}

.intro-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
    padding: 0.38rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #dff8f2;
    font-size: 0.83rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-title {
    margin: 0;
    font-size: clamp(1.6rem, 2vw + 1rem, 2.35rem);
    line-height: 1.1;
}

.page-lead {
    max-width: 68ch;
    margin: 0.9rem 0 0;
    color: rgba(246, 251, 250, 0.88);
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.guide-card {
    padding: 0.85rem 0.9rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.guide-card strong {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.95rem;
}

.guide-card p {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(246, 251, 250, 0.82);
}

.section-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.section-heading p {
    margin: 0.15rem 0 0;
}

.limit-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(12, 95, 79, 0.14);
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 0.82rem;
    font-weight: 700;
}

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

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}

.metric-card {
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    border: 1px solid rgba(214, 225, 234, 0.9);
    background: linear-gradient(180deg, #ffffff, #f7fafc);
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-card strong {
    display: block;
    margin-top: 0.25rem;
    font-size: 1rem;
}

.inline-note {
    margin: 0.75rem 0 0;
    font-size: 0.92rem;
    color: var(--muted);
}

.field-tip {
    margin-top: 0.4rem;
    font-size: 0.82rem;
    color: var(--muted);
}

.helper-list {
    margin: 0.75rem 0 0;
    padding-left: 1.1rem;
    color: var(--muted);
}

.helper-list li + li {
    margin-top: 0.3rem;
}

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
}

.tile {
    display: block;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.9rem;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(180deg, #ffffff, #f8fbfd);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(18, 34, 52, 0.08);
}

.tile h3 {
    margin: 0 0 0.3rem;
    font-size: 1rem;
}

.tile p {
    margin: 0;
    color: var(--muted);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.75rem;
}

.wide-grid {
    grid-template-columns: minmax(250px, 2fr) repeat(2, minmax(210px, 1fr));
}

label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.93rem;
}

.checks-row {
    margin-top: 0.65rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.check-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

input,
select,
button,
textarea {
    font: inherit;
}

input,
select {
    padding: 0.5rem 0.6rem;
    border: 1px solid #b8c8d8;
    border-radius: 10px;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(12, 95, 79, 0.55);
    box-shadow: 0 0 0 4px rgba(12, 95, 79, 0.12);
}

.btn {
    appearance: none;
    border: 0;
    border-radius: 10px;
    padding: 0.58rem 0.95rem;
    background: var(--brand);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 10px 18px rgba(12, 95, 79, 0.14);
}

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

.btn-secondary {
    background: #eef3f8;
    color: #17324a;
    box-shadow: none;
}

.btn-secondary:hover {
    background: #dfe9f3;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.status {
    margin: 0.6rem 0 0;
    font-size: 0.93rem;
}

.error {
    color: #b00020;
    margin: 0.25rem 0 0;
    font-weight: 600;
}

.result-list {
    margin: 0;
}

.result-list > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    border-bottom: 1px dashed var(--line);
    padding: 0.52rem 0;
}

.result-list dt {
    color: var(--muted);
}

.result-list dd {
    margin: 0;
    font-weight: 600;
    text-align: right;
}

.file-inline {
    display: inline-flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 280px;
}

.warn-list {
    margin: 0;
    padding-left: 1.2rem;
}

.warn-list li {
    margin: 0.25rem 0;
}

.info-box {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f7fafc;
    padding: 0.85rem 0.95rem;
}

.info-box strong {
    display: block;
    margin-bottom: 0.4rem;
}

.calc-disclaimer {
    margin-top: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff, #f7fafc);
    overflow: hidden;
}

.calc-disclaimer summary {
    list-style: none;
    cursor: pointer;
    padding: 0.85rem 0.95rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #17324a;
}

.calc-disclaimer summary::-webkit-details-marker {
    display: none;
}

.calc-disclaimer summary::after {
    content: "+";
    float: right;
    font-size: 1.05rem;
    line-height: 1;
}

.calc-disclaimer[open] summary::after {
    content: "-";
}

.calc-disclaimer-body {
    padding: 0 0.95rem 0.95rem;
}

.calc-explanation-title {
    margin: 0 0 0.4rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
}

.calc-explanation-intro,
.calc-explanation-note {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.calc-explanation-list {
    margin: 0.7rem 0;
    padding-left: 1.2rem;
    color: var(--muted);
}

.calc-explanation-list li + li {
    margin-top: 0.35rem;
}

.small-note {
    margin: 0.7rem 0 0;
    font-size: 0.9rem;
}

.mono-text {
    width: 100%;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.9rem;
    border: 1px solid #b8c8d8;
    border-radius: 12px;
    padding: 0.55rem 0.65rem;
    resize: vertical;
    background: #fff;
    color: #142534;
}

.subtle-divider {
    height: 1px;
    background: linear-gradient(90deg, rgba(214, 225, 234, 0), rgba(214, 225, 234, 1), rgba(214, 225, 234, 0));
}

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

.heater-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.heater-card img {
    width: 56px;
    height: 72px;
    object-fit: contain;
    border-radius: 10px;
    background: var(--card-soft);
    border: 1px solid rgba(12, 95, 79, 0.08);
}

.heater-card strong {
    display: block;
    margin-bottom: 0.1rem;
    font-size: 0.95rem;
}

.heater-card span {
    font-size: 0.85rem;
    color: var(--muted);
}

.heater-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(18, 34, 52, 0.08);
}

.heater-card.is-active {
    border-color: rgba(12, 95, 79, 0.6);
    box-shadow: 0 0 0 3px rgba(12, 95, 79, 0.12);
}

.result-card {
    display: grid;
    gap: 0.85rem;
}

.result-section {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.75rem;
    background: var(--card-soft);
}

.result-section h3 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    color: var(--brand-dark);
}

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

.result-item {
    border: 1px solid rgba(214, 225, 234, 0.9);
    border-radius: 12px;
    padding: 0.65rem 0.75rem;
    background: #fff;
}

.result-item span {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.result-item strong {
    display: block;
    margin-top: 0.25rem;
    font-size: 1rem;
}

.result-alert {
    color: #b00020;
    font-weight: 700;
}

@media (max-width: 740px) {
    .row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.7rem;
    }

    .wide-grid,
    .guide-grid,
    .card-grid,
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .page-shell {
        padding-top: 1rem;
    }

    .page-intro {
        padding: 1.1rem;
    }
}

