:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #172033;
  --muted: #687386;
  --line: #e3e7ed;
  --accent: #e84b31;
  --accent-soft: #fff0ec;
  --shadow: 0 10px 28px rgba(23, 32, 51, 0.07);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0 80px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: end;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .13em;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
  letter-spacing: -.045em;
}

.intro {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.count {
  min-width: 100px;
  padding: 13px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: right;
}

.count strong { display: block; font-size: 24px; line-height: 1; }
.count span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }

.search-panel { margin-bottom: 30px; }

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.search-box:focus-within {
  border-color: #f1a28f;
  box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow);
}

.search-box svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 17px;
}

.search-box input::placeholder { color: #9aa3b2; }

kbd {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 7px;
  color: var(--muted);
  background: #fafbfc;
  font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.graphics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.graphic-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.graphic-card:hover {
  transform: translateY(-2px);
  border-color: #d5dae2;
  box-shadow: var(--shadow);
}

.preview-link { display: block; color: inherit; text-decoration: none; }

.preview-wrap {
  --preview-padding: 22px;
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
  background-color: #f4f5f7;
  background-image:
    linear-gradient(45deg, #e9ebef 25%, transparent 25%),
    linear-gradient(-45deg, #e9ebef 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e9ebef 75%),
    linear-gradient(-45deg, transparent 75%, #e9ebef 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

.preview {
  position: absolute;
  inset: var(--preview-padding);
  width: calc(100% - (var(--preview-padding) * 2));
  height: calc(100% - (var(--preview-padding) * 2));
  display: block;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 6px 10px rgba(23, 32, 51, .08));
}

.card-copy { padding: 17px 18px 19px; }

.graphic-name {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.filename {
  margin: 5px 0 0;
  color: var(--accent);
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
}

.description {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.status {
  padding: 32px;
  border: 1px dashed #cfd5de;
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255,255,255,.6);
  text-align: center;
}

@media (max-width: 820px) {
  .shell { width: min(100% - 28px, 680px); padding-top: 38px; }
  .graphics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-header { align-items: start; }
}

@media (max-width: 540px) {
  .graphics-grid { grid-template-columns: 1fr; }
  .page-header { gap: 14px; }
  .count { min-width: 80px; }
  kbd { display: none; }
}

.pagination {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.page-summary {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.pagination-controls,
.page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pagination-button,
.page-button {
  min-width: 42px;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.pagination-button:hover:not(:disabled),
.page-button:hover:not(.is-current) {
  border-color: #d5dae2;
  background: #fafbfc;
}

.pagination-button:focus-visible,
.page-button:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 2px;
  border-color: #f1a28f;
}

.pagination-button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.page-button.is-current {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.pagination-ellipsis {
  min-width: 24px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 540px) {
  .pagination-controls {
    flex-wrap: wrap;
  }

  .page-numbers {
    order: -1;
    width: 100%;
  }
}
