.agent-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.agent-item {
    border: 1px dashed var(--color-border-soft);
    border-radius: var(--radius-sm);
    padding: var(--spacing-xs);
    background: var(--color-surface-alt);
}

.agent-header {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    align-items: center;
    margin-bottom: 6px;
}

.agent-name {
    font-weight: var(--font-weight-secondary);
    color: var(--color-text-secondary);
}

.agent-id {
    font-size: var(--font-size-caption);
    color: var(--color-text-tertiary);
}

.agent-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: var(--font-size-caption);
    color: var(--color-text-secondary);
}

.skill-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-xs);
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.skill-select-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-secondary);
    color: var(--color-text-secondary);
    user-select: none;
}

.skill-toolbar-count {
    font-size: var(--font-size-caption);
    color: var(--color-text-tertiary);
}

.skills-modal {
    width: min(96vw, 1100px);
}

.skills-modal-header {
    align-items: flex-start;
    margin-bottom: var(--spacing-xs);
}

.skills-modal-subtitle {
    margin-top: 6px;
    font-size: var(--font-size-caption);
    color: var(--color-text-tertiary);
    line-height: 1.45;
}

.skills-modal-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

/* =========================
   Skills manager two-column layout
   ========================= */

.skills-manager-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr);
    gap: var(--spacing-sm);
    align-items: start;
}

.skills-manager-col {
    min-width: 0;
}

.skills-actions-panel {
    margin-bottom: 0;
}

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

.skills-actions-grid .btn {
    margin-top: 0;
    min-height: 44px;
    padding: 12px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
}

.skills-actions-grid .skills-close-btn {
    grid-column: 1 / -1;
}

@media (max-width: 980px) {
    .skills-manager-grid {
        grid-template-columns: 1fr;
    }
    .skills-actions-grid {
        grid-template-columns: 1fr;
    }
}

.skills-root-box {
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-sm);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.86) 0%, rgba(255, 255, 255, 0.66) 100%);
    padding: 10px 12px;
    font-family: var(--font-family-mono);
    font-size: var(--font-size-caption);
    color: var(--color-text-secondary);
    word-break: break-all;
}

.skills-root-group {
    margin-bottom: var(--spacing-xs);
}

.skills-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

.skills-summary-item {
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-sm);
    background: linear-gradient(to bottom, rgba(255,255,255,0.96) 0%, rgba(255,248,241,0.7) 100%);
    padding: 10px 14px;
    min-width: 0;
    box-shadow: var(--shadow-subtle);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform var(--transition-fast) var(--ease-spring), box-shadow var(--transition-fast) var(--ease-spring);
}

.skills-summary-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(92,68,52,0.08);
}

.skills-summary-label {
    font-size: var(--font-size-caption);
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: var(--font-weight-caption);
}

.skills-summary-value {
    font-size: var(--font-size-large);
    color: var(--color-text-primary);
    font-weight: 600;
    line-height: 1.2;
}

.skills-panel {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm);
    background: linear-gradient(to bottom, rgba(255,255,255,0.92) 0%, rgba(255,248,241,0.7) 100%);
    box-shadow: var(--shadow-subtle);
    margin-bottom: var(--spacing-sm);
}

.skills-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-xs);
    margin-bottom: 10px;
}

.skills-panel-title-wrap {
    min-width: 0;
}

.skills-panel-title {
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-primary);
    color: var(--color-text-secondary);
}

.skills-panel-note {
    margin-top: 4px;
    font-size: var(--font-size-caption);
    color: var(--color-text-tertiary);
    line-height: 1.45;
}

.market-overview-section {
    margin-bottom: var(--spacing-sm);
}

.market-overview-header {
    gap: var(--spacing-sm);
    align-items: center;
}

.market-header-actions {
    flex-wrap: nowrap;
    align-items: center;
}

/* Compact header action buttons */
.selector-header.market-overview-header .market-header-actions .btn-tool-compact,
.selector-header.market-overview-header .market-header-actions .btn-tool.btn-tool-compact {
    min-height: 28px;
    padding: 4px 10px;
    font-size: var(--font-size-caption);
    line-height: 1.3;
    white-space: nowrap;
    border-radius: var(--radius-sm);
}

@media (max-width: 720px) {
    .market-overview-header {
        align-items: flex-start;
    }
    .market-header-actions {
        flex-wrap: wrap;
    }
}

.market-target-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: var(--spacing-sm);
}

.market-target-switch-compact {
    justify-content: flex-end;
    margin-bottom: 0;
}

.market-target-chip {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.9);
    color: var(--color-text-secondary);
    padding: 8px 18px;
    font-size: var(--font-size-caption);
    font-weight: var(--font-weight-caption);
    cursor: pointer;
    transition: all var(--transition-fast) var(--ease-spring);
}

.market-target-chip:disabled,
.market-target-chip[disabled] {
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none;
    box-shadow: none;
}

.market-target-chip.active {
    border-color: rgba(200,121,99,0.4);
    background: linear-gradient(to bottom, rgba(255,243,236,0.98) 0%, rgba(255,232,220,0.86) 100%);
    color: var(--color-brand-dark);
    box-shadow: 0 2px 8px rgba(200,121,99,0.12);
}

.market-target-chip:hover:not(.active):not(:disabled) {
    border-color: rgba(200,121,99,0.3);
    background: rgba(255,243,236,0.4);
}

.market-root-box {
    margin-bottom: var(--spacing-sm);
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-sm);
}

.market-panel {
    margin-bottom: 0;
    min-width: 0;
}

.market-actions-panel {
    grid-column: 1 / -1;
}

.market-panel-wide {
    grid-column: 1 / -1;
}

.market-preview-list {
    display: grid;
    gap: 10px;
}

.market-preview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-xs);
    padding: 10px 12px;
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.55);
    transition: all var(--transition-fast) var(--ease-spring);
}

.market-preview-item:hover {
    background: rgba(255,255,255,0.75);
    border-color: var(--color-border);
}

.market-preview-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.market-preview-title {
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-secondary);
    color: var(--color-text-secondary);
    overflow-wrap: anywhere;
}

.market-preview-meta {
    font-size: var(--font-size-caption);
    color: var(--color-text-tertiary);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.market-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--spacing-xs);
}

.market-action-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: linear-gradient(to bottom, rgba(255,255,255,0.96) 0%, rgba(255,248,241,0.8) 100%);
    color: var(--color-text-primary);
    text-align: left;
    padding: var(--spacing-sm) 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    transition: all var(--transition-fast) var(--ease-spring);
}

.market-action-card:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: rgba(200,121,99,0.4);
    box-shadow: var(--shadow-card);
}

.market-action-card:active:not(:disabled) {
    transform: translateY(0);
}

.market-action-card:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.market-action-title {
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-primary);
}

.market-action-copy {
    font-size: var(--font-size-caption);
    color: var(--color-text-tertiary);
    line-height: 1.5;
}

.skills-filter-row {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.skills-filter-row .form-input {
    flex: 1;
    min-width: 220px;
}

.skills-status-select {
    width: 210px;
    flex: 0 0 auto;
}
