/**
 * @file groq-admin.css
 * @brief Styles for the Groq AI Agent Development Management Panel
 */

/* ── Layout ──────────────────────────────────────────────────────────── */

.groq-admin {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 1060px;
    margin: 0 auto;
    padding: 0.5rem;
}

/* ── Header ──────────────────────────────────────────────────────────── */

.groq-header {
    text-align: center;
    padding: 1rem 0 0.5rem;
}

.groq-hero {
    border: 1px solid var(--border-color, rgba(168,85,247,0.22));
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(108,99,255,0.14), rgba(168,85,247,0.10));
    box-shadow: 0 10px 28px rgba(0,0,0,0.16), 0 0 0 1px rgba(168,85,247,0.10) inset;
    padding: 1rem 0.8rem 0.8rem;
}

.groq-header-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary, #1a1a1a);
}

.groq-header-title i {
    color: #6c63ff;
    margin-right: 0.4rem;
}

.groq-header-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary, #666);
    margin-top: 0.25rem;
}

/* ── Tabs ─────────────────────────────────────────────────────────────── */

.groq-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid var(--border, #e0e0e0);
    padding-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.groq-tab {
    padding: 0.5rem 0.75rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary, #666);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.groq-tab:hover {
    color: #6c63ff;
}

.groq-tab.active {
    color: #6c63ff;
    border-bottom-color: #6c63ff;
    font-weight: 600;
}

.groq-tab i {
    margin-right: 0.3rem;
    font-size: 0.75rem;
}

/* ── Panels ───────────────────────────────────────────────────────────── */

.groq-panel {
    display: none;
    flex-direction: column;
    gap: 1rem;
}

.groq-panel.active {
    display: flex;
}

/* ── Cards ────────────────────────────────────────────────────────────── */

.groq-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e0e0e0);
    border-radius: 8px;
    padding: 1rem;
}

.groq-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    color: var(--text-primary, #1a1a1a);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.groq-card h3 i {
    color: #6c63ff;
    font-size: 0.85rem;
}

/* ── Status Grid ──────────────────────────────────────────────────────── */

.groq-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.groq-stat-tile {
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
}

.groq-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
}

.groq-stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary, #666);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Model Cards ──────────────────────────────────────────────────────── */

.groq-model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.groq-model-card {
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    padding: 0.75rem;
    border-left: 3px solid #6c63ff;
}

.groq-model-tier {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    color: #fff;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}

.groq-model-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
}

.groq-model-id {
    margin-top: 0.15rem;
}

.groq-model-id code {
    font-size: 0.65rem;
    color: var(--text-secondary, #666);
    background: var(--bg-primary, #fff);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

.groq-model-desc {
    font-size: 0.7rem;
    color: var(--text-secondary, #666);
    margin-top: 0.3rem;
    line-height: 1.3;
}

/* ── Badge ────────────────────────────────────────────────────────────── */

.groq-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ── Toolbar ──────────────────────────────────────────────────────────── */

.groq-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ── Form ─────────────────────────────────────────────────────────────── */

.groq-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.groq-form-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.groq-form-row label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary, #666);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.groq-form-row-inline {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.groq-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 100px;
}

.groq-form-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary, #666);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.groq-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border, #ddd);
    border-radius: 6px;
    font-size: 0.85rem;
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #1a1a1a);
    width: 100%;
    box-sizing: border-box;
}

.groq-input:focus {
    border-color: #6c63ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.2);
}

.groq-textarea {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border, #ddd);
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: monospace;
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #1a1a1a);
    resize: vertical;
    width: 100%;
    box-sizing: border-box;
}

.groq-textarea:focus {
    border-color: #6c63ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.2);
}

.groq-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border, #ddd);
    border-radius: 6px;
    font-size: 0.85rem;
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #1a1a1a);
    cursor: pointer;
}

.groq-select-sm {
    padding: 0.35rem 0.5rem;
    font-size: 0.78rem;
}

.groq-info {
    font-size: 0.78rem;
    color: var(--text-secondary, #666);
    padding: 0.5rem;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 6px;
}

.groq-info i {
    color: #17a2b8;
    margin-right: 0.3rem;
}

/* ── Toggle Switch ────────────────────────────────────────────────────── */

.groq-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.groq-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.groq-toggle-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border, #ccc);
    border-radius: 12px;
    transition: background 0.3s;
}

.groq-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}

.groq-toggle input:checked + .groq-toggle-slider {
    background: #6c63ff;
}

.groq-toggle input:checked + .groq-toggle-slider::before {
    transform: translateX(20px);
}

/* ── Table ────────────────────────────────────────────────────────────── */

.groq-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.groq-table th {
    text-align: left;
    padding: 0.5rem;
    border-bottom: 2px solid var(--border, #e0e0e0);
    font-weight: 600;
    color: var(--text-secondary, #666);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.3px;
}

.groq-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border, #f0f0f0);
    color: var(--text-primary, #1a1a1a);
}

.groq-table tr:hover td {
    background: var(--bg-secondary, #f8f9fa);
}

/* ── Process Cards ────────────────────────────────────────────────────── */

.groq-process-card {
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-left: 3px solid #6c63ff;
}

.groq-process-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.groq-process-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary, #1a1a1a);
}

.groq-process-name i {
    color: #6c63ff;
    margin-right: 0.3rem;
}

.groq-process-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary, #666);
    margin-bottom: 0.4rem;
}

.groq-process-meta i {
    margin-right: 0.2rem;
}

.groq-process-actions {
    display: flex;
    gap: 0.5rem;
}

.groq-process-actions .btn-sm {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

/* ── Log Entries ──────────────────────────────────────────────────────── */

.groq-log-list {
    max-height: 400px;
    overflow-y: auto;
}

.groq-log-entry {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--border, #f0f0f0);
    font-size: 0.78rem;
    align-items: baseline;
}

.groq-log-entry:hover {
    background: var(--bg-secondary, #f8f9fa);
}

.groq-log-time {
    color: var(--text-secondary, #999);
    font-size: 0.7rem;
    min-width: 60px;
}

.groq-log-level {
    font-weight: 700;
    font-size: 0.65rem;
    min-width: 45px;
    text-transform: uppercase;
}

.groq-log-info .groq-log-level { color: #17a2b8; }
.groq-log-warn .groq-log-level { color: #ffc107; }
.groq-log-error .groq-log-level { color: #dc3545; }
.groq-log-debug .groq-log-level { color: #6c757d; }

.groq-log-agent {
    color: #6c63ff;
    font-weight: 500;
    font-size: 0.75rem;
}

.groq-log-msg {
    color: var(--text-primary, #1a1a1a);
    flex: 1;
}

.groq-log-details {
    width: 100%;
    color: var(--text-secondary, #666);
    font-size: 0.72rem;
    padding-left: 2rem;
    font-style: italic;
}

/* ── Memory Entries ───────────────────────────────────────────────────── */

.groq-memory-files {
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 6px;
    font-size: 0.78rem;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
}

.groq-memory-entry {
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 6px;
    padding: 0.6rem;
    margin-bottom: 0.5rem;
}

.groq-memory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
}

.groq-memory-time {
    font-size: 0.7rem;
    color: var(--text-secondary, #999);
}

.groq-memory-content {
    font-size: 0.82rem;
    color: var(--text-primary, #1a1a1a);
    line-height: 1.4;
}

.groq-memory-source {
    margin-top: 0.3rem;
    font-size: 0.72rem;
    color: var(--text-secondary, #666);
}

.groq-memory-source i {
    margin-right: 0.2rem;
}

/* ── Utility ──────────────────────────────────────────────────────────── */

.groq-empty {
    text-align: center;
    color: var(--text-secondary, #999);
    font-size: 0.85rem;
    padding: 1.5rem;
}

.groq-error {
    color: #dc3545;
    font-size: 0.85rem;
    padding: 0.5rem;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */

.groq-admin .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.groq-admin .btn-primary {
    background: #6c63ff;
    color: #fff;
}

.groq-admin .btn-primary:hover {
    background: #5a52e0;
}

.groq-admin .btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
}

.groq-admin .btn-success {
    background: #28a745;
    color: #fff;
}

.groq-admin .btn-warning {
    background: #ffc107;
    color: #212529;
}

.groq-admin .btn-danger {
    background: #dc3545;
    color: #fff;
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .groq-tabs {
        flex-wrap: nowrap;
    }

    .groq-tab {
        padding: 0.4rem 0.5rem;
        font-size: 0.7rem;
    }

    .groq-tab i {
        display: none;
    }

    .groq-status-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .groq-model-grid {
        grid-template-columns: 1fr;
    }

    .groq-form-row-inline {
        flex-direction: column;
    }

    .groq-agent-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Agent Team Grid ─────────────────────────────────────────────────── */

.groq-agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.groq-agent-card {
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    padding: 0.75rem;
    border-left: 3px solid #6c63ff;
}

.groq-agent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
}

.groq-agent-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary, #1a1a1a);
}

.groq-agent-model {
    font-size: 0.72rem;
    color: var(--text-secondary, #666);
    margin-bottom: 0.3rem;
}

.groq-agent-model i {
    margin-right: 0.2rem;
    color: #6c63ff;
}

.groq-agent-desc {
    font-size: 0.78rem;
    color: var(--text-secondary, #555);
    line-height: 1.3;
    margin-bottom: 0.4rem;
}

.groq-agent-caps {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.groq-cap-tag {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 500;
    color: #6c63ff;
    background: rgba(108, 99, 255, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    text-transform: lowercase;
}

/* ── Webroot / File Tree ─────────────────────────────────────────────── */

.groq-webroot-summary {
    margin-bottom: 0.75rem;
}

.groq-file-tree {
    font-size: 0.8rem;
}

.groq-tree-dir {
    margin-bottom: 0.5rem;
}

.groq-tree-dir-name {
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    padding: 0.3rem 0;
}

.groq-tree-dir-name i {
    color: #ffc107;
    margin-right: 0.3rem;
}

.groq-tree-file {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0 0.2rem 1.2rem;
    font-size: 0.78rem;
    color: var(--text-primary, #333);
}

.groq-tree-file i {
    color: #6c63ff;
    font-size: 0.7rem;
    width: 14px;
    text-align: center;
}

.groq-tree-fname {
    flex: 1;
}

.groq-tree-fsize {
    color: var(--text-secondary, #999);
    font-size: 0.68rem;
    min-width: 40px;
    text-align: right;
}

.groq-tree-furl code {
    font-size: 0.65rem;
    color: var(--text-secondary, #888);
    background: var(--bg-primary, #fff);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

/* ── Repo Info ────────────────────────────────────────────────────────── */

.groq-repo-section {
    margin-bottom: 0.75rem;
}

.groq-repo-section h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    margin: 0.5rem 0 0.4rem 0;
}

.groq-repo-section h4 i {
    color: #6c63ff;
    margin-right: 0.3rem;
}

.groq-endpoint-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0.3rem 0;
}

.groq-endpoint {
    font-size: 0.68rem;
    background: var(--bg-secondary, #f8f9fa);
    color: var(--text-primary, #333);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    border: 1px solid var(--border, #e0e0e0);
}

/* ── Dev Cycles ──────────────────────────────────────────────────────── */

.groq-cycle-card {
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid #6c63ff;
}

.groq-cycle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.groq-cycle-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary, #1a1a1a);
    margin-right: 0.4rem;
}

.groq-phase-bar {
    display: flex;
    gap: 0.25rem;
    margin: 0.5rem 0;
}

.groq-phase-step {
    flex: 1;
    padding: 0.3rem 0.2rem;
    text-align: center;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 500;
    background: var(--bg-primary, #fff);
    color: var(--text-secondary, #666);
    border: 1px solid var(--border, #e0e0e0);
    transition: all 0.2s;
}

.groq-phase-step.active {
    font-weight: 700;
    border: none;
}

.groq-phase-step.completed {
    background: var(--bg-primary, #fff);
    color: #28a745;
    border-color: #28a745;
}

.groq-phase-step i {
    font-size: 0.6rem;
    margin-right: 0.15rem;
}

.groq-phase-label {
    display: inline;
}

@media (max-width: 600px) {
    .groq-phase-label {
        display: none;
    }
}

.groq-phase-desc {
    font-size: 0.82rem;
    color: var(--text-primary, #333);
    margin: 0.4rem 0;
}

.groq-phase-desc i {
    margin-right: 0.3rem;
}

.groq-cycle-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    margin: 0.5rem 0;
}

.groq-cycle-objectives {
    margin-top: 0.5rem;
}

.groq-cycle-objectives h4 {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    margin: 0.3rem 0;
}

.groq-cycle-objectives h4 i {
    color: #6c63ff;
    margin-right: 0.2rem;
}

/* ── API Key Gate ──────────────────────────────────────────────── */

.groq-apikey-checking {
    padding: 3rem;
    text-align: center;
    color: var(--text-secondary, #666);
    font-size: 1rem;
}

.groq-apikey-gate {
    max-width: 640px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--card-bg, #fff);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    text-align: center;
}

.groq-apikey-gate-icon {
    font-size: 3rem;
    color: #6c63ff;
    margin-bottom: 1rem;
}

.groq-apikey-gate h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: var(--text-primary, #1a1a1a);
}

.groq-apikey-gate p {
    color: var(--text-secondary, #555);
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
}

.groq-apikey-gate a {
    color: #6c63ff;
    text-decoration: underline;
}

.groq-apikey-form {
    margin: 1.5rem 0;
    text-align: left;
}

.groq-apikey-form label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    color: var(--text-primary, #1a1a1a);
}

.groq-apikey-input {
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    width: 100%;
    box-sizing: border-box;
}

.groq-apikey-hint {
    font-size: 0.78rem;
    color: var(--text-secondary, #777);
    margin: 0.4rem 0 1rem;
}

.groq-apikey-btn {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
}

.groq-apikey-models {
    margin-top: 1.5rem;
    text-align: left;
    background: var(--surface, #f8f9fa);
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.groq-apikey-models h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    margin: 0 0 0.6rem;
}

.groq-apikey-models ul {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--text-secondary, #555);
    font-size: 0.85rem;
    line-height: 1.7;
}

/* ── Config panel: API key status ──────────────────────────────── */

.groq-form-section {
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.2rem;
    background: var(--surface, #f8f9fa);
}

.groq-form-section h4 {
    font-size: 0.92rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: var(--text-primary, #1a1a1a);
}

.groq-apikey-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.groq-apikey-status--ok {
    background: #d4edda;
    color: #155724;
}

.groq-apikey-status--warn {
    background: #fff3cd;
    color: #856404;
}

/* ── Agentic Iteration card ─────────────────────────────────────── */

.groq-iterate-card {
    border-top: 3px solid #6c63ff;
}

.groq-iterate-desc {
    color: var(--text-secondary, #555);
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

.groq-iterate-result {
    margin-top: 1.25rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
    padding-top: 1rem;
}

.groq-iterate-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    margin-bottom: 0.75rem;
}

.groq-iterate-json {
    background: var(--surface, #f4f4f8);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    padding: 1rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.78rem;
    line-height: 1.55;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 500px;
    overflow-y: auto;
    color: var(--text-primary, #1a1a1a);
}

.groq-optional {
    font-weight: 400;
    font-size: 0.78rem;
    color: var(--text-secondary, #888);
}

/* ── API key gate: register button, divider, hint ──────────────── */

.groq-apikey-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.9rem 0;
    color: var(--text-secondary, #aaa);
    font-size: 0.8rem;
}

.groq-apikey-divider::before,
.groq-apikey-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color, #e0e0e0);
}

.groq-apikey-register-btn {
    width: 100%;
    padding: 0.7rem;
    font-size: 0.95rem;
    background: transparent;
    border: 2px solid #6c63ff;
    color: #6c63ff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.18s, color 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.groq-apikey-register-btn:hover {
    background: #6c63ff;
    color: #fff;
}

.groq-apikey-register-btn--waiting {
    border-color: #28a745;
    color: #28a745;
}

.groq-apikey-register-btn--waiting:hover {
    background: #28a745;
    color: #fff;
}

.groq-register-hint {
    margin-top: 0.85rem;
    padding: 0.75rem 1rem;
    background: #e8f4fd;
    border: 1px solid #bee5fb;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #0c5460;
    line-height: 1.5;
    text-align: left;
}

.groq-register-hint i.fa-circle-notch {
    margin-right: 0.35rem;
    color: #17a2b8;
}

/* ── Auto-register panel ────────────────────────────────────────── */

.groq-autoreg-panel {
    margin-top: 0.25rem;
}

.groq-autoreg-toggle {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--surface, #f4f4f8);
    border: 2px dashed var(--border-color, #c0bef0);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    color: #6c63ff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    transition: background 0.15s, border-color 0.15s;
}

.groq-autoreg-toggle:hover {
    background: #ede9ff;
    border-color: #6c63ff;
}

.groq-autoreg-chevron {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.groq-autoreg-form {
    margin-top: 0.75rem;
    padding: 1.1rem;
    background: var(--surface, #f8f7ff);
    border: 1px solid #d0caf8;
    border-radius: 8px;
}

.groq-autoreg-desc {
    font-size: 0.82rem;
    color: var(--text-secondary, #666);
    margin: 0 0 1rem;
    line-height: 1.5;
}

.groq-autoreg-options {
    margin-top: 0.25rem;
}

.groq-autoreg-checkbox-label {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary, #555);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.groq-autoreg-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 0.72rem;
    font-size: 0.95rem;
}

.groq-autoreg-status {
    margin-top: 0.75rem;
    padding: 0.6rem 0.85rem;
    border-radius: 6px;
    background: var(--surface, #f0f4ff);
    border: 1px solid var(--border-color, #d0d0e8);
    font-size: 0.83rem;
    line-height: 1.5;
    color: var(--text-primary, #333);
/* ── Iterative Dev ───────────────────────────────────────────────── */

.groq-iterdev-stream {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.groq-iterdev-entry {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-size: 0.82rem;
    border-left: 3px solid #6c63ff;
    background: var(--bg-primary, #fff);
}

.groq-iterdev-entry.groq-iterdev-info  { border-left-color: #17a2b8; }
.groq-iterdev-entry.groq-iterdev-warn  { border-left-color: #ffc107; }
.groq-iterdev-entry.groq-iterdev-error { border-left-color: #dc3545; }
.groq-iterdev-entry.groq-iterdev-debug { border-left-color: #6c757d; }

.groq-iterdev-ts {
    color: var(--text-secondary, #888);
    font-size: 0.72rem;
    min-width: 52px;
    flex-shrink: 0;
}

.groq-iterdev-agent {
    font-weight: 600;
    color: #6c63ff;
    min-width: 100px;
    flex-shrink: 0;
}

.groq-iterdev-msg {
    color: var(--text-primary, #333);
    word-break: break-word;
}

/* ── GitHub Copilot ──────────────────────────────────────────────── */

.groq-gh-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}

.groq-gh-pr-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.groq-gh-pr-selector label {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-primary, #333);
    white-space: nowrap;
}

.groq-gh-log-entry {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border, #e8e8e8);
    font-size: 0.82rem;
}

.groq-gh-log-entry:last-child {
    border-bottom: none;
}

.groq-gh-log-ts {
    color: var(--text-secondary, #888);
    font-size: 0.72rem;
    margin-right: 0.4rem;
}

.groq-gh-chat {
    scrollbar-width: thin;
    scrollbar-color: #444 transparent;
}

.groq-gh-chat::-webkit-scrollbar {
    width: 6px;
}

.groq-gh-chat::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

.groq-gh-composer input {
    font-family: monospace;
}

.btn-success {
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
    font-size: 0.78rem;
}

.btn-success:hover {
    background: #218838;
}

@media (max-width: 600px) {
    .groq-gh-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .groq-gh-pr-selector {
        flex-direction: column;
        align-items: stretch;
    }
    .groq-iterdev-agent {
        min-width: 70px;
    }
}
