.aicd-container {
    max-width: 900px;
    margin: 2em auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1f2937;
}

.aicd-title {
    font-size: 1.6em;
    margin: 0 0 0.3em 0;
    color: #111827;
}

.aicd-subtitle {
    color: #6b7280;
    margin: 0 0 1em 0;
}

.aicd-input-section textarea {
    width: 100%;
    min-height: 240px;
    padding: 14px 16px;
    font-size: 15px;
    line-height: 1.5;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
}

.aicd-input-section textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.aicd-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.aicd-word-count {
    color: #6b7280;
    font-size: 14px;
}

.aicd-buttons {
    display: flex;
    gap: 10px;
}

.aicd-btn-primary,
.aicd-btn-secondary {
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.aicd-btn-primary {
    background: #2563eb;
    color: #fff;
}

.aicd-btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
}

.aicd-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.aicd-btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.aicd-btn-secondary:hover {
    background: #e5e7eb;
}

.aicd-result-section {
    margin-top: 2em;
}

.aicd-loader {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 30px;
    background: #f9fafb;
    border-radius: 8px;
    color: #374151;
}

.aicd-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: aicd-spin 0.8s linear infinite;
}

@keyframes aicd-spin {
    to { transform: rotate(360deg); }
}

.aicd-error {
    padding: 14px 18px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 8px;
}

.aicd-score-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 20px 24px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 1.5em;
    border-left: 6px solid #10b981;
    flex-wrap: wrap;
    gap: 16px;
}

.aicd-score-percent {
    font-size: 3.2em;
    font-weight: 700;
    line-height: 1;
}

.aicd-score-label {
    color: #6b7280;
    margin-top: 4px;
}

.aicd-score-meta {
    text-align: right;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.8;
}

.aicd-summary {
    background: #f9fafb;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 1.5em;
    line-height: 1.6;
}

.aicd-results h4 {
    margin: 1.5em 0 0.6em 0;
    color: #111827;
    font-size: 1.1em;
}

.aicd-highlighted-text {
    background: #fff;
    padding: 18px 22px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
}

mark.aicd-flag {
    background: #fef3c7;
    border-bottom: 2px solid #f59e0b;
    padding: 1px 2px;
    cursor: help;
}

.aicd-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.aicd-category {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px;
}

.aicd-cat-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #111827;
}

.aicd-cat-count {
    color: #6b7280;
    font-weight: 400;
    font-size: 0.9em;
}

.aicd-cat-list {
    margin: 0;
    padding-left: 18px;
    color: #374151;
    font-size: 14px;
}

.aicd-cat-list li {
    margin: 3px 0;
}

.aicd-human-cat {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.aicd-human-cat .aicd-cat-title {
    color: #15803d;
}
