
/* ============================================================
   result New Design (scoped with #result .rc-)
   ============================================================ */

/* --- Wrapper Reset --- */
#result.rc-wrap {
    background-color: #fff;
    color: #333;
    line-height: 1.7;
    padding: 0;
    margin: 0;
    border: none;
    min-width: auto;
}
#result.rc-wrap h1,
#result.rc-wrap h2,
#result.rc-wrap h3 {
    background-color: transparent;
    background-image: none;
    margin: 0;
    padding: 0;
    border: none;
}
#result.rc-wrap h1:before,
#result.rc-wrap h2:before,
#result.rc-wrap h3:before {
    content: none;
    background: none;
}
#result.rc-wrap p {
    margin: 0;
    line-height: 1.7;
}
#result.rc-wrap ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
#result.rc-wrap table {
    border: none;
}
#result.rc-wrap th,
#result.rc-wrap td {
    border: none;
}

/* --- Section Common --- */
#result .rc-section {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 20px;
}
#result .rc-page-title {
    text-align: center;
    font-size: 26px;
    font-weight: bold;
    color: #2E7D32;
    margin-bottom: 6px;
}
#result .rc-section-title {
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    color: #2E7D32;
    margin-bottom: 6px;
}
#result .rc-title-underline {
    display: block;
    width: 100%;
    max-width: 500px;
    margin: 6px auto 20px;
    height: 2px;
    background: repeating-linear-gradient(90deg, #2E7D32 0px, #2E7D32 4px, transparent 4px, transparent 8px);
}

/* --- Intro --- */
#result .rc-intro-text {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.8;
}
#result .rc-date-name {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    margin-bottom: 8px;
    font-size: 15px;
    flex-wrap: wrap;
}
#result .rc-date-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 15px;
    flex-wrap: wrap;
}
#result .rc-name-input {
    border: 1px solid #E0E0E0 !important;
    border-radius: 4px !important;
    padding: 6px 16px;
    font-size: 15px;
    color: #333;
    min-width: 200px;
    width: auto !important;
    height: auto !important;
    background: #fff !important;
    text-align: center;
}
#result .rc-name-note {
    font-size: 13px;
    color: #999;
}

/* --- Monthly Savings --- */
#result .rc-monthly-savings {
    text-align: center;
    margin-bottom: 24px;
    font-size: 16px;
}
#result .rc-savings-amount {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}
#result .rc-no-measures {
    text-align: center;
    font-size: 16px;
    color: #666;
    margin-bottom: 24px;
}

/* --- Chart Container --- */
#result .rc-chart-container {
    max-width: 700px;
    margin: 0 auto 24px;
    overflow: visible;
}
#result .rc-chart-container .mesgraph,
#result .rc-chart-container .graphEnergy,
#result .rc-chart-container #graph2p,
#result .rc-chart-container #graphCO2averagep {
    max-width: 100%;
}
#result .rc-chart-container svg {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}
#result .rc-chart-title {
    text-align: center;
    font-size: 15px;
    font-weight: bold;
    margin-top: 12px;
    margin-bottom: 12px;
    color: #333;
}
#result .rc-chart-container .mesgraph {
    background-color: #fff;
    margin: 5px;
}
#result .rc-chart-container .graphEnergy {
    background-color: #fff;
    margin: 5px;
}

/* --- Sub Text --- */
#result .rc-sub-text {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
    line-height: 1.7;
}

/* --- Comparison Table: PC --- */
#result .rc-comp-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 28px;
    border: none;
}
#result .rc-comp-table thead th {
    padding: 10px 12px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    border: none;
}
#result .rc-comp-th-empty {
    background: #F5F5F5;
    width: 120px;
}
#result .rc-comp-th-before {
    background: #F5F5F5;
    color: #333;
}
#result .rc-comp-th-after {
    background: #2E7D32;
    color: #fff;
}
#result .rc-comp-th-2030 {
    background: #F7931E;
    color: #fff;
}
#result .rc-comp-table tbody td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid #E0E0E0;
    font-size: 14px;
    border-left: none;
    border-right: none;
    background: transparent;
}
#result .rc-comp-table tbody td:first-child {
    background: #F5F5F5;
}
#result .rc-comp-label {
    text-align: left !important;
    font-weight: bold;
    width: 120px;
}
#result .rc-comp-val {
    white-space: nowrap;
}

/* Percentage badge */
#result .rc-pct-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    color: #fff;
    margin-right: 4px;
    vertical-align: middle;
}
#result .rc-pct-orange {
    background: #F7931E;
}
#result .rc-pct-green {
    background: #2E7D32;
}

/* --- Mobile Comparison --- */
#result .rc-mobile-comp {
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #E0E0E0;
}
#result .rc-mobile-comp-header {
    padding: 8px 16px;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
}
#result .rc-mobile-comp-body {
    padding: 10px 16px;
}
#result .rc-mobile-comp-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
}
#result .rc-mobile-comp-label {
    color: #666;
}

/* Background colors */
#result .rc-bg-gray   { background: #9E9E9E; }
#result .rc-bg-orange { background: #F7931E; }
#result .rc-bg-green  { background: #2E7D32; }

/* --- Measures Table: PC --- */
#result .rc-measures-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    border: none;
}
#result .rc-thead-orange th {
    background: #F7931E;
    color: #fff;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: bold;
    text-align: left;
    border: none;
}
#result .rc-thead-green th {
    background: #2E7D32;
    color: #fff;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: bold;
    text-align: left;
    border: none;
}
#result .rc-meas-th-val {
    text-align: center !important;
    width: 140px;
}
#result .rc-measures-table tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid #E0E0E0;
    font-size: 14px;
    border-left: none;
    border-right: none;
    background: transparent;
}
.rc-thead-orange{
    background: #FFF7DB !important;
}
.rc-thead-green{
    background: #ECF2E8 !important;
}
#result .rc-td-center {
    text-align: center;
    white-space: nowrap;
}

/* --- Mobile Measures Cards --- */
#result .rc-mobile-meas-header {
    padding: 10px 16px;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    border-radius: 6px 6px 0 0;
}
#result .rc-mobile-meas-card {
    border: 1px solid #E0E0E0;
    border-top: none;
    padding: 14px 16px;
}
#result .rc-mobile-meas-card:last-child {
    border-radius: 0 0 6px 6px;
    margin-bottom: 16px;
}
#result .rc-mobile-meas-name {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 8px;
    color: #333;
}
#result .rc-mobile-meas-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 2px 0;
}
#result .rc-mobile-meas-label {
    color: #666;
}

/* --- Responsive visibility --- */
#result .rc-pc-only { display: table; }
#result .rc-sp-only { display: none; }

/* --- Notes --- */
#result .rc-notes {
    font-size: 12px;
    color: #999;
    text-align: center;
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto;
}
#result .rc-notes p {
    margin-bottom: 4px;
}

/* --- Bottom Actions --- */
#result .rc-bottom-actions {
    text-align: center;
    padding: 24px 20px 60px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    max-width: 960px;
    margin: 0 auto;
}
#result .rc-bottom-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #999 !important;
    border-radius: 24px !important;
    padding: 10px 28px;
    font-size: 15px;
    cursor: pointer;
    background: #fff !important;
    color: #333 !important;
    transition: all 0.2s;
    margin: 0 !important;
}
#result .rc-bottom-btn:hover {
    background: #F5F5F5 !important;
    color: #333 !important;
}
#result .rc-bottom-btn-primary {
    background: #F7931E !important;
    color: #fff !important;
    border-color: #F7931E !important;
}
#result .rc-bottom-btn-primary:hover {
    background: #E8850A !important;
    color: #fff !important;
}

/* ===== Responsive: Mobile ===== */
@media screen and (max-width: 767px) {
    #result .rc-page-title {
        font-size: 21px;
    }
    #result .rc-section-title {
        font-size: 18px;
    }
    #result .rc-date-name {
        flex-direction: column;
        gap: 6px;
    }
    #result .rc-name-input {
        min-width: 160px;
        text-align: center;
    }

    /* Table visibility */
    #result .rc-pc-only {
        display: none !important;
    }
    #result .rc-sp-only {
        display: block !important;
    }

    /* Chart - responsive on narrow screens */
    #result .rc-chart-container {
        max-width: 100%;
    }

    /* Bottom actions */
    #result .rc-bottom-actions {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding-bottom: 40px;
    }
}

/* ===== Print ===== */
@media print {
    /* --- Hide header, footer, nav, decorations --- */
    #headWrap,
    #header_new,
    #globalNavWrap,
    #footerwrapper,
    #mirai_00,
    .ajastHedder,
    .totop,
    .notprint,
    .printbtn {
        display: none !important;
    }

    /* --- Reset page layout --- */
    body {
        background: #fff !important;
    }
    #wrap {
        width: 100% !important;
    }
    div.wrapper {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
    #main, main {
        min-height: auto !important;
    }
    .footer {
        display: none !important;
    }

    /* --- Result page specific --- */
    #result.rc-wrap {
        min-width: auto !important;
        padding: 0 !important;
    }
    #result .rc-bottom-actions {
        display: none !important;
    }
    #result .rc-name-note {
        display: none !important;
    }

    /* --- Prevent page breaks inside content blocks --- */
    #result .rc-section {
        page-break-inside: avoid;
        break-inside: avoid;
        padding-top: 20px;
        padding-bottom: 20px;
    }
    #result .rc-comp-table {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    #result .rc-measures-table {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    #result .rc-chart-container {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* --- Keep section titles with their content --- */
    #result .rc-section-title,
    #result .rc-page-title {
        page-break-after: avoid;
        break-after: avoid;
    }
    #result .rc-title-underline {
        page-break-after: avoid;
        break-after: avoid;
    }

    /* --- Color preservation --- */
    #result .rc-comp-th-after {
        background: #2E7D32 !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    #result .rc-comp-th-2030 {
        background: #F7931E !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    #result .rc-comp-th-before {
        background: #F5F5F5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    #result .rc-comp-table tbody td:first-child {
        background: #F5F5F5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    #result .rc-thead-orange th {
        background: #F7931E !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    #result .rc-thead-green th {
        background: #2E7D32 !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    #result .rc-pct-orange,
    #result .rc-pct-green {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    #result .rc-measures-table tbody td.rc-thead-green,
    #result .rc-measures-table tbody td.rc-thead-orange {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    #result .rc-title-underline {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* --- Chart sizing for print --- */
    #result .rc-chart-container .mesgraph,
    #result .rc-chart-container .graphEnergy {
        max-width: 100%;
    }
    #result .rc-chart-container svg {
        max-width: 100% !important;
        height: auto !important;
    }

    /* --- Notes at bottom --- */
    #result .rc-notes {
        page-break-inside: avoid;
        break-inside: avoid;
        margin-top: 20px;
    }
}
