/* handraw gallery — jcbot tokens; thin-border cards; type steps ≤4 */

.hd-page-note {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.8rem; /* step 3 */
  line-height: 1.4;
}

.hd-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin-bottom: 0.75rem;
}

.hd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.hd-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg1);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.26rem 0.68rem;
  font: inherit;
  font-size: 0.8rem; /* step 3 */
  cursor: pointer;
  line-height: 1.3;
}

.hd-chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--bg2-hover);
}

.hd-chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.hd-search {
  flex: 1 1 11rem;
  min-width: 9rem;
  max-width: 20rem;
}

.hd-search input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg1);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.38rem 0.65rem;
  font: inherit;
  font-size: 0.85rem; /* step 2 */
}

.hd-search input::placeholder {
  color: var(--dim);
}

.hd-meta {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.75rem; /* step 4 */
}

.hd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
}

.hd-card {
  display: flex;
  flex-direction: column;
  background: var(--bg1);
  border: 1px solid var(--border); /* thin border — no left bar */
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
}

.hd-card:hover {
  border-color: var(--border-strong);
  background: var(--bg2);
}

.hd-thumb {
  aspect-ratio: 1 / 1;
  width: 100%;
  background: var(--bg0);
  border-bottom: 1px solid var(--border-soft);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.hd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hd-ph {
  color: var(--dim);
  font-size: 0.8rem;
  text-align: center;
  padding: 0.75rem;
}

.hd-credit {
  margin: 0;
  padding: 0.4rem 0.7rem 0.35rem;
  font-size: 0.75rem; /* step 4 — readable */
  color: var(--dim);
  line-height: 1.35;
  border-bottom: 1px solid var(--border-soft);
}

.hd-credit a {
  color: var(--accent);
}

.hd-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.65rem 0.7rem 0.8rem;
  flex: 1;
}

.hd-idrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.45rem;
}

.hd-id {
  font-family: var(--mono);
  font-size: 0.8rem; /* step 3 */
  font-weight: 650;
  color: var(--accent);
}

.hd-cat {
  font-size: 0.75rem; /* step 4 */
  color: var(--muted);
}

.hd-scene {
  margin: 0;
  font-size: 0.9rem; /* step 1 — card main */
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}

.hd-sec {
  margin: 0;
  font-size: 0.75rem; /* step 4 */
  color: var(--muted);
  line-height: 1.35;
}

.hd-fit,
.hd-unfit {
  margin: 0;
  font-size: 0.78rem; /* step 3 — below title */
  color: var(--muted);
  line-height: 1.4;
}

.hd-unfit {
  color: var(--dim);
}

.hd-empty {
  grid-column: 1 / -1;
  padding: 1.75rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  border: 1px dashed var(--border-soft);
  border-radius: var(--radius);
}

.hd-footer {
  margin-top: 1.5rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-soft);
  font-size: 0.75rem; /* step 4 */
  color: var(--muted);
  line-height: 1.4;
}

.hd-footer a {
  color: var(--accent);
}

@media (max-width: 640px) {
  .hd-grid {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* T-30 rail chips */
.hd-rail-chips {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}
.hd-rail-chips .hd-chip {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 6px;
}
@media (max-width: 999px) {
  .hd-rail-chips {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .hd-rail-chips .hd-chip { width: auto; }
}
