.hiv-cost-section {
    --hiv-cost-accent: #c5253f;
    --hiv-cost-deep: #86182b;
    --hiv-cost-soft: #fff3f5;
    margin-top: 22px;
}
.hiv-cost-section > h3 {
    color: var(--hiv-cost-deep);
    font-size: 20px;
    margin-bottom: 7px;
}
.hiv-cost-intro {
    color: #526875;
    line-height: 1.7;
    margin: 0 0 13px;
}
.hiv-cost-safety {
    border-left: 4px solid #b45309;
    background: #fff8e8;
    color: #654a1b;
    font-size: 12px;
    line-height: 1.65;
    margin: 12px 0 17px;
    padding: 10px 13px;
}
.hiv-cost-preset-row,
.hiv-cost-add-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
}
.hiv-cost-preset-row > label,
.hiv-cost-add-row > label {
    color: #334f60;
    font-weight: 700;
    min-width: 0;
}
.hiv-cost-preset-row label > span,
.hiv-cost-add-row label > span {
    display: block;
    margin-bottom: 5px;
}
.hiv-cost-preset-row select,
.hiv-cost-add-row select {
    width: 100%;
    min-width: 0;
    height: 42px;
    border: 1px solid #899ea9;
    border-radius: 5px;
    background: #fff;
    color: #263f50;
    padding: 7px 9px;
}
.hiv-cost-preset-row .btn,
.hiv-cost-add-row .btn {
    min-height: 42px;
    white-space: nowrap;
}
.hiv-cost-context {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 13px 0 16px;
}
.hiv-cost-context label {
    display: flex;
    align-items: center;
    min-height: 42px;
    border: 1px solid #d5dfe4;
    border-radius: 6px;
    background: #f8fafb;
    color: #405966;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
    padding: 8px 10px;
}
.hiv-cost-context input {
    flex: none;
    margin: 0 7px 0 0;
}
.hiv-cost-builder {
    border: 1px solid #cad7dd;
    border-radius: 8px;
    background: #fff;
    margin: 16px 0;
    padding: 15px;
}
.hiv-cost-builder-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    border-bottom: 1px solid #e2e9ed;
    margin-bottom: 12px;
    padding-bottom: 11px;
}
.hiv-cost-builder-heading h4 {
    display: block !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--hiv-cost-deep) !important;
    font-size: 16px;
    margin: 0 0 4px;
    padding: 0 !important;
}
.hiv-cost-builder-heading p {
    color: #687b85;
    font-size: 11px;
    line-height: 1.5;
    margin: 0;
}
#hiv-cost-selection-count {
    flex: none;
    border-radius: 16px;
    background: var(--hiv-cost-soft);
    color: var(--hiv-cost-deep);
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
}
.hiv-cost-selected {
    display: grid;
    gap: 8px;
    margin-bottom: 13px;
}
.hiv-cost-empty {
    border: 1px dashed #c4d0d6;
    border-radius: 6px;
    color: #70818a;
    font-size: 12px;
    margin: 0;
    padding: 14px;
    text-align: center;
}
.hiv-cost-selected-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border: 1px solid #d5dfe4;
    border-left: 4px solid var(--hiv-cost-accent);
    border-radius: 6px;
    background: #fbfcfd;
    padding: 9px 10px;
}
.hiv-cost-selected-item strong,
.hiv-cost-selected-item small {
    display: block;
    overflow-wrap: anywhere;
}
.hiv-cost-selected-item strong {
    color: #263f50;
    font-size: 13px;
}
.hiv-cost-selected-item small {
    color: #687b85;
    font-size: 10px;
    line-height: 1.45;
    margin-top: 2px;
}
.hiv-cost-item-control {
    display: flex;
    align-items: center;
    gap: 8px;
}
.hiv-cost-item-control label {
    display: grid;
    grid-template-columns: auto 65px auto;
    align-items: center;
    gap: 5px;
    color: #526875;
    font-size: 10px;
    font-weight: 600;
}
.hiv-cost-item-control input {
    width: 65px;
    height: 34px;
    border: 1px solid #91a6b2;
    border-radius: 5px;
    background: #fff;
    padding: 5px 7px;
}
.hiv-cost-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #d9a7ae;
    border-radius: 50%;
    background: #fff;
    color: var(--hiv-cost-deep);
    font-size: 18px;
    line-height: 1;
}
.hiv-cost-remove:hover,
.hiv-cost-remove:focus {
    background: var(--hiv-cost-soft);
    outline: none;
}
.hiv-cost-course-tag {
    display: inline-block;
    border-radius: 13px;
    background: #e8f1f6;
    color: #31566a;
    font-size: 10px;
    font-weight: 700;
    padding: 5px 8px;
}
.hiv-cost-builder-status {
    min-height: 18px;
    color: #31704c;
    font-size: 11px;
    margin: 6px 0 -4px;
}
.hiv-cost-builder-status.is-error { color: #9b2735; }
.hiv-cost-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0 2px;
}
.hiv-cost-result {
    margin-top: 16px;
}
.hiv-cost-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0 16px;
}
.hiv-cost-metrics > div {
    border: 1px solid #d7e1e6;
    border-radius: 7px;
    background: linear-gradient(145deg, #fff, var(--hiv-cost-soft));
    min-width: 0;
    padding: 11px 9px;
    text-align: center;
}
.hiv-cost-metrics span,
.hiv-cost-metrics strong,
.hiv-cost-metrics small {
    display: block;
}
.hiv-cost-metrics span {
    color: #536b78;
    font-size: 10px;
    line-height: 1.35;
    min-height: 27px;
}
.hiv-cost-metrics strong {
    color: var(--hiv-cost-deep);
    font-size: 18px;
    margin: 4px 0;
    overflow-wrap: anywhere;
}
.hiv-cost-metrics small {
    color: #758690;
    font-size: 9px;
}
.hiv-cost-result h4 {
    display: block !important;
    border: 0 !important;
    background: transparent !important;
    color: #344f5f !important;
    font-size: 14px;
    margin: 15px 0 8px;
    padding: 0 !important;
}
.hiv-cost-breakdown {
    border-top: 1px solid #dce5e9;
    list-style: none;
    margin: 0;
    padding: 0;
}
.hiv-cost-breakdown li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 13px;
    border-bottom: 1px solid #e3eaee;
    padding: 9px 2px;
}
.hiv-cost-breakdown li > span:last-child {
    color: #344f5f;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}
.hiv-cost-breakdown strong,
.hiv-cost-breakdown small {
    display: block;
}
.hiv-cost-breakdown small {
    color: #6f8089;
    font-size: 10px;
    line-height: 1.45;
    margin-top: 2px;
}
.hiv-cost-errors,
.hiv-cost-warnings {
    border-left: 4px solid #b45309;
    background: #fff8e8;
    color: #684c17;
    font-size: 11px;
    line-height: 1.6;
    margin: 14px 0;
    padding: 10px 12px;
}
.hiv-cost-errors {
    border-left-color: #b42338;
    background: #fff1f3;
    color: #7d2634;
}
.hiv-cost-errors ul,
.hiv-cost-warnings ul {
    margin: 5px 0 0;
    padding-left: 20px;
}
.hiv-cost-disclaimer {
    border-top: 1px solid #dce5e9;
    color: #687b85;
    font-size: 10px;
    line-height: 1.65;
    margin: 15px 0 0;
    padding-top: 10px;
}
.hiv-cost-market {
    border: 1px solid #d5dfe4;
    border-radius: 7px;
    background: #fff;
    margin-top: 15px;
}
.hiv-cost-market summary {
    color: #344f5f;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    padding: 11px 13px;
}
.hiv-cost-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.hiv-cost-market table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 10px;
}
.hiv-cost-market th,
.hiv-cost-market td {
    border-top: 1px solid #e1e8ec;
    padding: 7px 8px;
    text-align: left;
    vertical-align: top;
}
.hiv-cost-market th {
    background: #f4f7f8;
    color: #405966;
    white-space: nowrap;
}
.hiv-cost-market td strong,
.hiv-cost-market td small { display: block; }
.hiv-cost-market td small { color: #71828b; margin-top: 2px; }
.hiv-cost-market > p {
    color: #70818a;
    font-size: 10px;
    line-height: 1.55;
    margin: 0;
    padding: 9px 12px 11px;
}
.hiv-cost-source {
    color: #70818a;
    font-size: 10px;
    margin-top: 9px;
    text-align: right;
}

@media (max-width: 991px) {
    .hiv-cost-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .hiv-cost-section > h3 { font-size: 18px; }
    .hiv-cost-preset-row,
    .hiv-cost-add-row,
    .hiv-cost-selected-item,
    .hiv-cost-breakdown li {
        grid-template-columns: minmax(0, 1fr);
    }
    .hiv-cost-preset-row .btn,
    .hiv-cost-add-row .btn { width: 100%; }
    .hiv-cost-context { grid-template-columns: minmax(0, 1fr); }
    .hiv-cost-builder { padding: 12px; }
    .hiv-cost-item-control { justify-content: space-between; }
    .hiv-cost-breakdown li > span:last-child {
        text-align: left;
        white-space: normal;
    }
    .hiv-cost-source { text-align: left; }
}

@media (max-width: 420px) {
    .hiv-cost-builder-heading { display: block; }
    #hiv-cost-selection-count { display: inline-block; margin-top: 7px; }
    .hiv-cost-metrics { grid-template-columns: minmax(0, 1fr); }
    .hiv-cost-item-control {
        align-items: flex-end;
        gap: 5px;
    }
    .hiv-cost-item-control label {
        grid-template-columns: auto 58px auto;
    }
    .hiv-cost-item-control input { width: 58px; }
}

#panel-hiv .hiv-tool-number { display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; border-radius:50%; background:#176b8e; color:#fff; margin-right:7px; padding:0; font-size:14px; vertical-align:middle; }
#panel-hiv #hiv-resistance-title, #panel-hiv #hiv-cost-title { display:flex; align-items:center; justify-content:flex-start; }
#panel-hiv .hiv-tool-number { flex-shrink:0; }
#panel-hiv #hiv-resistance-title .favorite-toggle, #panel-hiv #hiv-cost-title .favorite-toggle { margin-left:auto; }
