.dpls-main-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.98fr) minmax(0, 1.02fr);
    gap: 20px;
    align-items: start;
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.dpls-main-layout,
.dpls-main-layout * {
    box-sizing: border-box;
}

.dpls-input-col,
.dpls-result-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.dpls-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.dpls-tab {
    border: 1px solid #d7d2c8;
    background: #fff;
    color: #4b443c;
    font-size: 14px;
    font-weight: 700;
    border-radius: 11px;
    padding: 10px 12px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.dpls-tab:hover,
.dpls-tab:focus-visible {
    border-color: #d4af37;
    color: #7a5d13;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.16);
    transform: none;
    outline: none;
}

.dpls-tab.active {
    background: linear-gradient(135deg, #fff8df 0%, #f6ecd1 100%);
    border-color: #d4af37;
    color: #6b4f0f;
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.24);
}

.dpls-scenario-panel {
    display: none;
    border: 1px solid #ece7dc;
    border-radius: 12px;
    padding: 16px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.dpls-scenario-panel.active {
    display: block;
}

.dpls-section-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    color: #322f2a;
}

.dpls-section-title i {
    color: #8b6a1d;
}

.dpls-panel-desc {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.6;
    color: #6d665d;
}

.dpls-row-list {
    display: grid;
    gap: 10px;
    width: 100%;
    max-width: 100%;
}

.dpls-row-card {
    border: 1px solid #ece6db;
    border-radius: 10px;
    background: #fcfaf6;
    padding: 10px;
    display: grid;
    gap: 10px;
    min-width: 0;
}

.dpls-row-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dpls-row-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #3f372e;
}

.dpls-company-field,
.dpls-bucket-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.dpls-field-label,
.dpls-bucket-field > span {
    font-size: 12px;
    font-weight: 600;
    color: #6c6256;
}

.dpls-bucket-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.dpls-company-input,
.dpls-amount-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border: 1px solid #ddd6c9;
    border-radius: 8px;
    padding: 8px 10px;
    background: #fff;
    color: #2f2b26;
    font-size: 13px;
    line-height: 1.3;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dpls-company-input:hover,
.dpls-amount-input:hover {
    border-color: #d4c67a;
}

.dpls-company-input:focus,
.dpls-amount-input:focus {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
    outline: none;
}

.dpls-row-total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border-top: 1px solid #e8dfd0;
    padding-top: 8px;
    font-size: 12px;
    color: #6e6250;
}

.dpls-row-total {
    font-weight: 700;
    color: #5f4a18;
    font-size: 13px;
}

.dpls-row-remove {
    border: 1px solid #e2d9cb;
    background: #fff;
    color: #5d554c;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.dpls-row-remove:hover,
.dpls-row-remove:focus-visible {
    border-color: #c97b68;
    color: #a8432f;
    outline: none;
}

.dpls-row-remove:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.dpls-row-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.dpls-add-row-btn {
    border: 1px solid #d9b85d;
    border-radius: 9px;
    padding: 8px 12px;
    background: #fff;
    color: #7d5d13;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.dpls-add-row-btn:hover,
.dpls-add-row-btn:focus-visible {
    background: #fef8e9;
    border-color: #d4af37;
    box-shadow: 0 1px 6px rgba(212, 175, 55, 0.18);
    outline: none;
}

.dpls-guide-box {
    border: 1px dashed #e4d7b4;
    background: #fffdf5;
    border-radius: 10px;
    padding: 10px 12px;
}

.dpls-guide-box p {
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
    color: #665a45;
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

.dpls-btn-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.dpls-calc-btn,
.dpls-reset-btn {
    border-radius: 10px;
    border: 1px solid transparent;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: box-shadow 0.2s ease, filter 0.2s ease, border-color 0.2s ease;
}

.dpls-calc-btn {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    color: #fff;
    flex: 1 1 auto;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25);
}

.dpls-calc-btn:hover,
.dpls-calc-btn:focus-visible {
    filter: brightness(1.04);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.34);
    transform: none;
    outline: none;
}

.dpls-reset-btn {
    border-color: #d8d1c5;
    background: #f5f3f0;
    color: #5f5a56;
    flex: 0 1 122px;
}

.dpls-reset-btn:hover,
.dpls-reset-btn:focus-visible {
    border-color: #c8beaf;
    box-shadow: 0 2px 8px rgba(95, 90, 86, 0.14);
    outline: none;
}

.dpls-section,
.dpls-summary-section,
.dpls-chart-section,
.dpls-company-section,
.dpls-insight-section,
.dpls-disclaimer {
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    background: #fff;
    padding: 18px;
    min-width: 0;
    max-width: 100%;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

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

.dpls-chart-section,
.dpls-company-section,
.dpls-insight-section {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dpls-chart-section:hover,
.dpls-company-section:hover,
.dpls-insight-section:hover {
    border-color: #dfd6c4;
    box-shadow: 0 2px 8px rgba(45, 42, 38, 0.1);
}

.dpls-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.dpls-section-head h3 {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    line-height: 1.3;
    color: #302c26;
}

.dpls-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 4px 10px;
    background: #f6f1e5;
    color: #7a6540;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.dpls-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.dpls-kpi-card {
    border: 1px solid #ece6db;
    border-radius: 10px;
    background: #fff;
    padding: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.dpls-kpi-card h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #3c352c;
}

.dpls-kpi-card dl {
    margin: 0;
    display: grid;
    gap: 6px;
}

.dpls-kpi-card dl div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.dpls-kpi-card dt {
    margin: 0;
    font-size: 12px;
    color: #696258;
}

.dpls-kpi-card dd {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #3f3423;
}

.dpls-chart-sub {
    margin: 0 0 8px;
    font-size: 12px;
    color: #6b6357;
    line-height: 1.5;
}

.dpls-chart-wrap {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 300px;
}

.dpls-chart-wrap canvas {
    width: 100% !important;
    height: 300px !important;
}

.dpls-chart-fallback {
    margin-top: 10px;
    border: 1px dashed #e3dac9;
    border-radius: 10px;
    background: #fffdf8;
    padding: 10px;
}

.dpls-chart-fallback p {
    margin: 0 0 8px;
    font-size: 12px;
    color: #6c604d;
}

.dpls-chart-fallback-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.dpls-chart-fallback-card {
    border: 1px solid #e8dfcf;
    border-radius: 10px;
    background: #fff;
    padding: 10px;
}

.dpls-chart-fallback-card h4 {
    margin: 0 0 8px;
    font-size: 13px;
    color: #3f3423;
}

.dpls-chart-fallback-card dl {
    margin: 0;
    display: grid;
    gap: 6px;
}

.dpls-chart-fallback-card dl div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.dpls-chart-fallback-card dt {
    margin: 0;
    font-size: 12px;
    color: #6e6458;
}

.dpls-chart-fallback-card dd {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: #3e3424;
}

.dpls-company-compare-grid {
    display: grid;
    gap: 10px;
}

.dpls-company-compare-card {
    border: 1px solid #ece6db;
    border-radius: 10px;
    background: #fff;
    padding: 12px;
    display: grid;
    gap: 10px;
}

.dpls-company-compare-head {
    display: grid;
    gap: 4px;
}

.dpls-company-compare-head h4 {
    margin: 0;
    font-size: 14px;
    color: #3f372d;
}

.dpls-company-compare-head p {
    margin: 0;
    font-size: 12px;
    color: #6b6357;
}

.dpls-company-compare-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.dpls-company-metric-block {
    border: 1px solid #efe8da;
    border-radius: 9px;
    background: #fcfaf6;
    padding: 9px;
    min-width: 0;
}

.dpls-company-metric-block h5 {
    margin: 0 0 6px;
    font-size: 12px;
    color: #554a3a;
}

.dpls-company-metric-block dl {
    margin: 0;
    display: grid;
    gap: 5px;
}

.dpls-company-metric-block dl div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.dpls-company-metric-block dt {
    margin: 0;
    font-size: 11px;
    color: #706559;
}

.dpls-company-metric-block dd {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: #3d3325;
}

.dpls-company-compare-diff {
    margin: 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f6f1e5;
    color: #6b551f;
    font-size: 12px;
    font-weight: 700;
}

.dpls-company-compare-total {
    border-color: #e7dcc0;
    background: linear-gradient(135deg, #fffdf6 0%, #fbf4e3 100%);
}

.dpls-company-compare-empty {
    text-align: center;
    background: #fffdf8;
}

.dpls-company-compare-empty p {
    margin: 0;
    color: #6d6458;
    font-size: 13px;
}

#dplsInsightText {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #443d34;
}

.dpls-insight-list {
    margin: 10px 0 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
}

.dpls-insight-list li {
    font-size: 13px;
    line-height: 1.55;
    color: #4d463d;
}

.dpls-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    line-height: 1.6;
    color: #645a4d;
    background: #fcfaf6;
}

.dpls-download-btn {
    white-space: nowrap;
}

.dpls-download-btn.tool-btn-excel {
    background: #59ab79;
    border-color: #59ab79;
    color: #fff;
    box-shadow: 0 2px 6px rgba(89, 171, 121, 0.24);
}

.dpls-download-btn.tool-btn-excel:hover,
.dpls-download-btn.tool-btn-excel:focus-visible {
    background: #4f9f70;
    border-color: #4f9f70;
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 159, 112, 0.3);
    transform: none;
    outline: none;
}

.dpls-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    min-height: 180px;
    background: #fffdf8;
    border-style: dashed;
}

.dpls-waiting-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8b6a1d;
    background: rgba(212, 175, 55, 0.15);
    font-size: 20px;
}

.dpls-waiting-title {
    font-size: 15px;
    font-weight: 700;
    color: #483d2c;
}

.dpls-waiting-desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #665d51;
}

.dpls-hidden,
.dpls-waiting[hidden],
.dpls-chart-fallback[hidden],
#dplsWaiting[hidden],
#dplsChartFallback[hidden],
.dpls-main-layout [hidden] {
    display: none !important;
}

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

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

@media (max-width: 900px) {
    .dpls-main-layout {
        gap: 16px;
    }

    .dpls-input-col,
    .dpls-result-col {
        gap: 12px;
    }

    .dpls-scenario-panel,
    .dpls-section,
    .dpls-summary-section,
    .dpls-chart-section,
    .dpls-company-section,
    .dpls-insight-section,
    .dpls-disclaimer {
        padding: 14px;
    }

    .dpls-chart-wrap,
    .dpls-chart-wrap canvas {
        min-height: 280px;
        height: 280px !important;
    }
}

@media (max-width: 768px) {
    .dpls-main-layout {
        gap: 14px;
    }

    .dpls-summary-grid,
    .dpls-bucket-grid,
    .dpls-chart-fallback-grid,
    .dpls-company-compare-split {
        grid-template-columns: 1fr;
    }

    .dpls-btn-group {
        flex-direction: column;
    }

    .dpls-calc-btn,
    .dpls-reset-btn {
        width: 100%;
        flex-basis: auto;
    }

    .dpls-section-head,
    .dpls-row-card-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .dpls-chart-wrap,
    .dpls-chart-wrap canvas {
        min-height: 260px;
        height: 260px !important;
    }
}

@media (max-width: 480px) {
    .dpls-tabs {
        gap: 6px;
    }

    .dpls-tab {
        font-size: 13px;
        padding: 9px 10px;
    }

    .dpls-scenario-panel,
    .dpls-section,
    .dpls-summary-section,
    .dpls-chart-section,
    .dpls-company-section,
    .dpls-insight-section,
    .dpls-disclaimer {
        padding: 10px;
    }

    .dpls-section-title,
    .dpls-section-head h3 {
        font-size: 14px;
    }

    .dpls-panel-desc,
    .dpls-chart-sub,
    #dplsInsightText,
    .dpls-insight-list li,
    .dpls-disclaimer,
    .dpls-company-compare-empty p {
        font-size: 12px;
    }

    .dpls-kpi-card h4,
    .dpls-company-compare-head h4,
    .dpls-chart-fallback-card h4 {
        font-size: 13px;
    }

    .dpls-kpi-card dt,
    .dpls-kpi-card dd,
    .dpls-chart-fallback-card dt,
    .dpls-chart-fallback-card dd,
    .dpls-company-metric-block dt,
    .dpls-company-metric-block dd {
        font-size: 12px;
    }

    .dpls-calc-btn,
    .dpls-reset-btn,
    .dpls-download-btn {
        font-size: 13px;
        padding: 10px 12px;
    }

    .dpls-chart-wrap,
    .dpls-chart-wrap canvas {
        min-height: 220px;
        height: 220px !important;
    }

    .dpls-company-input,
    .dpls-amount-input {
        font-size: 12px;
        padding: 7px 8px;
    }

    .dpls-waiting {
        min-height: 160px;
        padding: 8px;
    }

    .dpls-waiting-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .dpls-waiting-title {
        font-size: 14px;
    }

    .dpls-waiting-desc {
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dpls-tab,
    .dpls-add-row-btn,
    .dpls-calc-btn,
    .dpls-reset-btn,
    .dpls-chart-section,
    .dpls-company-section,
    .dpls-insight-section {
        transition: none !important;
    }

    .dpls-tab:hover,
    .dpls-tab:focus-visible,
    .dpls-calc-btn:hover,
    .dpls-calc-btn:focus-visible {
        transform: none !important;
    }
}
