:root { color-scheme: dark; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #f2efe7; background: #151713; --page: #151713; --surface: #20231e; --surface-raised: #292c26; --control: #242721; --text: #f2efe7; --muted: #b9b3a5; --subtle: #918c82; --border: #44483e; --header: #10120f; --header-text: #f8f4e8; --header-muted: #c9c2b4; --hover: #2c3029; --error-bg: #2d211f; --focus: #78a9d1; --quality-normal: #575950; --quality-good: #8d918d; --quality-outstanding: #a76f40; --quality-excellent: #bfc4c7; --quality-masterpiece: #d0a52a; }
@media (prefers-color-scheme: light) { :root { color-scheme: light; color: #171717; background: #f7f7f4; --page: #f7f7f4; --surface: #fff; --surface-raised: #f0eee7; --control: #fff; --text: #171717; --muted: #66645f; --subtle: #8a867d; --border: #d8d4c9; --header: #20251f; --header-text: #f8f4e8; --header-muted: #ddd6c5; --hover: #faf7ef; --error-bg: #fff; --focus: #2f6f9f; --quality-normal: #f1eee5; } }
body { margin: 0; color: var(--text); background: var(--page); }
.page-header { position: relative; overflow: hidden; padding: 24px 32px 16px; background: var(--header); color: var(--header-text); }
h1 { position: relative; z-index: 1; margin: 0 0 6px; font-size: 30px; font-weight: 760; letter-spacing: 0; }
.site-title { position: relative; z-index: 1; display: inline-block; color: inherit; text-decoration: none; }
.site-title:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.page-header p { position: relative; z-index: 1; margin: 0; max-width: 980px; color: var(--header-muted); line-height: 1.45; }
main { padding: 20px 32px 40px; max-width: 1500px; margin: 0 auto; }
.item-filters { display: grid; gap: 10px; align-items: end; margin-bottom: 14px; }
.item-filters { grid-template-columns: minmax(230px, 1.5fr) repeat(4, minmax(120px, 1fr)); }
label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
select, input, button { box-sizing: border-box; border: 1px solid var(--border); border-radius: 6px; padding: 9px 10px; font: inherit; color: var(--text); background: var(--control); min-width: 0; }
button { cursor: pointer; }
.search-control { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 0; }
.search-control input { border-right: 0; border-radius: 6px 0 0 6px; }
.search-submit { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; line-height: 1; border-radius: 0 6px 6px 0; }
.category-menu-field { position: relative; display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.field-label { display: block; }
.category-menu-trigger { width: 100%; height: 40px; display: flex; align-items: center; justify-content: space-between; text-align: left; overflow: hidden; }
.category-menu-trigger span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-menu-trigger::after { content: "▾"; color: var(--subtle); }
.category-menu-popover { position: absolute; z-index: 10; top: calc(100% + 4px); left: 0; display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); width: min(720px, calc(100vw - 32px)); max-height: min(680px, calc(100vh - 180px)); overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: 0 18px 42px rgba(0, 0, 0, .28); }
.category-menu-popover[hidden] { display: none; }
.category-menu-column { min-width: 0; max-height: min(680px, calc(100vh - 180px)); overflow-y: auto; padding: 6px; border-left: 1px solid var(--border); }
.category-menu-column:first-child { border-left: 0; }
.category-menu-heading { display: block; padding: 5px 6px 7px; color: var(--subtle); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.category-menu-column button { width: 100%; border: 0; border-radius: 6px; background: transparent; text-align: left; color: var(--text); }
.category-menu-column button:hover, .category-menu-column button:focus-visible { background: var(--hover); }
.category-menu-column button[aria-checked="true"] { background: var(--surface-raised); font-weight: 760; }
.tabs { display: flex; align-items: center; gap: 8px; margin: 4px 0 16px; border-bottom: 1px solid var(--border); }
.tab { border: 0; border-radius: 6px 6px 0 0; padding: 10px 14px; background: transparent; color: var(--muted); cursor: pointer; }
.tab.active { color: var(--text); background: var(--surface); border: 1px solid var(--border); border-bottom-color: var(--surface); margin-bottom: -1px; }
.panel[hidden] { display: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.tile { box-sizing: border-box; display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 8px; text-align: center; min-height: 172px; width: 100%; color: inherit; text-decoration: none; }
.tile-title { min-height: 32px; display: grid; place-items: center; font-size: 13px; font-weight: 760; line-height: 1.2; margin-bottom: 4px; }
.tile img { width: 74px; height: 74px; object-fit: contain; display: block; margin: 0 auto 5px; }
.quality-tag { display: table; min-height: 18px; padding: 1px 6px; margin: 0 auto 5px; border-radius: 999px; font-size: 11px; color: var(--text); background: var(--quality-normal); }
.daily { display: block; font-size: 22px; font-weight: 780; line-height: 1; }
.daily-label { display: block; font-size: 11px; color: var(--muted); margin: 2px 0 6px; }
.item-id { display: block; font-size: 9px; color: var(--subtle); overflow-wrap: anywhere; line-height: 1.15; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.metric b { display: block; font-size: 22px; margin-bottom: 4px; }
.metric span, .muted { color: var(--muted); }
.title-activity-chart { position: absolute; inset: 0; display: flex; align-items: end; gap: 1px; opacity: .28; pointer-events: none; }
.activity-group { min-width: 0; height: 100%; flex: 1 1 0; display: flex; align-items: end; gap: 1px; }
.activity-group i { min-width: 1px; flex: 1; min-height: 1px; }
.activity-group .fetched-bar { background: #637a42; }
.activity-group .event-bar { background: #2f6f9f; }
.activity-group[data-errors]:not([data-errors="0"]) { border-top: 4px solid #b95f50; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; min-width: 1040px; }
.quality-table table { min-width: 0; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
thead th { background: var(--surface-raised); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
tbody tr:hover { background: var(--hover); }
.right { text-align: right; }
.error-state { padding: 12px; border-left: 4px solid #b95f50; background: var(--error-bg); }
.empty-state { color: var(--muted); }
.htmx-indicator { margin-left: auto; visibility: hidden; opacity: 0; color: var(--muted); transition: opacity 0s, visibility 0s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { visibility: visible; opacity: 1; transition-delay: 100ms; }
dialog { color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; max-width: min(720px, calc(100vw - 28px)); width: 720px; box-shadow: 0 24px 60px rgba(0, 0, 0, .38); }
dialog::backdrop { background: rgba(32, 37, 31, .38); }
.modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; margin: 0; }
.modal-head form { margin: 0; }
.modal-close { border: 0; background: transparent; font-size: 24px; line-height: 1; padding: 4px 8px; }
.quality-breakdown { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(92px, 1fr); gap: 10px; padding: 16px; overflow-x: auto; }
.quality-bucket { min-height: 156px; display: grid; align-content: start; justify-items: center; gap: 5px; border-left: 1px solid var(--border); padding-left: 10px; }
.quality-bucket:first-child { border-left: 0; padding-left: 0; }
.quality-bucket img { width: 74px; height: 74px; object-fit: contain; }
.quality-chip { width: 58px; height: 58px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); background: var(--quality-normal); font-weight: 760; }
.bucket-pct { min-width: 58px; border-radius: 999px; padding: 3px 9px; font-size: 20px; font-weight: 780; color: var(--text); background: var(--quality-normal); text-align: center; }
.quality-bg-2 { background: var(--quality-good); } .quality-bg-3 { background: var(--quality-outstanding); color: #fff; } .quality-bg-4 { background: var(--quality-excellent); } .quality-bg-5 { background: var(--quality-masterpiece); }
.bucket-label, .bucket-count { font-size: 12px; color: var(--muted); text-align: center; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 900px) { .page-header, main { padding-left: 16px; padding-right: 16px; } .item-filters { grid-template-columns: 1fr 1fr; } }
