/**
 * 치아보험 보장손익 계산기
 * @package Zipper
 */

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

.dic-main-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

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

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

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

.dic-main-layout .bi,
.dic-main-layout .bi-shield-check,
.dic-main-layout .bi-wallet2,
.dic-main-layout .bi-bandaid,
.dic-main-layout .bi-hospital,
.dic-main-layout .bi-calculator,
.dic-main-layout .bi-arrow-counterclockwise,
.dic-main-layout .bi-info-circle,
.dic-main-layout .bi-clipboard2-data,
.dic-main-layout .bi-bar-chart-line,
.dic-main-layout .bi-table,
.dic-main-layout .bi-file-earmark-excel {
    line-height: 1;
}

.dic-tab-group,
.dic-mode-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    background: #f5f3ef;
    border-radius: 10px;
    padding: 6px;
}

.dic-tab,
.dic-mode-tab {
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #6a645c;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    padding: 10px 8px;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.dic-tab:hover,
.dic-mode-tab:hover {
    color: #4f4637;
}

.dic-tab.is-active,
.dic-mode-tab.active,
.dic-mode-tab[aria-selected="true"] {
    background: #fff;
    color: #2d2a26;
    box-shadow: 0 2px 6px rgba(45, 42, 38, 0.12);
}

.dic-tab-content {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

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

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

.dic-input-group {
    margin-bottom: 12px;
}

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

.dic-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.dic-label,
.dic-input-label {
    display: block;
    margin-bottom: 6px;
    color: #5f5a56;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

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

.dic-input:hover,
.dic-amount-input:hover,
.dic-number-input:hover {
    border-color: #d4c67a;
}

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

.dic-input::placeholder,
.dic-amount-input::placeholder,
.dic-number-input::placeholder {
    color: #b7b1a8;
}

.dic-input[type="number"],
.dic-number-input[type="number"] {
    -moz-appearance: textfield;
}

.dic-input[type="number"]::-webkit-outer-spin-button,
.dic-input[type="number"]::-webkit-inner-spin-button,
.dic-number-input[type="number"]::-webkit-outer-spin-button,
.dic-number-input[type="number"]::-webkit-inner-spin-button {
    margin: 0;
}

.dic-amount-input {
    text-align: right;
    font-weight: 600;
}

.dic-number-input {
    text-align: right;
}

.dic-amount-wrap,
.dic-amount-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    width: 100%;
    border: 1px solid #ddd7cb;
    border-radius: 8px;
    overflow: hidden;
    background: #fbfaf8;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.dic-amount-wrap:hover,
.dic-amount-row:hover {
    border-color: #d4c67a;
}

.dic-amount-wrap:focus-within,
.dic-amount-row:focus-within {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
    background: #fff;
}

.dic-amount-wrap .dic-amount-input,
.dic-amount-wrap .dic-number-input,
.dic-amount-row .dic-input {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    text-align: right;
}

.dic-amount-wrap .dic-amount-input,
.dic-amount-row .dic-input {
    font-weight: 600;
}

.dic-amount-wrap .dic-amount-input:hover,
.dic-amount-wrap .dic-amount-input:focus,
.dic-amount-wrap .dic-number-input:hover,
.dic-amount-wrap .dic-number-input:focus,
.dic-amount-row .dic-input:hover,
.dic-amount-row .dic-input:focus {
    border: 0;
    box-shadow: none;
    background: transparent;
}

.dic-unit {
    min-width: 62px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #e4ddd0;
    background: linear-gradient(180deg, #fcfbf8 0%, #f3efe8 100%);
    color: #7b7467;
    font-size: 12px;
    user-select: none;
    box-sizing: border-box;
}

.dic-amount-wrap-small .dic-unit {
    min-width: 48px;
}

.dic-korean-amount {
    margin: 6px 0 0;
    color: #8b836f;
    font-size: 11px;
    line-height: 1.4;
}

.dic-hint {
    margin: 6px 0 0;
    color: #8f887d;
    font-size: 11px;
    line-height: 1.45;
}

.dic-mode-help {
    margin: 10px 0 0;
    color: #7a746a;
    font-size: 12px;
    line-height: 1.5;
}

.dic-choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dic-choice-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #e4ddd2;
    border-radius: 8px;
    background: #fffdf9;
    color: #5f5a56;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.dic-choice-chip input[type="radio"],
.dic-choice-chip input[type="checkbox"] {
    margin: 0;
    width: 15px;
    height: 15px;
    accent-color: #d4af37;
    flex: 0 0 auto;
}

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

.dic-btn,
.dic-calc-btn,
.dic-reset-btn {
    border: 0;
    border-radius: 10px;
    padding: 12px 14px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.dic-btn:disabled,
.dic-calc-btn:disabled,
.dic-reset-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

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

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

.dic-btn-ghost,
.dic-reset-btn {
    color: #5f5a56;
    background: #f5f3f0;
    border: 1px solid #e8e4dc;
}

.dic-btn-ghost:hover,
.dic-reset-btn:hover {
    transform: translateY(-1px);
}

.dic-waiting {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #7a704f;
    background: #fcfaf4;
}

.dic-waiting-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

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

.dic-waiting p {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
}

.dic-waiting-title {
    margin: 0;
    color: #5e5542;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.dic-waiting-desc {
    margin: 4px 0 0;
    color: #7d7566;
    font-size: 12px;
    line-height: 1.5;
}

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

.dic-summary-badge,
.dic-result-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f3ead3;
    color: #7a6120;
    font-size: 11px;
    font-weight: 700;
}

.dic-summary-title {
    margin: 0;
    color: #2d2a26;
    font-size: 20px;
    line-height: 1.35;
}

.dic-summary-note {
    margin: 10px 0 0;
    color: #6e685f;
    font-size: 13px;
    line-height: 1.5;
}

.dic-main-kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}

.dic-main-kpi {
    border: 1px solid #ede4d1;
    border-radius: 10px;
    background: #fffdfa;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dic-main-kpi-label {
    color: #7a7469;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
}

.dic-main-kpi-value {
    color: #2d2a26;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.dic-main-kpi-value.dic-gain {
    color: #1f7f4d;
}

.dic-main-kpi-value.dic-loss {
    color: #be5a3f;
}

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

.dic-summary-item,
.dic-summary-card {
    border: 1px solid #eadfcb;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.88);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dic-summary-card h3 {
    margin: 0;
    color: #6f695e;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.dic-summary-card p {
    margin: 2px 0 0;
    color: #2d2a26;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.dic-summary-label {
    color: #7a736a;
    font-size: 11px;
    line-height: 1.35;
}

.dic-summary-value {
    color: #2d2a26;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.dic-summary-value.dic-gain {
    color: #1f7f4d;
}

.dic-summary-value.dic-loss {
    color: #be5a3f;
}

.dic-block-head,
.dic-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.dic-inline-title {
    margin: 0;
}

.dic-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

#dicDownloadBtn.tool-btn.tool-btn-excel,
.dic-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);
}

#dicDownloadBtn.tool-btn.tool-btn-excel:hover,
.dic-download-btn.tool-btn.tool-btn-excel:hover {
    background: linear-gradient(135deg, #4f9f70 0%, #438f62 100%);
    box-shadow: 0 4px 12px rgba(67, 133, 93, 0.34);
}

.dic-block-sub {
    margin: 0;
    color: #6f685f;
    font-size: 12px;
    line-height: 1.5;
}

.dic-chart-wrap {
    margin-top: 12px;
    height: 280px;
    border: 1px solid #efe6d6;
    border-radius: 12px;
    background: #fffefa;
    padding: 10px;
    box-sizing: border-box;
}

.dic-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.dic-chart-fallback {
    margin: 12px 0 0;
    color: #8c5c30;
    font-size: 12px;
    line-height: 1.5;
    padding: 10px 12px;
    border: 1px dashed #e7d1ab;
    border-radius: 10px;
    background: #fff8ee;
}

.dic-fallback-block {
    margin-top: 10px;
    border: 1px dashed #e7d1ab;
    border-radius: 10px;
    background: #fff8ee;
    color: #805d2f;
    font-size: 12px;
    line-height: 1.5;
    padding: 10px 12px;
}

.dic-fallback-table-wrap {
    margin-top: 8px;
    border: 1px solid #eee3cf;
    border-radius: 10px;
    overflow-x: auto;
    background: #fff;
}

.dic-fallback-table,
.dic-table,
.dic-result-table,
.dic-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 560px;
}

.dic-fallback-table thead th,
.dic-table thead th,
.dic-result-table thead th,
.dic-detail-table thead th {
    background: #faf4e8;
    color: #5c4f3a;
    font-weight: 700;
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #ecdcc3;
    white-space: nowrap;
}

.dic-fallback-table tbody td,
.dic-table tbody td,
.dic-result-table tbody td,
.dic-detail-table tbody td {
    padding: 10px;
    border-bottom: 1px solid #f0e6d6;
    color: #3f3a33;
    vertical-align: top;
}

.dic-fallback-table tbody tr:last-child td,
.dic-table tbody tr:last-child td,
.dic-result-table tbody tr:last-child td,
.dic-detail-table tbody tr:last-child td {
    border-bottom: 0;
}

.dic-table-wrap {
    overflow-x: auto;
    border: 1px solid #eee3cf;
    border-radius: 10px;
    background: #fff;
}

.dic-empty-row td {
    text-align: center;
    color: #8e887f;
    padding: 14px 10px;
}

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

.dic-insight-item {
    border: 1px solid #ece2d0;
    border-radius: 10px;
    background: #fffdfa;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dic-insight-label {
    color: #7c7469;
    font-size: 11px;
}

.dic-insight-value {
    color: #2f2a23;
    font-size: 13px;
    line-height: 1.45;
}

.dic-disclaimer {
    border: 1px solid #f0e2c8;
    border-radius: 12px;
    background: #fffbf2;
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #6e644f;
    font-size: 12px;
    line-height: 1.5;
}

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

.dic-date-notice {
    color: #6f675c;
}

.tool-date-notice {
    color: #6f675c;
    font-size: 12px;
    line-height: 1.5;
}

.tool-description .tool-date-notice {
    margin: 0 0 12px;
}

.dic-rate-info {
    margin-top: 12px;
    border-top: 1px solid #eadfc9;
    padding-top: 10px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    font-size: 12px;
    color: #675f53;
}

.dic-rate-info strong {
    color: #4f473c;
}

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

    .dic-input-col {
        position: static;
        top: auto;
    }
}

@media (max-width: 900px) {
    .dic-input-group input:not([type="radio"]):not([type="checkbox"]),
    .dic-input-group select {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
        box-sizing: border-box;
    }

    .dic-summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dic-main-kpi-value {
        font-size: 20px;
    }
}

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

    .dic-input-row,
    .dic-main-kpi-grid,
    .dic-insight-grid {
        grid-template-columns: 1fr;
    }

    .dic-summary-title {
        font-size: 18px;
    }

    .dic-block-head,
    .dic-table-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dic-chart-wrap {
        height: 240px;
    }

    .dic-rate-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .tool-section,
    .dic-main-layout,
    .dic-input-col,
    .dic-result-col,
    .dic-section,
    .dic-result-summary,
    .dic-chart-section,
    .dic-table-section,
    .dic-fallback-section {
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .dic-summary-grid {
        grid-template-columns: 1fr;
    }

    .dic-btn,
    .dic-calc-btn,
    .dic-reset-btn {
        padding: 11px 12px;
        font-size: 12px;
    }

    .dic-choice-row {
        gap: 6px;
    }
}
