/* ==========================================================================
   VIUCraft API Playground Styles
   Uses design tokens from variables.css
   ========================================================================== */

/* ---------- Full-width override for docs layout ---------- */
.playground-full-width {
    max-width: 100% !important;
    width: 100%;
}

.playground-full-width ~ .docs-toc {
    display: none;
}

/* When playground is active, expand the docs container */
.docs-container:has(.playground-full-width) {
    max-width: 100%;
    padding-left: var(--space-16);
    padding-right: var(--space-16);
    padding-bottom: 0;
}

/* ---------- Playground container ---------- */
.playground {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 500px;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    background: #fff;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    position: relative;
}

/* ---------- Console header bar ---------- */
.playground-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-8) var(--space-16);
    background: var(--neutral-50);
    border-bottom: 1px solid var(--neutral-200);
    flex-shrink: 0;
}

.playground-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-12);
}

.playground-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--neutral-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.playground-title i {
    color: var(--primary-purple);
    font-size: var(--font-size-sm);
}

.playground-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-purple);
    background: rgba(113, 97, 239, 0.1);
    border-radius: 999px;
    line-height: 1.6;
}

.playground-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.playground-header-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--neutral-600);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.playground-header-btn:hover:not(:disabled) {
    color: var(--neutral-900);
    background: var(--neutral-100);
    border-color: var(--neutral-200);
}

.playground-header-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.playground-header-btn-reset {
    color: var(--danger);
}

.playground-header-btn-reset:hover:not(:disabled) {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}

/* ---------- Two-panel layout ---------- */
.playground-panels {
    display: grid;
    grid-template-columns: 1fr 6px 1fr;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.playground-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

/* ---------- Request panel (left) ---------- */
.playground-panel-request {
    border-right: none;
}

.playground-panel-scroll {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-16);
}

/* ---------- Sections within request panel ---------- */
.playground-section {
    margin-bottom: var(--space-16);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.playground-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-8) var(--space-12);
    background: var(--neutral-50);
    border-bottom: 1px solid var(--neutral-200);
}

.playground-section-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--neutral-700);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.playground-section-title i {
    color: var(--neutral-400);
    font-size: 0.8em;
    width: 16px;
    text-align: center;
}

.playground-section-badge {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--neutral-100);
    color: var(--neutral-500);
}

.playground-auth-status.configured {
    background: rgba(54, 179, 126, 0.1);
    color: var(--success);
}

.playground-section-body {
    padding: var(--space-12);
}

/* ---------- Form fields ---------- */
.playground-field {
    margin-bottom: var(--space-12);
}

.playground-field:last-child {
    margin-bottom: 0;
}

.playground-label {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--neutral-600);
    margin-bottom: var(--space-4);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.playground-input-group {
    display: flex;
    align-items: stretch;
}

.playground-input {
    flex: 1;
    padding: var(--space-8) var(--space-12);
    font-size: var(--font-size-sm);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    color: var(--neutral-900);
    background: #fff;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.playground-input:focus {
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(113, 97, 239, 0.1);
}

.playground-input::placeholder {
    color: var(--neutral-400);
    font-family: var(--font-family);
}

.playground-input-group .playground-input {
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.playground-input-addon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--neutral-500);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.playground-input-addon:hover {
    color: var(--neutral-700);
    background: var(--neutral-100);
}

.playground-input-suffix {
    display: flex;
    align-items: center;
    padding: 0 var(--space-12);
    font-size: var(--font-size-sm);
    color: var(--neutral-500);
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    white-space: nowrap;
}

.playground-select {
    width: 100%;
    padding: var(--space-8) var(--space-12);
    font-size: var(--font-size-sm);
    color: var(--neutral-900);
    background: #fff;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-sm);
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239e9e9e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.playground-select:focus {
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(113, 97, 239, 0.1);
}

/* ---------- API key chip selector ---------- */
.playground-key-select {
    margin-top: var(--space-8);
}

.playground-key-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.playground-key-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-4);
    padding: 3px 10px;
    font-size: var(--font-size-xs);
    color: var(--neutral-700);
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-radius: 999px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.playground-key-chip:hover {
    background: rgba(113, 97, 239, 0.06);
    border-color: var(--primary-purple);
    color: var(--primary-purple);
}

.playground-key-chip-env {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 1px 5px;
    border-radius: 3px;
}

.playground-key-chip-env-live {
    background: rgba(54, 179, 126, 0.15);
    color: var(--success);
}

.playground-key-chip-env-test {
    background: rgba(255, 171, 0, 0.15);
    color: var(--warning);
}

/* ---------- Parameters placeholder ---------- */
.playground-params-placeholder {
    min-height: 60px;
}

.playground-placeholder-text {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    font-size: var(--font-size-sm);
    color: var(--neutral-400);
    font-style: italic;
    margin: 0;
}

.playground-placeholder-text i {
    font-size: var(--font-size-sm);
}

/* ---------- Execute button ---------- */
.playground-execute {
    display: flex;
    align-items: center;
    gap: var(--space-12);
    padding: var(--space-12) var(--space-16);
}

.playground-execute-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
    padding: var(--space-12) var(--space-24);
    font-size: var(--font-size-base);
    font-weight: 600;
    color: #fff;
    background: var(--primary-purple);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.playground-execute-btn:hover {
    background: #5f4fd6;
    box-shadow: 0 4px 12px rgba(113, 97, 239, 0.3);
    transform: translateY(-1px);
}

.playground-execute-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.playground-execute-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.playground-execute-btn.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

.playground-execute-btn.is-loading i::before {
    content: "\f110"; /* fa-spinner */
}

.playground-execute-btn.is-loading i {
    animation: pg-spin 1s linear infinite;
}

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

.playground-execute-hint {
    font-size: var(--font-size-xs);
    color: var(--neutral-400);
    white-space: nowrap;
    flex-shrink: 0;
}

.playground-execute-hint kbd {
    display: inline-block;
    padding: 1px 5px;
    font-size: 0.7rem;
    font-family: var(--font-family);
    background: var(--neutral-100);
    border: 1px solid var(--neutral-200);
    border-radius: 3px;
    color: var(--neutral-600);
}

/* ---------- URL preview bar ---------- */
.playground-url-preview {
    display: flex;
    align-items: center;
    padding: var(--space-8) var(--space-12);
    background: var(--neutral-50);
    border-top: 1px solid var(--neutral-200);
    flex-shrink: 0;
    gap: var(--space-8);
    overflow: hidden;
}

.playground-url-method {
    flex-shrink: 0;
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--success);
    padding: 2px 6px;
    background: rgba(54, 179, 126, 0.1);
    border-radius: 3px;
}

.playground-url-text {
    flex: 1;
    font-size: var(--font-size-xs);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    color: var(--neutral-600);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playground-url-copy {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-sm);
    color: var(--neutral-500);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.playground-url-copy:hover {
    color: var(--primary-purple);
    border-color: var(--primary-purple);
    background: rgba(113, 97, 239, 0.05);
}

/* ---------- Resize handle ---------- */
.playground-resize-handle {
    width: 6px;
    background: var(--neutral-100);
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.playground-resize-handle:hover,
.playground-resize-handle.is-dragging {
    background: var(--primary-purple);
}

.playground-resize-handle-grip {
    width: 2px;
    height: 24px;
    border-radius: 1px;
    background: var(--neutral-300);
    transition: background var(--transition-fast);
}

.playground-resize-handle:hover .playground-resize-handle-grip,
.playground-resize-handle.is-dragging .playground-resize-handle-grip {
    background: rgba(255, 255, 255, 0.6);
}

/* ---------- Response panel (right) ---------- */
.playground-panel-response {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ---------- Response tabs ---------- */
.playground-response-tabs {
    display: flex;
    padding: 0 var(--space-12);
    background: var(--neutral-50);
    border-bottom: 1px solid var(--neutral-200);
    flex-shrink: 0;
    gap: var(--space-2);
}

.playground-response-tab {
    display: inline-flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-8) var(--space-12);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--neutral-500);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: -1px;
}

.playground-response-tab:hover {
    color: var(--neutral-700);
}

.playground-response-tab.active {
    color: var(--primary-purple);
    border-bottom-color: var(--primary-purple);
}

.playground-response-tab i {
    font-size: 0.8em;
}

/* ---------- Response content ---------- */
.playground-response-content {
    flex: 1;
    overflow: auto;
    position: relative;
}

.playground-tab-pane {
    display: none;
    padding: var(--space-16);
    height: 100%;
}

.playground-tab-pane.active {
    display: block;
}

/* ---------- Empty state ---------- */
.playground-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-48) var(--space-24);
    color: var(--neutral-400);
}

.playground-empty-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--neutral-100);
    border-radius: 50%;
    margin-bottom: var(--space-16);
}

.playground-empty-icon i {
    font-size: 1.5rem;
    color: var(--neutral-400);
}

.playground-empty-state h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--neutral-600);
    margin: 0 0 var(--space-8);
}

.playground-empty-state p {
    font-size: var(--font-size-sm);
    color: var(--neutral-400);
    margin: 0;
    max-width: 320px;
    line-height: 1.5;
}

.playground-empty-state kbd {
    display: inline-block;
    padding: 1px 5px;
    font-size: 0.75rem;
    font-family: var(--font-family);
    background: var(--neutral-100);
    border: 1px solid var(--neutral-200);
    border-radius: 3px;
    color: var(--neutral-600);
}

/* ---------- Response body ---------- */
.playground-response-body {
    margin: 0;
    padding: var(--space-16);
    font-size: var(--font-size-sm);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    color: var(--neutral-800);
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-sm);
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.6;
}

/* ---------- Headers table ---------- */
.playground-headers-table {
    width: 100%;
}

.playground-headers-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.playground-headers-table th {
    text-align: left;
    padding: var(--space-8) var(--space-12);
    font-weight: 600;
    color: var(--neutral-600);
    background: var(--neutral-50);
    border-bottom: 2px solid var(--neutral-200);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.playground-headers-table td {
    padding: var(--space-8) var(--space-12);
    border-bottom: 1px solid var(--neutral-100);
    color: var(--neutral-700);
}

.playground-headers-table td:first-child {
    font-weight: 500;
    color: var(--neutral-900);
    white-space: nowrap;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: var(--font-size-xs);
}

.playground-headers-table td:last-child {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: var(--font-size-xs);
    word-break: break-all;
}

/* ---------- Image preview ---------- */
.playground-image-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: var(--space-24);
    background-image:
        linear-gradient(45deg, #e0e0e0 25%, transparent 25%),
        linear-gradient(-45deg, #e0e0e0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e0e0e0 75%),
        linear-gradient(-45deg, transparent 75%, #e0e0e0 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--neutral-200);
}

.playground-image-preview img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 2px;
    box-shadow: var(--shadow-md);
}

/* ---------- Status bar ---------- */
.playground-status-bar {
    display: flex;
    align-items: center;
    gap: var(--space-24);
    padding: var(--space-8) var(--space-16);
    background: var(--neutral-50);
    border-top: 1px solid var(--neutral-200);
    flex-shrink: 0;
}

.playground-status-item {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.playground-status-label {
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--neutral-400);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.playground-status-value {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--neutral-600);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.playground-status-code.status-2xx {
    color: var(--success);
}

.playground-status-code.status-3xx {
    color: var(--info);
}

.playground-status-code.status-4xx {
    color: var(--warning);
}

.playground-status-code.status-5xx {
    color: var(--danger);
}

/* ---------- Loading overlay ---------- */
.playground-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(2px);
}

.playground-loading-bar {
    width: 200px;
    height: 3px;
    background: var(--neutral-200);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: var(--space-12);
}

.playground-loading-bar::after {
    content: '';
    display: block;
    width: 40%;
    height: 100%;
    background: var(--primary-purple);
    border-radius: 2px;
    animation: pg-loading-bar 1.2s ease-in-out infinite;
}

@keyframes pg-loading-bar {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(250%); }
    100% { transform: translateX(-100%); }
}

.playground-loading-text {
    font-size: var(--font-size-sm);
    color: var(--neutral-500);
    font-weight: 500;
}

/* ---------- API key validation states ---------- */
.playground-input.is-valid {
    border-color: var(--success);
}

.playground-input.is-valid:focus {
    box-shadow: 0 0 0 3px rgba(54, 179, 126, 0.1);
}

.playground-input.is-invalid {
    border-color: var(--danger);
}

.playground-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(255, 86, 48, 0.1);
}

/* ==========================================================================
   Dark Mode
   ========================================================================== */

[data-theme="dark"] .playground {
    background: #1a1a2e;
    border-color: #2a2a3e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .playground-header {
    background: #13132b;
    border-bottom-color: #2a2a3e;
}

[data-theme="dark"] .playground-title {
    color: #e4e4e7;
}

[data-theme="dark"] .playground-badge {
    background: rgba(113, 97, 239, 0.2);
    color: #a78bfa;
}

[data-theme="dark"] .playground-header-btn {
    color: #71717a;
}

[data-theme="dark"] .playground-header-btn:hover:not(:disabled) {
    color: #e4e4e7;
    background: #2a2a3e;
    border-color: #3a3a4e;
}

[data-theme="dark"] .playground-header-btn-reset:hover:not(:disabled) {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}

[data-theme="dark"] .playground-section {
    border-color: #2a2a3e;
}

[data-theme="dark"] .playground-section-header {
    background: #13132b;
    border-bottom-color: #2a2a3e;
}

[data-theme="dark"] .playground-section-title {
    color: #a1a1aa;
}

[data-theme="dark"] .playground-section-title i {
    color: #52567a;
}

[data-theme="dark"] .playground-section-badge {
    background: #2a2a3e;
    color: #71717a;
}

[data-theme="dark"] .playground-label {
    color: #71717a;
}

[data-theme="dark"] .playground-input {
    background: #0f0f23;
    border-color: #2a2a3e;
    color: #e4e4e7;
}

[data-theme="dark"] .playground-input::placeholder {
    color: #52567a;
}

[data-theme="dark"] .playground-input:focus {
    border-color: #7161ef;
    box-shadow: 0 0 0 3px rgba(113, 97, 239, 0.15);
}

[data-theme="dark"] .playground-input-addon {
    background: #1a1a2e;
    border-color: #2a2a3e;
    color: #52567a;
}

[data-theme="dark"] .playground-input-addon:hover {
    color: #a1a1aa;
    background: #2a2a3e;
}

[data-theme="dark"] .playground-input-suffix {
    background: #1a1a2e;
    border-color: #2a2a3e;
    color: #52567a;
}

[data-theme="dark"] .playground-select {
    background: #0f0f23;
    border-color: #2a2a3e;
    color: #e4e4e7;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2371717a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

[data-theme="dark"] .playground-select:focus {
    border-color: #7161ef;
    box-shadow: 0 0 0 3px rgba(113, 97, 239, 0.15);
}

[data-theme="dark"] .playground-key-chip {
    background: #1a1a2e;
    border-color: #2a2a3e;
    color: #a1a1aa;
}

[data-theme="dark"] .playground-key-chip:hover {
    background: rgba(113, 97, 239, 0.1);
    border-color: #7161ef;
    color: #a78bfa;
}

[data-theme="dark"] .playground-placeholder-text {
    color: #52567a;
}

[data-theme="dark"] .playground-execute-btn {
    background: #7161ef;
}

[data-theme="dark"] .playground-execute-btn:hover {
    background: #5f4fd6;
}

[data-theme="dark"] .playground-execute-hint {
    color: #52567a;
}

[data-theme="dark"] .playground-execute-hint kbd {
    background: #1a1a2e;
    border-color: #2a2a3e;
    color: #71717a;
}

[data-theme="dark"] .playground-url-preview {
    background: #13132b;
    border-top-color: #2a2a3e;
}

[data-theme="dark"] .playground-url-method {
    background: rgba(54, 179, 126, 0.15);
}

[data-theme="dark"] .playground-url-text {
    color: #a1a1aa;
}

[data-theme="dark"] .playground-url-copy {
    border-color: #2a2a3e;
    color: #52567a;
}

[data-theme="dark"] .playground-url-copy:hover {
    color: #a78bfa;
    border-color: #7161ef;
    background: rgba(113, 97, 239, 0.1);
}

[data-theme="dark"] .playground-resize-handle {
    background: #2a2a3e;
}

[data-theme="dark"] .playground-resize-handle-grip {
    background: #3a3a4e;
}

[data-theme="dark"] .playground-response-tabs {
    background: #13132b;
    border-bottom-color: #2a2a3e;
}

[data-theme="dark"] .playground-response-tab {
    color: #52567a;
}

[data-theme="dark"] .playground-response-tab:hover {
    color: #a1a1aa;
}

[data-theme="dark"] .playground-response-tab.active {
    color: #a78bfa;
    border-bottom-color: #a78bfa;
}

[data-theme="dark"] .playground-empty-state {
    color: #52567a;
}

[data-theme="dark"] .playground-empty-icon {
    background: #2a2a3e;
}

[data-theme="dark"] .playground-empty-icon i {
    color: #52567a;
}

[data-theme="dark"] .playground-empty-state h4 {
    color: #a1a1aa;
}

[data-theme="dark"] .playground-empty-state p {
    color: #52567a;
}

[data-theme="dark"] .playground-empty-state kbd {
    background: #1a1a2e;
    border-color: #2a2a3e;
    color: #71717a;
}

[data-theme="dark"] .playground-response-body {
    background: #0f0f23;
    border-color: #2a2a3e;
    color: #e4e4e7;
}

[data-theme="dark"] .playground-headers-table th {
    background: #13132b;
    border-bottom-color: #2a2a3e;
    color: #71717a;
}

[data-theme="dark"] .playground-headers-table td {
    border-bottom-color: #1a1a2e;
    color: #a1a1aa;
}

[data-theme="dark"] .playground-headers-table td:first-child {
    color: #e4e4e7;
}

[data-theme="dark"] .playground-image-preview {
    background-image:
        linear-gradient(45deg, #2a2a3e 25%, transparent 25%),
        linear-gradient(-45deg, #2a2a3e 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #2a2a3e 75%),
        linear-gradient(-45deg, transparent 75%, #2a2a3e 75%);
    border-color: #2a2a3e;
}

[data-theme="dark"] .playground-status-bar {
    background: #13132b;
    border-top-color: #2a2a3e;
}

[data-theme="dark"] .playground-status-label {
    color: #52567a;
}

[data-theme="dark"] .playground-status-value {
    color: #a1a1aa;
}

[data-theme="dark"] .playground-loading {
    background: rgba(26, 26, 46, 0.9);
}

[data-theme="dark"] .playground-loading-bar {
    background: #2a2a3e;
}

[data-theme="dark"] .playground-loading-text {
    color: #71717a;
}

[data-theme="dark"] .playground-input.is-valid {
    border-color: var(--success);
}

[data-theme="dark"] .playground-input.is-invalid {
    border-color: var(--danger);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 767px) {
    .playground {
        height: auto;
        min-height: auto;
    }

    .playground-panels {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .playground-resize-handle {
        width: 100%;
        height: 6px;
        cursor: row-resize;
    }

    .playground-resize-handle-grip {
        width: 24px;
        height: 2px;
    }

    .playground-panel-request {
        border-right: none;
        border-bottom: none;
    }

    .playground-panel-response {
        min-height: 300px;
    }

    .playground-header {
        flex-wrap: wrap;
        gap: var(--space-8);
    }

    .playground-header-btn-label {
        display: none;
    }

    .playground-execute {
        flex-direction: column;
    }

    .playground-execute-btn {
        width: 100%;
    }

    .playground-status-bar {
        flex-wrap: wrap;
        gap: var(--space-12);
    }
}

/* ==========================================================================
   Dynamic Parameter Form (E22-S02)
   ========================================================================== */

/* ---------- Parameter form layout ---------- */
.playground-param-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
}

.playground-param {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.playground-param-label {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--neutral-600);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.playground-param-required {
    color: var(--danger);
    font-weight: 700;
}

.playground-param-optional {
    color: var(--neutral-400);
    font-size: 0.65rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

.playground-param-description {
    font-size: var(--font-size-xs);
    color: var(--neutral-400);
    line-height: 1.4;
    margin-bottom: 2px;
}

/* ---------- Parameter inputs ---------- */
.playground-param-input {
    width: 100%;
    padding: var(--space-8) var(--space-12);
    font-size: var(--font-size-sm);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    color: var(--neutral-900);
    background: #fff;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    box-sizing: border-box;
}

.playground-param-input:focus {
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(113, 97, 239, 0.1);
}

.playground-param-input::placeholder {
    color: var(--neutral-400);
    font-family: var(--font-family);
}

.playground-param-input.is-invalid {
    border-color: var(--danger);
}

.playground-param-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(255, 86, 48, 0.1);
}

/* ---------- Number inputs ---------- */
.playground-param-number {
    -moz-appearance: textfield;
}

.playground-param-number::-webkit-outer-spin-button,
.playground-param-number::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ---------- Select inputs ---------- */
.playground-param-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239e9e9e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

/* ---------- Color input group ---------- */
.playground-param-color-group {
    display: flex;
    gap: var(--space-8);
    align-items: stretch;
}

.playground-param-color-swatch {
    width: 42px;
    height: 38px;
    padding: 2px;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: #fff;
    flex-shrink: 0;
}

.playground-param-color-swatch::-webkit-color-swatch-wrapper {
    padding: 0;
}

.playground-param-color-swatch::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

.playground-param-color-swatch::-moz-color-swatch {
    border: none;
    border-radius: 2px;
}

.playground-param-color-text {
    flex: 1;
}

/* ---------- Toggle switch ---------- */
.playground-param-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-8);
    cursor: pointer;
    user-select: none;
}

.playground-param-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.playground-param-toggle-slider {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    background: var(--neutral-200);
    border-radius: 999px;
    transition: background var(--transition-fast);
    flex-shrink: 0;
}

.playground-param-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.playground-param-toggle-input:checked + .playground-param-toggle-slider {
    background: var(--primary-purple);
}

.playground-param-toggle-input:checked + .playground-param-toggle-slider::after {
    transform: translateX(16px);
}

.playground-param-toggle-input:focus + .playground-param-toggle-slider {
    box-shadow: 0 0 0 3px rgba(113, 97, 239, 0.1);
}

.playground-param-toggle-label {
    font-size: var(--font-size-sm);
    color: var(--neutral-600);
    font-weight: 500;
}

/* ---------- File upload zone ---------- */
.playground-param-file-zone {
    border: 2px dashed var(--neutral-200);
    border-radius: var(--radius-sm);
    padding: var(--space-16) var(--space-24);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.playground-param-file-zone:hover {
    border-color: var(--primary-purple);
    background: rgba(113, 97, 239, 0.02);
}

.playground-param-file-zone.dragover {
    border-color: var(--primary-purple);
    background: rgba(113, 97, 239, 0.06);
}

.playground-param-file-zone.has-file {
    border-style: solid;
    border-color: var(--success);
    background: rgba(54, 179, 126, 0.04);
}

.playground-param-file-zone.is-invalid {
    border-color: var(--danger);
}

.playground-param-file-label {
    font-size: var(--font-size-sm);
    color: var(--neutral-500);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
}

.playground-param-file-label i {
    font-size: 1.1em;
    color: var(--neutral-400);
}

.playground-param-file-zone.has-file .playground-param-file-label {
    color: var(--neutral-700);
    font-weight: 500;
}

.playground-param-file-zone.has-file .playground-param-file-label i {
    color: var(--success);
}

.playground-param-file-info {
    font-size: var(--font-size-xs);
    color: var(--neutral-400);
    margin-top: var(--space-4);
}

/* ---------- Validation error ---------- */
.playground-param-error {
    font-size: var(--font-size-xs);
    color: var(--danger);
    line-height: 1.4;
}

/* ---------- Reset to defaults ---------- */
.playground-param-reset {
    display: inline-flex;
    align-items: center;
    gap: var(--space-4);
    font-size: var(--font-size-xs);
    color: var(--neutral-400);
    text-decoration: none;
    cursor: pointer;
    transition: color var(--transition-fast);
    padding-top: var(--space-4);
    align-self: flex-start;
}

.playground-param-reset:hover {
    color: var(--primary-purple);
}

.playground-param-reset i {
    font-size: 0.7em;
}

/* ---------- Endpoint description ---------- */
.playground-endpoint-description {
    font-size: var(--font-size-xs);
    color: var(--neutral-500);
    line-height: 1.5;
    margin-top: var(--space-8);
    padding: var(--space-8) var(--space-12);
    background: var(--neutral-50);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-purple);
}

/* ---------- Method badge in select options ---------- */
.playground-method-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-right: var(--space-4);
}

.playground-method-badge-get {
    color: var(--success);
    background: rgba(54, 179, 126, 0.1);
}

.playground-method-badge-post {
    color: var(--info);
    background: rgba(66, 104, 230, 0.1);
}

.playground-method-badge-delete {
    color: var(--danger);
    background: rgba(255, 86, 48, 0.1);
}

/* ==========================================================================
   Dynamic Parameter Form Dark Mode (E22-S02)
   ========================================================================== */

[data-theme="dark"] .playground-param-label {
    color: #71717a;
}

[data-theme="dark"] .playground-param-optional {
    color: #52567a;
}

[data-theme="dark"] .playground-param-description {
    color: #52567a;
}

[data-theme="dark"] .playground-param-input {
    background: #0f0f23;
    border-color: #2a2a3e;
    color: #e4e4e7;
}

[data-theme="dark"] .playground-param-input::placeholder {
    color: #52567a;
}

[data-theme="dark"] .playground-param-input:focus {
    border-color: #7161ef;
    box-shadow: 0 0 0 3px rgba(113, 97, 239, 0.15);
}

[data-theme="dark"] .playground-param-input.is-invalid {
    border-color: var(--danger);
}

[data-theme="dark"] .playground-param-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(255, 86, 48, 0.15);
}

[data-theme="dark"] .playground-param-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2371717a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

[data-theme="dark"] .playground-param-color-swatch {
    border-color: #2a2a3e;
    background: #0f0f23;
}

[data-theme="dark"] .playground-param-toggle-slider {
    background: #2a2a3e;
}

[data-theme="dark"] .playground-param-toggle-slider::after {
    background: #71717a;
}

[data-theme="dark"] .playground-param-toggle-input:checked + .playground-param-toggle-slider {
    background: #7161ef;
}

[data-theme="dark"] .playground-param-toggle-input:checked + .playground-param-toggle-slider::after {
    background: #fff;
}

[data-theme="dark"] .playground-param-toggle-label {
    color: #a1a1aa;
}

[data-theme="dark"] .playground-param-file-zone {
    border-color: #2a2a3e;
}

[data-theme="dark"] .playground-param-file-zone:hover {
    border-color: #7161ef;
    background: rgba(113, 97, 239, 0.04);
}

[data-theme="dark"] .playground-param-file-zone.dragover {
    border-color: #7161ef;
    background: rgba(113, 97, 239, 0.1);
}

[data-theme="dark"] .playground-param-file-zone.has-file {
    border-color: var(--success);
    background: rgba(54, 179, 126, 0.06);
}

[data-theme="dark"] .playground-param-file-label {
    color: #71717a;
}

[data-theme="dark"] .playground-param-file-label i {
    color: #52567a;
}

[data-theme="dark"] .playground-param-file-zone.has-file .playground-param-file-label {
    color: #e4e4e7;
}

[data-theme="dark"] .playground-param-file-info {
    color: #52567a;
}

[data-theme="dark"] .playground-param-error {
    color: #ff6b6b;
}

[data-theme="dark"] .playground-param-reset {
    color: #52567a;
}

[data-theme="dark"] .playground-param-reset:hover {
    color: #a78bfa;
}

[data-theme="dark"] .playground-endpoint-description {
    color: #71717a;
    background: #13132b;
    border-left-color: #7161ef;
}

/* ---------- Dynamic param responsive ---------- */
@media (max-width: 767px) {
    .playground-param-color-group {
        flex-direction: column;
    }

    .playground-param-color-swatch {
        width: 100%;
        height: 32px;
    }

    .playground-param-file-zone {
        padding: var(--space-12) var(--space-16);
    }
}

/* ---------- Dynamic param reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .playground-param-input,
    .playground-param-toggle-slider,
    .playground-param-toggle-slider::after,
    .playground-param-file-zone,
    .playground-param-reset,
    .playground-param-color-swatch {
        transition: none !important;
    }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
    .playground {
        display: none !important;
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .playground-execute-btn,
    .playground-header-btn,
    .playground-response-tab,
    .playground-input,
    .playground-select,
    .playground-resize-handle,
    .playground-url-copy,
    .playground-key-chip {
        transition: none !important;
    }

    .playground-loading-bar::after {
        animation: none;
        width: 100%;
        opacity: 0.5;
    }

    .playground-execute-btn.is-loading i {
        animation: none;
    }
}

/* ==========================================================================
   Auth State Styles (E22-S06)
   ========================================================================== */

/* ---------- Auth status badge enhancements ---------- */
.playground-auth-status {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    transition: all var(--transition-fast);
}

.playground-auth-icon {
    margin-right: 4px;
    font-size: 0.6rem;
}

.playground-auth-status.auth-unauthenticated {
    background: var(--neutral-100);
    color: var(--neutral-500);
}

.playground-auth-status.auth-authenticated {
    background: rgba(54, 179, 126, 0.1);
    color: var(--success);
}

.playground-auth-status.auth-invalid {
    background: rgba(255, 86, 48, 0.1);
    color: var(--danger);
}

/* ---------- Key chip selected state ---------- */
.playground-key-chip.selected {
    border-color: var(--primary-purple);
    background: rgba(113, 97, 239, 0.1);
    color: var(--primary-purple);
}

/* ---------- Key override link ---------- */
.playground-key-override {
    margin-top: 8px;
}

.playground-key-override-link {
    font-size: 0.75rem;
    color: var(--primary-purple);
    text-decoration: none;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.playground-key-override-link:hover {
    color: #5f4fd6;
    text-decoration: underline;
}

/* ---------- Auth messages ---------- */
.playground-auth-message {
    font-size: 0.75rem;
    margin-top: 6px;
    line-height: 1.4;
    padding: 4px 0;
}

.playground-auth-message.error {
    color: var(--danger);
}

.playground-auth-message.info {
    color: var(--neutral-500);
}

/* ==========================================================================
   Auth State Dark Mode (E22-S06)
   ========================================================================== */

[data-theme="dark"] .playground-auth-status.auth-unauthenticated {
    background: #2a2a3e;
    color: #71717a;
}

[data-theme="dark"] .playground-auth-status.auth-authenticated {
    background: rgba(54, 179, 126, 0.15);
    color: #4ade80;
}

[data-theme="dark"] .playground-auth-status.auth-invalid {
    background: rgba(255, 86, 48, 0.15);
    color: #ff6b6b;
}

[data-theme="dark"] .playground-key-chip.selected {
    border-color: #7161ef;
    background: rgba(113, 97, 239, 0.15);
    color: #a78bfa;
}

[data-theme="dark"] .playground-key-override-link {
    color: #a78bfa;
}

[data-theme="dark"] .playground-key-override-link:hover {
    color: #c4b5fd;
}

[data-theme="dark"] .playground-auth-message.error {
    color: #ff6b6b;
}

[data-theme="dark"] .playground-auth-message.info {
    color: #71717a;
}

/* ---------- Auth reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .playground-auth-status,
    .playground-key-override-link {
        transition: none !important;
    }
}

/* ==========================================================================
   Request Execution & Response Display (E22-S03)
   ========================================================================== */

/* ---------- JSON Syntax Highlighting ---------- */
.json-key { color: #dc2626; }
.json-string { color: #22c55e; }
.json-number { color: #3b82f6; }
.json-boolean { color: #a855f7; }
.json-null { color: #9ca3af; font-style: italic; }
.json-bracket { color: var(--neutral-500); }

/* ---------- Response body with content ---------- */
.playground-response-body.has-content {
    position: relative;
    padding: 0;
    overflow: auto;
}

/* ---------- JSON wrapper ---------- */
.playground-json-wrapper {
    position: relative;
}

.playground-json-code {
    display: block;
    counter-reset: line;
    padding: 16px 16px 16px 3.5em;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    white-space: pre;
}

/* ---------- Line numbers ---------- */
.playground-response-line {
    display: block;
}

.playground-response-line::before {
    counter-increment: line;
    content: attr(data-line);
    display: inline-block;
    width: 2.5em;
    margin-left: -3.5em;
    padding-right: 0.5em;
    text-align: right;
    color: var(--neutral-300);
    border-right: 1px solid var(--neutral-200);
    margin-right: 0.5em;
    font-size: 0.8em;
    user-select: none;
    -webkit-user-select: none;
}

/* ---------- Copy response button ---------- */
.playground-copy-response {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--neutral-500);
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    z-index: 2;
    transition: all 0.15s ease;
    font-family: inherit;
}

.playground-copy-response:hover {
    color: var(--neutral-700);
    background: var(--neutral-100);
    border-color: var(--neutral-300);
}

.playground-copy-response.copy-success {
    color: var(--success);
    border-color: var(--success);
    background: rgba(54, 179, 126, 0.05);
}

.playground-copy-response.copy-failed {
    color: var(--danger);
    border-color: var(--danger);
}

/* ---------- Error box ---------- */
.playground-error-box {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin: 16px;
}

.playground-error-code {
    font-weight: 700;
    color: var(--danger);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.875rem;
}

.playground-error-message {
    color: var(--neutral-700);
    margin-top: 4px;
    font-size: 0.875rem;
    line-height: 1.5;
}

.playground-error-details {
    margin-top: 8px;
}

.playground-error-details-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--neutral-500);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.playground-error-details-toggle:hover {
    color: var(--neutral-700);
}

.playground-error-details-toggle i {
    font-size: 0.6rem;
    transition: transform 0.15s ease;
}

.playground-error-details-content {
    margin-top: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--radius-sm);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.8rem;
    color: var(--neutral-600);
    white-space: pre-wrap;
    word-break: break-word;
}

/* ---------- Timing colors ---------- */
.playground-timing-fast {
    color: var(--success) !important;
}

.playground-timing-medium {
    color: var(--warning) !important;
}

.playground-timing-slow {
    color: var(--danger) !important;
}

/* ---------- Status code colors ---------- */
.playground-status-code.status-2xx {
    color: var(--success);
    font-weight: 600;
}

.playground-status-code.status-3xx {
    color: var(--info);
    font-weight: 600;
}

.playground-status-code.status-4xx {
    color: var(--warning);
    font-weight: 600;
}

.playground-status-code.status-5xx {
    color: var(--danger);
    font-weight: 600;
}

/* ---------- Network error display ---------- */
.playground-network-error {
    text-align: center;
    padding: 32px;
}

.playground-network-error-icon {
    font-size: 2rem;
    color: var(--danger);
    margin-bottom: 12px;
}

.playground-network-error-title {
    font-weight: 600;
    color: var(--neutral-700);
    margin-bottom: 4px;
    font-size: 1rem;
}

.playground-network-error-message {
    color: var(--neutral-500);
    font-size: 0.875rem;
    line-height: 1.5;
    max-width: 400px;
    margin: 0 auto;
}

/* ---------- Image response body notice ---------- */
.playground-image-body-notice {
    text-align: center;
    padding: 32px;
    color: var(--neutral-500);
    font-size: 0.875rem;
}

.playground-image-body-notice i {
    margin-right: 6px;
    color: var(--primary-purple);
}

/* ---------- Empty body notice ---------- */
.playground-empty-body-notice {
    text-align: center;
    padding: 32px;
    color: var(--neutral-400);
    font-size: 0.875rem;
    font-style: italic;
}

/* ---------- Headers table ---------- */
.playground-headers-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.playground-headers-tbl th {
    text-align: left;
    padding: 8px 12px;
    font-weight: 600;
    color: var(--neutral-600);
    background: var(--neutral-50);
    border-bottom: 2px solid var(--neutral-200);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.playground-headers-tbl td {
    padding: 6px 12px;
    border-bottom: 1px solid var(--neutral-100);
    color: var(--neutral-700);
}

.playground-headers-tbl .playground-header-value {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.8rem;
    word-break: break-all;
}

.playground-header-important td:first-child {
    color: var(--primary-purple);
    font-weight: 600;
}

.playground-headers-tbl tbody tr:hover {
    background: var(--neutral-50);
}

/* ---------- Image preview ---------- */
.playground-preview-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
}

.playground-preview-img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
                      linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
                      linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
    box-shadow: var(--shadow-sm);
}

.playground-preview-info {
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--neutral-500);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* ==========================================================================
   Response Display Dark Mode (E22-S03)
   ========================================================================== */

[data-theme="dark"] .json-key { color: #f87171; }
[data-theme="dark"] .json-string { color: #4ade80; }
[data-theme="dark"] .json-number { color: #60a5fa; }
[data-theme="dark"] .json-boolean { color: #c084fc; }
[data-theme="dark"] .json-null { color: #6b7280; }
[data-theme="dark"] .json-bracket { color: var(--neutral-400); }

[data-theme="dark"] .playground-response-line::before {
    color: #52567a;
    border-right-color: #2a2a3e;
}

[data-theme="dark"] .playground-copy-response {
    color: #a1a1aa;
    background: #1a1a2e;
    border-color: #2a2a3e;
}

[data-theme="dark"] .playground-copy-response:hover {
    color: #d4d4d8;
    background: #2a2a3e;
    border-color: #3a3a4e;
}

[data-theme="dark"] .playground-error-box {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .playground-error-code {
    color: #ff6b6b;
}

[data-theme="dark"] .playground-error-message {
    color: #a1a1aa;
}

[data-theme="dark"] .playground-error-details-toggle {
    color: #71717a;
}

[data-theme="dark"] .playground-error-details-toggle:hover {
    color: #a1a1aa;
}

[data-theme="dark"] .playground-error-details-content {
    background: rgba(255, 255, 255, 0.03);
    color: #a1a1aa;
}

[data-theme="dark"] .playground-network-error-title {
    color: #d4d4d8;
}

[data-theme="dark"] .playground-network-error-message {
    color: #71717a;
}

[data-theme="dark"] .playground-image-body-notice {
    color: #71717a;
}

[data-theme="dark"] .playground-empty-body-notice {
    color: #52567a;
}

[data-theme="dark"] .playground-headers-tbl th {
    color: #a1a1aa;
    background: #1a1a2e;
    border-bottom-color: #2a2a3e;
}

[data-theme="dark"] .playground-headers-tbl td {
    border-bottom-color: #1e1e32;
    color: #d4d4d8;
}

[data-theme="dark"] .playground-header-important td:first-child {
    color: #a78bfa;
}

[data-theme="dark"] .playground-headers-tbl tbody tr:hover {
    background: #1a1a2e;
}

[data-theme="dark"] .playground-preview-img {
    background-image: linear-gradient(45deg, #2a2a3e 25%, transparent 25%),
                      linear-gradient(-45deg, #2a2a3e 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #2a2a3e 75%),
                      linear-gradient(-45deg, transparent 75%, #2a2a3e 75%);
}

[data-theme="dark"] .playground-preview-info {
    color: #71717a;
}

/* ---------- Response display reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .playground-copy-response,
    .playground-error-details-toggle i {
        transition: none !important;
    }
}

/* ==========================================================================
   History Panel (E22-S05)
   ========================================================================== */

/* ---------- History Panel Container ---------- */
.playground-history-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 360px;
    max-width: 100%;
    background: #fff;
    border-right: 1px solid var(--neutral-200);
    z-index: 20;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.25s ease-out;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.08);
}

.playground-history-panel.is-open {
    transform: translateX(0);
}

/* ---------- History Header ---------- */
.playground-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--neutral-200);
    flex-shrink: 0;
}

.playground-history-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--neutral-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.playground-history-title i {
    color: var(--primary-purple);
    font-size: 0.8125rem;
}

.playground-history-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--neutral-400);
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.playground-history-close:hover {
    color: var(--neutral-700);
    background: var(--neutral-100);
}

/* ---------- History Search ---------- */
.playground-history-search {
    padding: 8px 12px;
    border-bottom: 1px solid var(--neutral-200);
    flex-shrink: 0;
}

.playground-history-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-sm);
    padding: 0 10px;
    transition: border-color 0.15s ease;
}

.playground-history-search-input-wrap:focus-within {
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(113, 97, 239, 0.1);
}

.playground-history-search-icon {
    color: var(--neutral-400);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.playground-history-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 7px 0;
    font-size: 0.8125rem;
    color: var(--neutral-900);
    outline: none;
    font-family: inherit;
    min-width: 0;
}

.playground-history-search-input::placeholder {
    color: var(--neutral-400);
}

.playground-history-search-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--neutral-400);
    font-size: 0.75rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.playground-history-search-clear:hover {
    color: var(--neutral-600);
}

/* ---------- History List ---------- */
.playground-history-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* ---------- History Card ---------- */
.playground-history-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--neutral-100);
    cursor: pointer;
    transition: background-color 0.1s ease;
}

.playground-history-card:hover {
    background: var(--neutral-50);
}

.playground-history-card:last-child {
    border-bottom: none;
}

.playground-history-card-main {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.playground-history-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.playground-history-card-bottom {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.6875rem;
}

/* ---------- Method Badge ---------- */
.playground-history-method {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: 3px;
    flex-shrink: 0;
    line-height: 1.6;
}

.playground-history-method.method-get {
    color: var(--success);
    background: rgba(54, 179, 126, 0.1);
}

.playground-history-method.method-post {
    color: var(--info);
    background: rgba(66, 104, 230, 0.1);
}

.playground-history-method.method-put {
    color: var(--warning);
    background: rgba(255, 171, 0, 0.1);
}

.playground-history-method.method-patch {
    color: var(--warning);
    background: rgba(255, 171, 0, 0.1);
}

.playground-history-method.method-delete {
    color: var(--danger);
    background: rgba(255, 86, 48, 0.1);
}

/* ---------- Endpoint Name ---------- */
.playground-history-endpoint {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--neutral-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* ---------- Time ---------- */
.playground-history-time {
    font-size: 0.6875rem;
    color: var(--neutral-400);
    flex-shrink: 0;
}

/* ---------- Status ---------- */
.playground-history-status {
    font-size: 0.6875rem;
    font-weight: 600;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    color: var(--neutral-400);
}

.playground-history-status.status-success {
    color: var(--success);
}

.playground-history-status.status-error {
    color: var(--danger);
}

.playground-history-status.status-other {
    color: var(--info);
}

/* ---------- Latency ---------- */
.playground-history-latency {
    font-size: 0.6875rem;
    color: var(--neutral-400);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* ---------- Delete Button ---------- */
.playground-history-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--neutral-300);
    font-size: 0.6875rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.playground-history-card:hover .playground-history-delete {
    opacity: 1;
}

.playground-history-delete:hover {
    color: var(--danger);
    background: rgba(255, 86, 48, 0.1);
}

/* ---------- Empty State ---------- */
.playground-history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    color: var(--neutral-400);
}

.playground-history-empty i {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--neutral-300);
}

.playground-history-empty p {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* ---------- History Footer ---------- */
.playground-history-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--neutral-200);
    flex-shrink: 0;
}

.playground-history-clear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 7px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--danger);
    background: transparent;
    border: 1px solid rgba(255, 86, 48, 0.25);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}

.playground-history-clear-btn:hover {
    background: rgba(255, 86, 48, 0.05);
    border-color: rgba(255, 86, 48, 0.4);
}

/* ---------- Active History Button State ---------- */
#playgroundHistoryBtn.active {
    color: var(--primary-purple);
    background: rgba(113, 97, 239, 0.1);
}

/* ---------- Toast Notification ---------- */
.playground-toast {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--neutral-900);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    z-index: 30;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.playground-toast.is-visible {
    opacity: 1;
}

/* ==========================================================================
   History Panel Dark Mode (E22-S05)
   ========================================================================== */

[data-theme="dark"] .playground-history-panel {
    background: #1a1a2e;
    border-right-color: #2a2a3e;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .playground-history-header {
    border-bottom-color: #2a2a3e;
}

[data-theme="dark"] .playground-history-title {
    color: #e4e4e7;
}

[data-theme="dark"] .playground-history-close {
    color: #71717a;
}

[data-theme="dark"] .playground-history-close:hover {
    color: #d4d4d8;
    background: #2a2a3e;
}

[data-theme="dark"] .playground-history-search {
    border-bottom-color: #2a2a3e;
}

[data-theme="dark"] .playground-history-search-input-wrap {
    background: #0f0f23;
    border-color: #2a2a3e;
}

[data-theme="dark"] .playground-history-search-input-wrap:focus-within {
    border-color: #7161ef;
    box-shadow: 0 0 0 3px rgba(113, 97, 239, 0.15);
}

[data-theme="dark"] .playground-history-search-icon {
    color: #52567a;
}

[data-theme="dark"] .playground-history-search-input {
    color: #e4e4e7;
}

[data-theme="dark"] .playground-history-search-input::placeholder {
    color: #52567a;
}

[data-theme="dark"] .playground-history-search-clear {
    color: #52567a;
}

[data-theme="dark"] .playground-history-search-clear:hover {
    color: #a1a1aa;
}

[data-theme="dark"] .playground-history-card {
    border-bottom-color: #2a2a3e;
}

[data-theme="dark"] .playground-history-card:hover {
    background: #2a2a3e;
}

[data-theme="dark"] .playground-history-endpoint {
    color: #e4e4e7;
}

[data-theme="dark"] .playground-history-time {
    color: #52567a;
}

[data-theme="dark"] .playground-history-status {
    color: #52567a;
}

[data-theme="dark"] .playground-history-status.status-success {
    color: #4ade80;
}

[data-theme="dark"] .playground-history-status.status-error {
    color: #ff6b6b;
}

[data-theme="dark"] .playground-history-latency {
    color: #52567a;
}

[data-theme="dark"] .playground-history-delete {
    color: #3a3a4e;
}

[data-theme="dark"] .playground-history-delete:hover {
    color: #ff6b6b;
    background: rgba(255, 86, 48, 0.15);
}

[data-theme="dark"] .playground-history-empty {
    color: #52567a;
}

[data-theme="dark"] .playground-history-empty i {
    color: #3a3a4e;
}

[data-theme="dark"] .playground-history-footer {
    border-top-color: #2a2a3e;
}

[data-theme="dark"] .playground-history-clear-btn {
    color: #ff6b6b;
    border-color: rgba(255, 86, 48, 0.3);
}

[data-theme="dark"] .playground-history-clear-btn:hover {
    background: rgba(255, 86, 48, 0.1);
    border-color: rgba(255, 86, 48, 0.5);
}

[data-theme="dark"] #playgroundHistoryBtn.active {
    color: #a78bfa;
    background: rgba(113, 97, 239, 0.15);
}

[data-theme="dark"] .playground-toast {
    background: #e4e4e7;
    color: #1a1a2e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ---------- History Responsive ---------- */
@media (max-width: 767px) {
    .playground-history-panel {
        width: 100%;
    }
}

/* ---------- History Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .playground-history-panel {
        transition: none !important;
    }

    .playground-toast {
        transition: none !important;
    }

    .playground-history-close,
    .playground-history-search-input-wrap,
    .playground-history-search-clear,
    .playground-history-card,
    .playground-history-delete,
    .playground-history-clear-btn {
        transition: none !important;
    }
}

/* ==========================================================================
   Enhanced Image Preview (E22-S04)
   ========================================================================== */

/* ---------- Image Toolbar ---------- */
.playground-image-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: var(--neutral-50);
    border-bottom: 1px solid var(--neutral-200);
    flex-shrink: 0;
}

.playground-image-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.playground-image-info-item {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--neutral-600);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.playground-image-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.playground-image-ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-sm);
    color: var(--neutral-600);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.75rem;
}

.playground-image-ctrl-btn:hover {
    color: var(--primary-purple);
    border-color: var(--primary-purple);
    background: rgba(113, 97, 239, 0.05);
}

.playground-image-zoom-level {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--neutral-500);
    min-width: 40px;
    text-align: center;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.playground-image-separator {
    width: 1px;
    height: 20px;
    background: var(--neutral-200);
    margin: 0 4px;
}

/* ---------- Image Viewport ---------- */
.playground-image-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
    cursor: grab;
    /* Checkered transparency background */
    background-image:
        linear-gradient(45deg, #e0e0e0 25%, transparent 25%),
        linear-gradient(-45deg, #e0e0e0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e0e0e0 75%),
        linear-gradient(-45deg, transparent 75%, #e0e0e0 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.playground-image-viewport.opaque {
    background-image: none;
    background-color: #f0f0f0;
}

.playground-image-viewport.is-panning {
    cursor: grabbing;
}

.playground-image-el {
    transform-origin: center center;
    transition: none;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* When the preview is active, make the tab pane flex */
#playgroundTabPreview.has-image {
    display: flex;
    flex-direction: column;
    padding: 0;
    height: 100%;
}

#playgroundTabPreview.has-image .playground-empty-state {
    display: none;
}

#playgroundTabPreview.has-image .playground-image-preview {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background-image: none;
    background-color: transparent;
}

/* ---------- Image Preview Dark Mode ---------- */
[data-theme="dark"] .playground-image-toolbar {
    background: #13132b;
    border-bottom-color: #2a2a3e;
}

[data-theme="dark"] .playground-image-info-item {
    color: #a1a1aa;
}

[data-theme="dark"] .playground-image-ctrl-btn {
    border-color: #2a2a3e;
    color: #71717a;
}

[data-theme="dark"] .playground-image-ctrl-btn:hover {
    color: #a78bfa;
    border-color: #7161ef;
    background: rgba(113, 97, 239, 0.1);
}

[data-theme="dark"] .playground-image-zoom-level {
    color: #71717a;
}

[data-theme="dark"] .playground-image-separator {
    background: #2a2a3e;
}

[data-theme="dark"] .playground-image-viewport {
    background-image:
        linear-gradient(45deg, #2a2a3e 25%, transparent 25%),
        linear-gradient(-45deg, #2a2a3e 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #2a2a3e 75%),
        linear-gradient(-45deg, transparent 75%, #2a2a3e 75%);
}

[data-theme="dark"] .playground-image-viewport.opaque {
    background-color: #1a1a2e;
}

/* ---------- Image Preview Responsive ---------- */
@media (max-width: 767px) {
    .playground-image-toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* ---------- Image Preview Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .playground-image-ctrl-btn {
        transition: none !important;
    }
}

/* ==========================================================================
   Export Panel (E22-S07)
   ========================================================================== */

/* ---------- Export Overlay ---------- */
.playground-export-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Export Panel ---------- */
.playground-export-panel {
    width: 90%;
    max-width: 680px;
    max-height: 90%;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ---------- Export Header ---------- */
.playground-export-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--neutral-200); }
.playground-export-title { font-size: 0.875rem; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; color: var(--neutral-900); }
.playground-export-title i { color: var(--primary-purple); }
.playground-export-header-right { display: flex; align-items: center; gap: 12px; }
.playground-export-redact { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--neutral-600); cursor: pointer; }
.playground-export-close { background: transparent; border: none; color: var(--neutral-400); cursor: pointer; font-size: 1rem; padding: 4px; border-radius: var(--radius-sm); transition: all 0.15s; }
.playground-export-close:hover { color: var(--neutral-700); background: var(--neutral-100); }

/* ---------- Export Tabs ---------- */
.playground-export-tabs { display: flex; padding: 0 12px; background: var(--neutral-50); border-bottom: 1px solid var(--neutral-200); }
.playground-export-tab { padding: 8px 12px; font-size: 0.8125rem; font-weight: 500; color: var(--neutral-500); background: transparent; border: none; border-bottom: 2px solid transparent; cursor: pointer; transition: all 0.15s; font-family: inherit; }
.playground-export-tab:hover { color: var(--neutral-700); }
.playground-export-tab.active { color: var(--primary-purple); border-bottom-color: var(--primary-purple); }

/* ---------- Export Code Area ---------- */
.playground-export-code-wrap { flex: 1; overflow: auto; position: relative; padding: 16px; }
.playground-export-code { margin: 0; font-size: 0.8125rem; font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; line-height: 1.6; white-space: pre-wrap; word-break: break-all; color: var(--neutral-800); background: var(--neutral-50); border: 1px solid var(--neutral-200); border-radius: var(--radius-sm); padding: 16px; }
.playground-export-copy { position: absolute; top: 24px; right: 24px; display: flex; align-items: center; gap: 4px; padding: 6px 12px; font-size: 0.75rem; font-weight: 500; background: #fff; border: 1px solid var(--neutral-200); border-radius: var(--radius-sm); cursor: pointer; transition: all 0.15s; font-family: inherit; color: var(--neutral-600); }
.playground-export-copy:hover { border-color: var(--primary-purple); color: var(--primary-purple); }
.playground-export-copy.copied { color: var(--success); border-color: var(--success); }

/* ---------- Export Share ---------- */
.playground-export-share { padding: 12px 16px; border-top: 1px solid var(--neutral-200); }
.playground-export-share-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px; font-size: 0.8125rem; font-weight: 500; color: var(--primary-purple); background: rgba(113,97,239,0.05); border: 1px solid rgba(113,97,239,0.2); border-radius: var(--radius-sm); cursor: pointer; transition: all 0.15s; font-family: inherit; }
.playground-export-share-btn:hover { background: rgba(113,97,239,0.1); border-color: rgba(113,97,239,0.3); }

/* ---------- Syntax Highlighting ---------- */
.export-keyword { color: #c026d3; font-weight: 500; }
.export-string { color: #22c55e; }
.export-comment { color: #9ca3af; font-style: italic; }
.export-function { color: #3b82f6; }
.export-variable { color: #dc2626; }
.export-number { color: #f59e0b; }

/* ---------- Active Export Button State ---------- */
#playgroundExportBtn.active {
    color: var(--primary-purple);
    background: rgba(113, 97, 239, 0.1);
}

/* ==========================================================================
   Export Panel Dark Mode (E22-S07)
   ========================================================================== */

[data-theme="dark"] .playground-export-overlay { background: rgba(0,0,0,0.5); }
[data-theme="dark"] .playground-export-panel { background: #1a1a2e; box-shadow: 0 8px 32px rgba(0,0,0,0.5); }
[data-theme="dark"] .playground-export-header { border-bottom-color: #2a2a3e; }
[data-theme="dark"] .playground-export-title { color: #e4e4e7; }
[data-theme="dark"] .playground-export-redact { color: #a1a1aa; }
[data-theme="dark"] .playground-export-close { color: #52567a; }
[data-theme="dark"] .playground-export-close:hover { color: #a1a1aa; background: #2a2a3e; }
[data-theme="dark"] .playground-export-tabs { background: #13132b; border-bottom-color: #2a2a3e; }
[data-theme="dark"] .playground-export-tab { color: #52567a; }
[data-theme="dark"] .playground-export-tab:hover { color: #a1a1aa; }
[data-theme="dark"] .playground-export-tab.active { color: #a78bfa; border-bottom-color: #a78bfa; }
[data-theme="dark"] .playground-export-code { background: #0f0f23; border-color: #2a2a3e; color: #e4e4e7; }
[data-theme="dark"] .playground-export-copy { background: #1a1a2e; border-color: #2a2a3e; color: #a1a1aa; }
[data-theme="dark"] .playground-export-copy:hover { border-color: #7161ef; color: #a78bfa; }
[data-theme="dark"] .playground-export-share { border-top-color: #2a2a3e; }
[data-theme="dark"] .playground-export-share-btn { background: rgba(113,97,239,0.1); border-color: rgba(113,97,239,0.2); }
[data-theme="dark"] .playground-export-share-btn:hover { background: rgba(113,97,239,0.15); border-color: rgba(113,97,239,0.3); }
[data-theme="dark"] .export-keyword { color: #e879f9; }
[data-theme="dark"] .export-string { color: #4ade80; }
[data-theme="dark"] .export-comment { color: #6b7280; }
[data-theme="dark"] .export-function { color: #60a5fa; }
[data-theme="dark"] .export-variable { color: #f87171; }
[data-theme="dark"] .export-number { color: #fbbf24; }

[data-theme="dark"] #playgroundExportBtn.active {
    color: #a78bfa;
    background: rgba(113, 97, 239, 0.15);
}

/* ---------- Export Responsive ---------- */
@media (max-width: 767px) {
    .playground-export-panel { width: 100%; max-width: 100%; max-height: 100%; border-radius: 0; }
    .playground-export-tabs { overflow-x: auto; }
}

/* ---------- Export Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .playground-export-tab,
    .playground-export-copy,
    .playground-export-share-btn,
    .playground-export-close {
        transition: none !important;
    }
}
