.cebi-lead {
    margin: 8px 0 18px;
    color: #5f5a56;
    font-size: 14px;
    line-height: 1.6;
}

.cebi-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: flex-start;
}

.cebi-input-col,
.cebi-result-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.cebi-section {
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    background: #fff;
    padding: 14px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.cebi-section h3 {
    margin: 0 0 10px;
    font-size: 15px;
    color: #2d2a26;
}

.cebi-config-section,
.cebi-mode-section {
    display: block;
}

.cebi-input-group {
    margin-bottom: 10px;
}

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

.cebi-input-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #5b544d;
}

.cebi-select,
.cebi-input-group input,
.cebi-textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid #ddd7cc;
    border-radius: 9px;
    padding: 10px 11px;
    background: #fff;
    color: #2d2a26;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cebi-input-group input,
.cebi-textarea,
.cebi-builder-preview code,
.cebi-table {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.cebi-textarea {
    min-height: 110px;
    resize: vertical;
    line-height: 1.55;
}

.cebi-select:focus,
.cebi-input-group input:focus,
.cebi-textarea:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.14);
}

.cebi-hint,
.cebi-note,
.cebi-panel-desc {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.55;
    color: #6f675f;
}

.cebi-mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.cebi-mode-tab {
    flex: 1;
    justify-content: center;
    border-radius: 9px;
    padding: 9px 10px;
    font-size: 13px;
    font-weight: 700;
}

.cebi-mode-tab.active,
.cebi-mode-tab[aria-selected='true'] {
    border-color: #c6971e;
    background: #fff7df;
    color: #8b6914;
}

.cebi-builder-preview {
    margin: 10px 0 0;
    font-size: 12px;
    color: #5f5a56;
    line-height: 1.5;
}

.cebi-builder-preview code {
    background: #faf6ea;
    border: 1px solid #ebdfc0;
    border-radius: 6px;
    padding: 2px 7px;
    color: #7a5812;
    word-break: break-all;
}

.cebi-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cebi-actions .tool-btn {
    flex: 1;
    min-width: 130px;
    justify-content: center;
}

.cebi-waiting {
    border-style: dashed;
    border-color: #d8ca9d;
    background: #fff8e8;
    color: #876211;
    font-size: 13px;
}

.cebi-waiting p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cebi-waiting p::before {
    content: '';
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(184, 134, 11, 0.28);
    border-top-color: #b8860b;
    animation: cebi-spin 0.9s linear infinite;
}

.cebi-validation {
    background: #faf9f7;
}

#cebiValidationStatus {
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.55;
    color: #3f3932;
}

#cebiValidationMessages {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
}

#cebiValidationMessages li,
#cebiDisclaimerList li {
    font-size: 12px;
    line-height: 1.55;
    color: #5f5a56;
}

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

.cebi-summary-card {
    border: 1px solid #ebe4d7;
    border-radius: 10px;
    background: #faf9f7;
    padding: 10px 11px;
}

.cebi-summary-card .tool-result-label {
    font-size: 12px;
    color: #7d756a;
    margin-bottom: 5px;
}

.cebi-summary-card .tool-result-value {
    font-size: 18px;
    font-weight: 800;
    color: #2d2a26;
    line-height: 1.35;
    word-break: break-word;
}

.cebi-summary-card .tool-result-sub {
    font-size: 13px;
    line-height: 1.45;
    color: #4f4a44;
    word-break: break-word;
}

#cebiInterpretationText,
#cebiTimezoneNote {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #4b453f;
}

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

.cebi-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

.cebi-table th,
.cebi-table td {
    border-bottom: 1px solid #efe9dd;
    padding: 9px 10px;
    font-size: 12px;
    line-height: 1.45;
    text-align: left;
    color: #2d2a26;
    vertical-align: top;
}

.cebi-table th {
    background: #faf9f7;
    color: #5c544a;
    font-weight: 700;
}

.cebi-table tbody tr:last-child td {
    border-bottom: none;
}

#cebiChartCanvas {
    display: block;
    width: 100%;
    max-width: 100%;
    border: 1px solid #ece4d7;
    border-radius: 10px;
    background: #fff;
    margin-bottom: 8px;
}

#cebiChartFallbackText {
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(192, 57, 43, 0.25);
    background: rgba(231, 76, 60, 0.08);
    color: #a73327;
    font-size: 12px;
    line-height: 1.5;
}

.cebi-disclaimer {
    background: #fcfbf9;
}

#cebiDisclaimerList {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
}

.cebi-mode-panel[hidden],
.cebi-input-group[hidden],
.cebi-waiting[hidden],
#cebiChartFallbackText[hidden] {
    display: none !important;
}

@keyframes cebi-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

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

@media (max-width: 768px) {
    .cebi-section {
        padding: 12px;
    }

    .cebi-actions .tool-btn {
        flex: 1 1 calc(50% - 8px);
    }

    .cebi-mode-tabs {
        gap: 6px;
    }

    .cebi-table th,
    .cebi-table td {
        font-size: 11px;
        padding: 8px;
    }

    #cebiChartCanvas {
        height: 170px !important;
    }
}

@media (max-width: 480px) {
    .cebi-lead {
        font-size: 13px;
    }

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

    .cebi-actions .tool-btn {
        flex: 1 1 100%;
    }

    .cebi-mode-tabs {
        flex-direction: column;
    }

    .cebi-table {
        min-width: 520px;
    }

    .cebi-summary-card .tool-result-value {
        font-size: 16px;
    }
}
