#cheTool {
    color: #2d2a26;
}

#cheTool .che-lead {
    margin: 10px 0 18px;
    color: #5f5a56;
    line-height: 1.65;
}

#cheTool .che-control-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

#cheTool .che-control-item,
#cheTool .che-toggle-card,
#cheTool .che-panel,
#cheTool .che-summary-card,
#cheTool .che-output-card,
#cheTool .che-note-card,
#cheTool .che-chip-panel {
    border: 1px solid #ddd7cb;
    border-radius: 12px;
    background: #fffdf8;
}

#cheTool .che-control-item {
    padding: 12px;
}

#cheTool .che-toggle-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    cursor: pointer;
}

#cheTool .che-toggle-card input {
    margin-top: 2px;
}

#cheTool .che-toggle-card strong {
    display: block;
    font-size: 13px;
    color: #2d2a26;
}

#cheTool .che-toggle-card small {
    display: block;
    margin-top: 4px;
    color: #756f69;
    line-height: 1.45;
}

#cheTool .che-main-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 12px;
    margin-bottom: 12px;
}

#cheTool .che-input-panel,
#cheTool .che-result-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#cheTool .che-panel {
    padding: 14px;
    box-shadow: 0 1px 2px rgba(45, 42, 38, 0.04);
}

#cheTool .che-panel-head,
#cheTool .che-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

#cheTool .che-panel-head {
    margin-bottom: 12px;
}

#cheTool .che-panel-head-tight {
    margin-bottom: 10px;
}

#cheTool .che-panel-title,
#cheTool .che-section-title {
    margin: 0;
    color: #2d2a26;
}

#cheTool .che-panel-title {
    font-size: 15px;
}

#cheTool .che-section-title {
    font-size: 13px;
}

#cheTool .che-panel-desc {
    margin: 4px 0 0;
    color: #756f69;
    line-height: 1.55;
    font-size: 13px;
}

#cheTool .che-badge,
#cheTool .che-mini-label {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
}

#cheTool .che-badge {
    background: #f5efe2;
    color: #6f6243;
}

#cheTool .che-badge-accent {
    background: #fdf2cc;
    color: #7d6420;
}

#cheTool .che-mini-label {
    background: #f7f3ea;
    color: #756f69;
}

#cheTool .che-action-row,
#cheTool .che-output-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#cheTool .che-action-row {
    margin-bottom: 12px;
}

#cheTool .che-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #ddd7cb;
    border-radius: 10px;
    background: #fffaf0;
    color: #2d2a26;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

#cheTool .che-btn:hover {
    border-color: #d4af37;
    background: #f7f0e2;
}

#cheTool .che-btn:focus-visible,
#cheTool .che-textarea:focus-visible,
#cheTool .tool-input-group input:focus-visible,
#cheTool .tool-input-group select:focus-visible {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

#cheTool .che-btn-primary {
    background: #e0bd4d;
    border-color: #d4af37;
}

#cheTool .che-btn-primary:hover {
    background: #d4af37;
}

#cheTool .che-btn-small {
    padding: 7px 10px;
    font-size: 12px;
}

#cheTool .che-textarea-label {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
}

#cheTool .che-textarea {
    width: 100%;
    min-height: 240px;
    border: 1px solid #ddd7cb;
    border-radius: 12px;
    padding: 12px;
    font: 13px/1.65 "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    background: #fffefb;
    color: #2d2a26;
    box-sizing: border-box;
}

#cheTool .che-output-textarea {
    min-height: 140px;
}

#cheTool .che-inline-notes {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0 0;
    padding-left: 18px;
    color: #756f69;
    font-size: 13px;
}

#cheTool .che-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

#cheTool .che-summary-card {
    padding: 10px 11px;
}

#cheTool .che-summary-card-strong {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.08));
    border-color: rgba(212, 175, 55, 0.45);
}

#cheTool .che-summary-label {
    display: block;
    color: #756f69;
    font-size: 12px;
    margin-bottom: 6px;
}

#cheTool .che-summary-value {
    display: block;
    color: #2d2a26;
    font-size: 22px;
    line-height: 1.1;
}

#cheTool .che-chip-panel,
#cheTool .che-output-card,
#cheTool .che-note-card {
    padding: 12px;
}

#cheTool .che-chip-panel,
#cheTool .che-output-card {
    margin-bottom: 10px;
}

#cheTool .che-chip-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

#cheTool .che-chip,
#cheTool .che-empty-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 12px;
}

#cheTool .che-chip {
    background: #f7f3ea;
    color: #2d2a26;
    border: 1px solid #e3d9c2;
}

#cheTool .che-chip-empty,
#cheTool .che-empty-chip {
    background: #fff7ea;
    color: #8b6d35;
    border: 1px dashed rgba(212, 175, 55, 0.6);
}

#cheTool .che-chip-duplicate {
    background: #fff4ef;
    border-color: #efc5b1;
}

#cheTool .che-waiting {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px dashed #d4af37;
    border-radius: 10px;
    background: #fff8ea;
    color: #6f6243;
    padding: 10px 12px;
    margin-bottom: 10px;
}

#cheTool .che-waiting i {
    animation: che-spin 1s linear infinite;
}

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

#cheTool .che-note-list,
#cheTool .che-hidden {
    margin: 0;
}

#cheTool .che-note-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 18px;
    color: #5f5a56;
    font-size: 13px;
    line-height: 1.55;
}

#cheTool .che-hidden {
    display: none !important;
}

#cheTool .che-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

#cheTool .che-detail-panel {
    padding: 14px;
}

#cheTool .che-table-wrap {
    overflow-x: auto;
    margin-top: 10px;
    border: 1px solid #eee4d2;
    border-radius: 12px;
    background: #fffefb;
}

#cheTool .che-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 540px;
}

#cheTool .che-table th,
#cheTool .che-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0e7d7;
    text-align: left;
    font-size: 13px;
    vertical-align: top;
}

#cheTool .che-table th {
    background: #fbf7ef;
    color: #5f5a56;
    font-weight: 700;
}

#cheTool .che-table tr:last-child td {
    border-bottom: 0;
}

#cheTool .che-preview-header-row td {
    background: rgba(212, 175, 55, 0.08);
}

#cheTool .che-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #e7dcc4;
    border-radius: 12px;
    background: #fffcf6;
    color: #5f5a56;
}

#cheTool .che-disclaimer p {
    margin: 0;
    line-height: 1.6;
}

@media (max-width: 1180px) {
    #cheTool .che-control-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    #cheTool .che-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    #cheTool .che-main-layout,
    #cheTool .che-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    #cheTool .che-control-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    #cheTool .che-panel,
    #cheTool .che-detail-panel {
        padding: 12px;
    }

    #cheTool .che-textarea {
        min-height: 220px;
    }
}

@media (max-width: 560px) {
    #cheTool .che-control-grid {
        grid-template-columns: 1fr;
    }

    #cheTool .che-panel-head,
    #cheTool .che-section-head {
        flex-direction: column;
        align-items: stretch;
    }

    #cheTool .che-action-row,
    #cheTool .che-output-actions {
        width: 100%;
    }

    #cheTool .che-btn {
        width: 100%;
    }

    #cheTool .che-textarea {
        min-height: 200px;
    }
}
