:root {
    --color-ink: #f1eee7;
    --color-ink-soft: #d4cec0;
    --color-muted: #aaa598;
    --color-bg: #10100f;
    --color-bg-warm: #10100f;
    --color-surface: #1b1b19;
    --color-surface-strong: #24231f;
    --color-line: #3b3932;
    --color-primary: #f1eee7;
    --color-primary-hover: #fffaf0;
    --color-accent: #c5a66c;
    --color-accent-hover: #dec48f;
    --color-accent-soft: #30291d;
    --color-success: #a8d3b3;
    --color-success-soft: #1e3025;
    --color-danger: #ffaaa4;
    --color-danger-soft: #392423;
    --color-blue: #aec7ea;
    --color-blue-soft: #253345;
    --color-orange: #e6bd84;
    --color-orange-soft: #392d20;
    --font-body: "DM Sans", Arial, sans-serif;
    --font-display: "Libre Baskerville", Georgia, serif;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 8px;
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, .12);
    --shadow-md: 0 18px 40px rgba(0, 0, 0, .18);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .22);
    --container: 1320px;
}

body,
body.admin-body {
    background: var(--color-bg);
    color: var(--color-ink);
}

a,
.btn,
button,
input,
select,
textarea {
    transition-duration: .16s;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}

.site-header {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 14px max(24px, calc((100vw - var(--container)) / 2));
    gap: 32px;
    border: 0;
    border-bottom: 1px solid var(--color-line);
    border-radius: 0;
    background: rgba(16, 16, 15, .96);
    box-shadow: none;
    backdrop-filter: blur(12px);
}

.admin-header { background: rgba(16, 16, 15, .97); }

.brand {
    gap: 16px;
    color: var(--color-ink);
    font-family: var(--font-display);
    font-size: 23px;
    font-weight: 700;
    letter-spacing: 0;
    white-space: nowrap;
}

.brand:hover { color: var(--color-accent-hover); }

.brand-logo {
    display: block;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
}

.login-brand { margin-bottom: 26px; }

.brand-context {
    border-left: 1px solid var(--color-line);
    color: var(--color-muted);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    padding-left: 16px;
    text-transform: uppercase;
}

.header-search {
    flex: 1 1 280px;
    max-width: 440px;
    min-width: 0;
    border-radius: var(--radius-sm);
    background: var(--color-surface);
}

.header-search input { color: var(--color-ink); font-weight: 500; }
.header-search input::placeholder,
input::placeholder,
textarea::placeholder { color: #898477; opacity: 1; }

.header-search button {
    min-height: 44px;
    border-radius: 0;
    background: var(--color-surface-strong);
    color: var(--color-accent-hover);
}

.main-nav { gap: 4px; flex-wrap: nowrap; }
.main-nav a {
    border-radius: var(--radius-sm);
    color: var(--color-ink-soft);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.main-nav a:hover,
.main-nav a.active { background: var(--color-surface-strong); color: var(--color-accent-hover); }
.main-nav span { background: var(--color-accent); color: #15130f; }

.page { padding-top: 28px; }
.site-footer { border-top: 1px solid var(--color-line); color: var(--color-muted); }

h1, h2, h3 { line-height: 1.18; }
h1 { font-size: clamp(34px, 5vw, 58px); }
h2 { font-size: clamp(25px, 3vw, 36px); }
h3 { font-size: 20px; }
.admin-layout h1, .admin-layout h2, .admin-layout h3,
.admin-header, .product-detail-panel h1 { font-family: var(--font-body); }
.admin-layout h1 { font-size: clamp(28px, 3vw, 40px); }
.admin-layout h2 { font-size: clamp(22px, 2vw, 29px); }

.eyebrow {
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--color-accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    padding: 0;
}

.collection-intro {
    display: grid;
    gap: 4px;
    margin: 6px 0 32px;
    border-bottom: 1px solid var(--color-line);
    padding: 0 0 24px;
}
.collection-intro .eyebrow { margin: 0 0 10px; }
.collection-intro h1 { margin: 0; }
.collection-intro p { margin: 8px 0 0; color: var(--color-muted); }

.discovery-hero {
    display: block;
    margin-bottom: 36px;
    border-bottom: 1px solid var(--color-line);
    border-radius: 0;
    background: none;
    box-shadow: none;
    padding: 8px 0 30px;
}
.discovery-hero .eyebrow { color: var(--color-accent); }
.discovery-hero h1 {
    margin: 8px 0 20px;
    color: var(--color-ink);
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.18;
}
.hero-search {
    grid-template-columns: minmax(0, 540px) auto;
    justify-content: start;
    margin-top: 0;
    margin-bottom: 18px;
}
.hero-search label { color: var(--color-muted); font-weight: 600; }
.hero-search input { min-height: 48px; background: var(--color-surface); }
.hero-search button { min-height: 48px; }
.discovery-hero .quick-filter-chips a,
.quick-filter-chips a,
.quick-filters a {
    border-color: var(--color-line);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-ink-soft);
    font-weight: 600;
}
.quick-filter-chips a:hover, .quick-filters a:hover {
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
    color: var(--color-accent-hover);
}
.section-heading h2 { font-size: clamp(25px, 3vw, 36px); }
.section-heading p { font-weight: 400; }
.text-link { color: var(--color-accent-hover); font-weight: 600; }
.discover-section { margin-bottom: 48px; }

.search-page-hero {
    border: 0;
    border-bottom: 1px solid var(--color-line);
    border-radius: 0;
    background: none;
    box-shadow: none;
    padding: 8px 0 28px;
}
.search-page-hero h1 { font-size: clamp(30px, 4vw, 48px); }
.search-page-form {
    grid-template-columns: minmax(0, 1fr) auto;
    max-width: 760px;
    gap: 12px;
}
.search-page-form button { min-width: 140px; }

.shop-filter-sidebar {
    border: 0;
    border-right: 1px solid var(--color-line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.filter-group { border-color: var(--color-line); }
.filter-group h3 { font-family: var(--font-body); font-size: 14px; }
.shop-results-bar { border-bottom: 1px solid var(--color-line); padding-bottom: 14px; }
.sort-form { background: var(--color-surface); padding-left: 14px; }
.sort-form label { color: var(--color-muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.sort-form select { background: var(--color-surface); min-width: 168px; font-weight: 600; }
.sort-form:focus-within { border-color: var(--color-accent); }
.filter-group input { accent-color: var(--color-accent); }

.card, .panel, .table-wrap,
.admin-color-editor, .admin-image-group, .admin-image-preview,
.admin-search-tags, .admin-search-tag-group,
.admin-color-grid label, .admin-color-chip,
.account-order-card, .checkbox-card {
    border-color: var(--color-line);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: none;
}
.panel { padding: clamp(18px, 3vw, 28px); }
.card:hover { border-color: #5a4f3b; }
.product-grid { gap: 22px 16px; }
.product-card { border-radius: var(--radius-sm); }
.search-product-grid .product-card { border: 1px solid var(--color-line); }
.product-card { animation: product-enter .3s ease-out both; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.product-card:hover, .search-product-grid .product-card:hover { border-color: #6b5b3d; box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.product-card > a, .product-image { background: #2b2a26; }
.product-image { aspect-ratio: 3 / 4; }
.product-card .card-body { padding: 14px; }
.product-card-meta span { border-color: var(--color-line); background: var(--color-surface-strong); color: var(--color-ink-soft); }
.product-title { color: var(--color-ink); font-size: 14px; font-weight: 600; }
.price { color: var(--color-accent-hover); font-size: 19px; font-weight: 700; }

.btn, button, input[type="submit"] {
    min-height: 44px;
    border-radius: var(--radius-sm);
    background: var(--color-accent);
    color: #18150f;
    font-size: 14px;
    font-weight: 700;
}
.btn:hover, button:hover, input[type="submit"]:hover {
    background: var(--color-accent-hover);
    color: #18150f;
    box-shadow: none;
    transform: none;
}
.btn.secondary, .admin-search-add-button,
.gallery-thumb, .admin-image-menu summary,
.admin-image-menu-panel {
    border-color: var(--color-line);
    border-radius: var(--radius-sm);
    background: var(--color-surface-strong);
    color: var(--color-ink);
}
.btn.secondary:hover, .admin-search-add-button:hover {
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
    color: var(--color-accent-hover);
}
.admin-search-add-button.is-used { color: var(--color-accent-hover); }
button:disabled, button:disabled:hover { background: #58554f; color: #d5d0c5; }

input, textarea, select {
    border-radius: var(--radius-sm);
    background: var(--color-surface-strong);
    color: var(--color-ink);
}
input:hover, textarea:hover, select:hover { border-color: #746b59; }
input:focus, textarea:focus, select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(197, 166, 108, .17);
}
input[type="radio"], input[type="checkbox"] { accent-color: var(--color-accent); }
label { color: var(--color-ink-soft); }

th { background: var(--color-surface-strong); font-weight: 700; }
tbody tr:nth-child(even) { background: #20201d; }
tbody tr:hover, .admin-products-table tbody tr:hover { background: var(--color-accent-soft); }
.admin-products-table tbody tr:nth-child(even) { background: #20201d; }
.admin-tabs .active { border-color: var(--color-accent); background: var(--color-accent-soft); color: var(--color-accent-hover); }
.status { border-radius: var(--radius-sm); background: var(--color-surface-strong); color: var(--color-ink-soft); }
.status-payment-pending, .status-fulfillment-not_ordered { background: var(--color-orange-soft); color: var(--color-orange); }
.notice { border-color: #3f654a; }
.error { border-color: #76443f; }
.admin-image-grid figure.is-size-guide-image { border-color: var(--color-accent); background: var(--color-accent-soft); }
.admin-image-menu summary { box-shadow: var(--shadow-sm); }
.admin-image-menu-panel { box-shadow: var(--shadow-md); }
.grid-form .admin-search-tags .admin-search-tag-group,
.grid-form .admin-search-tags .admin-search-tag-group[open] summary { background: var(--color-surface); }
.grid-form .admin-search-tags .admin-search-tag-chip:has(input[type="checkbox"]:checked) span,
.grid-form .admin-search-tags .admin-search-tag-chip:hover span { background: var(--color-accent-soft); }
.diagnostics-log { background: #0a0a09; color: var(--color-ink-soft); }

.payment-explainer { margin-top: 4px; border-top: 1px solid var(--color-line); padding-top: 12px; }
.payment-explainer summary { width: fit-content; cursor: pointer; color: var(--color-accent-hover); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.payment-explainer-body { margin-top: 12px; padding: 16px; border: 1px solid var(--color-line); border-radius: var(--radius-sm); background: var(--color-surface-strong); }
.payment-explainer-body p { margin: 8px 0 0; color: var(--color-ink-soft); font-size: 14px; line-height: 1.6; }
.checkout-feedback { margin-top: 32px; border-top: 1px solid var(--color-line); padding-top: 24px; text-align: left; }
.checkout-feedback h2 { margin: 0 0 10px; font-size: 23px; }
.feedback-form { max-width: 640px; }
.feedback-form label { display: grid; gap: 6px; }
.feedback-form textarea { min-height: 110px; }
.shop-feedback { margin: 52px 0 24px; border-top: 1px solid var(--color-line); padding-top: 26px; }
.shop-feedback-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.shop-feedback-heading h2 { margin: 7px 0 0; font-size: 25px; }
.shop-feedback-heading > p { margin: 0; color: var(--color-muted); font-size: 13px; }
.shop-feedback-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.shop-feedback-grid blockquote { margin: 0; padding: 18px; border: 1px solid var(--color-line); border-radius: var(--radius-sm); background: var(--color-surface); }
.shop-feedback-grid blockquote p { min-height: 68px; margin: 10px 0 16px; line-height: 1.5; }
.shop-feedback-grid blockquote footer { color: var(--color-muted); font-size: 13px; }
.feedback-stars { color: var(--color-accent-hover); letter-spacing: 2px; }
.feedback-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.feedback-filters a { padding: 8px 12px; border: 1px solid var(--color-line); border-radius: var(--radius-sm); }
.feedback-filters a[aria-current="page"] { border-color: var(--color-accent); color: var(--color-accent-hover); background: var(--color-accent-soft); }
.admin-feedback-list { display: grid; gap: 12px; }
.admin-feedback-item { border-top: 1px solid var(--color-line); padding: 16px 0; }
.feedback-item-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.feedback-item-head span { color: var(--color-muted); font-size: 13px; }
.admin-feedback-item p { line-height: 1.55; }
.admin-feedback-item .actions { margin-top: 12px; }
.admin-product-source-cell { min-width: 130px; }
.admin-product-source-cell a, .admin-product-source-cell span { display: block; }
.admin-product-source-cell a { color: var(--color-accent-hover); font-weight: 700; }
.admin-product-source-cell span { margin-top: 4px; color: var(--color-muted); font-size: 12px; overflow-wrap: anywhere; }
.admin-product-source-details summary { margin-top: 6px; cursor: pointer; color: var(--color-ink-soft); font-size: 12px; }
.admin-product-source-details code { display: block; max-width: 240px; margin-top: 5px; overflow-wrap: anywhere; white-space: normal; font-size: 11px; }

.sourcing-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 10px 0 18px; }
.sourcing-heading h1 { margin: 4px 0 0; font-size: 28px; }
.sourcing-state, .sourcing-badge { display: inline-block; padding: 5px 8px; border: 1px solid var(--color-line); border-radius: 3px; color: var(--color-accent-hover); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.sourcing-quick { padding: 20px 0 24px; border-top: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line); }
.sourcing-quick h2 { margin: 0 0 5px; font-size: 20px; }
.sourcing-quick p { margin: 0 0 18px; color: var(--color-muted); font-size: 13px; }
.sourcing-quick-form { max-width: 860px; }
.sourcing-quick-form > label:first-of-type { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; }
.sourcing-quick-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.sourcing-quick-row input { width: 100%; min-width: 0; min-height: 44px; }
.sourcing-quick-row button { min-height: 44px; white-space: nowrap; }
.sourcing-quick-count { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; font-size: 12px; font-weight: 700; }
.sourcing-quick-count input { width: 72px; min-height: 38px; text-align: center; }
.sourcing-quick .sourcing-quick-hint { margin: 7px 0 0; font-size: 12px; }
.sourcing-quick-rights { display: flex; align-items: flex-start; gap: 9px; margin-top: 12px; font-size: 12px; color: var(--color-ink-soft); }
.sourcing-quick-rights input { flex: 0 0 16px; width: 16px; height: 16px; min-height: 0; margin: 1px 0 0; }
.sourcing-advanced { padding: 12px 0; border-bottom: 1px solid var(--color-line); }
.sourcing-advanced > summary { cursor: pointer; width: fit-content; color: var(--color-accent-hover); font-size: 13px; font-weight: 700; }
.sourcing-advanced[open] > summary { margin-bottom: 8px; }
.sourcing-tabs { display: flex; gap: 18px; flex-wrap: wrap; border-bottom: 1px solid var(--color-line); margin-bottom: 24px; padding-bottom: 12px; }
.sourcing-tabs a { color: var(--color-ink-soft); font-size: 13px; }
.sourcing-tabs a:hover { color: var(--color-accent-hover); }
.sourcing-section { padding: 25px 0; border-bottom: 1px solid var(--color-line); }
.sourcing-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.sourcing-section-head h2 { margin: 0; font-size: 20px; }
.sourcing-section-head p { margin: 0; color: var(--color-muted); font-size: 13px; }
.sourcing-run-form, .sourcing-fields { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.sourcing-run-form label, .sourcing-fields label { display: grid; gap: 5px; min-width: 180px; font-size: 12px; }
.sourcing-run-form .sourcing-check, .sourcing-fields .sourcing-check { display: flex; align-items: center; min-height: 41px; max-width: 290px; }
.sourcing-check input { width: auto; }
.sourcing-run-form select, .sourcing-fields input, .sourcing-fields select { min-height: 41px; }
.sourcing-run-list { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.sourcing-run-list a { padding: 7px 10px; border: 1px solid var(--color-line); border-radius: 3px; font-size: 12px; }
.sourcing-run-list .selected { border-color: var(--color-accent); color: var(--color-accent-hover); }
.sourcing-stats { display: flex; flex-wrap: wrap; gap: 0 22px; margin: 10px 0 18px; padding: 12px 0; border-top: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line); }
.sourcing-stats span { color: var(--color-muted); font-size: 12px; }
.sourcing-stats strong { color: var(--color-ink); font-size: 16px; margin-left: 5px; }
.sourcing-table-wrap { width: 100%; overflow-x: auto; }
.sourcing-table { width: 100%; min-width: 740px; border-collapse: collapse; font-size: 12px; }
.sourcing-table th, .sourcing-table td { text-align: left; vertical-align: top; padding: 10px; border-bottom: 1px solid var(--color-line); }
.sourcing-table th { color: var(--color-muted); font-size: 11px; text-transform: uppercase; }
.sourcing-table td strong { display: block; max-width: 280px; line-height: 1.4; }
.sourcing-table td small { display: block; max-width: 300px; margin-top: 4px; color: var(--color-muted); overflow-wrap: anywhere; }
.sourcing-table td a { color: var(--color-accent-hover); }
.sourcing-table button { padding: 7px 9px; font-size: 11px; }
.sourcing-add { margin-top: 16px; }
.sourcing-add summary { cursor: pointer; width: fit-content; color: var(--color-accent-hover); font-size: 13px; }
.sourcing-add .sourcing-fields { margin-top: 14px; }
.sourcing-log { max-height: 250px; overflow: auto; font-family: monospace; font-size: 11px; }
.sourcing-log p { margin: 0; display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--color-line); }
.sourcing-log time, .sourcing-log span { flex: 0 0 auto; color: var(--color-muted); }

@keyframes product-enter {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 1050px) {
    .site-header { flex-wrap: wrap; gap: 12px 24px; }
    .header-search { order: 3; max-width: none; flex-basis: 100%; }
    .admin-header .main-nav { overflow-x: auto; justify-content: flex-start; width: 100%; }
}
@media (max-width: 620px) {
    .sourcing-quick-row { grid-template-columns: 1fr; }
    .sourcing-quick-row button { width: 100%; }
    .shop-feedback-grid { grid-template-columns: 1fr; }
    .shop-feedback-heading { display: block; }
    .shop-feedback-heading > p { margin-top: 8px; }
    body { background: var(--color-bg); }
    .site-header { width: 100%; margin: 0; padding: 12px; }
    .main-nav { display: flex; gap: 2px; overflow-x: auto; justify-content: flex-start; width: 100%; }
    .main-nav a { flex: 0 0 auto; min-height: 38px; font-size: 12px; padding: 8px 10px; }
    .header-search { order: 2; }
    .page, .site-footer { width: min(calc(100% - 28px), var(--container)); }
    .collection-intro { margin-bottom: 24px; }
    .discovery-hero { padding: 4px 0 24px; }
    .discovery-hero h1 { font-size: 34px; }
    .hero-search { grid-template-columns: 1fr; }
    .search-page-form { grid-template-columns: 1fr; }
    .search-page-form button { width: 100%; }
    .sort-form { justify-content: space-between; }
    .sort-form select { min-width: 0; }
    .product-grid, .discovery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 8px; }
    .product-card .card-body { padding: 10px; }
    .product-title { font-size: 12px; }
    .price { font-size: 16px; }
    .product-card button { font-size: 12px; padding: 10px 4px; }
    .admin-layout .panel { padding: 18px; }
}
@media (max-width: 370px) {
    .product-grid, .discovery-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; animation-duration: 0s !important; }
}
