/* ==========================================================================
   CHROMACRAFT DESIGN SYSTEM & STYLESHEET
   ========================================================================== */

/* Design Tokens */
:root {
    /* Color Palette (Windows XP Luna Classic Blue & Silver Theme) */
    --bg-dark: #ece9d8;
    --bg-panel: #f1efe2;
    --bg-card: #ffffff;
    --bg-hover: #e0dbce;
    --bg-sidebar: #0c43c2;
    --bg-active-nav: #27567e;
    --bg-code: #ffffff;
    --text-code: #003c74;
    --bg-toast: #f1efe2;
    --bg-palette-info: #e0dbce;
    --brand-gradient: linear-gradient(to bottom, #ffffff, #ece9d8);
    
    --text-main: #000000;
    --text-muted: #444444;
    --text-dark: #777777;
    
    --accent-indigo: #225ad7; /* Luna Royal Blue */
    --accent-violet: #0053e2; /* Deep Header Blue */
    --accent-cyan: #388e3c;   /* Start Menu Green */
    --accent-pink: #e62d2d;   /* Windows Red Close Button */
    
    --success: #388e3c;
    --warning: #ff9800;
    --error: #e62d2d;

    /* Windows XP Borders & Details */
    --glass-border: #7f9db9;
    --glass-shadow: rgba(0, 0, 0, 0.3);
    --shadow-inset: inset -1px -1px 0px #000, inset 1px 1px 0px #fff;
    
    /* Layout & Spacing */
    --sidebar-width: 260px;
    --border-radius-lg: 8px;
    --border-radius-md: 3px;
    --border-radius-sm: 2px;
    --font-heading: 'Tahoma', 'Segoe UI', sans-serif;
    --font-body: 'Tahoma', 'Segoe UI', sans-serif;
}

.light-theme {
    /* Windows XP Silver Theme variant */
    --bg-dark: #e3e3e3;
    --bg-panel: #ececec;
    --bg-card: #ffffff;
    --bg-hover: #d4d4d4;
    --bg-sidebar: #7a7a7a;
    --bg-active-nav: #4a4a4a;
    --bg-code: #ffffff;
    --text-code: #333333;
    --bg-toast: #ececec;
    --bg-palette-info: #d4d4d4;
    
    --text-main: #000000;
    --text-muted: #444444;
    --text-dark: #666666;
    
    --accent-indigo: #7a7a7a;
    --accent-violet: #4a4a4a;
    --accent-cyan: #969696;
    --accent-pink: #d93838;
    
    --glass-border: #969696;
    --glass-shadow: rgba(0, 0, 0, 0.15);
}

.light-theme .logo-dot {
    mix-blend-mode: normal;
}

/* Background Bliss Wallpaper instead of Orbs */
.bg-orb {
    display: none !important;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: #0b2265;
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: url('https://upload.wikimedia.org/wikipedia/commons/7/7d/Bliss_%28Windows_XP_wallpaper%29.png');
    background-size: cover;
    background-position: center bottom;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

body.light-theme {
    background-image: url('https://upload.wikimedia.org/wikipedia/commons/7/7d/Bliss_%28Windows_XP_wallpaper%29.png');
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* App Layout (Unified Top Navigation) */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Windows XP Taskbar (Pinnned to bottom) */
.app-header {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    height: 40px;
    background: linear-gradient(to bottom, #245dd7 0%, #3f8cf3 9%, #1b52e3 18%, #1f57e6 55%, #184dc8 70%, #1540a8 100%);
    border-top: 2px solid #3f8cf3;
    border-bottom: none;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.4);
}

.header-inner {
    max-width: 100%;
    width: 100%;
    height: 100%;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
}

.brand {
    background: linear-gradient(to bottom, #53ab24 0%, #70d638 10%, #53ab24 85%, #3d7d17 100%);
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    box-shadow: 2px 0px 5px rgba(0,0,0,0.3);
    padding: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 0.5rem;
}

.logo-icon {
    width: 16px;
    height: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}

.logo-dot {
    position: static;
    width: 7px;
    height: 7px;
    border-radius: 1px;
    mix-blend-mode: normal;
}

.dot-1 {
    background-color: #f34336;
    animation: none;
}

.dot-2 {
    background-color: #2196f3;
    animation: none;
}

.dot-3 {
    background-color: #4caf50;
    animation: none;
}

.brand h1 {
    font-family: 'Tahoma', sans-serif;
    font-weight: 900;
    font-style: italic;
    color: white;
    text-shadow: 1px 1px 1px #000;
    font-size: 1.15rem;
    background: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
}

.nav-menu {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    height: 100%;
    flex-grow: 1;
}

.nav-item {
    background: linear-gradient(to bottom, #3c7fb1 0%, #4c98d1 10%, #326ea0 85%, #27567e 100%) !important;
    border: 1px solid #1c3a52 !important;
    border-radius: 3px !important;
    color: white !important;
    padding: 4px 12px !important;
    font-size: 0.8rem !important;
    font-weight: bold;
    font-family: 'Tahoma', sans-serif;
    height: 28px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.4);
    transition: none;
}

.nav-item i {
    width: 16px;
    height: 16px;
}

.nav-item:hover {
    background: linear-gradient(to bottom, #4c98d1 0%, #5faee3 100%) !important;
    color: white !important;
    border-color: #225ad7 !important;
}

.nav-item:hover i {
    transform: none;
}

.nav-item.active {
    color: white !important;
    background: linear-gradient(to bottom, #1c3a52 0%, #27567e 100%) !important;
    box-shadow: inset 1px 1px 3px rgba(0,0,0,0.8) !important;
    border-color: #112233 !important;
}

.nav-item.active i {
    color: white;
}

.header-actions {
    background: #0c43c2;
    border-left: 1px solid #1b52e3;
    padding: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
}

.selected-color-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    background-color: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

/* Main Content Area */
.main-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 2rem 60px 2rem;
    min-width: 0;
}

.page-title-container {
    margin-bottom: 1.5rem;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 1rem;
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

#current-tab-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2.2rem;
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
    color: white;
    text-shadow: 1.5px 1.5px 3px rgba(0,0,0,0.9);
}

#current-tab-desc {
    color: white;
    font-size: 0.95rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.9);
}

.global-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-toggle-wrapper {
    position: relative;
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    padding: 3px;
    gap: 2px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    width: 80px;
    height: 34px;
    align-items: center;
}

.lang-toggle-btn {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    z-index: 2;
    transition: color 0.3s ease;
    text-align: center;
    line-height: 26px;
    padding: 0;
}

.lang-toggle-btn.active {
    color: var(--bg-dark);
}

.lang-slide-bg {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 36px;
    height: 26px;
    background: var(--accent-indigo);
    border-radius: calc(var(--border-radius-sm) - 1px);
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.3);
}

.lang-toggle-wrapper.tr-active .lang-slide-bg {
    transform: translateX(36px);
}

.active-color-preview {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--accent-indigo);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
    border: 2px solid white;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.active-color-code {
    font-family: monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Windows XP Dialog Groupboxes */
.panel {
    background-color: #ece9d8;
    border: 2px solid #d0ccc0;
    border-radius: 4px;
    padding: 1.5rem;
    position: relative;
    box-shadow: none;
}

.panel::before, .panel::after {
    display: none !important;
}

/* Tabs Infrastructure */
.tab-viewport {
    flex-grow: 1;
    display: grid;
    min-width: 0;
    max-width: 100%;
    background-color: #f1efe2;
    border: 3px solid #0053e2;
    border-top: 30px solid #0053e2;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    position: relative;
    box-shadow: 4px 4px 20px rgba(0, 0, 0, 0.4);
    padding: 20px;
    margin-top: 1rem;
    overflow: hidden;
}

.tab-viewport::before {
    content: 'hexcodecolor v1.3.0 - AI Color Suite';
    position: absolute;
    top: -24px;
    left: 8px;
    color: white;
    font-family: 'Tahoma', sans-serif;
    font-weight: bold;
    font-size: 0.85rem;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.tab-viewport::after {
    content: '';
    position: absolute;
    top: -24px;
    right: 8px;
    width: 60px;
    height: 18px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 20"><rect x="0" y="0" width="16" height="16" rx="2" fill="%232d6ce6" stroke="white" stroke-width="1"/><line x1="4" y1="12" x2="12" y2="12" stroke="white" stroke-width="2"/><rect x="20" y="0" width="16" height="16" rx="2" fill="%232d6ce6" stroke="white" stroke-width="1"/><rect x="23" y="3" width="10" height="10" fill="none" stroke="white" stroke-width="2"/><rect x="40" y="0" width="18" height="16" rx="2" fill="%23e62d2d" stroke="white" stroke-width="1"/><line x1="45" y1="4" x2="53" y2="12" stroke="white" stroke-width="2"/><line x1="53" y1="4" x2="45" y2="12" stroke="white" stroke-width="2"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
}

.tab-content {
    display: none;
    animation: fade-in 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-content.active {
    display: block;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   TAB: COLOR PICKER
   ========================================================================== */
.picker-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
}

.picker-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.picker-wheel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    width: 100%;
}

.canvas-wrapper {
    position: relative;
    width: 280px;
    height: 280px;
    cursor: crosshair;
    touch-action: none;
}

.wheel-pointer {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid white;
    background: transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5), inset 0 2px 8px rgba(0,0,0,0.3);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: transform 0.05s ease-out;
}

.picker-sliders {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.slider-label span:last-child {
    font-family: monospace;
    font-weight: 600;
    color: var(--text-main);
}

/* Custom Styled Range Sliders */
.custom-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 100px;
    outline: none;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--glass-border);
    transition: all 0.2s;
}

.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    cursor: pointer;
    transition: transform 0.1s ease;
}

.custom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Slider Track Gradients */
.hue-slider {
    background: linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
}

.saturation-slider {
    background: linear-gradient(to right, #808080, var(--accent-indigo));
}

.lightness-slider {
    background: linear-gradient(to right, #000000, #808080 50%, #ffffff 100%);
}

/* Picker Details Panel */
.section-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.15rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-inputs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.input-card {
    background-color: #ffffff;
    border: 2px inset #7f9db9;
    border-radius: 0;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.input-card:focus-within {
    border-color: #ff9800;
}

.input-card label {
    font-size: 0.8rem;
    text-transform: none;
    font-weight: normal;
    color: #000000;
}

.input-with-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.input-with-copy input {
    background: transparent;
    border: none;
    outline: none;
    color: #000000;
    font-family: monospace;
    font-weight: 600;
    font-size: 1rem;
    width: 80%;
}

.btn-copy {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-copy:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.06);
}

.btn-copy i {
    width: 16px;
    height: 16px;
}

/* Harmonies */
.harmony-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.btn-pill {
    background-color: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    color: var(--text-muted);
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-pill:hover {
    background-color: var(--bg-hover);
    color: var(--text-main);
}

.btn-pill.active {
    background-color: var(--accent-indigo);
    border-color: var(--accent-indigo);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.harmony-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(65px, 1fr));
    gap: 0.75rem;
}

.harmony-swatch {
    border-radius: var(--border-radius-md);
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0.5rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.harmony-swatch:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.harmony-swatch span {
    font-family: monospace;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 0.15rem 0.25rem;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.harmony-swatch:hover span {
    opacity: 1;
}

/* ==========================================================================
   TAB: GRADIENTS
   ========================================================================== */
.gradient-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.gradient-preview-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.gradient-canvas {
    height: 180px;
    border-radius: var(--border-radius-md);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.25);
    position: relative;
}

.stop-slider-container {
    position: relative;
    height: 24px;
    margin: 0 10px;
    touch-action: none;
}

.stop-slider-track {
    position: relative;
    height: 10px;
    background-color: #ffffff;
    border: 2px inset #7f9db9;
    border-radius: 0;
    top: 7px;
}

.stop-marker {
    position: absolute;
    width: 14px;
    height: 20px;
    border-radius: 2px;
    border: 1px solid #1a3563;
    background: linear-gradient(to bottom, #ffffff 0%, #ece9d8 100%);
    box-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    top: -5px;
    transform: translateX(-50%);
    cursor: grab;
    transition: transform 0.1s ease, border-color 0.2s;
    z-index: 10;
}

.stop-marker::after {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
}

.stop-marker:active {
    cursor: grabbing;
    transform: translateX(-50%);
}

.stop-marker.active {
    border-color: var(--warning);
    box-shadow: 0 0 6px var(--warning);
    z-index: 20;
}

/* Controls Grid */
.gradient-controls-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 2rem;
}

.settings-row {
    display: flex;
    gap: 1.5rem;
}

.settings-col {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.settings-col label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
}

.toggle-group {
    display: flex;
    background-color: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 0.25rem;
}

.btn-toggle {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-toggle.active {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    box-shadow: var(--shadow-inset);
}

.angle-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 0.35rem 0.75rem;
}

.angle-input-wrapper input[type=number] {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-family: monospace;
    font-size: 0.95rem;
    width: 45px;
    text-align: right;
}

/* Hide number spinner styling */
.angle-input-wrapper input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.angle-input-wrapper span {
    color: var(--text-dark);
    font-size: 0.85rem;
}

.angle-range {
    -webkit-appearance: none;
    flex-grow: 1;
    height: 4px;
    border-radius: 100px;
    outline: none;
    background: rgba(255,255,255,0.06);
}

.angle-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
}

.active-stop-color-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: #ffffff;
    border: 2px inset #7f9db9;
    border-radius: 0;
    padding: 0.25rem 0.5rem;
}

.active-stop-preview {
    width: 32px;
    height: 24px;
    border-radius: 2px;
    border: 1px solid #7f9db9;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s;
}

.active-stop-preview:hover {
    transform: scale(1.05);
    filter: brightness(1.15);
}

.active-stop-color-row input[type=text] {
    background: transparent;
    border: none;
    outline: none;
    color: #000000;
    font-family: monospace;
    font-size: 0.95rem;
    font-weight: 600;
    flex-grow: 1;
}

.active-stop-color-row input[type=color] {
    -webkit-appearance: none;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    background: transparent;
}

.active-stop-color-row input[type=color]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.active-stop-color-row input[type=color]::-webkit-color-swatch {
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--border-radius-sm);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background-color: var(--error);
    color: white;
}

.btn-danger i {
    width: 16px;
    height: 16px;
}

/* Button variants */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius-md);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid transparent;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.btn-primary {
    background: var(--accent-indigo);
    color: #050505;
    border: 1px solid var(--accent-indigo);
    box-shadow: 0 2px 10px rgba(255, 107, 0, 0.15);
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: transparent;
    color: var(--accent-indigo);
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: rgba(255, 107, 0, 0.06);
    border-color: var(--accent-indigo);
    transform: translateY(-2px);
}

.actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Code Output Box */
.code-output-container {
    position: relative;
    background-color: #ffffff;
    border: 2px inset #7f9db9;
    border-radius: 0;
    padding: 40px 10px 10px 10px;
    margin-bottom: 1.5rem;
    min-height: 80px;
}

.code-output-container pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

.code-output-container code {
    font-family: monospace;
    font-size: 0.85rem;
    color: #000000;
    line-height: 1.4;
}

.code-copy-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: linear-gradient(to bottom, #ffffff 0%, #ece9d8 100%);
    border: 1px solid #7f9db9;
    padding: 3px 8px;
    border-radius: 3px;
    color: #000000;
    font-size: 0.75rem;
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.code-copy-btn:hover {
    background: linear-gradient(to bottom, #e0f0ff 0%, #c0e0ff 100%);
    border-color: #225ad7;
}

.code-copy-btn:active {
    border-color: #808080 #fff #fff #808080;
    background: #e0dbce;
}

.code-copy-btn i {
    width: 12px;
    height: 12px;
}

/* Gradient Presets */
.gradient-presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
}

.gradient-preset-card {
    background-color: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.gradient-preset-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.preset-preview {
    height: 75px;
    width: 100%;
}

.preset-details {
    padding: 0.65rem;
}

.preset-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preset-stops {
    font-size: 0.65rem;
    color: var(--text-dark);
}

/* ==========================================================================
   TAB: TRENDING PALETTES
   ========================================================================== */
.palettes-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background-color: var(--bg-panel);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 20px var(--glass-shadow);
}

.palette-filters {
    display: flex;
    gap: 0.5rem;
}

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

.palette-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: 0 8px 30px var(--glass-shadow);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
}

.palette-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}

.palette-colors-row {
    display: flex;
    height: 130px;
    width: 100%;
}

.palette-color-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 1rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: flex-grow 0.3s ease;
}

.palette-color-block span {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translate(-50%, 10px);
    font-family: monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    background-color: rgba(0, 0, 0, 0.65);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}

@media (hover: hover) {
    .palette-color-block:hover {
        flex-grow: 1.4;
    }
    .palette-color-block:hover span {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.palette-info {
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-palette-info);
}

.palette-meta h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.15rem;
}

.palette-meta span {
    font-size: 0.75rem;
    color: var(--text-dark);
}

.palette-card-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon-only {
    background-color: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    border-radius: var(--border-radius-md);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-only:hover {
    background-color: rgba(255,255,255,0.08);
    color: var(--text-main);
}

.btn-icon-only.liked {
    color: var(--accent-pink);
    background-color: rgba(236, 72, 153, 0.1);
    border-color: rgba(236, 72, 153, 0.2);
}

.btn-icon-only.liked i {
    fill: var(--accent-pink);
}

/* ==========================================================================
   TAB: CONTRAST CHECKER
   ========================================================================== */
.contrast-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
}

.contrast-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contrast-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contrast-input-card {
    background-color: #ffffff;
    border: 2px inset #7f9db9;
    border-radius: 0;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.contrast-input-card label {
    font-size: 0.8rem;
    font-weight: normal;
    color: #000000;
    text-transform: none;
}

.contrast-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.color-preview-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.contrast-picker-wrapper input[type=text] {
    background: transparent;
    border: none;
    outline: none;
    color: #000000;
    font-family: monospace;
    font-size: 1rem;
    font-weight: 600;
    flex-grow: 1;
}

.contrast-picker-wrapper input[type=color] {
    -webkit-appearance: none;
    border: none;
    width: 28px;
    height: 28px;
    cursor: pointer;
    background: transparent;
}

.contrast-picker-wrapper input[type=color]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.contrast-picker-wrapper input[type=color]::-webkit-color-swatch {
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.contrast-score-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.contrast-ratio-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.75rem;
}

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

.ratio-value {
    font-size: 2rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--text-main);
}

.contrast-standards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.standard-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.standard-row span:first-child {
    color: var(--text-muted);
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge.pass {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.fail {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Contrast Preview Box */
.contrast-preview-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contrast-preview-box {
    flex-grow: 1;
    border-radius: var(--border-radius-md);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    justify-content: center;
    min-height: 250px;
    transition: background-color 0.2s, color 0.2s;
    border: 1px solid var(--glass-border);
}

.contrast-preview-box h3 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
}

.contrast-preview-box p {
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 90%;
}

.contrast-preview-btn {
    align-self: flex-start;
    padding: 0.65rem 1.25rem;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid transparent;
    cursor: pointer;
}

.contrast-tips {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    background-color: var(--bg-card);
    padding: 1rem;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--glass-border);
}

.contrast-tips i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--accent-cyan);
}

/* ==========================================================================
   TAB: IMAGE EXTRACTOR
   ========================================================================== */
.extractor-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
}

.extractor-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 350px;
}

.dropzone {
    width: 100%;
    height: 100%;
    min-height: 300px;
    border: 2px dashed rgba(255,255,255,0.15);
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    background-color: rgba(255,255,255,0.01);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent-indigo);
    background-color: rgba(99, 102, 241, 0.03);
    box-shadow: inset 0 0 20px rgba(99, 102, 241, 0.05);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem;
    text-align: center;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    transition: color 0.3s, transform 0.3s;
}

.dropzone:hover .upload-icon {
    color: var(--accent-indigo);
    transform: translateY(-5px);
}

.dropzone-content h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.15rem;
}

.dropzone-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.dropzone-content span {
    font-size: 0.75rem;
    color: var(--text-dark);
    text-transform: uppercase;
    font-weight: 600;
}

.dropzone-preview-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
}

.dropzone-preview-container img {
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: var(--border-radius-md);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.btn-clear-image {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(0,0,0,0.7);
    border: 1px solid var(--glass-border);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}

.btn-clear-image:hover {
    background-color: var(--error);
    transform: scale(1.1);
}

.btn-clear-image i {
    width: 16px;
    height: 16px;
}

.extractor-instruction {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.extracted-swatches-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.extracted-swatch-card {
    background-color: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.extracted-swatch-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.15);
}

.extracted-swatch-color {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--glass-border);
}

.extracted-swatch-info {
    display: flex;
    flex-direction: column;
}

.extracted-swatch-hex {
    font-family: monospace;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-main);
}

.extracted-swatch-percent {
    font-size: 0.7rem;
    color: var(--text-dark);
}

.extractor-demo-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.section-subtitle {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.demo-images-row {
    display: flex;
    gap: 0.75rem;
}

.demo-img-btn {
    width: 55px;
    height: 55px;
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--glass-border);
    cursor: pointer;
    background-size: cover;
    background-position: center;
    transition: all 0.2s;
}

.demo-img-btn:hover {
    border-color: var(--accent-indigo);
    transform: scale(1.1);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1000;
}

.toast {
    background-color: var(--bg-toast);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    padding: 0.85rem 1.25rem;
    border-radius: var(--border-radius-md);
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 250px;
    backdrop-filter: blur(10px);
    transform: translateY(50px);
    opacity: 0;
    animation: toast-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes toast-in {
    to { transform: translateY(0); opacity: 1; }
}

.toast.fade-out {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-out {
    to { transform: translateX(100px); opacity: 0; }
}

.toast i {
    width: 18px;
    height: 18px;
}

.toast-success i {
    color: var(--success);
}

.toast-error i {
    color: var(--error);
}

.toast-text {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Utility Helpers */
.hidden {
    display: none !important;
}

/* Windows XP Start Menu (Mobile Hamburger Menu) */
.xp-start-menu {
    position: fixed;
    bottom: 42px;
    left: 4px;
    width: 220px;
    background-color: #ffffff;
    border: 2px solid #0053e2;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    box-shadow: 2px 2px 15px rgba(0,0,0,0.5);
    z-index: 2000;
    display: none;
    flex-direction: column;
    font-family: 'Tahoma', sans-serif;
    overflow: hidden;
}

.xp-start-menu.open {
    display: flex;
}

.start-header {
    background: linear-gradient(to bottom, #1b52e3 0%, #1f57e6 55%, #184dc8 70%, #1540a8 100%);
    border-bottom: 2px solid #3f8cf3;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border: 2px solid #fff;
    border-radius: 3px;
    overflow: hidden;
    background-color: #5faee3;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    display: block;
}

.username {
    font-weight: bold;
    font-size: 0.85rem;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.8);
}

.start-body {
    display: flex;
    background-color: #ffffff;
    height: auto;
}

.start-left {
    width: 100%;
    background-color: white;
    padding: 8px;
    display: flex;
    flex-direction: column;
}

.start-section-title {
    font-size: 0.65rem;
    color: #888;
    border-bottom: 1px solid #eee;
    padding-bottom: 2px;
    margin-bottom: 4px;
    text-transform: uppercase;
    font-weight: bold;
}

.start-programs-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.start-left .nav-item {
    background: transparent !important;
    border: none !important;
    color: black !important;
    padding: 6px 8px !important;
    width: 100% !important;
    height: auto !important;
    font-size: 0.78rem !important;
    font-weight: normal !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    cursor: pointer;
}

.start-left .nav-item:hover {
    background: #1540a8 !important;
    color: white !important;
}

.start-left .nav-item.active {
    font-weight: bold !important;
    background-color: #e2e2e2 !important;
    color: #1540a8 !important;
}

.start-left .nav-item.active:hover {
    background: #1540a8 !important;
    color: white !important;
}

.start-footer {
    background: linear-gradient(to bottom, #1540a8 0%, #184dc8 30%, #1f57e6 100%);
    border-top: 2px solid #3f8cf3;
    padding: 6px 10px;
    display: flex;
    justify-content: flex-end;
}

.start-footer-btn {
    background: transparent;
    border: none;
    color: white;
    font-family: 'Tahoma', sans-serif;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.start-footer-btn:hover {
    text-decoration: underline;
}



/* Responsive Styling */
@media (max-width: 1200px) {
    .picker-layout, .contrast-layout, .extractor-layout {
        grid-template-columns: 1fr;
    }
    .gradient-controls-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .app-container {
        flex-direction: column;
    }
    
    /* Keep app-header at bottom on mobile */
    .app-header {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        height: 40px;
        background: linear-gradient(to bottom, #245dd7 0%, #3f8cf3 9%, #1b52e3 18%, #1f57e6 55%, #184dc8 70%, #1540a8 100%);
        border-top: 2px solid #3f8cf3;
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.4);
    }

    .app-header .header-inner {
        padding: 0;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        height: 100%;
        width: 100%;
        overflow: hidden;
    }

    /* Start Button on Mobile */
    .app-header .brand {
        display: flex !important;
        align-items: center;
        height: 100%;
        padding: 0 14px;
        flex-shrink: 0;
        background: linear-gradient(to bottom, #53ab24 0%, #70d638 10%, #53ab24 85%, #3d7d17 100%) !important;
        border-top-right-radius: 8px !important;
        border-bottom-right-radius: 8px !important;
        border: 1px solid #3d7d17 !important;
        border-left: 1px solid #70d638 !important;
        border-top: 1px solid #70d638 !important;
        box-shadow: 1px 0px 4px rgba(0,0,0,0.3) !important;
    }
    
    .app-header .brand h1 {
        visibility: hidden !important;
        position: relative !important;
        font-family: 'Tahoma', sans-serif !important;
        font-weight: bold !important;
        font-size: 1.1rem !important;
        width: 55px !important;
    }

    .app-header .brand h1::after {
        content: 'start ⏶' !important;
        visibility: visible !important;
        position: absolute !important;
        left: 0 !important;
        top: -1px !important;
        color: white !important;
        font-weight: 900 !important;
        font-style: italic !important;
        text-shadow: 1px 1px 1px #000 !important;
    }

    /* Show only the active nav-item inside navbar on mobile to indicate which tab is open! */
    .app-header .nav-menu {
        display: flex !important;
        justify-content: center !important;
        flex-grow: 1 !important;
        height: 100% !important;
        margin: 0 8px !important;
        overflow: hidden !important;
    }

    .app-header .nav-menu .nav-item {
        display: none !important;
    }

    .app-header .nav-menu .nav-item.active {
        display: inline-flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        max-width: 150px !important;
        height: 28px !important;
        padding: 4px 10px !important;
        border-radius: 3px !important;
        background: linear-gradient(to bottom, #1c3a52 0%, #27567e 100%) !important;
        border: 1px solid #112233 !important;
        box-shadow: inset 1px 1px 3px rgba(0,0,0,0.8) !important;
        color: white !important;
        font-size: 0.75rem !important;
        gap: 6px !important;
    }
    
    .app-header .nav-menu .nav-item.active span {
        display: inline !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .app-header .nav-menu .nav-item.active i {
        width: 14px !important;
        height: 14px !important;
    }
    
    /* Tray on mobile */
    .app-header .header-actions {
        display: flex !important;
        height: 100%;
        background: #0c43c2;
        border-left: 1px solid #1b52e3;
        padding: 0 10px;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }

    .app-header .active-color-code {
        display: none !important;
    }

    .main-content {
        padding: 2rem 1rem 60px 1rem !important;
    }
    
    /* Gradients Tab adjustments */
    .settings-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .actions-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    /* Palettes Tab Toolbar scrollable on mobile */
    .palettes-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .palette-filters {
        display: flex;
        overflow-x: auto;
        padding-bottom: 0.25rem;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x;
        gap: 0.35rem;
        scrollbar-width: none;
    }
    
    .palette-filters::-webkit-scrollbar {
        display: none;
    }
    
    .palette-filters .btn-pill {
        flex-shrink: 0;
    }
    
    .palettes-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }
    
    .palette-colors-row {
        height: 80px !important;
    }
    
    .palette-info {
        padding: 0.75rem !important;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .palette-meta h3 {
        font-size: 0.85rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }
    
    .palette-meta span {
        font-size: 0.7rem !important;
    }
    
    .palette-like-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem !important;
    }
    
    /* Contrast Checker */
    .contrast-preview-box {
        padding: 1.5rem;
    }
    
    .preview-text-large {
        font-size: 1.75rem !important;
    }
    
    .preview-text-small {
        font-size: 0.85rem !important;
        line-height: 1.4;
    }
    
    /* Image Extractor */
    .dropzone {
        padding: 1.5rem 1rem !important;
    }
    
    .dropzone i {
        width: 32px !important;
        height: 32px !important;
        margin-bottom: 0.5rem !important;
    }
    
    .dropzone p {
        font-size: 0.85rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .extracted-swatches-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    .palette-color-block span {
        display: inline-block !important;
        opacity: 1 !important;
        transform: translate(-50%, 0) !important;
        font-size: 0.65rem !important;
        padding: 0.15rem 0.3rem !important;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }
    /* Fold inputs and columns on small phone screens */
    .color-inputs-grid {
        grid-template-columns: 1fr;
    }
    
    .extracted-swatches-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .actions-row {
        grid-template-columns: 1fr;
    }
    
    #current-tab-title {
        font-size: 1.6rem;
    }
    
    #current-tab-desc {
        font-size: 0.85rem;
    }
}

/* Selected Color Card */
.picker-selected-preview-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-inset);
    transition: all 0.3s ease;
}

.selected-color-block {
    width: 50px;
    height: 50px;
    border-radius: var(--border-radius-sm);
    border: 2px solid white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.selected-color-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.selected-color-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-dark);
}

.selected-color-value {
    font-family: monospace;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

/* Footer Credit Style */
.app-credit-footer {
    text-align: center;
    margin-top: 2rem;
    padding-bottom: 2rem;
    font-family: 'Tahoma', sans-serif;
    font-size: 0.8rem;
    color: white;
    text-shadow: 1.5px 1.5px 3px rgba(0,0,0,0.9);
}

.app-credit-footer a {
    color: #ff9800;
    text-decoration: underline;
    font-weight: bold;
}

.app-credit-footer a:hover {
    color: #ffb74d;
}
