.cbi-hidden {
    display: none !important;
}

.cbi-main-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
    align-items: start;
}

.cbi-input-col {
    position: sticky;
    top: 20px;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-sizing: border-box;
}

.cbi-result-col {
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
}

.cbi-section,
.cbi-result-summary,
.cbi-card-section,
.cbi-chart-section,
.cbi-table-section,
.cbi-apply-section {
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    background: #fff;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
    transition: box-shadow 0.2s ease;
    max-width: 100%;
    box-sizing: border-box;
}

.cbi-section:hover,
.cbi-result-summary:hover,
.cbi-card-section:hover,
.cbi-chart-section:hover,
.cbi-table-section:hover,
.cbi-apply-section:hover {
    box-shadow: 0 2px 8px rgba(45, 42, 38, 0.1);
}

.cbi-section-title,
.cbi-block-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #2d2a26;
}

.cbi-section-title i,
.cbi-block-title i {
    color: #d4af37;
}

.cbi-input-group {
    margin-bottom: 12px;
    max-width: 100%;
    box-sizing: border-box;
}

.cbi-input-group:last-child {
    margin-bottom: 0;
}

.cbi-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #5f5a56;
}

.cbi-select,
.cbi-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid #ddd7cb;
    border-radius: 8px;
    background: #fbfaf8;
    color: #2d2a26;
    font-size: 13px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.cbi-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 10px 32px 10px 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%236f6758' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.cbi-input {
    padding: 10px 12px;
    text-align: right;
    font-weight: 600;
}

.cbi-input::placeholder {
    color: #c4c0bc;
    font-weight: 400;
}

.cbi-select:hover,
.cbi-input:hover {
    border-color: #d4c67a;
}

.cbi-select:focus,
.cbi-input:focus {
    outline: none;
    background: #fff;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.cbi-hint {
    margin: 5px 0 0;
    font-size: 11px;
    line-height: 1.45;
    color: #8f897f;
}

.cbi-grid-2,
.cbi-grid-3 {
    display: grid;
    gap: 10px;
}

.cbi-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cbi-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cbi-radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.cbi-radio-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #ddd7cb;
    border-radius: 8px;
    padding: 10px;
    font-size: 12px;
    color: #5f5a56;
    background: #fbfaf8;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cbi-radio-label input[type="radio"] {
    margin: 0;
    width: auto;
}

.cbi-radio-label.active {
    border-color: #d4af37;
    background: #fff9ea;
    color: #4b432f;
}

.cbi-checklist {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    line-height: 1.5;
    color: #5f5a56;
}

.cbi-btn-group {
    display: flex;
    gap: 8px;
}

.cbi-btn {
    border: none;
    border-radius: 10px;
    padding: 12px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cbi-btn-primary {
    flex: 1;
    color: #fff;
    background: linear-gradient(135deg, #d4af37 0%, #c49520 100%);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.26);
}

.cbi-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.34);
}

.cbi-btn-ghost {
    color: #5f5a56;
    border: 1px solid #dfd8cb;
    background: #f5f3ef;
}

.cbi-btn-ghost:hover {
    background: #fff;
    border-color: #d4c67a;
}

.cbi-waiting {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    color: #7f755f;
    font-size: 13px;
    line-height: 1.5;
}

.cbi-waiting i {
    color: #d4af37;
    font-size: 18px;
    flex-shrink: 0;
    opacity: 0.9;
}

.cbi-waiting p {
    margin: 0;
}

.cbi-result-summary {
    background: linear-gradient(135deg, #fdfbf5 0%, #faf6ec 100%);
    box-shadow: 0 2px 12px rgba(212, 175, 55, 0.12);
}

.cbi-summary-badge {
    display: inline-flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.18);
    color: #7a5a14;
    font-size: 12px;
    font-weight: 700;
}

.cbi-summary-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.45;
    color: #2d2a26;
}

.cbi-main-value {
    margin-top: 8px;
    margin-bottom: 10px;
    font-size: 34px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: #b58913;
}

.cbi-summary-note {
    margin: 0;
    color: #6f6758;
    font-size: 12px;
    line-height: 1.5;
}

.cbi-summary-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.cbi-summary-item {
    border: 1px solid #e8dfc8;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
}

.cbi-summary-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #83796b;
}

.cbi-summary-value {
    margin-top: 4px;
    display: block;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    color: #2d2a26;
}

.cbi-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.cbi-card {
    border: 1px solid #ece6db;
    border-radius: 10px;
    background: #fff;
    padding: 12px;
}

.cbi-card h3 {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #7a7167;
}

.cbi-card p {
    margin: 6px 0 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    color: #2d2a26;
    letter-spacing: -0.01em;
}

.cbi-pill {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid #e6ddc8;
    padding: 4px 9px;
    font-size: 12px;
    color: #7b6c4e;
    background: #fffaf0;
}

.cbi-block-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.cbi-block-sub {
    margin: 2px 0 0;
    font-size: 11px;
    line-height: 1.45;
    color: #8f897f;
    text-align: right;
}

.cbi-chart-wrap {
    position: relative;
    width: 100%;
    height: 290px;
}

.cbi-chart-wrap canvas {
    max-height: 290px;
}

.cbi-chart-fallback {
    margin-top: 10px;
    border-radius: 8px;
    border: 1px dashed #dccfb4;
    background: #fffcf4;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.5;
    color: #7f745f;
}

.cbi-table-wrap {
    margin-top: 8px;
    overflow-x: auto;
}

.cbi-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 480px;
}

.cbi-table th,
.cbi-table td {
    border-bottom: 1px solid #eee8dc;
    padding: 10px 8px;
    vertical-align: top;
}

.cbi-table th {
    background: #fcfaf5;
    color: #665f53;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
}

.cbi-table td:first-child {
    width: 52%;
    font-size: 12px;
    color: #4f493f;
}

.cbi-table td:last-child {
    font-size: 14px;
    font-weight: 700;
    color: #2d2a26;
    text-align: right;
    white-space: nowrap;
}

.cbi-table-note {
    margin-top: 3px;
    font-size: 11px;
    font-weight: 400;
    color: #8f8678;
    line-height: 1.4;
}

.cbi-empty-row td {
    text-align: center !important;
    color: #8d867a !important;
    font-weight: 500 !important;
    white-space: normal !important;
}

.cbi-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 34px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
}

.cbi-download-btn.tool-btn.tool-btn-excel {
    color: #fff;
    background: linear-gradient(135deg, #59ab79 0%, #4b9a69 100%);
    border: 1px solid #448e62;
    box-shadow: 0 2px 6px rgba(72, 146, 103, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.cbi-download-btn.tool-btn.tool-btn-excel:hover {
    color: #fff;
    background: linear-gradient(135deg, #4f9f70 0%, #438f62 100%);
    border-color: #3d845a;
    box-shadow: 0 4px 12px rgba(67, 133, 93, 0.34);
    transform: translateY(-1px);
}

.cbi-apply-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.cbi-apply-list a {
    color: #3f6f9f;
    text-decoration: none;
    word-break: break-word;
}

.cbi-apply-list a:hover {
    color: #2f5578;
    text-decoration: underline;
}

.cbi-apply-note {
    margin: 10px 0 0;
    font-size: 11px;
    line-height: 1.45;
    color: #8f8678;
}

.cbi-disclaimer {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    background: #faf9f7;
    font-size: 11px;
    color: #9e9a96;
    line-height: 1.5;
}

.cbi-disclaimer i {
    color: #d4af37;
    flex-shrink: 0;
    margin-top: 2px;
}

.tool-description .tool-date-notice {
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid #eadfca;
    border-radius: 8px;
    background: #fffcf5;
    font-size: 13px;
    line-height: 1.6;
    color: #5b5347;
}

@media (max-width: 1200px) {
    .cbi-main-layout {
        grid-template-columns: 340px 1fr;
    }

    .cbi-card p {
        font-size: 20px;
    }
}

@media (max-width: 900px) {
    .cbi-main-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .cbi-input-col {
        position: static;
        top: auto;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .cbi-result-col {
        width: 100%;
    }

    .cbi-grid-3 {
        grid-template-columns: 1fr;
    }

    .cbi-input-group input:not([type="radio"]):not([type="checkbox"]),
    .cbi-input-group select {
        width: 100% !important;
        max-width: 100% !important;
    }

    .cbi-block-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .cbi-block-sub {
        text-align: left;
    }

    .cbi-chart-wrap {
        height: 260px;
    }
}

@media (max-width: 768px) {
    .cbi-section,
    .cbi-result-summary,
    .cbi-card-section,
    .cbi-chart-section,
    .cbi-table-section,
    .cbi-apply-section {
        padding: 14px;
    }

    .cbi-summary-grid,
    .cbi-card-grid,
    .cbi-grid-2,
    .cbi-radio-group {
        grid-template-columns: 1fr;
    }

    .cbi-main-value {
        font-size: 30px;
    }

    .cbi-card p {
        font-size: 19px;
    }

    .cbi-summary-value {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .tool-section,
    .cbi-main-layout,
    .cbi-input-col,
    .cbi-result-col {
        max-width: 100%;
        overflow-x: hidden;
    }

    .cbi-main-value {
        font-size: 26px;
    }

    .cbi-btn {
        font-size: 12px;
        padding: 10px 12px;
    }

    .cbi-table {
        min-width: 0;
    }

    .cbi-table th,
    .cbi-table td {
        padding: 8px 6px;
    }

    .cbi-table td:first-child {
        width: 56%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cbi-section,
    .cbi-result-summary,
    .cbi-card-section,
    .cbi-chart-section,
    .cbi-table-section,
    .cbi-apply-section,
    .cbi-select,
    .cbi-input,
    .cbi-btn,
    .cbi-radio-label {
        transition: none !important;
    }

    .cbi-btn-primary:hover {
        transform: none !important;
    }
}
