.hwb-fab,
.hwb-panel,
.hwb-overlay {
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.hwb-fab {
    position: fixed;
    z-index: 79;
    top: 62%;
    right: 0;
    bottom: auto;
    width: 58px;
    height: 208px;
    padding: 10px 4px;
    border: 1px solid #e2bd69;
    border-right: 0;
    border-radius: 7px 0 0 7px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(160deg, #0e4f88, #1a80bb 54%, #e1a443 55%, #f3c96f);
    box-shadow: 0 14px 34px rgba(8, 55, 99, .3);
    cursor: pointer;
    -webkit-transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.hwb-fab:hover,
.hwb-fab:focus {
    color: #0c3c70;
    outline: 0;
    background: linear-gradient(145deg, #fff8e8, #f9dfaa);
    box-shadow: 0 13px 30px rgba(38, 66, 94, .22);
    -webkit-transform: translateX(-3px);
    transform: translateX(-3px);
}

.hwb-fab-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(145deg, #ef9b2d, #d6a13c);
    box-shadow: 0 4px 10px rgba(194, 132, 30, .24);
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.hwb-fab-label {
    margin-top: 8px;
    display: block;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 2px;
    text-align: center;
    white-space: nowrap;
    -webkit-writing-mode: vertical-rl;
    -ms-writing-mode: tb-rl;
    writing-mode: vertical-rl;
    text-orientation: upright;
}

.hwb-overlay {
    position: fixed;
    z-index: 2147482990;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    visibility: hidden;
    opacity: 0;
    background: rgba(4, 24, 44, .52);
    -webkit-transition: opacity .25s ease, visibility .25s ease;
    transition: opacity .25s ease, visibility .25s ease;
}

.hwb-overlay.is-open {
    visibility: visible;
    opacity: 1;
}

.hwb-panel {
    position: fixed;
    z-index: 2147483000;
    top: 14px;
    right: 70px;
    bottom: 14px;
    width: calc(100% - 28px);
    max-width: 438px;
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 18px;
    color: #183a5d;
    background: #fff;
    box-shadow: -12px 0 42px rgba(0, 25, 50, .25);
    visibility: hidden;
    -webkit-overflow-scrolling: touch;
    -webkit-transform: translateX(calc(100% + 32px));
    transform: translateX(calc(100% + 32px));
    -webkit-transition: transform .3s cubic-bezier(.2, .8, .3, 1), visibility .3s ease;
    transition: transform .3s cubic-bezier(.2, .8, .3, 1), visibility .3s ease;
}

.hwb-panel.is-open {
    visibility: visible;
    -webkit-transform: translateX(0);
    transform: translateX(0);
}

.hwb-panel::-webkit-scrollbar { width: 7px; }
.hwb-panel::-webkit-scrollbar-track { background: #edf3f8; }
.hwb-panel::-webkit-scrollbar-thumb { border-radius: 7px; background: #8da3b7; }

body.huiwai-budget-open {
    overflow: hidden !important;
}

.hwb-head {
    position: -webkit-sticky;
    position: sticky;
    z-index: 3;
    top: 0;
    min-height: 66px;
    padding: 12px 58px 12px 18px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    color: #fff;
    background: linear-gradient(135deg, #0a3566, #1c5b92);
    box-shadow: 0 5px 16px rgba(8, 45, 79, .14);
}

.hwb-head strong,
.hwb-head small {
    display: block;
}

.hwb-head strong {
    font-size: 17px;
    line-height: 1.3;
}

.hwb-head small {
    margin-top: 2px;
    color: rgba(255, 255, 255, .72);
    font-size: 11px;
}

.hwb-close {
    position: absolute;
    top: 13px;
    right: 12px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: transparent;
    font-size: 30px;
    font-weight: 300;
    line-height: 38px;
    cursor: pointer;
}

.hwb-close:hover,
.hwb-close:focus {
    outline: 0;
    background: rgba(255, 255, 255, .12);
}

.hwb-body {
    padding: 20px 20px 24px;
}

.hwb-field {
    margin-bottom: 21px;
}

.hwb-field-title {
    margin: 0 0 9px;
    display: block;
    color: #0b3561;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.55;
}

.hwb-people {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
}

.hwb-choice,
.hwb-radio {
    border: 2px solid #e0e8f0;
    border-radius: 11px;
    color: #243f59;
    background: #fff;
    -webkit-transition: border-color .18s ease, color .18s ease, background-color .18s ease;
    transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}

.hwb-choice {
    position: relative;
    min-height: 43px;
    padding: 7px 3px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.hwb-choice:hover,
.hwb-choice:focus,
.hwb-choice.is-active {
    outline: 0;
    border-color: #ef6a3c;
    color: #e9592b;
    background: #fff5ef;
}

.hwb-choice.is-recommended:after {
    content: "★";
    position: absolute;
    top: -10px;
    right: -3px;
    color: #e2a631;
    font-size: 15px;
    text-shadow: 0 1px #fff;
}

.hwb-note {
    margin: 7px 0 0;
    color: #ea6034;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
}

.hwb-days {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 12px;
}

.hwb-days input {
    width: 100%;
    accent-color: #ef6a3c;
}

.hwb-days output {
    min-width: 82px;
    color: #ef6338;
    font-size: 15px;
    font-weight: 700;
    text-align: right;
}

.hwb-select {
    width: 100%;
    height: 48px;
    padding: 0 12px;
    border: 2px solid #e0e8f0;
    border-radius: 11px;
    outline: 0;
    color: #183a5d;
    background: #fff;
    font-size: 13px;
}

.hwb-select:focus {
    border-color: #4b89b6;
    box-shadow: 0 0 0 3px rgba(49, 117, 169, .1);
}

.hwb-picker { position: relative; z-index: 1; }
.hwb-picker.is-open { z-index: 8; }
.hwb-picker-trigger { width: 100%; min-height: 48px; padding: 10px 42px 10px 13px; border: 2px solid #e0e8f0; border-radius: 11px; display: block; position: relative; color: #183a5d; background: linear-gradient(135deg, #fff, #f8fbfd); font-size: 13px; line-height: 1.4; text-align: left; cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease; }
.hwb-picker-trigger:hover, .hwb-picker.is-open .hwb-picker-trigger { outline: 0; border-color: #4b89b6; box-shadow: 0 0 0 3px rgba(49,117,169,.1); }
.hwb-picker-trigger i { width: 25px; height: 25px; position: absolute; top: 50%; right: 10px; border-radius: 7px; display: flex; align-items: center; justify-content: center; color: #a36f20; background: #fff2d5; font-size: 18px; font-style: normal; line-height: 1; transform: translateY(-50%); transition: transform .2s ease, background .2s ease; }
.hwb-picker-trigger i svg { display: block; width: 14px; height: 14px; flex: 0 0 14px; }
.hwb-picker.is-open .hwb-picker-trigger i { color: #fff; background: #c58d32; transform: translateY(-50%) rotate(180deg); }
.hwb-picker-menu { width: 100%; max-height: 0; padding: 0 7px; overflow: hidden; position: absolute; top: calc(100% + 6px); left: 0; border: 1px solid transparent; border-radius: 12px; opacity: 0; pointer-events: none; background: #fff; box-shadow: 0 14px 30px rgba(12,55,91,.18); transform: translateY(-6px); transition: max-height .2s ease, padding .2s ease, opacity .16s ease, transform .2s ease; box-sizing: border-box; }
.hwb-picker.is-open .hwb-picker-menu { max-height: 230px; padding: 7px; overflow-y: auto; border-color: #d7e5ee; opacity: 1; pointer-events: auto; transform: translateY(0); }
.hwb-picker-option { width: 100%; min-height: 39px; margin: 2px 0; padding: 8px 10px; border: 0; border-radius: 8px; display: block; color: #385673; background: transparent; font-size: 12px; line-height: 1.4; text-align: left; cursor: pointer; }
.hwb-picker-option:hover, .hwb-picker-option:focus { outline: 0; color: #0b4f84; background: #edf6fb; }
.hwb-picker-option.is-selected { color: #9a6420; background: #fff3d8; font-weight: 700; }

.hwb-radio-list {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: 9px;
}

.hwb-radio {
    min-height: 45px;
    padding: 9px 12px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    line-height: 1.45;
    cursor: pointer;
}

.hwb-radio.is-checked {
    border-color: #ef6a3c;
    background: #fff5ef;
}

.hwb-radio input {
    flex: 0 0 auto;
    margin: 0;
    accent-color: #ef6234;
}

.hwb-calculate,
.hwb-cta {
    width: 100%;
    border: 0;
    border-radius: 11px;
    color: #fff;
    cursor: pointer;
}

.hwb-calculate {
    min-height: 52px;
    padding: 10px;
    background: linear-gradient(135deg, #ef6938, #e3a539);
    box-shadow: 0 8px 20px rgba(222, 117, 43, .25);
    font-size: 15px;
    font-weight: 800;
}

.hwb-calculate:hover,
.hwb-calculate:focus {
    outline: 0;
    background: linear-gradient(135deg, #e75d2d, #d99a2d);
}

.hwb-results {
    display: none;
}

.hwb-results.is-visible {
    display: block;
}

.hwb-summary {
    margin: 0 0 13px;
    color: #60768a;
    font-size: 12px;
    text-align: center;
}

.hwb-breakdown {
    margin-bottom: 14px;
    padding: 8px 13px;
    border-radius: 12px;
    background: #f5f8fb;
}

.hwb-row {
    min-height: 37px;
    padding: 7px 0;
    border-bottom: 1px dashed #dce6ee;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
}

.hwb-row:last-child { border-bottom: 0; }
.hwb-row span { color: #536b80; }
.hwb-row strong { flex: 0 0 auto; color: #173b5e; }

.hwb-row.is-service {
    margin: 0 -13px;
    padding: 9px 13px;
    border-bottom: 0;
    border-radius: 8px;
    background: #fff1e9;
}

.hwb-row.is-service strong { color: #e75f31; }

.hwb-total {
    margin-bottom: 13px;
    padding: 18px 14px;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #0b3564, #1a5a91);
    text-align: center;
}

.hwb-total small,
.hwb-total strong,
.hwb-total span {
    display: block;
}

.hwb-total small { color: rgba(255, 255, 255, .76); font-size: 11px; }
.hwb-total strong { margin: 6px 0; font-size: 27px; line-height: 1.2; }
.hwb-total span { color: #f3bd53; font-size: 12px; font-weight: 700; line-height: 1.55; }

.hwb-risk {
    margin-bottom: 14px;
    padding: 12px 13px;
    border: 1px solid #edaaa6;
    border-radius: 11px;
    color: #9d3034;
    background: #fff2f1;
    font-size: 12px;
    line-height: 1.6;
}

.hwb-compare-button,
.hwb-back {
    width: 100%;
    padding: 7px;
    border: 0;
    color: #144873;
    background: transparent;
    font-size: 12px;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.hwb-compare-wrap {
    display: none;
    margin: 7px 0 14px;
    overflow-x: auto;
}

.hwb-compare-wrap.is-visible { display: block; }

.hwb-compare {
    width: 100%;
    min-width: 380px;
    border-collapse: collapse;
    font-size: 10px;
}

.hwb-compare th,
.hwb-compare td {
    padding: 7px 4px;
    border: 1px solid #dce6ee;
    text-align: center;
}

.hwb-compare th { color: #fff; background: #123f6a; }
.hwb-compare td:last-child { color: #14814b; background: #eaf8f0; font-weight: 700; }

.hwb-cta {
    min-height: 47px;
    margin-top: 9px;
    padding: 9px 12px;
    background: #103d6b;
    font-size: 13px;
    font-weight: 800;
}

.hwb-cta.is-primary {
    background: linear-gradient(135deg, #ef6938, #e2a438);
}

.hwb-back { margin-top: 6px; }

.hwb-footnote {
    margin: 12px 0 0;
    color: #98a7b4;
    font-size: 10px;
    line-height: 1.55;
    text-align: center;
}

@media (max-width: 520px) {
    .hwb-fab {
        top: calc(60% + 72px);
        right: 0;
        bottom: auto;
        width: 32px;
        height: 164px;
        padding: 8px 2px;
    }

    .hwb-fab-icon { width: 24px; height: 24px; font-size: 15px; }
    .hwb-fab-label { margin-top: 6px; font-size: 10px; letter-spacing: 1px; }

    .hwb-panel {
        top: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        border-radius: 0;
        -webkit-transform: translateX(100%);
        transform: translateX(100%);
    }

    .hwb-body { padding: 18px 14px 24px; }
    .hwb-field { margin-bottom: 18px; }
    .hwb-choice { font-size: 11px; }
    .hwb-radio { padding: 9px 10px; font-size: 12px; }
}

.hwb-activities { display: grid; gap: 3px; scrollbar-width: thin; scrollbar-color: #c6d5e1 transparent; overscroll-behavior: contain; }
.hwb-activity-picker .hwb-activity { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border: 0; border-radius: 8px; margin: 0; color: #385673; font-size: 13px; font-weight: 400; cursor: pointer; transition: background .16s ease, color .16s ease; }
.hwb-activity-picker .hwb-activity:hover { background: #edf6fb; color: #0b4f84; }
.hwb-activity-picker .hwb-activity:has(input:checked) { background: #fff3d8; color: #9a6420; }
.hwb-activity-picker .hwb-activity input { appearance: none; width: 17px; height: 17px; margin: 0; flex: 0 0 17px; border: 1.5px solid #becfdd; border-radius: 5px; background: #fff; cursor: pointer; display: grid; place-content: center; }
.hwb-activity-picker .hwb-activity input:checked { background: #c58d32; border-color: #c58d32; }
.hwb-activity-picker .hwb-activity input:checked::after { content: ''; width: 7px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }
.hwb-activity-picker .hwb-activity input:focus-visible { outline: 2px solid #4b89b6; outline-offset: 3px; }
.hwb-activity-picker .hwb-activity span { min-width: 0; flex: 1; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 12px; row-gap: 3px; overflow-wrap: anywhere; }
.hwb-activity-picker .hwb-activity small { margin: 0; color: #73879b; font-size: 11px; white-space: nowrap; font-weight: 400; }
.hwb-activity-picker .hwb-activity:has(input:checked) small { color: #a17c3e; }
.hwb-activity-picker .hwb-picker-menu { visibility: hidden; }
.hwb-activity-picker.is-open .hwb-picker-menu { visibility: visible; }
.hwb-activity-picker .hwb-picker-trigger > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hwb-picker.opens-up .hwb-picker-menu { top: auto; bottom: calc(100% + 6px); }

/* Budget result: clear total, compact breakdown and consistent actions. */
.hwb-results .hwb-summary { margin: 0 0 16px; padding: 9px 12px; border-radius: 8px; background: #f3f7fa; color: #647b90; font-size: 12px; text-align: center; }
.hwb-results .hwb-total { margin: 0 0 24px; padding: 25px 16px; border-radius: 16px; background: linear-gradient(125deg,#123b67,#216293); box-shadow: 0 8px 20px rgba(18,59,103,.12); }
.hwb-results .hwb-total small { font-size: 12px; letter-spacing: .4px; }
.hwb-results .hwb-total strong { margin: 12px 0; font-size: clamp(23px,6vw,30px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hwb-results .hwb-total span { display: inline-block; padding: 6px 11px; border-radius: 7px; background: rgba(255,255,255,.08); color: #ffe0a0; font-weight: 500; }
.hwb-details-title { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: #173b5e; }
.hwb-results .hwb-breakdown { padding: 4px 14px; margin-bottom: 12px; border: 1px solid #e5edf3; border-radius: 12px; background: #fff; }
.hwb-results .hwb-row { padding: 13px 0; gap: 12px; align-items: baseline; border-bottom: 1px solid #edf2f6; font-size: 12px; }
.hwb-results .hwb-row:last-child { border-bottom: 0; }
.hwb-results .hwb-row strong { font-variant-numeric: tabular-nums; }
.hwb-results .hwb-compare-button { width: 100%; padding: 11px; margin: 0 0 16px; border: 1px solid #dce7ef; border-radius: 9px; background: #f7fafc; color: #426683; font-size: 13px; text-decoration: none; }
.hwb-results .hwb-back { width: 100%; margin-top: 10px; padding: 11px; border: 1px solid #dce7ef; border-radius: 9px; text-decoration: none; color: #476780; background: #fff; }
.hwb-results .hwb-footnote { margin-top: 18px; line-height: 1.7; font-size: 11px; }
