:root {
  --ink: #171813;
  --muted: #6d7066;
  --paper: #f5f3ed;
  --card: #fffdf8;
  --line: #dedbd1;
  --acid: #dfff43;
  --orange: #ff6c36;
  --shadow: 0 18px 50px rgba(28, 29, 24, .1);
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.site-header { height: 68px; padding: 0 clamp(20px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(245,243,237,.88); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 20; }
.brand { color: inherit; text-decoration: none; display: flex; gap: 10px; align-items: center; font-weight: 850; letter-spacing: -.03em; }
.brand-mark { display: grid; place-items: center; width: 34px; aspect-ratio: 1; border-radius: 50%; background: var(--ink); color: var(--acid); }
.source-note { color: var(--muted); font-size: 13px; text-underline-offset: 4px; }
main { width: min(1480px, 100%); margin: auto; padding: 0 clamp(16px, 4vw, 60px) 80px; }
.hero { padding: clamp(58px, 9vw, 120px) 0 52px; max-width: 1050px; }
.eyebrow { font: 700 12px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .16em; margin: 0 0 20px; }
h1 { font-size: clamp(45px, 7vw, 94px); line-height: .96; letter-spacing: -.07em; margin: 0; max-width: 1000px; }
h1 span { color: var(--orange); }
.hero-copy { max-width: 690px; color: var(--muted); font-size: clamp(16px, 2vw, 21px); line-height: 1.65; margin: 28px 0 34px; }
.search-bar { display: flex; width: min(760px, 100%); gap: 10px; }
.search-input { flex: 1; height: 56px; border: 1px solid var(--ink); background: var(--card); display: flex; align-items: center; gap: 10px; padding: 0 18px; border-radius: 15px; box-shadow: 4px 4px 0 var(--ink); }
.search-input span { font-size: 25px; }
.search-input input { border: 0; outline: 0; background: transparent; width: 100%; min-width: 0; }
.search-bar button { border: 1px solid var(--ink); border-radius: 15px; padding: 0 24px; background: var(--acid); font-weight: 800; box-shadow: 4px 4px 0 var(--ink); }
.toolbar { display: flex; align-items: center; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); position: sticky; top: 68px; z-index: 10; background: rgba(245,243,237,.94); backdrop-filter: blur(12px); }
.filter-group { display: flex; gap: 8px; }
.pill { border: 1px solid var(--line); padding: 8px 14px; border-radius: 999px; background: transparent; color: var(--muted); }
.pill.active { color: var(--ink); background: var(--acid); border-color: var(--ink); font-weight: 750; }
.model-select { margin-left: auto; display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; }
.model-select select { border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; background: var(--card); }
.result-count { font-size: 13px; color: var(--muted); }
.status { min-height: 45px; padding: 18px 0 8px; color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; align-items: start; }
.gallery-column { min-width: 0; }
.card { break-inside: avoid; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--card); transition: transform .2s, box-shadow .2s; outline: none; }
.card:hover, .card:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #b8b5aa; }
.image-wrap { position: relative; background: #e9e6dd; overflow: hidden; }
.image-wrap img { width: 100%; height: auto; display: block; transition: transform .45s; }
.card:hover img { transform: scale(1.025); }
.badge { position: absolute; top: 11px; left: 11px; padding: 6px 10px; border-radius: 99px; background: rgba(23,24,19,.86); color: white; font-size: 11px; font-weight: 750; backdrop-filter: blur(6px); }
.quality-card { border-color: #c8cc79; }
.quality-card .badge { background: var(--acid); color: var(--ink); border: 1px solid rgba(23,24,19,.55); }
.card-body { padding: 16px 16px 18px; }
.card h2 { font-size: 16px; line-height: 1.42; margin: 0 0 12px; letter-spacing: -.02em; }
.open-hint { color: var(--muted); font-size: 12px; }
.feed-sentinel { min-height: 76px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 24px 0 6px; color: var(--muted); font-size: 13px; }
.feed-sentinel[hidden] { display: none; }
.feed-spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; opacity: 0; }
.feed-sentinel.is-loading .feed-spinner { opacity: 1; animation: feed-spin .7s linear infinite; }
@keyframes feed-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .feed-sentinel.is-loading .feed-spinner { animation: none; } }
.modal { width: min(1140px, calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 0; border: 0; border-radius: 22px; background: var(--card); box-shadow: 0 30px 100px rgba(0,0,0,.28); }
.modal::backdrop { background: rgba(20,21,18,.68); backdrop-filter: blur(8px); }
.modal-close { position: sticky; float: right; top: 14px; margin: 14px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,253,248,.9); font-size: 25px; }
.detail-grid { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(340px, 1.1fr); min-height: 600px; }
.detail-media { background: #e8e5dc; }
.detail-media img, .detail-media video { width: 100%; height: 100%; max-height: calc(100vh - 28px); object-fit: cover; display: block; }
.detail-copy { padding: clamp(28px, 4vw, 52px); overflow: auto; }
.detail-kicker { color: var(--orange); font: 750 12px ui-monospace, monospace; letter-spacing: .12em; }
.detail-copy h2 { font-size: clamp(28px, 4vw, 48px); letter-spacing: -.05em; line-height: 1.06; margin: 12px 0 18px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.meta span, .source-link { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; color: var(--muted); text-decoration: none; }
.source-link { color: var(--ink); border-color: var(--ink); background: var(--acid); font-weight: 750; }
.prompt-block { border-top: 1px solid var(--line); padding: 22px 0 0; margin-top: 18px; }
.prompt-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.prompt-head strong { font-size: 13px; }
.copy-button { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 6px 10px; }
.prompt-text { white-space: pre-wrap; color: #45483f; font-size: 14px; line-height: 1.72; max-height: 290px; overflow: auto; padding-right: 8px; }
.source-only-note { margin-top: 24px; padding: 18px; border: 1px solid #c8cc79; border-radius: 14px; background: #f7fadf; color: #45483f; }
.source-only-note p { margin: 8px 0 12px; line-height: 1.6; }
.source-only-note a { color: var(--ink); font-weight: 750; text-underline-offset: 4px; }
.error-card { padding: 30px; border: 1px dashed #b6412b; color: #8a2e1c; border-radius: 16px; background: #fff2ed; }

@media (max-width: 980px) {
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: minmax(260px, .8fr) minmax(360px, 1.2fr); }
}

@media (max-width: 760px) {
  .site-header { height: 58px; padding: 0 16px; }
  .brand { font-size: 15px; }
  .brand-mark { width: 31px; }
  .source-note { display: none; }
  main { padding: 0 14px 52px; }
  .hero { padding: 40px 2px 34px; }
  .eyebrow { margin-bottom: 14px; font-size: 10px; }
  h1 { font-size: clamp(40px, 12vw, 56px); line-height: .98; }
  .hero-copy { margin: 20px 0 24px; font-size: 16px; line-height: 1.55; }
  .search-bar { flex-direction: column; gap: 9px; }
  .search-input { height: 52px; border-radius: 13px; box-shadow: 3px 3px 0 var(--ink); }
  .search-bar button { min-height: 50px; border-radius: 13px; box-shadow: 3px 3px 0 var(--ink); }
  .toolbar { top: 58px; margin: 0 -14px; padding: 12px 14px; align-items: center; gap: 10px; overflow: hidden; }
  .filter-group { width: 100%; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .filter-group::-webkit-scrollbar { display: none; }
  .pill { flex: 0 0 auto; min-height: 42px; padding: 9px 14px; }
  .model-select { margin-left: 0; width: 100%; justify-content: space-between; }
  .model-select select { min-height: 42px; flex: 1; max-width: 230px; }
  .result-count { width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .status { min-height: 42px; padding: 14px 2px 7px; font-size: 13px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card { margin-bottom: 12px; border-radius: 14px; }
  .image-wrap { min-height: 110px; }
  .badge { top: 8px; left: 8px; padding: 5px 8px; font-size: 10px; }
  .card-body { padding: 12px; }
  .card h2 { font-size: 14px; margin-bottom: 8px; }
  .open-hint { font-size: 11px; }
  .feed-sentinel { min-height: 64px; padding: 20px 0 4px; }
  .modal { width: 100vw; max-width: none; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .modal-close { position: fixed; top: 8px; right: 8px; margin: 0; width: 44px; height: 44px; box-shadow: 0 3px 14px rgba(0,0,0,.16); }
  .detail-grid { display: block; min-height: 100%; }
  .detail-media { min-height: 36vh; display: grid; place-items: center; }
  .detail-media img, .detail-media video { width: 100%; height: auto; max-height: 58vh; object-fit: contain; }
  .detail-copy { padding: 26px 18px 54px; overflow: visible; }
  .detail-copy h2 { font-size: clamp(28px, 9vw, 40px); margin-right: 24px; }
  .meta { margin-bottom: 20px; }
  .meta span, .source-link { min-height: 38px; display: inline-flex; align-items: center; }
  .copy-button { min-height: 40px; min-width: 66px; }
  .prompt-text { max-height: none; overflow: visible; font-size: 15px; line-height: 1.75; }
}

@media (max-width: 420px) {
  .gallery { grid-template-columns: 1fr; }
  .card { display: grid; grid-template-columns: 42% 1fr; min-height: 156px; }
  .image-wrap { min-height: 156px; }
  .image-wrap img { width: 100%; height: 100%; object-fit: cover; }
  .card-body { display: flex; flex-direction: column; justify-content: center; }
  .card h2 { font-size: 15px; }
}
