body.growth-page {
    min-height: 100vh;
    height: auto;
    background: #f7fbfa;
    color: #22313f;
    user-select: auto;
    transition: background-color 0.2s ease;
}

body.growth-page[data-sex="boys"] {
    background: #f4f9ff;
}

body.growth-page[data-sex="girls"] {
    background: #fff7fb;
}

body.growth-page header {
    background: #e8f7f1;
    color: #1f5b49;
}

.growth-shell {
    width: min(100%, 840px);
    margin: 0 auto;
    padding: 16px 16px 34px;
}

.back-button {
    min-height: 40px;
    border: 1px solid #d8e8e1;
    border-radius: 999px;
    background: #ffffff;
    color: #1f5b49;
    padding: 8px 15px;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(32, 88, 71, 0.08);
}

.back-button:active {
    transform: translateY(1px);
}

.intro-card,
.form-card,
.result-card,
.metric-card,
.notice-card {
    background: #ffffff;
    border: 1px solid #e3efea;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(32, 88, 71, 0.08);
}

body.growth-page[data-sex="boys"] .intro-card,
body.growth-page[data-sex="boys"] .form-card,
body.growth-page[data-sex="boys"] .result-card,
body.growth-page[data-sex="boys"] .metric-card,
body.growth-page[data-sex="boys"] .notice-card {
    border-color: #d9ebfb;
    box-shadow: 0 6px 18px rgba(54, 116, 171, 0.08);
}

body.growth-page[data-sex="girls"] .intro-card,
body.growth-page[data-sex="girls"] .form-card,
body.growth-page[data-sex="girls"] .result-card,
body.growth-page[data-sex="girls"] .metric-card,
body.growth-page[data-sex="girls"] .notice-card {
    border-color: #f5dce8;
    box-shadow: 0 6px 18px rgba(170, 73, 121, 0.08);
}

.intro-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-top: 14px;
    padding: 18px;
}

.intro-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #def7ec;
    font-size: 1.6rem;
    flex: 0 0 auto;
}

.intro-card h1,
.form-card h2,
.metric-card h2 {
    margin: 0;
    letter-spacing: 0;
}

.intro-card h1 {
    font-size: 1.45rem;
    color: #164937;
}

.intro-card p {
    margin: 8px 0 0;
    color: #5d6d7e;
    line-height: 1.6;
    font-size: 0.95rem;
}

.form-card,
.result-card {
    margin-top: 16px;
    padding: 18px;
}

.form-card h2 {
    font-size: 1.08rem;
    color: #1f5b49;
    margin-bottom: 14px;
}

.field-group {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.field-group > label,
.field span {
    color: #4b635b;
    font-weight: 800;
    font-size: 0.92rem;
}

.segmented-control {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.sex-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sex-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 1px solid #d8e8e1;
    border-radius: 10px;
    background: #f8fcfb;
    color: #2d4f45;
    font-weight: 800;
}

.sex-option input:checked + span {
    background: #dff7ed;
    border-color: #70c7a3;
    color: #15523d;
}

body.growth-page[data-sex="boys"] .sex-option input:checked + span {
    background: #e3f2ff;
    border-color: #7cb7ea;
    color: #1e4f78;
}

body.growth-page[data-sex="girls"] .sex-option input:checked + span {
    background: #ffe5f0;
    border-color: #ec9abd;
    color: #7a2c55;
}

.field-grid {
    display: grid;
    gap: 12px;
}

.field {
    display: grid;
    gap: 7px;
}

.field input {
    width: 100%;
    min-height: 46px;
    border: 1px solid #d8e8e1;
    border-radius: 10px;
    padding: 10px 12px;
    color: #22313f;
    background: #ffffff;
    font: inherit;
    font-size: 1rem;
}

.field input:focus {
    outline: 3px solid rgba(112, 199, 163, 0.28);
    border-color: #70c7a3;
}

.form-message {
    min-height: 22px;
    margin: 12px 0 10px;
    color: #c0392b;
    font-weight: 700;
    line-height: 1.4;
}

.primary-action {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 10px;
    background: #1f8f6b;
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(31, 143, 107, 0.22);
}

.primary-action:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.prediction-result {
    margin-top: 14px;
    border-radius: 12px;
    background: #f1fbf7;
    padding: 14px;
}

.prediction-result strong {
    display: block;
    color: #164937;
    font-size: 1.25rem;
    line-height: 1.35;
}

.prediction-result p {
    margin: 8px 0 0;
    color: #5d6d7e;
    font-size: 0.9rem;
    line-height: 1.55;
}

body.growth-page[data-sex="boys"] .prediction-result {
    background: #eef7ff;
}

body.growth-page[data-sex="girls"] .prediction-result {
    background: #fff0f6;
}

.secondary-action {
    width: 100%;
    min-height: 44px;
    margin-top: 16px;
    border: 1px solid #cfe3da;
    border-radius: 10px;
    background: #ffffff;
    color: #1f5b49;
    font-size: 0.98rem;
    font-weight: 900;
    cursor: pointer;
}

.secondary-action:active {
    transform: translateY(1px);
}

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

.result-summary > div {
    border-radius: 12px;
    background: #f1fbf7;
    padding: 12px;
}

.summary-label {
    display: block;
    color: #5d6d7e;
    font-size: 0.82rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.result-summary strong {
    color: #164937;
    font-size: 1.15rem;
}

.notice-card {
    display: grid;
    gap: 4px;
    margin-top: 12px;
    padding: 12px;
    color: #496058;
    line-height: 1.5;
}

.notice-card strong {
    color: #1f5b49;
}

.metric-stack {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}

.metric-card {
    padding: 14px;
}

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

.metric-heading h2 {
    color: #1f5b49;
    font-size: 1rem;
}

.metric-heading span {
    color: #22313f;
    font-weight: 900;
}

.segment-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    border-radius: 10px;
    border: 0;
    background: transparent;
}

.segment {
    position: relative;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    padding: 8px 6px;
    color: #4b5563;
    font-size: 0.72rem;
    font-weight: 900;
    text-align: center;
    line-height: 1.2;
    white-space: normal;
}

.segment + .segment {
    border-left: 0;
}

.segment-green { background: #ddf7e8; }
.segment-yellow { background: #fff4c7; }
.segment-red { background: #ffe1df; }
.segment.active {
    color: #17202a;
    box-shadow: inset 0 0 0 3px #1f8f6b;
}

.segment.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1f8f6b;
    transform: translateX(-50%);
}

.bmi-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
    border: 1px solid #e1ebe7;
    background: #f8fafc;
}

.bmi-bar .segment {
    border-radius: 0;
    white-space: nowrap;
}

.bmi-bar .segment + .segment {
    border-left: 1px solid rgba(255, 255, 255, 0.75);
}

.metric-result {
    margin-top: 10px;
    color: #164937;
    font-size: 1.05rem;
    font-weight: 900;
}

.range-list {
    display: grid;
    gap: 8px;
}

.range-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-radius: 10px;
    padding: 10px 12px;
    color: #22313f;
}

.range-item span {
    font-size: 0.88rem;
    font-weight: 900;
}

.range-item strong {
    font-size: 0.95rem;
    text-align: right;
}

.range-green { background: #ddf7e8; }
.range-yellow { background: #fff4c7; }
.range-red { background: #ffe1df; }

.reference-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 12px 0 0;
}

.reference-list div {
    border-radius: 9px;
    background: #f8fbfa;
    padding: 8px;
    text-align: center;
}

.reference-list dt {
    color: #6b7b76;
    font-size: 0.72rem;
    font-weight: 900;
}

.reference-list dd {
    margin: 4px 0 0;
    color: #22313f;
    font-size: 0.86rem;
    font-weight: 800;
}

.result-footnote {
    margin: 16px 0 0;
    color: #6b7b76;
    font-size: 0.78rem;
    line-height: 1.55;
}

.result-footnote p {
    margin: 0;
}

.result-footnote p + p {
    margin-top: 0.9rem;
}

@media (min-width: 720px) {
    .growth-shell {
        padding-top: 24px;
    }

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

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

    .form-card,
    .result-card,
    .intro-card {
        padding: 22px;
    }

    .reference-list {
        grid-template-columns: repeat(6, 1fr);
    }

    .segment-bar {
        grid-template-columns: repeat(8, minmax(0, 1fr));
        gap: 0;
        overflow: hidden;
        border: 1px solid #e1ebe7;
        background: #f8fafc;
    }

    .segment {
        border-radius: 0;
        white-space: nowrap;
    }

    .segment + .segment {
        border-left: 1px solid rgba(255, 255, 255, 0.75);
    }

    .bmi-bar {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
