/* ===============================================
   Auto Crop Photo ID - Modern Premium Design
   =============================================== */

:root {
    --primary: #00d4aa;
    --primary-light: #00ffcc;
    --primary-dark: #00a88a;
    --secondary: #6366f1;
    --accent: #f59e0b;
    --danger: #ef4444;

    --bg-dark: #0a0a0f;
    --bg-card: #111118;
    --bg-card-hover: #16161f;
    --bg-elevated: #1a1a24;
    --bg-input: #0d0d12;

    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --border-color: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --shadow-glow: 0 0 30px rgba(0, 212, 170, 0.12);

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 15px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 212, 170, 0.06) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header */
.header {
    padding: 0.75rem 0;
    margin-bottom: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.logo-icon .material-symbols-rounded {
    font-size: 28px;
    color: white;
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-text .tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.25rem;
}

/* Left Panel */
.left-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-elevated);
}

.card-header .material-symbols-rounded {
    font-size: 20px;
    color: var(--primary);
}

.card-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    flex: 1;
}

.badge {
    background: var(--primary);
    color: var(--bg-dark);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    min-width: 24px;
    text-align: center;
}

/* Upload */
.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.upload-area:hover {
    background: var(--bg-card-hover);
}

.upload-icon-main {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.upload-area p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.upload-area .hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* File List */
.file-list {
    max-height: 180px;
    overflow-y: auto;
    padding: 0.5rem;
}

.file-list::-webkit-scrollbar {
    width: 4px;
}

.file-list::-webkit-scrollbar-track {
    background: var(--bg-input);
}

.file-list::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 2px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

.empty-state .material-symbols-rounded {
    font-size: 40px;
    opacity: 0.3;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.85rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    transition: background var(--transition-fast);
}

.file-item:hover {
    background: var(--bg-elevated);
}

.file-item.processing {
    background: rgba(99, 102, 241, 0.15);
}

.file-item.success .file-status .material-symbols-rounded {
    color: var(--primary);
}

.file-item.error .file-status .material-symbols-rounded {
    color: var(--danger);
}

.file-status {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
}

.file-status .material-symbols-rounded {
    font-size: 16px;
    color: var(--text-muted);
}

.file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}

/* Settings */
.settings-content {
    padding: 0.5rem;
}

.settings-group {
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    padding: 0.625rem;
    margin-bottom: 0.5rem;
}

.settings-group:last-child {
    margin-bottom: 0;
}

.group-label {
    display: flex;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}

.size-tag {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.size-tag.square {
    background: linear-gradient(135deg, var(--secondary), #818cf8);
}

.setting-row.compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
}

.setting-row.compact .material-symbols-rounded {
    font-size: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.setting-row.compact input[type="range"] {
    flex: 1;
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.setting-row.compact input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.setting-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    min-width: 32px;
    text-align: right;
}

/* Layout Options */
.layout-content {
    padding: 0.5rem;
}

.layout-options {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.layout-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.layout-option:hover {
    background: var(--bg-card-hover);
}

.layout-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.layout-option span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Right Panel */
.right-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.preview-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-title .material-symbols-rounded {
    font-size: 22px;
    color: var(--primary);
}

.preview-title h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.current-file {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.35rem 0.75rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
}

/* Preview Grid */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    flex: 1;
}

.preview-item {
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.preview-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.625rem;
    background: var(--bg-input);
    border-bottom: 1px solid var(--border-color);
}

.preview-label .material-symbols-rounded {
    font-size: 18px;
    color: var(--secondary);
}

.preview-label span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.preview-label .size-badge {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    background: none;
}

.size-unit {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.preview-item.original .preview-label {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05));
}

.preview-item.merged .preview-label .size-badge {
    font-size: 0.95rem;
}

.preview-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    min-height: 200px;
    background: #0a0a0f;
}

.preview-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.preview-image img:not([src]),
.preview-image img[src=""] {
    display: none;
}

/* Control Bar */
.control-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-info .material-symbols-rounded {
    font-size: 18px;
    color: var(--primary);
}

.status-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.progress-bar {
    flex: 1;
    height: 5px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
    min-width: 100px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn .material-symbols-rounded {
    font-size: 18px;
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
}

.btn-accent {
    background: linear-gradient(135deg, var(--secondary), #818cf8);
    color: white;
}

.btn-accent:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

/* Responsive */
@media (max-width: 1200px) {
    .preview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .left-panel {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .panel-card {
        flex: 1;
        min-width: 280px;
    }

    .preview-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 600px) {
    .app-container {
        padding: 0.75rem;
    }

    .preview-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .control-bar {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 420px;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-normal);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-elevated);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header .material-symbols-rounded {
    font-size: 22px;
    color: var(--primary);
}

.modal-header h3 {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.25rem;
}

.modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.modal-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.modal-option:hover {
    background: var(--bg-card-hover);
}

.modal-option:has(input:checked) {
    border-color: var(--primary);
    background: rgba(0, 212, 170, 0.1);
}

.modal-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.modal-option span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.modal-option:has(input:checked) span {
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-input);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.modal-loading {
    display: none;
    align-items: center;
    gap: 0.5rem;
    margin-right: auto;
    color: var(--primary);
    font-size: 0.85rem;
}

.modal-loading.active {
    display: flex;
}

.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Loading Dots Animation */
.loading-dots::after {
    content: '.';
    animation: dots 1.5s steps(5, end) infinite;
    display: inline-block;
    width: 1em;
    text-align: left;
}

@keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60% {
        content: '...';
    }

    80%,
    100% {
        content: '';
    }
}

/* ===============================================
   Compact Layout Overrides (2x2 Grid & No Scroll)
   =============================================== */

.app-container {
    height: 100vh;
    overflow: hidden;
    padding: 0.5rem;
}

.header {
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
}

.logo-icon .material-symbols-rounded {
    font-size: 20px;
}

.logo-text h1 {
    font-size: 1.2rem;
}

.main-content {
    transition: transform var(--transition-normal);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-elevated);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header .material-symbols-rounded {
    font-size: 22px;
    color: var(--primary);
}

.modal-header h3 {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.25rem;
}

.modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.modal-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.modal-option:hover {
    background: var(--bg-card-hover);
}

.modal-option:has(input:checked) {
    border-color: var(--primary);
    background: rgba(0, 212, 170, 0.1);
}

.modal-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.modal-option span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.modal-option:has(input:checked) span {
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-input);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.modal-loading {
    display: none;
    align-items: center;
    gap: 0.5rem;
    margin-right: auto;
    color: var(--primary);
    font-size: 0.85rem;
}

.modal-loading.active {
    display: flex;
}

.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Loading Dots Animation */
.loading-dots::after {
    content: '.';
    animation: dots 1.5s steps(5, end) infinite;
    display: inline-block;
    width: 1em;
    text-align: left;
}

@keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60% {
        content: '...';
    }

    80%,
    100% {
        content: '';
    }
}

/* ===============================================
   Compact Layout Overrides (2x2 Grid & No Scroll)
   =============================================== */

.app-container {
    height: 100vh;
    overflow: hidden;
    padding: 0.5rem;
}

.header {
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
}

.logo-icon .material-symbols-rounded {
    font-size: 20px;
}

.logo-text h1 {
    font-size: 1.2rem;
}

.main-content {
    gap: 0.75rem;
    height: calc(100vh - 70px);
    overflow: hidden;
}

/* Left Panel Compact */
.left-panel {
    gap: 0.5rem;
    overflow: hidden;
    /* Changed from auto to hidden to use flex */
    padding-right: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.panel-card {
    border-radius: var(--radius-md);
    flex-shrink: 0;
    /* Prevent other cards from shrinking */
}

.card-header {
    padding: 0.5rem 0.75rem;
}

.card-header h3 {
    font-size: 0.85rem;
}

/* Preview Card Expansion */
.panel-card.preview-card {
    flex: 1;
    /* Take remaining height */
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.preview-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0f;
    padding: 0.5rem;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

#defaultPreview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    display: none;
}

#defaultPreviewLoading {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Compact Upload */
.upload-area {
    padding: 0.75rem;
    flex-direction: row;
    gap: 0.75rem;
}

.upload-icon-main {
    font-size: 24px;
    margin-bottom: 0;
}

.upload-area p {
    font-size: 0.85rem;
    margin-bottom: 0;
}

.upload-area .hint {
    display: none;
}

/* Compact File List */
.file-list {
    max-height: 100px;
    padding: 0.25rem;
}

.file-item {
    padding: 0.25rem 0.5rem;
}

/* Compact Settings */
.settings-content {
    padding: 0.25rem;
}

.settings-group {
    padding: 0.4rem;
    margin-bottom: 0.25rem;
}

.group-label {
    margin-bottom: 0.25rem;
}

.setting-row.compact {
    padding: 0.1rem 0;
}

/* Right Panel Compact */
.right-panel {
    padding: 0.75rem;
    overflow: hidden;
}

.preview-header {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
}

.control-bar {
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* 2x2 Preview Grid */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0.5rem;
    flex: 1;
    min-height: 0;
}

.preview-item {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.preview-label {
    padding: 0.4rem;
}

.preview-label .size-badge {
    font-size: 0.9rem;
}

.preview-image {
    padding: 0.5rem;
    min-height: 0;
    flex: 1;
}

/* Responsive Overrides */
@media (max-width: 900px) {
    .app-container {
        height: auto;
        overflow: visible;
    }

    .main-content {
        height: auto;
        overflow: visible;
        grid-template-columns: 1fr;
    }

    .left-panel {
        height: auto;
        overflow: visible;
    }

    .panel-card.preview-card {
        min-height: 300px;
    }

    .preview-grid {
        grid-template-columns: repeat(2, 1fr);
        height: auto;
        grid-template-rows: auto;
    }

    .preview-item {
        min-height: 200px;
    }
}