/* allpaintcolours.co.uk — minimal tool aesthetic */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #111;
    background: #fff;
    line-height: 1.5;
    font-size: 15px;
}

a {
    color: #111;
    text-decoration: underline;
}
a:hover {
    color: #555;
}

/* Layout */

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

/* Header */

header {
    border-bottom: 1px solid #eee;
    padding: 12px 0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 100;
}
header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.site-title {
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}
nav a {
    margin-left: 20px;
    text-decoration: none;
    font-size: 14px;
    color: #555;
}
nav a:hover {
    color: #111;
}

/* Page header */

.page-header {
    padding: 24px 0 16px;
}
.page-header h1 {
    font-size: 22px;
    font-weight: 700;
}
.page-header p {
    color: #666;
    font-size: 14px;
    margin-top: 4px;
}

/* Browse toolbar (sticky search + filters + band nav) */

.browse-toolbar {
    position: sticky;
    top: 49px;  /* below site header */
    background: #fff;
    z-index: 50;
    padding: 8px 0 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 8px;
}

/* Top row: search + manufacturer checkboxes side by side */

.toolbar-top {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 6px;
}
.toolbar-top .search-box {
    flex-shrink: 0;
    width: 280px;
}
.toolbar-top .filters {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
}
.toolbar-top .filters label {
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}
.toolbar-top .filters input[type="checkbox"] {
    margin: 0;
}
.toolbar-top .filters .lime-filter {
    color: #555;
}

/* Band navigation pills */

.band-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px 0 8px;
    scrollbar-width: none;
}
.band-nav::-webkit-scrollbar {
    display: none;
}
.band-nav a {
    flex-shrink: 0;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 20px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.band-nav a:hover {
    background: #f5f5f5;
    border-color: #bbb;
}
.band-nav a.active {
    background: #222;
    color: #fff;
    border-color: #222;
}
.band-count {
    font-weight: 400;
    color: #999;
    font-size: 11px;
    margin-left: 4px;
}
.band-nav a.active .band-count {
    color: #aaa;
}

/* Band section headers */

.band-section {
    margin-bottom: 24px;
}
.band-header {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 0 6px;
    border-bottom: 1px solid #e5e5e5;
    margin: 0 0 8px;
}
.band-header-count {
    font-weight: 400;
    color: #aaa;
    font-size: 12px;
    margin-left: 6px;
}

/* Colour grid (browse page) */

.colour-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 2px;
}
.colour-card {
    text-decoration: none;
    display: block;
}
.colour-card .swatch {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid #eee;
}
.colour-card .info {
    padding: 4px 2px;
}
.colour-card .colour-name {
    font-size: 11px;
    font-weight: 600;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.colour-card .manufacturer {
    font-size: 10px;
    color: #888;
    display: block;
}

/* Search */

.search-box {
    position: relative;
}
.search-box input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    font-size: 14px;
    font-family: inherit;
}
.search-box input:focus {
    outline: 2px solid #333;
    outline-offset: -1px;
}
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}
.search-results-dropdown.active {
    display: block;
}
.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
}
.search-result-item:hover {
    background: #f8f8f8;
}
.search-result-item .mini-swatch {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border: 1px solid #eee;
}
.search-result-item .result-name {
    font-size: 13px;
    font-weight: 600;
}
.search-result-item .result-brand {
    font-size: 11px;
    color: #888;
}

/* Colour detail page */

.colour-detail {
    padding: 24px 0;
}
.colour-hero {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}
.colour-hero .large-swatch {
    position: relative;
    width: 300px;
    height: 300px;
    border: 1px solid #eee;
    flex-shrink: 0;
}
.colour-hero .colour-info {
    flex: 1;
    min-width: 250px;
}
.colour-hero .colour-info h1 {
    font-size: 28px;
    margin-bottom: 4px;
}
.colour-number {
    font-size: 16px;
    color: #666;
    margin-bottom: 8px;
}
.colour-manufacturer {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}
.colour-price {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}
.colour-hex {
    font-size: 13px;
    color: #888;
    font-family: monospace;
    margin-bottom: 16px;
}
.sample-link {
    display: inline-block;
    padding: 8px 20px;
    background: #111;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
}
.sample-link:hover {
    background: #333;
    color: #fff;
}

/* AI discovery: summary paragraph */

.colour-summary {
    font-size: 15px;
    line-height: 1.7;
    color: #222;
    margin-bottom: 24px;
    max-width: 700px;
}

/* Colour properties definition list */

.colour-props {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 16px;
    font-size: 14px;
    margin-bottom: 16px;
}
.colour-props dt {
    color: #666;
    font-weight: 400;
}
.colour-props dd {
    font-weight: 600;
}
.colour-props code {
    font-family: monospace;
    font-size: 13px;
}

/* Matches table */

.matches-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 24px;
}
.matches-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 8px;
    border-bottom: 2px solid #eee;
}
.matches-table td {
    padding: 8px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.matches-table tr:hover {
    background: #fafafa;
}
.match-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 600;
}
.match-link:hover {
    text-decoration: underline;
}
.matches-table .mini-swatch {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 1px solid #eee;
    flex-shrink: 0;
    vertical-align: middle;
}

@media (max-width: 600px) {
    .matches-table th:nth-child(3),
    .matches-table td:nth-child(3),
    .matches-table th:nth-child(4),
    .matches-table td:nth-child(4) {
        display: none;
    }
}

/* Matches section */

.matches-section {
    margin-bottom: 30px;
}
.matches-section h2 {
    font-size: 18px;
    margin-bottom: 16px;
}
.match-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.match-card {
    border: 1px solid #eee;
    text-decoration: none;
    display: block;
}
.match-card .swatch-row {
    display: flex;
    height: 80px;
}
.match-card .swatch-main {
    width: 40%;
    height: 100%;
}
.match-card .swatch-match {
    position: relative;
    width: 60%;
    height: 100%;
}
.match-card .match-info {
    padding: 8px;
}
.match-card .match-name {
    font-size: 13px;
    font-weight: 600;
    display: block;
}
.match-card .match-brand {
    font-size: 11px;
    color: #888;
}
.match-card .match-delta {
    font-size: 11px;
    margin-top: 4px;
}

/* Delta E badges */

.delta-badge {
    display: inline-block;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 2px;
}
.delta-badge.identical { background: #d4edda; color: #155724; }
.delta-badge.near-identical { background: #d4edda; color: #155724; }
.delta-badge.very-close { background: #fff3cd; color: #856404; }
.delta-badge.similar { background: #e2e3e5; color: #383d41; }

.match-price {
    font-size: 12px;
    margin-top: 4px;
}
.price-diff {
    color: #888;
}
.price-diff.cheaper { color: #155724; }
.price-diff.dearer { color: #856404; }

/* Cluster visualisation */

.cluster-viz {
    margin-bottom: 30px;
}
.cluster-viz h2 {
    font-size: 18px;
    margin-bottom: 12px;
}

/* Submission form */

.submission-form {
    border-top: 1px solid #eee;
    padding-top: 24px;
    margin-top: 30px;
    max-width: 400px;
}
.submission-form h3 {
    font-size: 16px;
    margin-bottom: 12px;
}
.form-group {
    margin-bottom: 12px;
}
.form-group label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}
.form-group select,
.form-group input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ccc;
    font-size: 14px;
    font-family: inherit;
}
.form-submit {
    padding: 8px 20px;
    background: #111;
    color: #fff;
    border: none;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}
.form-submit:hover {
    background: #333;
}
/* Honeypot — hidden from real users */
.hp-field {
    position: absolute;
    left: -9999px;
}

/* About page */

.about-content {
    max-width: 640px;
    padding-bottom: 40px;
}
.about-content p {
    margin-bottom: 16px;
    line-height: 1.7;
}
.about-signoff {
    font-style: italic;
}
.about-contact {
    margin-top: 24px;
    font-size: 14px;
}
.about-contact a {
    color: #111;
}

/* Rankings page */

.ranking-section {
    margin-bottom: 40px;
}
.ranking-section h2 {
    font-size: 18px;
    margin-bottom: 16px;
}
.ranking-list {
    list-style: none;
}
.ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.ranking-item .rank {
    font-size: 14px;
    font-weight: 700;
    color: #888;
    width: 30px;
    text-align: right;
    flex-shrink: 0;
}
.ranking-item .mini-swatch {
    width: 36px;
    height: 36px;
    border: 1px solid #eee;
    flex-shrink: 0;
}
.ranking-item .ranking-info {
    flex: 1;
}
.ranking-item .ranking-name {
    font-size: 13px;
    font-weight: 600;
}
.ranking-item .ranking-brand {
    font-size: 11px;
    color: #888;
}
.ranking-item .ranking-stat {
    font-size: 12px;
    color: #666;
    flex-shrink: 0;
}

/* Match input page */

.match-input {
    max-width: 600px;
    margin-bottom: 30px;
}
.match-input h2 {
    font-size: 16px;
    margin-bottom: 12px;
}
.input-methods {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.input-method {
    flex: 1;
    min-width: 200px;
}
.input-method h3 {
    font-size: 14px;
    margin-bottom: 8px;
}
.hex-input, .rgb-inputs input {
    padding: 6px 10px;
    border: 1px solid #ccc;
    font-size: 14px;
    font-family: inherit;
}
.rgb-inputs {
    display: flex;
    gap: 6px;
}
.rgb-inputs input {
    width: 70px;
}
.preview-swatch {
    width: 60px;
    height: 60px;
    border: 1px solid #eee;
    margin-top: 8px;
}

/* Image upload */

.upload-zone {
    border: 2px dashed #ccc;
    padding: 30px;
    text-align: center;
    font-size: 13px;
    color: #888;
    cursor: pointer;
    margin-bottom: 16px;
}
.upload-zone:hover {
    border-color: #999;
}
.palette-results {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
button.palette-swatch {
    width: 50px;
    height: 50px;
    border: 1px solid #eee;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}
.palette-swatch:hover {
    border-color: #333;
}
.palette-swatch.selected {
    border: 2px solid #111;
}
@media (max-width: 600px) {
    .palette-results { flex-wrap: wrap; }
    .palette-swatch { width: 56px; height: 56px; min-height: 44px; }
    .match-input { padding-bottom: 180px; }
}

/* Footer */

footer {
    border-top: 1px solid #eee;
    padding: 20px 0;
    margin-top: 40px;
}
footer p {
    font-size: 11px;
    color: #999;
    max-width: 700px;
}

/* Responsive */

@media (max-width: 600px) {
    .toolbar-top {
        flex-direction: column;
        gap: 8px;
    }
    .toolbar-top .search-box {
        width: 100%;
    }
    .colour-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    .colour-hero {
        flex-direction: column;
    }
    .colour-hero .large-swatch {
        width: 100%;
        height: 200px;
    }
    .match-grid {
        grid-template-columns: 1fr;
    }
}

/* Print */

@media print {
    header, nav, footer, .browse-toolbar,
    .submission-form, .upload-zone,
    .palette-toggle, .palette-panel, .palette-add-btn { display: none !important; }
    .colour-hero .large-swatch { width: 150px; height: 150px; }
}

/* Palette — add button */

.palette-add-btn {
    display: none;
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    border: 1px solid #ccc;
    color: #333;
    font-size: 15px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    z-index: 2;
    user-select: none;
    transition: background 0.15s;
}
.palette-add-btn:hover { background: #fff; border-color: #999; }
.palette-add-btn.added {
    background: #e8f5e9;
    border-color: #81c784;
    color: #2e7d32;
}
.swatch:hover .palette-add-btn,
.large-swatch:hover .palette-add-btn,
.swatch-match:hover .palette-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (hover: none) {
    .palette-add-btn { display: flex; align-items: center; justify-content: center; }
}

/* Palette — toggle button */

.palette-toggle {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 201;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #111;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transition: transform 0.15s, bottom 0.2s ease;
}
.palette-toggle:hover { transform: scale(1.08); }
.palette-toggle.panel-open { bottom: 180px; }
.palette-toggle .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #d9534f;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    padding: 0 3px;
}
.palette-toggle .badge:empty { display: none; }

/* Palette — bottom bar panel */

.palette-panel {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: #fff;
    border-top: 2px solid #e8e8e8;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.10);
    flex-direction: column;
    max-height: 164px;
}
.palette-panel.open { display: flex; }

.palette-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 14px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.palette-title {
    font-size: 11px;
    font-weight: 600;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.palette-header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}
.palette-header-actions button {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 2px 8px;
    font-size: 11px;
    cursor: pointer;
    color: #666;
}
.palette-header-actions button:hover { background: #f5f5f5; }
.palette-minimise {
    border: none !important;
    font-size: 18px !important;
    padding: 0 2px !important;
    color: #aaa !important;
    line-height: 1;
}

.palette-body {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 14px;
    gap: 10px;
    flex: 1;
    align-items: flex-start;
    -webkit-overflow-scrolling: touch;
}

.palette-empty {
    font-size: 12px;
    color: #aaa;
    align-self: center;
    white-space: nowrap;
}

.palette-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 80px;
    cursor: grab;
    position: relative;
    user-select: none;
}
.palette-item.dragging { opacity: 0.4; }

.palette-item .pi-swatch {
    width: 80px;
    height: 80px;
    border: 1px solid #ddd;
    border-radius: 2px;
    flex-shrink: 0;
}

.palette-item .pi-info { width: 100%; margin-top: 4px; }
.palette-item .pi-link {
    display: block;
    text-decoration: none;
    color: #111;
    text-align: center;
}
.palette-item .pi-link:hover { color: #555; }
.palette-item .pi-name {
    font-size: 10px;
    font-weight: 600;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}
.palette-item .pi-brand {
    font-size: 9px;
    color: #888;
    display: block;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.palette-item .pi-remove {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #333;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
    padding: 0;
}
.palette-item:hover .pi-remove { opacity: 1; }

/* Toast notification */
.palette-toast {
    position: fixed;
    bottom: 70px;
    right: 20px;
    z-index: 202;
    background: #111;
    color: #fff;
    padding: 8px 14px;
    font-size: 12px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
}
.palette-toast.show { opacity: 1; }

@media (max-width: 600px) {
    .palette-item { width: 64px; }
    .palette-item .pi-swatch { width: 64px; height: 64px; }
    .palette-toggle.panel-open { bottom: 150px; }
}

/* Palette share page */

.palette-page-actions {
    display: flex;
    gap: 12px;
    margin: 16px 0;
}
.palette-page-actions button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fafafa;
    cursor: pointer;
    font-size: 13px;
}
.palette-page-actions button:hover { background: #f0f0f0; }

/* Finishes page */

.finishes-intro {
    font-size: 14px;
    color: #444;
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 720px;
}
.finishes-jump-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}
.finishes-jump-links a {
    font-size: 12px;
    padding: 4px 10px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    text-decoration: none;
    color: #333;
}
.finishes-jump-links a:hover {
    background: #eee;
}
.finishes-brand {
    margin-bottom: 36px;
}
.finishes-brand h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    padding-top: 8px;
}
.finishes-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.finishes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.finishes-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 8px;
    border-bottom: 2px solid #eee;
    white-space: nowrap;
}
.finishes-table td {
    padding: 8px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}
.finishes-table tr:hover {
    background: #fafafa;
}
.finishes-name {
    font-weight: 600;
    white-space: nowrap;
}
.finishes-desc {
    color: #555;
    font-size: 12px;
    line-height: 1.5;
    max-width: 400px;
}
.finishes-sizes {
    white-space: nowrap;
}
.size-pill {
    display: inline-block;
    font-size: 11px;
    padding: 2px 6px;
    background: #f0f0f0;
    border: 1px solid #e0e0e0;
    margin: 1px 2px;
}
.finishes-price {
    white-space: nowrap;
    font-weight: 600;
}
.finishes-lime {
    text-align: center;
    font-size: 15px;
}
.lime-yes { color: #2a7d2a; font-weight: 700; }
.lime-no { color: #b33; font-weight: 700; }
.lime-unknown { color: #999; font-weight: 600; }
.finishes-filters {
    margin-bottom: 16px;
}
.lime-filter {
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.lime-filter input { margin: 0; }
.finishes-footnote {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    font-size: 12px;
    color: #888;
    line-height: 1.6;
    max-width: 720px;
}
@media (max-width: 600px) {
    .finishes-col-sizes {
        display: none;
    }
    .finishes-sizes {
        display: none;
    }
    .finishes-desc {
        max-width: 200px;
    }
}
