/* ============================================
   COLOR WHEEL TOOL STYLES
   tools.suritdevelopers.com
   Dark mode support with light mode default
   ============================================ */

/* CSS Variables for Color Wheel specific styling */
:root {
    --color-1: #e64e4e;
    --color-2: #3399cc;
    --color-3: #339966;
    
    --wheel-bg: #ffffff;
    --wheel-border: #e0e0e0;
    --panel-bg: #ffffff;
    --panel-border: #e5e7eb;
    --input-bg: #f8fafc;
    --slider-track: #e2e8f0;
    --slider-fill: var(--color-2);
}

[data-theme="dark"] {
    --wheel-bg: #1e293b;
    --wheel-border: #334155;
    --panel-bg: #1e293b;
    --panel-border: #334155;
    --input-bg: #334155;
    --slider-track: #475569;
    --slider-fill: var(--color-2);
}

/* Tool Header - Title Row */
.tool-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tool-icon-wrapper {
    width: 64px;
    height: 64px;
    background: var(--color-1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 14px rgba(230, 78, 78, 0.2);
    flex-shrink: 0;
}

.tool-icon-wrapper i,
.tool-icon-wrapper svg {
    width: 32px;
    height: 32px;
}

[data-theme="dark"] .tool-icon-wrapper {
    box-shadow: 0 4px 14px rgba(230, 78, 78, 0.15);
}

.tool-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-1);
    margin: 0;
}

@media (max-width: 768px) {
    .tool-title {
        font-size: 1.75rem;
    }
    .tool-icon-wrapper {
        width: 48px;
        height: 48px;
    }
    .tool-icon-wrapper i,
    .tool-icon-wrapper svg {
        width: 24px;
        height: 24px;
    }
}
.tool-description {
    max-width: 800px;
    margin: 0 auto 1.5rem;
    color: var(--text-secondary);
    line-height: 1.7;
    text-align: center;
}

.tool-description a {
    color: var(--color-2);
    text-decoration: none;
    transition: color 0.2s ease;
}

.tool-description a:hover {
    color: var(--color-1);
}

/* ============================================
   MAIN TOOL LAYOUT
   ============================================ */
.color-wheel-tool {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2rem;
    background: var(--panel-bg);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--panel-border);
    margin-bottom: 2rem;
    transition: background-color 0.25s, border-color 0.25s;
}

@media (max-width: 900px) {
    .color-wheel-tool {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }
}

/* ============================================
   COLOR WHEEL SECTION
   ============================================ */
.wheel-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.wheel-container {
    position: relative;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .wheel-container {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#colorWheel {
    border-radius: 50%;
    cursor: crosshair;
    display: block;
}

.wheel-selector {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 0 0 2px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: box-shadow 0.15s ease;
    z-index: 10;
}

.center-preview {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 4px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: background-color 0.15s ease;
    pointer-events: none;
}

[data-theme="dark"] .center-preview {
    border-color: #1e293b;
}

/* ============================================
   SLIDER CONTROLS
   ============================================ */
.slider-controls {
    width: 100%;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.slider-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.slider-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.slider-group label i {
    color: var(--color-2);
}

.styled-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 4px;
    background: var(--slider-track);
    outline: none;
    cursor: pointer;
}

.styled-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-2);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease;
}

.styled-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.styled-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-2);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider-group span {
    min-width: 45px;
    text-align: right;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================
   CONTROLS SECTION
   ============================================ */
.controls-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.controls-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
}

.controls-section h3 i {
    color: var(--color-2);
}

/* ============================================
   HARMONY SELECTOR
   ============================================ */
.harmony-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem;
}

.harmony-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    background: var(--input-bg);
    border: 2px solid var(--panel-border);
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.harmony-btn:hover {
    border-color: var(--color-2);
    color: var(--text-primary);
}

.harmony-btn.active {
    background: rgba(51, 153, 204, 0.1);
    border-color: var(--color-2);
    color: var(--color-2);
}

.harmony-icon {
    display: flex;
    gap: 2px;
}

.harmony-icon .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* ============================================
   COLOR INPUT SECTION
   ============================================ */
.color-input-section {
    background: var(--input-bg);
    padding: 1rem;
    border-radius: 10px;
}

.input-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.input-group {
    flex: 1;
    min-width: 120px;
}

.input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.input-with-prefix {
    display: flex;
    align-items: center;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    overflow: hidden;
}

.input-prefix {
    padding: 0.5rem 0.75rem;
    background: var(--input-bg);
    color: var(--text-muted);
    font-weight: 600;
    border-right: 1px solid var(--panel-border);
}

.input-with-prefix input {
    flex: 1;
    padding: 0.5rem;
    border: none;
    background: transparent;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 0.9375rem;
    color: var(--text-primary);
    outline: none;
    text-transform: uppercase;
}

.rgb-inputs {
    display: flex;
    gap: 0.25rem;
}

.rgb-inputs input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    background: var(--panel-bg);
    font-size: 0.875rem;
    color: var(--text-primary);
    text-align: center;
    outline: none;
    transition: border-color 0.2s ease;
}

.rgb-inputs input:focus {
    border-color: var(--color-2);
}

/* Input validation states */
.input-with-prefix.input-valid {
    border-color: var(--color-3);
}

.input-with-prefix.input-invalid {
    border-color: var(--color-1);
}

.rgb-inputs input.input-valid {
    border-color: var(--color-3);
}

.rgb-inputs input.input-invalid {
    border-color: var(--color-1);
}

.input-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    opacity: 0.8;
}

.input-hint i {
    flex-shrink: 0;
}

.color-input-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

/* Apply button - override custom_styles.css generic button rules */
button.apply-color-btn,
.apply-color-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    background: var(--color-2);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
    transform: none;
    box-shadow: none;
    line-height: 1.4;
    min-width: 90px;
    justify-content: center;
}

button.apply-color-btn:hover,
.apply-color-btn:hover {
    background: #2d8ab8;
    transform: none;
    box-shadow: none;
}

button.apply-color-btn:focus,
.apply-color-btn:focus {
    outline: 2px solid var(--color-2);
    outline-offset: 2px;
    transform: none;
    box-shadow: none;
}

button.apply-color-btn:active,
.apply-color-btn:active {
    transform: none;
    box-shadow: none;
}

/* Success state - green flash */
button.apply-color-btn.btn-success,
.apply-color-btn.btn-success {
    background: var(--color-3);
    pointer-events: none;
}

/* Error state - red flash */
button.apply-color-btn.btn-error,
.apply-color-btn.btn-error {
    background: var(--color-1);
    pointer-events: none;
}

/* ============================================
   PALETTE SECTION
   ============================================ */
.palette-section {
    background: var(--panel-bg);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--panel-border);
    margin-bottom: 2rem;
    transition: background-color 0.25s, border-color 0.25s;
}

.palette-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.palette-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.palette-header h2 i {
    color: var(--color-2);
}

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

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    border-color: var(--color-2);
    color: var(--text-primary);
}

.action-btn.primary {
    background: var(--color-2);
    border-color: var(--color-2);
    color: #fff;
}

.action-btn.primary:hover {
    background: #2d8ab8;
    border-color: #2d8ab8;
}

/* Palette Container */
.palette-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.palette-color {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.palette-color:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .palette-color {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .palette-color:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.color-swatch {
    height: 100px;
    position: relative;
}

.color-label {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #333;
}

.color-info {
    padding: 0.75rem;
    background: var(--panel-bg);
}

.color-hex {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

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

.copy-indicator {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    font-size: 0.6875rem;
    color: #333;
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.palette-color:hover .copy-indicator {
    opacity: 1;
}

/* ============================================
   COLOR DETAILS PANEL
   ============================================ */
.color-details-panel {
    background: var(--panel-bg);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--panel-border);
    margin-bottom: 2rem;
    transition: background-color 0.25s, border-color 0.25s;
}

.color-details-panel h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem;
}

.color-details-panel h3 i {
    color: var(--color-2);
}

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

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0.875rem;
    background: var(--input-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.detail-item:hover {
    background: rgba(51, 153, 204, 0.1);
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ============================================
   COPY NOTIFICATION
   ============================================ */
.copy-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--color-3);
    color: #fff;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 1000;
}

.copy-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ============================================
   ERROR MESSAGE
   ============================================ */
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background: var(--error-bg);
    border: 1px solid var(--error-color);
    border-radius: 12px;
    color: var(--error-color);
    text-align: center;
    margin-bottom: 1.5rem;
}

.error-message i {
    width: 24px;
    height: 24px;
}

.error-help {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.error-help a {
    color: var(--color-2);
}

/* ============================================
   EXPORT MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--panel-bg);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--panel-border);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-header h3 i {
    color: var(--color-2);
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--input-bg);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.export-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 480px) {
    .export-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

.export-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--input-bg);
    border: 2px solid var(--panel-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-option:hover {
    border-color: var(--color-2);
}

.export-option.active {
    background: rgba(51, 153, 204, 0.1);
    border-color: var(--color-2);
}

.export-option i {
    color: var(--color-2);
}

.export-option span {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
}

.export-preview {
    background: var(--input-bg);
    border-radius: 10px;
    padding: 1rem;
}

.export-preview pre {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 1rem;
    margin: 0 0 1rem;
    overflow-x: auto;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 250px;
}

/* ============================================
   INFO CARDS & CONTENT
   ============================================ */
.info-card {
    background: var(--panel-bg);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--panel-border);
    margin-bottom: 1.5rem;
    transition: background-color 0.25s, border-color 0.25s;
}

.info-card h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1.25rem;
}

.info-card h2 i {
    color: var(--color-2);
}

/* Steps List */
.steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: step-counter;
}

.steps-list li {
    position: relative;
    padding-left: 2.5rem;
    padding-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.steps-list li:last-child {
    padding-bottom: 0;
}

.steps-list li::before {
    content: counter(step-counter);
    counter-increment: step-counter;
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    background: var(--color-2);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.steps-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(51, 153, 204, 0.08);
    border-radius: 10px;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.steps-tip i {
    color: var(--color-2);
    flex-shrink: 0;
    margin-top: 2px;
}

.steps-tip a {
    color: var(--color-2);
}

/* Harmony Guide */
.harmony-guide {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.guide-item {
    padding: 1rem;
    background: var(--input-bg);
    border-radius: 10px;
}

.guide-item h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-2);
    margin: 0 0 0.5rem;
}

.guide-item p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Related Tools Grid */
.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.related-tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.related-tool-card:hover {
    border-color: var(--color-2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.related-tool-card i {
    color: var(--color-2);
}

.related-tool-card span {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.related-tool-card small {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
}

/* ============================================
   FAQ STYLES
   ============================================ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.faq-item {
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.faq-item:hover,
.faq-item.open {
    border-color: var(--color-2);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--input-bg);
    border: none;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s ease;
}

.faq-question:hover {
    background: rgba(51, 153, 204, 0.08);
}

.faq-question i {
    color: var(--text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.faq-item.open .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    padding: 1rem 1.25rem;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.7;
    border-top: 1px solid var(--panel-border);
}

.faq-answer a {
    color: var(--color-2);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    .wheel-container {
        width: 260px;
        height: 260px;
    }
    
    #colorWheel {
        width: 260px;
        height: 260px;
    }
    
    .center-preview {
        width: 60px;
        height: 60px;
    }
    
    .harmony-buttons {
        grid-template-columns: 1fr;
    }
    
    .palette-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .palette-actions {
        width: 100%;
    }
    
    .action-btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .color-wheel-tool {
        padding: 1rem;
    }
    
    .wheel-container {
        width: 240px;
        height: 240px;
    }
    
    #colorWheel {
        width: 240px;
        height: 240px;
    }
    
    .slider-group {
        flex-wrap: wrap;
    }
    
    .slider-group label {
        min-width: 100%;
        margin-bottom: 0.25rem;
    }
    
    .input-row {
        flex-direction: column;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   PRECISION COLOR PICKER
   Brightness/saturation field + hue rail + live readout
   ============================================ */

.wheel-section {
    width: 100%;
    max-width: 340px;
}

.picker-shell {
    display: flex;
    gap: 0.875rem;
    width: 100%;
}

.sv-field {
    position: relative;
    flex: 1;
    height: 210px;
    border-radius: 12px;
    cursor: crosshair;
    touch-action: none;
    outline: none;
    border: 1px solid var(--panel-border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .sv-field {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.sv-field:focus-visible,
.hue-rail:focus-visible,
#colorWheel:focus-visible {
    box-shadow: 0 0 0 3px rgba(51, 153, 204, 0.5);
}

#svCanvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 11px;
}

.sv-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.35);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 5;
}

.hue-rail {
    position: relative;
    flex-shrink: 0;
    width: 26px;
    height: 210px;
    border-radius: 13px;
    cursor: pointer;
    touch-action: none;
    outline: none;
    border: 1px solid var(--panel-border);
    background: linear-gradient(to bottom,
        hsl(0, 100%, 50%),
        hsl(60, 100%, 50%),
        hsl(120, 100%, 50%),
        hsl(180, 100%, 50%),
        hsl(240, 100%, 50%),
        hsl(300, 100%, 50%),
        hsl(360, 100%, 50%));
}

.hue-thumb {
    position: absolute;
    top: 0;
    left: 50%;
    width: 34px;
    height: 12px;
    border-radius: 6px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Live readout row */
.picker-readout {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.picker-swatch {
    flex-shrink: 0;
    width: 96px;
    height: 46px;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.picker-swatch span {
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.2rem 0.45rem;
    border-radius: 5px;
}

.picker-numbers {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    flex: 1;
}

.num-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-width: 0;
}

.num-field label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.num-field input {
    width: 100%;
    min-width: 0;
    padding: 0.45rem 0.4rem;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.85rem;
    text-align: center;
    -moz-appearance: textfield;
}

.num-field input::-webkit-outer-spin-button,
.num-field input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.num-field input:focus {
    outline: none;
    border-color: var(--color-2);
}

.picker-icon-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--color-2);
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

/* A display value on the class would otherwise beat the [hidden] attribute */
.picker-icon-btn[hidden] {
    display: none;
}

.picker-icon-btn:hover {
    border-color: var(--color-2);
    background: rgba(51, 153, 204, 0.1);
}

/* Harmony wheel block */
.wheel-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding-top: 0.25rem;
}

.wheel-block-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.wheel-block-head i,
.wheel-block-head svg {
    color: var(--color-2);
}

.wheel-block-head small {
    font-weight: 400;
    font-size: 0.72rem;
    opacity: 0.75;
}

#colorWheel {
    width: 100%;
    height: 100%;
    touch-action: none;
    outline: none;
}

@media (max-width: 768px) {
    .wheel-section {
        max-width: 320px;
        margin: 0 auto;
    }

    .sv-field,
    .hue-rail {
        height: 190px;
    }
}

@media (max-width: 480px) {
    .sv-field,
    .hue-rail {
        height: 170px;
    }

    .picker-readout {
        flex-wrap: wrap;
    }

    .picker-swatch {
        width: 100%;
    }
}

/* ============================================
   TOOL LAYOUT
   Picker and wheel side by side, harmony modes and the
   generated scheme stacked underneath in the same card so
   the palette is visible without scrolling.
   ============================================ */

.color-wheel-tool {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tool-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.75rem;
    align-items: start;
}

.wheel-section {
    width: auto;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
}

.sv-field {
    height: 230px;
}

.hue-rail {
    height: 230px;
}

/* Harmony wheel column */
.wheel-block {
    width: 260px;
    flex-shrink: 0;
    gap: 0.5rem;
    padding-top: 0;
}

.wheel-container {
    width: 260px;
    height: 260px;
}

.wheel-block-hint {
    font-size: 0.72rem;
    color: var(--text-secondary);
    opacity: 0.75;
}

/* Headings that used to be scoped to .controls-section */
.harmony-selector h3,
.color-input-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
}

.harmony-selector h3 i,
.color-input-section h3 i {
    color: var(--color-2);
}

.harmony-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Manual entry sits on one line under the picker */
.color-input-section {
    padding: 0.75rem 0.875rem;
}

.color-input-section .input-row {
    align-items: flex-end;
    gap: 0.75rem;
}

.color-input-section .input-group {
    min-width: 96px;
}

.color-input-section .color-input-actions {
    margin-top: 0;
    flex-shrink: 0;
}

/* The palette now lives inside the tool card */
.palette-section {
    background: transparent;
    border: 0;
    border-top: 1px solid var(--panel-border);
    border-radius: 0;
    padding: 1.25rem 0 0;
    margin: 0;
}

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

.palette-container {
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    gap: 0.75rem;
}

.color-swatch {
    height: 84px;
}

@media (max-width: 720px) {
    /* Stack, and push the wheel below the scheme - on a phone the order that
       matters is pick a colour, choose a harmony, see the result. */
    .tool-top {
        display: contents;
    }

    .wheel-section {
        width: 100%;
        max-width: none;
        order: 1;
    }

    .harmony-selector {
        order: 2;
    }

    .palette-section {
        order: 3;
    }

    .wheel-block {
        order: 4;
        align-self: center;
        padding-top: 0.5rem;
    }

    .harmony-buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .harmony-buttons {
        grid-template-columns: 1fr;
    }

    .color-input-section .input-row {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .palette-container {
        grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
    }
}

/* Vertical budget: keep the generated scheme inside the first screen */

.color-wheel-tool {
    gap: 1.25rem;
    padding: 1.5rem;
}

.wheel-section {
    gap: 0.75rem;
}

.sv-field,
.hue-rail {
    height: 200px;
}

.wheel-block {
    width: 240px;
}

.wheel-container {
    width: 240px;
    height: 240px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.1);
}

.picker-swatch {
    height: 42px;
}

/* Manual entry reads as one more row of the picker, not a separate panel */
.color-input-section {
    background: transparent;
    padding: 0;
}

.color-input-section .input-row {
    gap: 0.5rem;
}

.color-input-section .input-group label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.input-hint {
    margin-top: 0.4rem;
    font-size: 0.7rem;
}

.harmony-selector h3 {
    margin-bottom: 0.6rem;
}

.palette-section {
    padding-top: 1rem;
}

.palette-header {
    margin-bottom: 0.75rem;
}

.palette-container {
    gap: 0.625rem;
}

.color-swatch {
    height: 72px;
}

.color-info {
    padding: 0.5rem 0.625rem;
}

.color-hex {
    font-size: 0.85rem;
    margin-bottom: 0.1rem;
}

.color-rgb {
    font-size: 0.68rem;
}

.color-wheel-tool {
    padding: 1.25rem;
}

.color-swatch {
    height: 64px;
}

.input-hint {
    margin-top: 0.3rem;
    line-height: 1.2;
}

/* Wheel proportions at the smaller 240px size */
.center-preview {
    width: 58px;
    height: 58px;
    border-width: 3px;
}

.picker-shell {
    gap: 1.125rem;
}

/* Two-colour harmonies should not stretch into two giant banners -
   auto-fill keeps every swatch the same size whatever the scheme */
.palette-container {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}

@media (max-width: 560px) {
    .palette-container {
        grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    }

    .center-preview {
        width: 50px;
        height: 50px;
    }
}

/* Readout: the swatch takes the slack, the number fields stay compact */
.picker-swatch {
    flex: 1 1 auto;
    width: auto;
    min-width: 110px;
}

.picker-numbers {
    flex: 0 0 auto;
}

.num-field {
    flex: 0 0 74px;
}

.color-input-section .input-group:first-child {
    flex: 0 1 190px;
}

@media (max-width: 560px) {
    .picker-swatch {
        flex: 1 1 100%;
        width: 100%;
    }

    .picker-numbers {
        flex: 1 1 100%;
    }

    .num-field {
        flex: 1 1 auto;
    }
}

/* Three digits have to fit - "249" was being clipped to "24" on narrow screens */
.rgb-inputs input {
    min-width: 0;
    padding: 0.45rem 0.25rem;
    -moz-appearance: textfield;
}

.rgb-inputs input::-webkit-outer-spin-button,
.rgb-inputs input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

@media (max-width: 560px) {
    .color-input-section .input-row {
        flex-wrap: wrap;
    }

    .color-input-section .input-group:first-child {
        flex: 1 1 100%;
    }

    .color-input-section .input-group + .input-group {
        flex: 1 1 60%;
    }
}

/* ============================================
   FORMAT READOUT, SHADES, RECENTS, HAND-OFF
   ============================================ */

/* The readout value is now a copy button */
.picker-value {
    border: 0;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    max-width: 95%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: transform 0.12s ease;
}

.picker-value:hover {
    transform: scale(1.04);
}

.picker-value:active {
    transform: scale(0.97);
}

/* The colour field takes a whole CSS colour now, so no # prefix */
.input-with-prefix.no-prefix .input-prefix {
    display: none;
}

.input-with-prefix.no-prefix input {
    padding-left: 0.75rem;
}

/* Shades and tints */
.shades-block {
    margin-top: 1rem;
}

.shades-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.shades-head i,
.shades-head svg {
    color: var(--color-2);
}

.shades-head small {
    font-weight: 400;
    font-size: 0.72rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.shades-strip {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    gap: 3px;
    border-radius: 10px;
    overflow: hidden;
}

.shade-cell {
    position: relative;
    height: 46px;
    border: 0;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.shade-cell:hover,
.shade-cell:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
    outline: none;
    z-index: 2;
}

.shade-cell.is-base {
    box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px rgba(0, 0, 0, 0.35);
}

.shade-hex {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.56rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    padding-bottom: 3px;
    opacity: 0;
    transition: opacity 0.12s ease;
}

.shade-cell:hover .shade-hex,
.shade-cell:focus-visible .shade-hex {
    opacity: 1;
}

/* Recent colours, tucked under the wheel */
.recent-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.35rem;
}

.recent-row[hidden] {
    display: none;
}

.recent-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.recent-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.recent-chip {
    width: 19px;
    height: 19px;
    border-radius: 5px;
    border: 1px solid var(--panel-border);
    padding: 0;
    cursor: pointer;
    transition: transform 0.12s ease;
}

.recent-chip:hover,
.recent-chip:focus-visible {
    transform: scale(1.18);
    outline: none;
    border-color: var(--color-2);
}

/* Hand-off links */
.handoff-line {
    margin: 0.9rem 0 0;
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.handoff-line a {
    color: var(--color-2);
    text-decoration: none;
    font-weight: 500;
}

.handoff-line a:hover {
    text-decoration: underline;
}

.link-btn {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--color-2);
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.link-btn:hover {
    color: var(--color-1);
}

/* Palette swatches are keyboard operable */
.palette-color:focus-visible {
    outline: 3px solid var(--color-2);
    outline-offset: 2px;
}

@media (max-width: 560px) {
    .shades-strip {
        grid-template-columns: repeat(6, 1fr);
        gap: 4px;
    }

    .shade-cell {
        height: 40px;
        border-radius: 6px;
    }

    .shade-hex {
        opacity: 1;
    }
}

/* The hint is a flex row, so its message has to be one item or the words
   get spread apart by the gap */
.input-hint > span {
    flex: 1;
    min-width: 0;
}

.input-hint code {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.95em;
    opacity: 0.95;
}
