/* Main Layout Overhaul */
.palette-layout {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    padding: 1rem 0;
}

.honeycomb-section {
    flex: 1;
    min-width: 0;
    /* Allow shrinking */
}

.output-section {
    flex: 0 0 320px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 2rem;
}

.honeycomb-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    padding: 2rem;
    position: relative;
    backdrop-filter: blur(10px);
}

.honeycomb-grid::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(var(--accent-color-rgb), 0.03);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    z-index: -1;
}

/* Dense Hexagon Logic 
   Width: 20px
   Height: 24px
*/
.hexagon-wrapper {
    width: 20px;
    height: 24px;
    margin: 1px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}


.hexagon-wrapper:hover {
    transform: scale(1.6);
    z-index: 50;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.hexagon {
    width: 100%;
    height: 100%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: #ccc;
    transition: all 0.2s;
}

/* Selected State */
.hexagon-wrapper.active .hexagon {
    box-shadow: 0 0 0 2px var(--accent-color), inset 0 0 0 2px rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.honeycomb-row {
    display: flex;
    justify-content: center;
    margin-top: -5px;
    /* Tighter vertical packing */
}

.honeycomb-row:first-child {
    margin-top: 0;
}

/* Result Bar */
/* .color-preview-bar is removed as it's replaced by .output-section content */

.large-swatch {
    width: 100%;
    height: 120px;
    border-radius: 12px;
    background: var(--accent-color);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.color-details {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.code-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.code-group label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.input-wrapper input {
    background: var(--bg-color);
    border: 1px solid var(--panel-border);
    color: var(--text-color);
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    width: 100%;
}

.copy-tiny {
    background: var(--button-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-muted);
    border-radius: 8px;
    padding: 0 1rem;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.copy-tiny:hover {
    background: var(--accent-color);
    color: white;
}

@media (max-width: 900px) {
    .palette-layout {
        flex-direction: column;
        align-items: stretch;
    }

    .output-section {
        flex: none;
        position: static;
    }
}