/* ==========================================================================
   SHADCN/UI MINIMALIST SYSTEM (PRETO E BRANCO)
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Paleta Shadcn Neutra (Dark Mode Puro) */
    --bg-black: #000000;
    --card-bg: #09090b;
    --card-border: #27272a;
    --card-border-hover: #3f3f46;
    
    --text-primary: #fafafa;
    --text-muted: #a1a1aa;
    --text-dim: #71717a;
    
    --ui-white: #ffffff;
    --ui-gray-light: #e4e4e7;
    --ui-gray-dark: #18181b;
    --ui-border-focus: #52525b;
    
    --accent-red: #ef4444;
    --accent-red-muted: rgba(239, 68, 68, 0.1);
    --accent-blue: #3b82f6;
    
    /* Fontes */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--bg-black);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
header {
    padding: 3rem 1.5rem 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--card-border);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
}

.logo h1 {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 500;
    letter-spacing: -0.04em;
    color: var(--text-primary);
}

.logo h1 span {
    color: var(--text-primary);
    font-weight: 800; /* Unmixer em negrito */
    border-bottom: 2px solid var(--text-primary);
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 0.5rem;
    letter-spacing: 0.02em;
}

/* ==========================================================================
   LAYOUT GERAL (APROVEITA MAIS ÁREA)
   ========================================================================== */
.app-container {
    max-width: 1400px; /* Largura expandida */
    margin: 3rem auto 5rem auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* Grid Layout Principal (Responsivo e Lado a Lado) */
.grid-main {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 2.5rem;
    align-items: start;
}

.grid-secondary {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

.grid-col {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* ==========================================================================
   SHADCN CARDS (BORDAS SUTIS E PRETO SÓLIDO)
   ========================================================================== */
.glass-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px; /* Cantos Shadcn */
    padding: 2rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.card-header {
    margin-bottom: 1.75rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.precision-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.btn-improve-precision {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--card-border);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.btn-improve-precision:hover {
    border-color: var(--card-border-hover);
    color: var(--text-primary);
}

.btn-improve-precision:disabled {
    opacity: 0.5;
    cursor: default;
}

.badge-precision {
    background: var(--ui-gray-dark);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--font-heading);
}

/* ==========================================================================
   INPUTS DE COR E PREVIEW
   ========================================================================== */
.color-picker-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.color-preview-container {
    width: 100%;
    height: 120px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--card-border);
}

.color-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    position: relative;
}

/* Tabuleiro transparente sutil */
.color-preview-container::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: linear-gradient(45deg, #18181b 25%, transparent 25%), 
                      linear-gradient(-45deg, #18181b 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, #18181b 75%), 
                      linear-gradient(-45deg, transparent 75%, #18181b 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
}

.color-preview span {
    z-index: 1;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-black);
    padding: 0.35rem 0.85rem;
    border-radius: 4px;
    border: 1px solid var(--card-border);
    letter-spacing: 0.05em;
}

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

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

.input-group label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.hex-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-black);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: border-color 0.15s;
}

.hex-input-wrapper:focus-within {
    border-color: var(--ui-border-focus);
}

.hex-input-wrapper span {
    color: var(--text-dim);
    font-family: var(--font-heading);
    font-weight: 600;
    margin-right: 0.25rem;
    user-select: none;
}

.hex-input-wrapper input {
    background: transparent;
    border: none;
    outline: none;
    color: inherit;
    font-family: var(--font-heading);
    font-weight: 600;
    width: 100%;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.color-picker-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-black);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    height: 42px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s;
}

.color-picker-input-wrapper:hover {
    border-color: var(--card-border-hover);
}

.color-picker-input-wrapper input[type="color"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.color-picker-input-wrapper i {
    color: var(--text-muted);
    width: 1.1rem;
    height: 1.1rem;
}

/* ==========================================================================
   SLIDERS E CONTROLE DE DILUIÇÃO
   ========================================================================== */
.water-dilution-section {
    background: var(--bg-black);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 1.25rem;
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.label-with-icon {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
}

#opacity-percentage {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--ui-gray-dark);
    border: 1px solid var(--card-border);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}

.premium-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--ui-gray-dark);
    outline: none;
    margin-bottom: 1.25rem;
}

.premium-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--ui-white);
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: transform 0.1s;
}

.premium-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.dilution-result-box {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    background: var(--ui-gray-dark);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--card-border);
}

/* Becker Estilo Minimalista */
.glass-beaker {
    position: relative;
    width: 36px;
    height: 46px;
    border: 2px solid var(--text-muted);
    border-top: none;
    border-radius: 0 0 4px 4px;
    overflow: hidden;
}

.beaker-fill {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.beaker-fill.water {
    background: rgba(255, 255, 255, 0.15);
    z-index: 1;
}

.beaker-fill.paint {
    z-index: 2;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.dilution-text-info {
    flex: 1;
}

.ratio-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

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

/* ==========================================================================
   MISTURA ANIMADA (SHADER WEBGL)
   ========================================================================== */
.mix-shader-section {
    margin-bottom: 1.5rem;
}

.mix-shader-canvas-wrapper {
    width: 100%;
    height: 340px;
    border-radius: 6px;
    border: 1px solid var(--card-border);
    overflow: hidden;
    background: var(--bg-black);
}

#mix-shader-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.mix-shader-caption {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
    text-align: center;
    letter-spacing: 0.01em;
}

/* ==========================================================================
   RESULTADOS DA MISTURA
   ========================================================================== */
.comparison-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-black);
    padding: 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--card-border);
    margin-bottom: 1.5rem;
}

.comparison-half {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.comp-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-dim);
}

.comp-color {
    height: 42px;
    border-radius: 4px;
    border: 1px solid var(--card-border);
    position: relative;
    overflow: hidden;
}

.comp-color::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(45deg, #18181b 25%, transparent 25%), 
                      linear-gradient(-45deg, #18181b 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, #18181b 75%), 
                      linear-gradient(-45deg, transparent 75%, #18181b 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
    z-index: -1;
}

.comparison-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: var(--ui-gray-dark);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
}

.comparison-divider i {
    width: 0.95rem;
    height: 0.95rem;
}

/* Lista de Proporções */
.paint-mix-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.paint-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    background: var(--bg-black);
    border: 1px solid var(--card-border);
    padding: 0.65rem 0.85rem;
    border-radius: 6px;
    transition: border-color 0.15s;
}

.paint-row:hover {
    border-color: var(--card-border-hover);
}

.paint-color-swatch {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.paint-info-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.paint-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
}

.paint-bar-bg {
    width: 100%;
    height: 4px;
    background: var(--ui-gray-dark);
    border-radius: 2px;
    overflow: hidden;
}

.paint-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease-out;
}

.paint-amount {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    min-width: 55px;
}

.paint-amount span {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* ==========================================================================
   BOTÕES SHADCN (PRETO E BRANCO SÓLIDOS)
   ========================================================================== */
.actions-row {
    display: flex;
    gap: 1rem;
}

.btn-primary {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--ui-white);
    color: var(--bg-black);
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1.25rem;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.1s;
}

.btn-primary:hover {
    background-color: var(--ui-gray-light);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-text-danger {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    transition: background-color 0.15s;
}

.btn-text-danger:hover {
    background: var(--accent-red-muted);
}

/* ==========================================================================
   EXTRAÇÃO DE CORES DE IMAGEM & MARCADORES (PINS)
   ========================================================================== */
.upload-area {
    width: 100%;
    min-height: 220px;
    border: 1px dashed var(--card-border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--bg-black);
    transition: border-color 0.15s, background-color 0.15s;
    position: relative;
}

.upload-area:hover, .upload-area.drag-over {
    border-color: var(--ui-border-focus);
    background: var(--ui-gray-dark);
}

.file-input-hidden {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 5;
}

.upload-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
    pointer-events: none;
    color: var(--text-muted);
}

.upload-text-main {
    font-weight: 500;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
}

.upload-text-sub {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Wrapper da imagem que vai conter os marcadores */
.image-preview-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 1.5rem;
    background: var(--bg-black);
    width: 100%;
}

.canvas-markers-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    max-height: 100%;
}

.canvas-markers-container img {
    display: block;
    max-width: 100%;
    max-height: 380px; /* Altura controlada */
    object-fit: contain;
    cursor: crosshair; /* Cursor estilo conta-gotas */
    user-select: none;
    -webkit-user-drag: none;
}

/* Marcadores de Cores na Imagem */
.color-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.8), inset 0 0 2px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transform: translate(-50%, -50%); /* Centraliza no ponto */
    z-index: 10;
    transition: transform 0.15s, border-color 0.15s;
}

.color-marker:hover, .color-marker.active {
    transform: translate(-50%, -50%) scale(1.3);
    border-color: #ffffff;
    z-index: 15;
}

.color-marker::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.3);
}

/* Marcador temporário de clique customizado */
.color-marker.custom-marker {
    border-color: #ffffff;
    border-style: dashed;
    animation: pulse-marker 1.5s infinite;
}

@keyframes pulse-marker {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.image-preview-actions {
    width: 100%;
    display: flex;
    justify-content: center;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.btn-secondary:hover {
    background-color: var(--ui-gray-dark);
    border-color: var(--card-border-hover);
}

.extracted-palette-section {
    margin-top: 1.5rem;
    border-top: 1px solid var(--card-border);
    padding-top: 1.25rem;
}

.extracted-palette-section h3 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.section-instruction {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.extracted-colors-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.extracted-color-item {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid var(--card-border);
    transition: transform 0.15s, border-color 0.15s;
    position: relative; /* Mantido relativo para conter o botão de remoção */
}

.extracted-color-item:hover, .extracted-color-item.active {
    transform: translateY(-2px);
    border-color: var(--text-primary);
}

/* Botão de remoção de Pin no Swatch */
.btn-delete-pin {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--accent-red);
    color: #ffffff;
    border: none;
    font-size: 9px;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.1s ease;
    z-index: 10;
}

.extracted-color-item:hover .btn-delete-pin {
    opacity: 1;
}

.btn-delete-pin:hover {
    transform: scale(1.15);
}


/* Indicador pequeno de número sobre a cor */
.extracted-color-item::after {
    content: attr(data-index);
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #000;
    color: #fff;
    font-size: 8px;
    padding: 0 3px;
    border-radius: 2px;
    border: 0.5px solid var(--card-border);
    font-weight: bold;
}

/* ==========================================================================
   MINHAS PALETAS SALVAS
   ========================================================================== */
.saved-colors-container {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 380px;
    overflow-y: auto;
    transition: all 0.2s ease;
    min-height: 120px; /* Garante área para arrastar mesmo vazia */
}

.saved-colors-container.drag-over {
    outline: 2px dashed var(--text-muted);
    outline-offset: 4px;
    background: var(--ui-gray-dark);
}

/* Evita que elementos filhos interceptem o drop de cor */
.saved-colors-container.drag-over * {
    pointer-events: none !important;
}

.saved-colors-container::-webkit-scrollbar {
    width: 4px;
}

.saved-colors-container::-webkit-scrollbar-track {
    background: var(--bg-black);
}

.saved-colors-container::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 2px;
}

.saved-colors-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

.saved-color-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-black);
    border: 1px solid var(--card-border);
    padding: 0.65rem 0.85rem;
    border-radius: 6px;
    transition: border-color 0.15s;
}

.saved-color-row:hover {
    border-color: var(--card-border-hover);
}

.saved-color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid var(--card-border);
    cursor: pointer;
}

.saved-color-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0; /* Permite truncar o texto */
}

.saved-color-hex {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
}

.saved-color-hex:hover {
    text-decoration: underline;
}

.saved-color-mix-summary {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-delete-saved {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    transition: color 0.15s, background-color 0.15s;
}

.btn-delete-saved:hover {
    background: var(--ui-gray-dark);
    color: var(--accent-red);
}

.btn-delete-saved i {
    width: 0.85rem;
    height: 0.85rem;
}

/* Estados Vazios */
.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dim);
}

.empty-sub {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
    text-align: center;
    padding: 2.5rem 1.5rem;
    border-top: 1px solid var(--card-border);
    margin-top: auto;
}

.footer-container p {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   HARMONIAS & TONS (ESTILO SHADCN)
   ========================================================================== */
.card-harmonies {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tones-section, .harmonies-section {
    display: flex;
    flex-direction: column;
}

.tones-section h3, .harmonies-section h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.25rem;
}

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

.tone-item, .harmony-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tone-label, .harmony-label {
    font-size: 0.65rem;
    color: var(--text-dim);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tone-swatch, .harmony-swatch {
    height: 38px;
    border-radius: 4px;
    border: 1px solid var(--card-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    position: relative;
}

.tone-swatch:hover, .harmony-swatch:hover {
    transform: translateY(-2px);
    border-color: var(--text-primary);
}

.tone-swatch span {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    background: rgba(0,0,0,0.25);
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
    letter-spacing: 0.02em;
}

.harmonies-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

/* Feedback visual de arraste */
.dragging {
    opacity: 0.4 !important;
    transform: scale(0.95);
    outline: 2px dashed var(--text-primary);
}

/* ==========================================================================
   RESPONSIVIDADE E MOBILE DECENTE
   ========================================================================== */
@media (max-width: 968px) {
    .grid-main, .grid-secondary {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .app-container {
        margin: 1.5rem auto 3rem auto;
        padding: 0 1rem;
        gap: 1.5rem;
    }
    
    header {
        padding: 2rem 1rem 1.5rem 1rem;
    }
    
    .glass-card {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .glass-card {
        padding: 1.25rem 1rem;
        border-radius: 6px;
    }
    
    .logo h1 {
        font-size: 1.85rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .card-header {
        margin-bottom: 1.25rem;
        padding-bottom: 0.75rem;
    }
    
    .card-header h2 {
        font-size: 1.15rem;
    }
    
    .inputs-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .color-picker-input-wrapper {
        height: 40px;
    }
    
    .dilution-result-box {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        padding: 0.75rem;
    }
    
    .glass-beaker {
        width: 32px;
        height: 42px;
    }
    
    .ratio-title {
        font-size: 0.85rem;
    }
    
    .ratio-desc {
        font-size: 0.7rem;
    }
    
    .paint-row {
        grid-template-columns: auto 1fr auto;
        padding: 0.5rem 0.75rem;
        gap: 0.75rem;
    }
    
    .paint-name {
        font-size: 0.75rem;
    }
    
    .paint-amount {
        font-size: 0.75rem;
        min-width: 48px;
    }
    
    .paint-color-swatch {
        width: 14px;
        height: 14px;
    }
    
    .canvas-markers-container img {
        max-height: 280px;
    }
    
    .color-marker {
        width: 22px; /* Maior no mobile para facilitar o toque de dedos */
        height: 22px;
    }
    
    .color-marker:hover, .color-marker.active {
        transform: translate(-50%, -50%) scale(1.15);
    }
    
    .extracted-color-item {
        width: 38px;
        height: 38px;
    }
    
    .saved-color-row {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }
    
    .saved-color-swatch {
        width: 20px;
        height: 20px;
    }
    
    .saved-color-hex {
        font-size: 0.75rem;
    }
    
    .saved-color-mix-summary {
        font-size: 0.65rem;
        max-width: 170px;
    }
    
    .btn-primary {
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
    }
    
    .beaker-water, .beaker-paint {
        transition: none; /* Melhora performance em celulares antigos */
    }
    
    .btn-delete-pin {
        opacity: 1 !important; /* Visível por padrão no mobile */
        top: -5px;
        right: -5px;
        width: 16px;
        height: 16px;
        font-size: 10px;
    }
}


