:root {
  --tym-red: #b32025;
  --tym-red-dark: #8f191d;
  --tym-red-soft: #fde9ea;
  --tym-ink: #1f2328;
  --tym-muted: #677281;
  --tym-line: #dde3ea;
  --tym-bg: #f5f7fa;
  --tym-card: #ffffff;
  --tym-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --tym-radius-xl: 24px;
  --tym-radius-lg: 18px;
  --tym-radius-md: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, Arial, Helvetica, sans-serif; color: var(--tym-ink); background: var(--tym-bg); }
a { color: inherit; }
button, input, select { font: inherit; }

.tym-widget {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 18px 64px;
}

.tym-hero {
  background: linear-gradient(135deg, #121418 0%, #2b313a 58%, #b32025 130%);
  color: #fff;
  border-radius: 28px;
  padding: 32px;
  box-shadow: var(--tym-shadow);
  overflow: hidden;
  position: relative;
}
.tym-hero::after {
  content: "";
  position: absolute;
  inset: auto -60px -60px auto;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 70%);
}
.tym-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}
.tym-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}
.tym-hero h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}
.tym-hero p {
  margin: 14px 0 0;
  max-width: none;
  color: rgba(255,255,255,0.86);
  font-size: 16px;
  line-height: 1.6;
}
.tym-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  max-width: 820px;
  width: 100%;
  align-self: start;
}
.tym-stat {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 18px;
  text-align: center;
}
.tym-stat strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  margin-bottom: 8px;
}
.tym-stat span {
  display: block;
  color: rgba(255,255,255,0.74);
  font-size: 13px;
}

.tym-toolbar {
  margin-top: 22px;
  background: var(--tym-card);
  border: 1px solid var(--tym-line);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--tym-shadow);
  display: grid;
  gap: 14px;
}
.tym-toolbar-top {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(180px, 0.6fr)) auto;
  gap: 12px;
}
.tym-input, .tym-select {
  width: 100%;
  border: 1px solid var(--tym-line);
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  min-height: 52px;
  color: var(--tym-ink);
}
.tym-input:focus, .tym-select:focus {
  outline: none;
  border-color: rgba(179,32,37,.5);
  box-shadow: 0 0 0 4px rgba(179,32,37,.12);
}
.tym-clear-btn {
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  background: #111827;
  color: #fff;
  border-radius: 14px;
  cursor: pointer;
}
.tym-series-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tym-chip {
  border: 1px solid var(--tym-line);
  background: #fff;
  color: var(--tym-ink);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: .18s ease;
}
.tym-chip small { color: var(--tym-muted); font-weight: 500; }
.tym-chip:hover { transform: translateY(-1px); border-color: rgba(179,32,37,.35); }
.tym-chip.is-active {
  background: var(--tym-red);
  color: #fff;
  border-color: var(--tym-red);
}
.tym-chip.is-active small { color: rgba(255,255,255,0.8); }

.tym-series-panel {
  margin-top: 18px;
  background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
  border: 1px solid var(--tym-line);
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow: var(--tym-shadow);
}
.tym-series-panel h2 {
  margin: 0 0 8px;
  font-size: 24px;
}
.tym-series-panel p {
  margin: 0;
  color: var(--tym-muted);
  line-height: 1.7;
}

.tym-results-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 20px 0 12px;
}
.tym-results-head strong { font-size: 18px; }
.tym-results-meta { color: var(--tym-muted); font-size: 14px; }

.tym-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.tym-card {
  background: var(--tym-card);
  border: 1px solid var(--tym-line);
  border-radius: 22px;
  box-shadow: var(--tym-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.tym-card-media {
  aspect-ratio: 16 / 10;
  background: linear-gradient(180deg, #fff, #f3f5f8);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tym-card-media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.tym-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}
.tym-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.tym-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f1f4f8;
  color: #384250;
  font-size: 12px;
  font-weight: 700;
}
.tym-badge--hero { background: var(--tym-red-soft); color: var(--tym-red-dark); }
.tym-card-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}
.tym-card-subtitle {
  color: var(--tym-muted);
  font-size: 14px;
  margin-top: -6px;
}
.tym-spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.tym-spec-tile {
  border: 1px solid var(--tym-line);
  border-radius: 16px;
  padding: 12px;
  background: #fbfcfe;
}
.tym-spec-tile span {
  display: block;
  color: var(--tym-muted);
  font-size: 12px;
  margin-bottom: 5px;
}
.tym-spec-tile strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}
.tym-card-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}
.tym-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--tym-line);
  background: #fff;
  color: var(--tym-ink);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.tym-btn:hover { border-color: rgba(179,32,37,.35); }
.tym-btn--primary {
  background: var(--tym-red);
  border-color: var(--tym-red);
  color: #fff;
}
.tym-btn--primary:hover { background: var(--tym-red-dark); border-color: var(--tym-red-dark); }
.tym-btn--full { flex: 1; }

.tym-empty {
  background: #fff;
  border: 1px dashed #c8d0db;
  border-radius: 22px;
  padding: 42px 20px;
  text-align: center;
  color: var(--tym-muted);
}

.tym-modal[hidden] { display: none !important; }
.tym-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.tym-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(4px);
}
.tym-modal__dialog {
  position: relative;
  width: min(1200px, 100%);
  max-height: min(92vh, 960px);
  overflow: auto;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.22);
}
.tym-modal__close {
  position: sticky;
  top: 14px;
  margin-left: auto;
  margin-right: 14px;
  z-index: 4;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--tym-line);
  background: rgba(255,255,255,0.95);
  cursor: pointer;
}
.tym-modal__content {
  padding: 12px 26px 30px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  gap: 26px;
}
.tym-gallery-main {
  background: linear-gradient(180deg, #fff, #f4f6f9);
  border: 1px solid var(--tym-line);
  border-radius: 22px;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}
.tym-gallery-main img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tym-gallery-thumbs {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
}
.tym-thumb {
  border: 1px solid var(--tym-line);
  background: #fff;
  border-radius: 16px;
  aspect-ratio: 1;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tym-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tym-thumb.is-active { border-color: var(--tym-red); box-shadow: inset 0 0 0 1px var(--tym-red); }

.tym-modal__meta .tym-badges { margin-bottom: 12px; }
.tym-modal__title {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1;
}
.tym-modal__deck {
  color: var(--tym-muted);
  line-height: 1.7;
  margin: 12px 0 0;
}
.tym-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}
.tym-highlight-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 18px;
}
.tym-highlight-pill {
  background: #f6f8fb;
  border: 1px solid var(--tym-line);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
}
.tym-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 20px;
}
.tym-detail-card {
  background: #fafbfd;
  border: 1px solid var(--tym-line);
  border-radius: 16px;
  padding: 12px;
}
.tym-detail-card span {
  display: block;
  font-size: 12px;
  color: var(--tym-muted);
  margin-bottom: 4px;
}
.tym-detail-card strong {
  display: block;
  font-size: 15px;
  line-height: 1.4;
}
.tym-spec-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--tym-line);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
}
.tym-spec-table th,
.tym-spec-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--tym-line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}
.tym-spec-table th {
  width: 38%;
  background: #fbfcfe;
  color: #334155;
}
.tym-spec-table tr:last-child th,
.tym-spec-table tr:last-child td { border-bottom: 0; }
.tym-footnote {
  margin-top: 10px;
  color: var(--tym-muted);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 1200px) {
  .tym-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .tym-hero-grid,
  .tym-toolbar-top,
  .tym-modal__content {
    grid-template-columns: 1fr;
  }
  .tym-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .tym-widget { padding-inline: 12px; }
  .tym-hero { padding: 22px; border-radius: 24px; }
  .tym-hero-stats { grid-template-columns: 1fr; }
  .tym-grid { grid-template-columns: 1fr; }
  .tym-spec-grid,
  .tym-detail-grid,
  .tym-gallery-thumbs { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tym-card-actions,
  .tym-modal__actions { flex-direction: column; }
  .tym-btn--full { width: 100%; }
  .tym-modal { padding: 8px; }
  .tym-modal__dialog { border-radius: 18px; }
  .tym-modal__content { padding: 10px 14px 20px; }
  .tym-series-panel h2 { font-size: 22px; }
}
.tym-logo-wrap {
  margin: 0 0 18px 0;
  padding: 6px 0 10px 0;
}
.tym-logo {
  display: block;
  max-width: 120px;
  width: 100%;
  height: auto;
}