* { box-sizing: border-box; }
:root { color-scheme: light; font-family: system-ui, -apple-system, sans-serif; color: #1b1d20; background: #edece8; }
body { margin: 0; font-size: 15px; }
[hidden] { display: none !important; }
header { padding: 36px 32px 24px; border-bottom: 1px solid #cccac4; }
header p { max-width: 820px; color: #44484e; line-height: 1.55; }
h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 600; letter-spacing: -1.4px; margin: 10px 0; }
small { text-transform: uppercase; letter-spacing: 1.5px; font-size: 12px; }
.muted { font-size: 13px; }
.tools { display: flex; gap: 12px 20px; flex-wrap: wrap; align-items: end; padding: 16px 32px; position: sticky; top: 0; background: #edece8f5; z-index: 2; border-bottom: 1px solid #cccac4; }
.search-label { display: grid; gap: 5px; font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
button, input, .viewer-actions a { font: inherit; border: 1px solid #aaa9a4; border-radius: 5px; background: #fff; padding: 11px 12px; color: #1b1d20; min-height: 44px; }
button { cursor: pointer; }
button:disabled { cursor: default; color: #666; background: #e0dfdb; border-color: #bebdb8; }
button[aria-pressed="true"] { background: #1b1d20; color: white; }
input[type="search"] { width: min(270px, 100%); font-size: 16px; }
input[type="checkbox"] { min-height: 20px; width: 20px; height: 20px; accent-color: #1b1d20; margin: 0; }
#count { font-size: 13px; margin: 0; min-height: 44px; display: flex; align-items: center; }
.status { margin: 0; padding: 0 32px; line-height: 1.5; }
.status:not(:empty) { padding-top: 16px; }
.results { max-width: 100%; overflow-x: auto; }
main { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 40px 24px; padding: 30px 32px 60px; }
main.large { grid-template-columns: repeat(auto-fill, minmax(min(390px, 100%), 1fr)); }
main.comparing { display: flex; align-items: flex-start; }
main.comparing article { flex: 0 0 clamp(280px, 36vw, 390px); }
main.comparing.large article { flex-basis: clamp(320px, 44vw, 520px); }
article { min-width: 0; }
.caption { display: flex; gap: 10px; align-items: center; }
.selection { display: flex; gap: 8px; align-items: center; font-size: 13px; min-height: 44px; min-width: 60px; cursor: pointer; }
h2 { font-size: 18px; font-weight: 600; margin: 0; }
article p { font-size: 13px; color: #50545b; min-height: 38px; line-height: 1.45; margin: 8px 0 12px; }
.preview { display: block; }
article img { display: block; width: 100%; height: auto; border: 1px solid #d2d0ca; background: white; }
article:has(input:checked) .preview { outline: 3px solid #965137; outline-offset: 3px; }
a { color: #75391f; }
:focus-visible { outline: 3px solid #965137; outline-offset: 4px; }
.empty { text-align: center; padding: 64px 24px; }
.empty p { color: #50545b; }
.skip { position: absolute; top: -100px; left: 16px; background: white; padding: 12px; z-index: 5; }
.skip:focus { top: 8px; }
.share-fallback { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 20px 32px; }
.share-fallback input { flex: 1; min-width: 200px; }
footer { padding: 0 32px 32px; color: #50545b; font-size: 13px; line-height: 1.6; }
dialog { border: 1px solid #bbb; border-radius: 12px; padding: 20px; width: min(1100px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; background: #f4f3ef; color: #1b1d20; }
dialog::backdrop { background: #14161be0; }
body:has(dialog[open]) { overflow: hidden; }
.viewer-toolbar, .viewer-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.viewer-actions { justify-content: center; flex-wrap: wrap; padding-top: 16px; }
.viewer-actions a { text-decoration: none; display: inline-flex; align-items: center; }
#viewer-position { color: #50545b; font-size: 13px; }
.viewer-stage { height: min(68dvh, 900px); overflow: auto; text-align: center; background: #deddd8; }
#viewer-image { width: auto; height: 100%; display: block; margin: auto; }
.viewer-stage.enlarged #viewer-image { height: auto; width: min(853px, 180%); max-width: none; }
.image-error, #viewer-error { color: #8a2c19; }
@media (max-width: 600px) {
  header { padding: 24px 16px 18px; }
  .tools { padding: 12px 16px; position: static; gap: 10px; align-items: start; }
  .search-label, input[type="search"] { width: 100%; }
  .actions { width: 100%; }
  .actions button { flex: 1 1 calc(50% - 8px); }
  #count { min-height: 24px; }
  main { padding: 20px 16px 40px; gap: 32px 20px; }
  .status, .share-fallback, footer { padding-left: 16px; padding-right: 16px; }
  dialog { padding: 12px; }
  .viewer-stage { height: 60dvh; }
  .viewer-actions { gap: 8px; }
}
