:root {
    --bg: #faf6f1;
    --surface: #ffffff;
    --ink: #2e2018;
    --ink-muted: #7a6a5c;
    --border: #e7dccf;
    --accent: #8a5a3b;
    --accent-dark: #5c3a24;
    --sale: #b8542c;
    --sale-bg: #fbe9de;
    --out-bg: #f2efea;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
}

.site-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--accent-dark);
    color: #fff;
}

.site-header .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #fff;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
}
.brand-icon { width: 22px; height: 22px; flex-shrink: 0; }

.site-header .tagline {
    color: #e6d9cc;
    font-size: 0.9rem;
}

.main-nav {
    margin-left: auto;
    display: flex;
    gap: 1.25rem;
    align-items: center;
}
.main-nav a { color: #e6d9cc; text-decoration: none; font-size: 0.88rem; font-weight: 600; }
.main-nav a:hover { color: #fff; text-decoration: underline; }

.lang-switch {
    display: flex;
    gap: 0.35rem;
    align-self: center;
}

.lang-switch a {
    color: #e6d9cc;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.lang-switch a.active {
    color: var(--accent-dark);
    background: #fff;
    border-color: #fff;
}

.lang-switch a:not(.active):hover {
    border-color: rgba(255, 255, 255, 0.5);
}

main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}

.hero-text { text-align: center; padding: 1rem 1rem 1.5rem; }
.hero-text h1 { font-size: 1.7rem; margin: 0 0 0.5rem; color: var(--accent-dark); }
.hero-subtitle { color: var(--ink-muted); font-size: 0.95rem; margin: 0 0 0.35rem; max-width: 34rem; margin-left: auto; margin-right: auto; }
.hero-text .last-updated { margin: 0; }

.origin-section { margin-bottom: 1.75rem; }
.origin-section h2 { font-size: 1.05rem; margin: 0 0 0.8rem; color: var(--accent-dark); }
.origin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.8rem; }
.origin-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    text-decoration: none;
    color: var(--ink);
    transition: box-shadow 0.15s, transform 0.15s;
}
.origin-card:hover { box-shadow: 0 6px 16px rgba(46, 32, 24, 0.12); transform: translateY(-1px); }
.origin-card-icon { width: 24px; height: 24px; color: var(--accent); margin-bottom: 0.55rem; }
.origin-card-name { font-size: 1rem; font-weight: 700; color: var(--accent-dark); }
.origin-card-meta { font-size: 0.8rem; color: var(--ink-muted); margin-top: 0.2rem; }
.origin-card-more {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: transparent;
    border-style: dashed;
    color: var(--ink-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.hero-search {
    position: relative;
    max-width: 38rem;
    margin: 0 auto 2rem;
}
.hero-search-icon {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--ink-muted);
    pointer-events: none;
}
.hero-search input[type="search"] {
    width: 100%;
    font: inherit;
    font-size: 1.05rem;
    padding: 0.85rem 1.1rem 0.85rem 3rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 2px 8px rgba(46, 32, 24, 0.06);
}
.hero-search input[type="search"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 2px 12px rgba(138, 90, 59, 0.2);
}
/* clear ("x") button that WebKit/Blink add to type=search inputs */
.hero-search input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }

.clear-filters-link { text-align: center; margin: -1.2rem 0 1.5rem; font-size: 0.85rem; }
.clear-filters-link a { color: var(--ink-muted); text-decoration: underline; }
.clear-filters-link a:hover { color: var(--accent-dark); }

.secondary-filters { margin: 1.75rem 0 1.25rem; }
.secondary-filters summary {
    cursor: pointer;
    color: var(--ink-muted);
    font-weight: 600;
    font-size: 0.85rem;
    list-style: none;
}
.secondary-filters summary::-webkit-details-marker { display: none; }
.secondary-filters summary::before { content: "▸ "; }
.secondary-filters[open] summary::before { content: "▾ "; }
.secondary-filters-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-top: 0.75rem;
}

.field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; }
.field.checkbox { flex-direction: row; align-items: center; }
.field label { color: var(--ink-muted); }

.info-tip {
    position: relative;
    display: inline-block;
    color: var(--ink-muted);
    cursor: help;
    font-size: 0.9em;
}
.info-tip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 130%;
    left: 0;
    background: var(--accent-dark);
    color: #fff;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    font-size: 0.75rem;
    line-height: 1.4;
    white-space: normal;
    width: max-content;
    max-width: 15rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 10;
}
.info-tip:hover::after, .info-tip:focus::after {
    opacity: 1;
    visibility: visible;
}
.field select, .field input[type="number"] {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
    min-width: 8rem;
}
.field input[type="number"] { min-width: 6rem; }

.checkbox-list {
    max-height: 9rem;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    min-width: 11rem;
    background: var(--surface);
}
.checkbox-list-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0;
    font-size: 0.85rem;
    color: var(--ink);
    cursor: pointer;
    white-space: nowrap;
}
.checkbox-list-item input { margin: 0; flex-shrink: 0; }

.note-chips { margin-top: 0.25rem; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.note-chip {
    display: inline-block;
    padding: 0.03rem 0.4rem;
    border-radius: 999px;
    background: var(--sale-bg);
    color: var(--accent-dark);
    font-size: 0.68rem;
}

.empty a { margin-left: 0.6rem; color: var(--accent-dark); font-weight: 600; }

.coffee-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.coffee-table th, .coffee-table td {
    padding: 0.6rem 0.7rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}

.coffee-table th { color: var(--ink-muted); font-weight: 600; }
.coffee-table th.sortable { padding: 0; }
.coffee-table th.sortable a {
    display: block;
    padding: 0.6rem 0.7rem;
    color: var(--ink-muted);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.coffee-table th.sortable a:hover { color: var(--accent-dark); background: #fbf3ec; }
.coffee-table th.sortable.active a { color: var(--accent-dark); }
.sort-arrow { margin-left: 0.3rem; font-size: 0.7em; }
.coffee-table tbody tr:hover { background: #fbf3ec; }
.coffee-table tr.on-sale { background: var(--sale-bg); }
.coffee-table tr.out-of-stock { opacity: 0.55; }

.coffee-table a { color: var(--accent-dark); text-decoration: none; font-weight: 600; }
.coffee-table a:hover { text-decoration: underline; }

.thumb img { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; }
.row-link-cell { text-align: center; }
.coffee-table .row-link { display: inline-flex; color: var(--ink-muted); }
.coffee-table .row-link:hover { color: var(--accent-dark); }
.row-link svg { width: 17px; height: 17px; }
.ppg { font-weight: 700; }
.was { text-decoration: line-through; color: var(--ink-muted); margin-left: 0.35rem; font-size: 0.85em; }

.tag {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: #efe6da;
    color: var(--ink-muted);
    font-size: 0.72rem;
}

.badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-right: 0.25rem;
}
.badge.sale { background: var(--sale); color: #fff; }
.badge.out { background: var(--out-bg); color: var(--ink-muted); }

.empty { text-align: center; color: var(--ink-muted); padding: 2rem !important; }
.count { color: var(--ink-muted); font-size: 0.85rem; margin-top: 0.5rem; }

.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.table-footer .count { margin-top: 0; }
.pagination { display: flex; align-items: center; gap: 1rem; font-size: 0.9rem; }
.pagination a { color: var(--accent-dark); text-decoration: none; white-space: nowrap; }
.pagination a:hover { text-decoration: underline; }
.pagination .page-label { color: var(--ink-muted); white-space: nowrap; }

.back { display: inline-block; margin-bottom: 1rem; color: var(--accent-dark); text-decoration: none; }
.back:hover { text-decoration: underline; }

.detail { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem; }
.detail-head { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; }
.detail-image { width: 140px; height: 140px; object-fit: cover; border-radius: 10px; }
.detail-meta { color: var(--ink-muted); }
.description { margin: 1.25rem 0; line-height: 1.55; }

.rating-widget { margin: 1rem 0; }
.rating-stars { display: flex; gap: 0.15rem; }
.rating-stars .star {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--border);
    padding: 0;
}
.rating-stars .star.filled,
.rating-stars .star:hover { color: var(--accent); }
.rating-summary { color: var(--ink-muted); font-size: 0.9rem; margin: 0.35rem 0 0; }
.rating-own { color: var(--accent-dark); font-weight: 600; }

.comment-list { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-direction: column; gap: 1rem; }
.comment { border-bottom: 1px solid var(--border); padding-bottom: 0.85rem; }
.comment-meta { font-size: 0.82rem; color: var(--ink-muted); margin: 0 0 0.25rem; }
.comment-text { margin: 0; line-height: 1.5; white-space: pre-line; }
.comment-none { color: var(--ink-muted); font-size: 0.9rem; }

.variants-table { width: 100%; border-collapse: collapse; margin-top: 0.75rem; }
.variants-table th, .variants-table td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 0.9rem;
}
.variants-table th { color: var(--ink-muted); font-weight: 600; }
.variants-table tr.out-of-stock { opacity: 0.55; }

.chart-wrap { position: relative; margin: 0.75rem 0 1.5rem; }
.price-chart { width: 100%; height: auto; display: block; }
.price-chart .hover-target { cursor: crosshair; }
.chart-empty { color: var(--ink-muted); font-size: 0.9rem; }

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 0.4rem;
    font-size: 0.82rem;
    color: var(--ink-muted);
}
.legend-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.legend-swatch { width: 14px; height: 2px; border-radius: 1px; display: inline-block; }

.chart-tooltip {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    background: var(--accent-dark);
    color: #fff;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    font-size: 0.78rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    min-width: 9rem;
}
.chart-tooltip[hidden] { display: none; }
.chart-tooltip-date { color: #e6d9cc; margin-bottom: 0.25rem; font-size: 0.72rem; }
.chart-tooltip-row { display: flex; align-items: center; gap: 0.4rem; padding: 0.05rem 0; }
.tt-key { width: 10px; height: 2px; border-radius: 1px; display: inline-block; flex-shrink: 0; }
.tt-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.tt-label { color: #e6d9cc; }

.chart-table-toggle { margin-top: 0.5rem; font-size: 0.85rem; }
.chart-table-toggle summary { cursor: pointer; color: var(--accent-dark); }
.chart-table-toggle .history-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; font-size: 0.82rem; }
.chart-table-toggle .history-table th, .chart-table-toggle .history-table td {
    padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--border); text-align: left;
}

@media (max-width: 640px) {
    .coffee-table { display: block; overflow-x: auto; }
    .filters { flex-direction: column; }
    .site-header { flex-wrap: wrap; row-gap: 0.5rem; }
    .site-header .tagline { display: none; }
    .main-nav { margin-left: 0; order: 3; width: 100%; gap: 1rem; }
}

.last-updated { color: var(--ink-muted); font-size: 0.82rem; margin: -0.5rem 0 1.25rem; }

.report-issue { color: var(--ink-muted); font-size: 0.85rem; text-decoration: underline; }

.site-footer {
    max-width: 1100px;
    margin: 2.5rem auto 0;
    padding: 1.25rem 1rem 2rem;
    border-top: 1px solid var(--border);
    color: var(--ink-muted);
    font-size: 0.82rem;
}
.footer-disclaimer { max-width: 60rem; line-height: 1.5; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 0.75rem; }
.footer-nav a { color: var(--accent-dark); text-decoration: none; font-weight: 600; }
.footer-nav a:hover { text-decoration: underline; }

.prose { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem 1.75rem; line-height: 1.6; max-width: 46rem; }
.prose h1 { margin-top: 0; }
.prose h2 { font-size: 1.05rem; margin: 1.5rem 0 0.4rem; color: var(--accent-dark); }
.prose h2:first-of-type { margin-top: 0.5rem; }
.prose a { color: var(--accent-dark); }

.status-table td, .status-table th { font-size: 0.9rem; }
.badge.ok { background: #e4ede0; color: #3e6b34; }

.contact-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.25rem; max-width: 32rem; }
.contact-form .field { gap: 0.35rem; }
.contact-form label { color: var(--ink-muted); font-size: 0.85rem; }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    resize: vertical;
}
.contact-form button {
    align-self: flex-start;
    padding: 0.55rem 1.4rem;
    border: none;
    border-radius: 6px;
    background: var(--accent-dark);
    color: #fff;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
}
.contact-form button:hover { background: var(--accent); }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-success { color: #3e6b34; font-weight: 600; margin-top: 1.25rem; }
.contact-error { color: var(--sale); font-weight: 600; }
