/* toys.9minecraft.net — Toy Shelf & Collector Showcase Design System (V6+)
   Light-mode default, Minecraft block pastel palette, Model 10 soft gradient cards,
   ZERO single-edge color bars, ZERO dark backdrops in light mode, ZERO external CDNs. */

:root {
  --ty-bg: #f7fafc;
  --ty-surface: #ffffff;
  --ty-soft: #f1f5f9;
  --ty-ink: #1e293b;
  --ty-ink-2: #475569;
  --ty-muted: #64748b;
  --ty-line: #e2e8f0;
  --ty-line-2: #cbd5e1;
  --ty-grass: #22c55e;
  --ty-diamond: #0ea5e9;
  --ty-oak: #f59e0b;
  --ty-cherry: #ec4899;
  --ty-amethyst: #8b5cf6;
  --ty-redstone: #ef4444;
  --ty-teal: #14b8a6;
  --ty-shadow: 0 1px 2px rgba(60, 64, 67, .10), 0 1px 3px rgba(15, 23, 42, .06);
  --ty-shadow-hover: 0 8px 22px rgba(15, 23, 42, .11);
  --ty-r: 18px;
  --ty-r-sm: 12px;
}

html[data-theme="dark"] {
  --ty-bg: #11161d;
  --ty-surface: #1a212b;
  --ty-soft: #222b38;
  --ty-ink: #edf2f7;
  --ty-ink-2: #cbd5e1;
  --ty-muted: #94a3b8;
  --ty-line: #2d3748;
  --ty-line-2: #3b475c;
  --ty-shadow: 0 1px 3px rgba(0, 0, 0, .45);
  --ty-shadow-hover: 0 10px 26px rgba(0, 0, 0, .55);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --ty-bg: #11161d;
    --ty-surface: #1a212b;
    --ty-soft: #222b38;
    --ty-ink: #edf2f7;
    --ty-ink-2: #cbd5e1;
    --ty-muted: #94a3b8;
    --ty-line: #2d3748;
    --ty-line-2: #3b475c;
    --ty-shadow: 0 1px 3px rgba(0, 0, 0, .45);
    --ty-shadow-hover: 0 10px 26px rgba(0, 0, 0, .55);
  }
}

html body {
  background: var(--ty-bg);
  color: var(--ty-ink);
}

/* Always respect hidden attribute on flex/grid containers */
.ty-card[hidden],
.ty-sec[hidden],
.ty-more[hidden],
.ty-loc-extra[hidden],
.ty-chk-row[hidden],
.ty-panel[hidden],
[hidden] {
  display: none !important;
}

/* ── Section Header (toy shelf aisle) ── */
.ty-sec {
  margin: 28px 0 34px;
}

.ty-sec__h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}

.ty-sec__title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: clamp(20px, 2.3vw, 26px);
  line-height: 1.2;
  font-weight: 800;
  color: var(--ty-ink);
  letter-spacing: -.015em;
}

.ty-sec__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--tc, var(--ty-diamond));
  flex: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tc, var(--ty-diamond)) 18%, transparent);
}

.ty-sec__count {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ty-muted);
  font-variant-numeric: tabular-nums;
}

.ty-sec__all {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  color: color-mix(in srgb, var(--tc, var(--ty-diamond)) 82%, var(--ty-ink));
  background: color-mix(in srgb, var(--tc, var(--ty-diamond)) 12%, var(--ty-surface));
  transition: background .15s, transform .15s;
}

.ty-sec__all:hover {
  background: color-mix(in srgb, var(--tc, var(--ty-diamond)) 20%, var(--ty-surface));
  transform: translateY(-1px);
}

/* ── Home Search Bar Strip ── */
.ty-home-search {
  margin: -36px auto 26px;
  position: relative;
  z-index: 3;
  max-width: 820px;
  padding: 16px 18px;
  border: 0;
  border-radius: 20px;
  background: linear-gradient(165deg, color-mix(in srgb, var(--ty-diamond) 10%, var(--ty-surface)) 0%, var(--ty-surface) 62%);
  box-shadow: 0 6px 24px rgba(15, 23, 42, .10);
}

.ty-home-search__form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ty-home-search__in {
  flex: 1 1 260px;
  min-width: 0;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 13px;
  border: 1px solid var(--ty-line-2);
  background: var(--ty-surface);
  color: var(--ty-ink);
  font-size: 16px;
}

.ty-home-search__in:focus {
  outline: 2px solid var(--ty-diamond);
  outline-offset: 1px;
  border-color: var(--ty-diamond);
}

.ty-home-search__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

/* ── Buttons ── */
.ty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--ty-line-2);
  background: var(--ty-surface);
  color: var(--ty-ink);
  font: 700 14.5px/1 system-ui, -apple-system, Roboto, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
}

.ty-btn:hover {
  border-color: var(--ty-diamond);
  background: color-mix(in srgb, var(--ty-diamond) 8%, var(--ty-surface));
  transform: translateY(-1px);
}

.ty-btn--pri {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff !important;
}

.ty-btn--pri:hover {
  background: #0369a1;
  border-color: #0369a1;
  box-shadow: 0 4px 14px rgba(2, 132, 199, .28);
}

.ty-btn--grass {
  background: #15803d;
  border-color: #15803d;
  color: #ffffff !important;
}

.ty-btn--grass:hover {
  background: #166534;
  border-color: #166534;
}

.ty-btn--own[aria-pressed="true"] {
  background: #15803d;
  border-color: #15803d;
  color: #ffffff !important;
}

/* ── Model 10 Soft-Gradient Toy Box Cards ── */
.ty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 16px;
}

.ty-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ty-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ty-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(192px, 1fr));
  gap: 12px;
}

.ty-card {
  display: flex;
  flex-direction: column;
  border: 0;
  border-radius: var(--ty-r);
  overflow: hidden;
  text-decoration: none;
  color: var(--ty-ink);
  background: linear-gradient(165deg, color-mix(in srgb, var(--tc, #0ea5e9) 14%, var(--ty-surface)) 0%, var(--ty-surface) 60%);
  box-shadow: var(--ty-shadow);
  transition: transform .16s, box-shadow .16s;
}

.ty-card:hover,
.ty-maker-card:hover,
.ty-tl-card:hover {
  text-decoration: none;
}

.ty-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--ty-shadow-hover);
}

/* Transparent figure container so Model 10 gradient flows seamlessly */
.ty-card__fig {
  position: relative;
  aspect-ratio: 16 / 10;
  background: transparent;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ty-card__fig--sq {
  aspect-ratio: 4 / 3;
}

.ty-card__fig img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .22s;
}

.ty-card__fig--contain img {
  object-fit: contain;
  padding: 10px;
  box-sizing: border-box;
}

.ty-card:hover .ty-card__fig img {
  transform: scale(1.03);
}

.ty-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .02em;
  background: color-mix(in srgb, var(--ty-surface) 92%, transparent);
  color: color-mix(in srgb, var(--tc, #0ea5e9) 82%, var(--ty-ink));
  box-shadow: 0 1px 4px rgba(15, 23, 42, .12);
  font-variant-numeric: tabular-nums;
}

.ty-card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.ty-card__k {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.ty-card__t {
  margin: 0;
  font-size: 16.5px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ty-ink);
}

.ty-card__p {
  margin: 0;
  font-size: 13.8px;
  line-height: 1.5;
  color: var(--ty-ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ty-card__foot {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* ── Pills & Metadata Chips ── */
.ty-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  color: var(--ty-ink-2);
  background: color-mix(in srgb, var(--ty-soft) 90%, var(--ty-surface));
  font-variant-numeric: tabular-nums;
}

.ty-pill--accent {
  color: color-mix(in srgb, var(--tc, #0ea5e9) 82%, var(--ty-ink));
  background: color-mix(in srgb, var(--tc, #0ea5e9) 14%, var(--ty-surface));
}

.ty-pill--available {
  color: #15803d;
  background: #dcfce7;
}

.ty-pill--retired {
  color: #b91c1c;
  background: #fee2e2;
}

.ty-pill--exclusive {
  color: #7c3aed;
  background: #ede9fe;
}

.ty-pill--promo {
  color: #b45309;
  background: #fef3c7;
}

html[data-theme="dark"] .ty-pill--available {
  color: #86efac;
  background: #143221;
}

html[data-theme="dark"] .ty-pill--retired {
  color: #fca5a5;
  background: #38181c;
}

html[data-theme="dark"] .ty-pill--exclusive {
  color: #c4b5fd;
  background: #291d42;
}

html[data-theme="dark"] .ty-pill--promo {
  color: #fcd34d;
  background: #362611;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .ty-pill--available { color: #86efac; background: #143221; }
  html:not([data-theme="light"]) .ty-pill--retired { color: #fca5a5; background: #38181c; }
  html:not([data-theme="light"]) .ty-pill--exclusive { color: #c4b5fd; background: #291d42; }
  html:not([data-theme="light"]) .ty-pill--promo { color: #fcd34d; background: #362611; }
}

/* ── Toy Makers Showcase (Top of Home + /tools/) ── */
.ty-maker-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 0;
  border-radius: var(--ty-r);
  text-decoration: none;
  color: var(--ty-ink);
  background: linear-gradient(165deg, color-mix(in srgb, var(--tc, #0ea5e9) 16%, var(--ty-surface)) 0%, var(--ty-surface) 62%);
  box-shadow: var(--ty-shadow);
  transition: transform .16s, box-shadow .16s;
}

.ty-maker-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--ty-shadow-hover);
}

.ty-maker-card__ic {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  background: color-mix(in srgb, var(--tc, #0ea5e9) 18%, var(--ty-surface));
  color: color-mix(in srgb, var(--tc, #0ea5e9) 85%, var(--ty-ink));
}

.ty-maker-card__ic svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ty-maker-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  color: var(--ty-ink);
}

.ty-maker-card p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ty-ink-2);
}

.ty-maker-card__cta {
  margin-top: auto;
  font-size: 13.5px;
  font-weight: 800;
  color: color-mix(in srgb, var(--tc, #0ea5e9) 85%, var(--ty-ink));
}

/* ── Detail Page Header & LEGO Spec Sheet ── */
.ty-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin: 12px 0 24px;
}

.ty-stage {
  border: 0;
  border-radius: 20px;
  overflow: hidden;
  padding: 14px;
  background: linear-gradient(165deg, color-mix(in srgb, var(--tc, #22c55e) 12%, var(--ty-surface)) 0%, var(--ty-surface) 64%);
  box-shadow: var(--ty-shadow);
}

.ty-stage img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  border-radius: 14px;
}

.ty-stage__cap {
  margin: 10px 4px 0;
  font-size: 12.5px;
  color: var(--ty-muted);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ty-spec {
  border: 0;
  border-radius: 20px;
  padding: 20px 22px;
  background: linear-gradient(165deg, color-mix(in srgb, var(--tc, #22c55e) 12%, var(--ty-surface)) 0%, var(--ty-surface) 62%);
  box-shadow: var(--ty-shadow);
}

.ty-spec__code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.02em;
  color: color-mix(in srgb, var(--tc, #22c55e) 82%, var(--ty-ink));
  font-variant-numeric: tabular-nums;
  margin: 0 0 8px;
}

.ty-spec h1 {
  margin: 0 0 10px;
  font-size: clamp(22px, 2.8vw, 31px);
  line-height: 1.2;
  color: var(--ty-ink);
}

.ty-spec__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 16px;
}

.ty-stat {
  padding: 11px 13px;
  border-radius: 13px;
  background: var(--ty-soft);
}

.ty-stat__l {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ty-muted);
  margin-bottom: 3px;
}

.ty-stat__v {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: var(--ty-ink);
  font-variant-numeric: tabular-nums;
}

.ty-spec__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

/* ── Panel / Callout Box (Model 10, 0 single-side bar) ── */
.ty-panel {
  border: 0;
  border-radius: var(--ty-r);
  padding: 20px 22px;
  margin: 18px 0 22px;
  background: linear-gradient(165deg, color-mix(in srgb, var(--tc, #0ea5e9) 11%, var(--ty-surface)) 0%, var(--ty-surface) 64%);
  box-shadow: var(--ty-shadow);
}

.ty-panel h2 {
  margin: 0 0 12px;
  font-size: 21px;
  line-height: 1.28;
  color: var(--ty-ink);
}

.ty-panel p {
  margin: 0 0 12px;
  font-size: 15.5px;
  line-height: 1.68;
  color: var(--ty-ink-2);
}

.ty-panel p:last-child {
  margin-bottom: 0;
}

.ty-panel code,
.ty-steps code,
.ty-tbl code,
article.g-article code {
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 0.9em;
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--ty-soft);
}

/* ── Numbered Step Blocks (Build It In Minecraft / How To Get / How To Use) ── */
.ty-steps {
  list-style: none;
  margin: 14px 0 18px;
  padding: 0;
  counter-reset: tystep;
  display: grid;
  gap: 12px;
}

.ty-steps li {
  counter-increment: tystep;
  position: relative;
  padding: 14px 16px 14px 56px;
  border-radius: 14px;
  background: var(--ty-soft);
  color: var(--ty-ink-2);
  font-size: 15.5px;
  line-height: 1.62;
}

.ty-steps li::before {
  content: counter(tystep);
  position: absolute;
  left: 14px;
  top: 13px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--tc, #0284c7);
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}

.ty-steps li b {
  color: var(--ty-ink);
}

/* ── Collector Checklist UI (/checklists/ & /series/) ── */
.ty-chk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-radius: var(--ty-r);
  background: linear-gradient(165deg, color-mix(in srgb, var(--ty-oak) 14%, var(--ty-surface)) 0%, var(--ty-surface) 64%);
  box-shadow: var(--ty-shadow);
  margin: 14px 0 18px;
}

.ty-chk-prog {
  flex: 1 1 240px;
  min-width: 0;
}

.ty-chk-prog__t {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 7px;
  font-variant-numeric: tabular-nums;
}

.ty-chk-track {
  height: 10px;
  border-radius: 999px;
  background: var(--ty-line);
  overflow: hidden;
}

.ty-chk-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #0ea5e9);
  transition: width .22s;
}

.ty-chk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.ty-chk-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 15px;
  background: linear-gradient(165deg, color-mix(in srgb, var(--tc, #0ea5e9) 10%, var(--ty-surface)) 0%, var(--ty-surface) 65%);
  box-shadow: var(--ty-shadow);
}

.ty-chk-row.is-owned {
  background: linear-gradient(165deg, color-mix(in srgb, #22c55e 18%, var(--ty-surface)) 0%, var(--ty-surface) 65%);
}

.ty-chk-btn {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 2px solid var(--ty-line-2);
  background: var(--ty-surface);
  color: #ffffff;
  font-size: 20px;
  font-weight: 900;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.ty-chk-btn[aria-pressed="true"] {
  background: #16a34a;
  border-color: #16a34a;
}

.ty-chk-info {
  min-width: 0;
  flex: 1;
}

.ty-chk-info a {
  display: block;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ty-ink);
  text-decoration: none;
  line-height: 1.3;
}

.ty-chk-info a:hover {
  text-decoration: underline;
}

.ty-chk-info span {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--ty-muted);
  font-variant-numeric: tabular-nums;
}

/* ── Year Timeline (/years/) ── */
.ty-tl-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: thin;
}

.ty-tl-yr {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 15px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--ty-ink);
  background: var(--ty-surface);
  box-shadow: var(--ty-shadow);
  transition: background .15s, color .15s;
}

.ty-tl-yr:hover,
.ty-tl-yr--on {
  background: #0284c7;
  color: #ffffff;
}

.ty-tl-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.ty-tl-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-radius: var(--ty-r);
  text-decoration: none;
  color: var(--ty-ink);
  background: linear-gradient(165deg, color-mix(in srgb, var(--tc, #0ea5e9) 14%, var(--ty-surface)) 0%, var(--ty-surface) 64%);
  box-shadow: var(--ty-shadow);
  transition: transform .16s, box-shadow .16s;
}

.ty-tl-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ty-shadow-hover);
}

.ty-tl-card__y {
  font-size: 30px;
  font-weight: 900;
  line-height: 1.05;
  color: color-mix(in srgb, var(--tc, #0ea5e9) 82%, var(--ty-ink));
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
}

.ty-tl-card__n {
  font-size: 14px;
  font-weight: 700;
  color: var(--ty-ink);
  margin-bottom: 6px;
}

.ty-tl-card__s {
  font-size: 13px;
  line-height: 1.45;
  color: var(--ty-muted);
}

/* ── Filter Bar (.b-loc enhancements compatible with _loc_chuan.js) ── */
.ty-loc-search {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ty-loc-search input {
  flex: 1 1 240px;
  min-width: 0;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--ty-line-2);
  background: var(--ty-surface);
  color: var(--ty-ink);
  font-size: 16px;
}

.ty-more-filters {
  border: 1px solid var(--ty-line-2);
  background: var(--ty-surface);
  color: var(--ty-ink);
  padding: 0 14px;
  min-height: 40px;
  border-radius: 999px;
  font: 700 13.5px/1 system-ui, sans-serif;
  cursor: pointer;
}

.ty-more-filters:hover {
  border-color: var(--ty-diamond);
}

/* ── Pagination & Show More ── */
.ty-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: 24px 0 8px;
}

.ty-pager a,
.ty-pager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  padding: 0 13px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  background: var(--ty-surface);
  color: var(--ty-ink);
  box-shadow: var(--ty-shadow);
}

.ty-pager span.on {
  background: #0284c7;
  color: #ffffff;
}

/* ── Responsive Tables -> Mobile Pill Cards (0 horizontal overflow) ── */
.ty-tbl-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 14px 0 20px;
  border-radius: 14px;
}

.ty-tbl {
  width: 100%;
  border-collapse: collapse;
  background: var(--ty-surface);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--ty-shadow);
  font-size: 14.5px;
}

.ty-tbl th,
.ty-tbl td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--ty-line);
  vertical-align: top;
}

.ty-tbl th {
  background: var(--ty-soft);
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ty-muted);
}

.ty-tbl tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 640px) {
  .ty-tbl-wrap {
    overflow-x: visible;
  }
  .ty-tbl,
  .ty-tbl tbody,
  .ty-tbl tr,
  .ty-tbl td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  .ty-tbl {
    background: transparent;
    box-shadow: none;
  }
  .ty-tbl thead {
    display: none;
  }
  .ty-tbl tr {
    margin: 0 0 12px;
    border-radius: 14px;
    border: 1px solid var(--ty-line);
    background: var(--ty-surface);
    overflow: hidden;
    box-shadow: var(--ty-shadow);
  }
  .ty-tbl td {
    border-bottom: 1px solid var(--ty-line);
    padding: 10px 13px;
  }
  .ty-tbl td:first-child {
    background: color-mix(in srgb, var(--ty-diamond) 9%, var(--ty-surface));
    font-weight: 800;
    font-size: 15.5px;
    color: var(--ty-ink);
  }
  .ty-tbl td[data-label]::before {
    content: attr(data-label);
    display: inline-block;
    margin: 0 0 6px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #0369a1;
    background: color-mix(in srgb, var(--ty-diamond) 14%, var(--ty-surface));
  }
  html[data-theme="dark"] .ty-tbl td[data-label]::before {
    color: #7dd3fc;
  }
  .ty-tbl td[data-label] {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Tool Workspace Layout (Desktop 2-col, Mobile full-width preview + bottom dock) ── */
.ty-tool-shell {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin: 14px 0 26px;
}

.ty-tool-ctrl {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: var(--ty-r);
  background: linear-gradient(165deg, color-mix(in srgb, var(--tc, #0ea5e9) 10%, var(--ty-surface)) 0%, var(--ty-surface) 64%);
  box-shadow: var(--ty-shadow);
}

.ty-tool-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ty-muted);
  margin-bottom: 6px;
}

.ty-tool-field input,
.ty-tool-field select {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--ty-line-2);
  background: var(--ty-surface);
  color: var(--ty-ink);
  font-size: 16px;
}

.ty-tool-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(165deg, color-mix(in srgb, var(--tc, #0ea5e9) 9%, var(--ty-surface)) 0%, var(--ty-surface) 62%);
  box-shadow: var(--ty-shadow);
}

.ty-tool-view canvas {
  width: 100%;
  max-width: 720px;
  height: auto;
  border-radius: 14px;
  background: var(--ty-surface);
  box-shadow: 0 2px 12px rgba(15, 23, 42, .08);
}

.ty-tool-view canvas.is-pixel {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ── Responsive Breakpoints ── */
@media (max-width: 960px) {
  .ty-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ty-grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ty-detail-hero {
    grid-template-columns: 1fr;
  }
  .ty-tool-shell {
    grid-template-columns: 1fr;
  }
  .ty-tool-view {
    order: -1;
    padding: 12px;
  }
}

@media (max-width: 640px) {
  .ty-grid,
  .ty-grid--3,
  .ty-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
  }
  .ty-grid--1m {
    grid-template-columns: 1fr;
  }
  .ty-card__body {
    padding: 11px 12px 13px;
  }
  .ty-card__t {
    font-size: 14.5px;
  }
  .ty-home-search {
    margin: -22px 0 20px;
    padding: 13px;
  }
  .ty-spec {
    padding: 16px;
  }
  .ty-spec__stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .ty-panel {
    padding: 15px 16px;
  }
  .ty-chk-grid {
    grid-template-columns: 1fr;
  }
}

/* ── V17 Community Favorite Set Poll ── */
.ty-vote { display: flex; flex-direction: column; gap: 10px; }
.ty-vote__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--ty-ink-2); }
.ty-vote__list { display: flex; flex-direction: column; gap: 8px; }
.ty-vote__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--ty-line); background: linear-gradient(155deg, color-mix(in srgb, #22c55e 9%, var(--ty-surface)) 0%, var(--ty-surface) 65%); }
.ty-vote__rank { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; border-radius: 10px; font-weight: 800; font-size: 13.5px; background: color-mix(in srgb, #f59e0b 18%, var(--ty-surface)); color: var(--ty-ink); }
.ty-vote__info { flex: 1 1 210px; min-width: 0; }
.ty-vote__name { font-weight: 800; font-size: 14.5px; color: var(--ty-ink); text-decoration: none; display: block; }
.ty-vote__name:hover { text-decoration: underline; }
.ty-vote__meta { font-size: 12.5px; color: var(--ty-muted); margin-top: 2px; }
.ty-vote__btns { display: flex; flex-wrap: wrap; gap: 5px; }
.ty-vote__btn { min-width: 40px; min-height: 36px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--ty-line-2); background: var(--ty-surface); color: var(--ty-ink); font: 700 12.5px/1 system-ui, sans-serif; cursor: pointer; }
.ty-vote__btn:hover { border-color: #f59e0b; background: color-mix(in srgb, #f59e0b 14%, var(--ty-surface)); }
.ty-vote__btn[aria-pressed="true"] { background: #d97706; border-color: #d97706; color: #fff; }
.ty-vote__stat { font-size: 13px; font-weight: 700; color: var(--ty-ink-2); min-height: 18px; }

/* ── V24 Context-Aware Sort By Bar & Paged Archive Sort Shell ── */
.b-loc--page {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  margin: 0;
}
.ty-sortbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 10px 0 14px;
}
.ty-sortbar__lbl {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ty-muted);
  margin-right: 2px;
  white-space: nowrap;
}
.ty-sortbar__btn {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--ty-line-2);
  background: var(--ty-surface);
  color: var(--ty-ink);
  font: 600 13.5px/1 system-ui, -apple-system, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.ty-sortbar__btn:hover {
  border-color: #0284c7;
  background: color-mix(in srgb, #0284c7 10%, var(--ty-surface));
}
.ty-sortbar__btn[aria-pressed="true"] {
  background: #15803d;
  border-color: #15803d;
  color: #ffffff;
  font-weight: 700;
}
@media (max-width: 640px) {
  .ty-sortbar {
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
  }
  .ty-sortbar__lbl {
    width: 100%;
    margin-bottom: 2px;
  }
  .ty-sortbar__btn {
    height: 34px;
    padding: 0 12px;
    font-size: 13px;
  }
}

/* ── Reduced Motion Accessibility ── */
@media (prefers-reduced-motion: reduce) {
  .ty-card,
  .ty-card__fig img,
  .ty-maker-card,
  .ty-tl-card,
  .ty-btn,
  .ty-sec__all,
  .ty-chk-fill {
    transition: none !important;
    transform: none !important;
  }
}
