/* ==========================================================================
   Contao Responsive Image Size & Focal Point Checker
   Modern Design System & Styling
   ========================================================================== */

:root {
    /* Shared Accent & Brand Colors */
    --accent-primary: rgb(249, 243, 0);
    --accent-primary-hover: rgb(225, 220, 0);
    --accent-primary-glow: rgba(249, 243, 0, 0.25);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing & Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Dark Theme (Default)
   ========================================================================== */
:root,
html.dark {
    color-scheme: dark;
    --bg-base: #222222;
    --bg-surface-1: #121212;
    --bg-surface-2: #1e1e1e;
    --bg-surface-3: #3d3d3d;
    --bg-surface-glass: rgba(18, 18, 18, 0.85);

    --border-subtle: rgba(217, 217, 217, 0.12);
    --border-medium: #3d3d3d;
    --border-focus: rgb(249, 243, 0);

    --text-primary: #ffffff;
    --text-secondary: rgb(217, 217, 217);
    --text-muted: rgba(217, 217, 217, 0.6);

    --accent-success: #ffffff;
    --accent-success-bg: rgba(217, 217, 217, 0.15);

    --accent-warning: rgb(249, 243, 0);
    --accent-warning-bg: rgba(249, 243, 0, 0.15);

    --accent-danger: #ffffff;
    --accent-danger-bg: rgba(61, 61, 61, 0.5);

    --accent-cyan: rgb(249, 243, 0);
    --accent-purple: rgb(217, 217, 217);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.8);
    --shadow-glow: 0 0 24px var(--accent-primary-glow);

    --layout-gradient: radial-gradient(circle at 50% 0%, #242424 0%, #000000 70%);
}

/* ==========================================================================
   Light Theme
   ========================================================================== */
html.light {
    color-scheme: light;
    --bg-base: #ffffff;
    --bg-surface-1: #f8f8f8;
    --bg-surface-2: #eeeeee;
    --bg-surface-3: rgb(217, 217, 217);
    --bg-surface-glass: rgba(255, 255, 255, 0.9);

    --border-subtle: rgba(61, 61, 61, 0.15);
    --border-medium: rgba(61, 61, 61, 0.28);
    --border-focus: #000000;

    --text-primary: #000000;
    --text-secondary: #3d3d3d;
    --text-muted: #666666;

    --accent-success: #000000;
    --accent-success-bg: rgba(217, 217, 217, 0.5);

    --accent-warning: #000000;
    --accent-warning-bg: rgba(249, 243, 0, 0.35);

    --accent-danger: #000000;
    --accent-danger-bg: rgba(217, 217, 217, 0.7);

    --accent-cyan: #3d3d3d;
    --accent-purple: #3d3d3d;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 20px rgba(249, 243, 0, 0.5);

    --layout-gradient: radial-gradient(circle at 50% 0%, rgb(217, 217, 217, 0.45) 0%, #ffffff 70%);
}

/* Base Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Layout Container */
.app-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--layout-gradient);
    transition: background var(--transition-normal);
}

/* ==========================================================================
   Header Bar
   ========================================================================== */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.75rem;
    background: var(--bg-surface-glass);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 40;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    box-shadow: 0 0 16px rgba(249, 243, 0, 0.35);
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.brand-logo svg {
    width: 22px;
    height: 22px;
}

.brand-text h1 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.brand-subtitle {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: block;
}

.header-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
}

.stat-pill.highlight {
    background: rgba(249, 243, 0, 0.15);
    border-color: rgba(249, 243, 0, 0.4);
    color: var(--text-primary);
}

html.light .stat-pill.highlight {
    background: rgba(249, 243, 0, 0.35);
    border-color: rgba(0, 0, 0, 0.2);
    color: #000000;
}

html.dark .stat-pill.highlight {
    color: rgb(249, 243, 0);
}

.stat-label {
    color: var(--text-muted);
}

.stat-value {
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

/* Theme Toggle Button */
.btn-theme-toggle {
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-theme-toggle:hover {
    background: var(--bg-surface-2);
    color: var(--text-primary);
}

html.dark .theme-icon-moon {
    display: none;
}

html.dark .theme-icon-sun {
    display: block;
    color: var(--accent-primary);
}

html.light .theme-icon-sun {
    display: none;
}

html.light .theme-icon-moon {
    display: block;
    color: var(--text-primary);
}

/* ==========================================================================
   Preset Navigation Bar
   ========================================================================== */
.preset-navbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.75rem;
    background: var(--bg-surface-1);
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.preset-search-box {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 280px;
    flex: 1 1 280px;
    max-width: 420px;
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    color: var(--text-muted);
    pointer-events: none;
}

.preset-search-box input {
    width: 100%;
    padding: 0.55rem 2.4rem 0.55rem 2.4rem;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-sans);
    transition: all var(--transition-fast);
}

.preset-search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
    background: var(--bg-surface-3);
}

.search-shortcut {
    position: absolute;
    right: 0.75rem;
    padding: 0.15rem 0.45rem;
    background: var(--bg-surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.btn-clear-search {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.2rem;
}

.btn-clear-search:hover {
    color: #fff;
}

.category-chips-wrapper {
    overflow-x: auto;
    scrollbar-width: thin;
    max-width: 100%;
    flex: 2 1 auto;
}

.category-chips {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
    padding-bottom: 2px;
}

.chip-btn {
    padding: 0.4rem 0.85rem;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.chip-btn:hover {
    background: var(--bg-surface-3);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.chip-btn.active {
    background: var(--accent-primary);
    color: #000000;
    font-weight: 600;
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px var(--accent-primary-glow);
}

.preset-dropdown-container {
    min-width: 240px;
    flex: 0 0 auto;
}

.preset-select {
    width: 100%;
    padding: 0.55rem 1rem;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.preset-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.preset-select option {
    background: var(--bg-surface-1);
    color: var(--text-primary);
}

/* ==========================================================================
   Workspace Layout (Split Panel)
   ========================================================================== */
.workspace-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1.5rem;
    padding: 1.5rem 1.75rem;
    flex: 1;
    max-width: 1920px;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 1200px) {
    .workspace-grid {
        grid-template-columns: 340px 1fr;
    }
}

@media (max-width: 900px) {
    .workspace-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Left Sidebar Controls
   ========================================================================== */
.sidebar-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.panel-card {
    background: var(--bg-surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition-fast);
}

.panel-card:hover {
    border-color: var(--border-medium);
}

.card-header {
    margin-bottom: 1rem;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
}

.card-title svg {
    color: var(--accent-primary);
}

.card-title h2 {
    font-size: 0.95rem;
    font-weight: 600;
}

/* Dropzone */
.dropzone {
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-md);
    padding: 1.25rem 1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--accent-primary);
    background: rgba(249, 243, 0, 0.06);
    box-shadow: 0 0 16px var(--accent-primary-glow);
}

.dropzone-icon {
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.dropzone-text {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.dropzone-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: block;
}

.dropzone-hint kbd {
    background: var(--bg-surface-3);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
    font-family: var(--font-mono);
}

/* Sample Picker */
.sample-picker {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-subtle);
}

.sample-picker-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.45rem;
}

.sample-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.btn-sample {
    padding: 0.45rem 0.6rem;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.btn-sample:hover {
    background: var(--bg-surface-3);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.btn-sample.active {
    background: rgba(249, 243, 0, 0.15);
    border-color: var(--accent-primary);
    color: rgb(249, 243, 0);
}

/* Media Ratio Picker (assets/media) */
.media-ratio-picker {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-subtle);
}

.media-ratio-select {
    width: 100%;
    padding: 0.55rem 0.85rem;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.media-ratio-select:hover {
    border-color: var(--border-medium);
    background: var(--bg-surface-3);
}

.media-ratio-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-primary-glow);
}

.media-ratio-select optgroup {
    font-weight: 700;
    color: var(--accent-primary);
    background: var(--bg-surface-1);
}

.media-ratio-select option {
    font-weight: 400;
    color: var(--text-primary);
    background: var(--bg-surface-1);
    padding: 3px 0;
}

/* Source Image Metadata */
.image-meta {
    margin-top: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.65rem 0.85rem;
    background: var(--bg-surface-2);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.meta-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meta-label {
    color: var(--text-muted);
}

.meta-val {
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-weight: 500;
}

.truncate {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   Interactive Focal Point Editor
   ========================================================================== */
.focal-canvas-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: crosshair;
    border: 1px solid var(--border-subtle);
    user-select: none;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
}

.focal-canvas-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Reticle / Fadenkreuz */
.focal-reticle {
    position: absolute;
    width: 36px;
    height: 36px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
    transition: transform 0.05s ease-out;
}

.reticle-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    transform: translate(-50%, -50%);
    background: var(--accent-primary);
    border: 2px solid #000000;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(249, 243, 0, 0.9);
}

.reticle-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    animation: reticlePulse 2s infinite ease-in-out;
}

@keyframes reticlePulse {

    0%,
    100% {
        transform: scale(1);
        border-color: rgba(255, 255, 255, 0.9);
    }

    50% {
        transform: scale(1.15);
        border-color: rgb(249, 243, 0);
    }
}

.reticle-crosshair-h,
.reticle-crosshair-v {
    position: absolute;
    background: rgba(255, 255, 255, 0.6);
}

.reticle-crosshair-h {
    top: 50%;
    left: -12px;
    right: -12px;
    height: 1px;
    transform: translateY(-50%);
}

.reticle-crosshair-v {
    left: 50%;
    top: -12px;
    bottom: -12px;
    width: 1px;
    transform: translateX(-50%);
}

.reticle-label {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
    font-size: 0.68rem;
    font-family: var(--font-mono);
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.focal-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.45rem;
    text-align: center;
}

/* Focal Numeric & Buttons */
.focal-controls {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.focal-inputs-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.coord-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.coord-group label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.input-stepper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-stepper input {
    width: 100%;
    padding: 0.45rem 1.8rem 0.45rem 0.65rem;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
}

.input-stepper input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.input-stepper .unit {
    position: absolute;
    right: 0.65rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    pointer-events: none;
}

/* 3x3 Position Grid */
.preset-positions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface-2);
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
}

.positions-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.grid-3x3 {
    display: grid;
    grid-template-columns: repeat(3, 24px);
    grid-template-rows: repeat(3, 24px);
    gap: 3px;
}

.btn-pos {
    background: var(--bg-surface-3);
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-pos:hover {
    background: var(--accent-primary);
    color: #000000;
}

.btn-pos.active {
    background: var(--accent-primary);
    color: #000000;
    box-shadow: 0 0 6px var(--accent-primary-glow);
}

/* Contao Copy Button */
.btn-copy-contao {
    width: 100%;
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    background: var(--accent-primary);
    color: #000000;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--accent-primary-glow);
    transition: all var(--transition-fast);
}

.btn-copy-contao:hover {
    background: var(--accent-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(249, 243, 0, 0.4);
}

.btn-copy-contao.copied {
    background: #ffffff;
    color: #000000;
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.35);
}

/* ==========================================================================
   Toggles & Settings Card
   ========================================================================== */
.toggles-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toggle-control {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.toggle-control input {
    position: absolute;
    opacity: 0;
}

.toggle-switch {
    width: 36px;
    height: 20px;
    background: var(--bg-surface-3);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-full);
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all var(--transition-fast);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition-fast);
}

.toggle-control input:checked+.toggle-switch {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.toggle-control input:checked+.toggle-switch::after {
    transform: translateX(16px);
    background: #000000;
}

.toggle-label {
    display: flex;
    flex-direction: column;
}

.toggle-label strong {
    font-size: 0.8rem;
    color: var(--text-primary);
}

.toggle-label small {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Right Panel: Responsive Breakpoint Gallery
   ========================================================================== */
.gallery-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    background: var(--bg-surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.toolbar-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.toolbar-title-group h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-sans);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.gallery-key-tag {
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.view-size-selector {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.view-size-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.size-buttons {
    display: flex;
    background: var(--bg-surface-2);
    padding: 2px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.size-buttons .btn {
    padding: 0.25rem 0.55rem;
    font-size: 0.72rem;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.size-buttons .btn.active {
    background: var(--accent-primary);
    color: #000000;
    font-weight: 600;
}

/* Breakpoint Cards Grid */
.breakpoint-grid {
    display: grid;
    gap: 1.25rem;
    transition: all var(--transition-normal);
}

.breakpoint-grid.size-compact {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.breakpoint-grid.size-regular {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.breakpoint-grid.size-large {
    grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
}

/* Breakpoint Card */
.breakpoint-card {
    background: var(--bg-surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.breakpoint-card:hover {
    border-color: rgba(249, 243, 0, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.card-top-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-surface-2);
    border-bottom: 1px solid var(--border-subtle);
}

.card-device-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.device-icon {
    color: var(--accent-primary);
}

.device-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-badges {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Card Visual Frame */
.card-preview-stage {
    position: relative;
    width: 100%;
    background: #000;
    overflow: hidden;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-preview-canvas {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Card Overlays */
.overlay-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Rule of Thirds Grid */
.overlay-thirds {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
}

.overlay-thirds::before,
.overlay-thirds::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.thirds-line-h1,
.thirds-line-h2 {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(217, 217, 217, 0.4);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

.thirds-line-h1 {
    top: 33.333%;
}

.thirds-line-h2 {
    top: 66.666%;
}

.thirds-line-v1,
.thirds-line-v2 {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(217, 217, 217, 0.4);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

.thirds-line-v1 {
    left: 33.333%;
}

.thirds-line-v2 {
    left: 66.666%;
}

/* Safe Margin Box (15%) */
.overlay-safe-margin {
    position: absolute;
    inset: 15%;
    border: 1.5px dashed rgb(249, 243, 0);
    border-radius: 4px;
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.12) inset;
}

.overlay-safe-margin::after {
    content: 'SAFE';
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 0.55rem;
    font-family: var(--font-mono);
    color: rgb(249, 243, 0);
    font-weight: 700;
}

/* Center Crosshair Overlay */
.overlay-center-cross {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
}

.overlay-center-cross::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -4px;
    right: -4px;
    height: 1px;
    background: rgba(255, 255, 255, 0.8);
}

.overlay-center-cross::after {
    content: '';
    position: absolute;
    left: 50%;
    top: -4px;
    bottom: -4px;
    width: 1px;
    background: rgba(255, 255, 255, 0.8);
}

/* Card Bottom Footer */
.card-bottom-info {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: var(--bg-surface-1);
}

.card-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
}

.info-label {
    color: var(--text-muted);
}

.info-val {
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.media-query-snippet {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.25);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   Badges & Tags
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    font-family: var(--font-mono);
    background: var(--bg-surface-3);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.badge-subtle {
    background: var(--bg-surface-2);
    color: var(--text-secondary);
}

.badge-primary {
    background: rgba(249, 243, 0, 0.15);
    color: rgb(249, 243, 0);
    border-color: rgba(249, 243, 0, 0.35);
}

.badge-accent {
    background: rgba(217, 217, 217, 0.15);
    color: rgb(217, 217, 217);
    border-color: rgba(217, 217, 217, 0.3);
}

.badge-warning {
    background: rgba(249, 243, 0, 0.15);
    color: rgb(249, 243, 0);
    border-color: rgba(249, 243, 0, 0.35);
}

.badge-success {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.badge-danger {
    background: rgba(61, 61, 61, 0.6);
    color: rgb(217, 217, 217);
    border-color: #3d3d3d;
}

/* ==========================================================================
   Buttons & UI Elements
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: var(--font-sans);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-primary);
    color: #000000;
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
    box-shadow: 0 0 14px var(--accent-primary-glow);
}

.btn-secondary {
    background: var(--bg-surface-2);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}

.btn-secondary:hover {
    background: var(--bg-surface-3);
    border-color: var(--border-medium);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-surface-2);
    color: var(--text-primary);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
}

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

/* ==========================================================================
   Dialog / Modal Styling (<dialog>)
   ========================================================================== */
.detail-dialog {
    border: none;
    background: transparent;
    max-width: 92vw;
    width: 1000px;
    margin: auto;
    padding: 0;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    overflow: hidden;
}

.detail-dialog::backdrop {
    background: rgba(5, 8, 15, 0.8);
    backdrop-filter: blur(12px);
}

.dialog-content {
    background: var(--bg-surface-1);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}

.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: var(--bg-surface-2);
    border-bottom: 1px solid var(--border-subtle);
}

.dialog-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dialog-title-group h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dialog-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-close-dialog {
    width: 32px;
    height: 32px;
    background: var(--bg-surface-3);
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-close-dialog:hover {
    background: var(--accent-primary);
    color: #000000;
    border-color: var(--accent-primary);
}

/* Modal Body */
.dialog-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface-1);
    min-height: 300px;
}

/* Dialog Footer */
.dialog-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    background: var(--bg-surface-2);
    border-top: 1px solid var(--border-subtle);
}

/* Help Dialog Styling */
.help-dialog {
    max-width: 680px;
}

.help-body {
    background: var(--bg-surface-1);
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.75rem;
}

.help-section h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.help-section p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.help-steps {
    padding-left: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.help-steps strong {
    color: var(--text-primary);
}

.help-steps code,
.help-steps kbd {
    background: var(--bg-surface-3);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 100;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 500;
    pointer-events: auto;
    animation: toastSlideIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.success {
    border-color: var(--accent-primary);
    background: var(--bg-surface-2);
    color: var(--text-primary);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Utilities */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hidden {
    display: none !important;
}