/* YeScript marketing pages — layout fixes + overview-specific blocks.
   Scoped to .ys-page; not subject to home/agg font whitelist. */

/* Theme tokens — mirror tradeiz-home.css (.tt-home / .tt-agg) so
   var(--tt-fg-0) is #fff on dark and #000 on light inside YeScript pages. */
.theme--dark .ys-page,
body.theme--dark .ys-page {
  --tt-bg-0: #000000;
  --tt-line: #0a0a0a;
  --tt-line-2: #161616;
  --tt-fg-0: #d0d0d0;
  --tt-up: #00C896;
  --tt-down: #FF4D6A;
  --tt-accent: #2962ff;
  --tt-border: rgba(255, 255, 255, 0.12);
}

body.theme--light .ys-page,
.theme--light .ys-page {
  --tt-bg-0: #ffffff;
  --tt-line: #e8e8e8;
  --tt-line-2: #d0d0d0;
  --tt-fg-0: #181818;
  --tt-up: #00C896;
  --tt-down: #FF4D6A;
  --tt-accent: #2962ff;
  --tt-border: rgba(0, 0, 0, 0.12);
}

.ys-page {
  background: var(--tt-bg-0);
  color: var(--tt-fg-0);
}

/* YeScript marketing sub-nav tab strip (partials/yescript-subnav.ejs). */
.ys-page .ai-subnav {
  margin: 30px 0 36px;
  border-bottom: 1px solid var(--tt-border);
}
.ys-page .ai-subnav__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.ys-page .ai-subnav__item {
  padding: 0;
}
.ys-page .ai-subnav__link {
  display: inline-block;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tt-fg-0);
  opacity: 0.6;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 150ms ease, border-color 150ms ease, opacity 150ms ease;
}
.ys-page .ai-subnav__link:hover {
  color: var(--tt-fg-0);
  opacity: 1;
  border-bottom-color: rgba(41, 98, 255, 0.45);
  text-decoration: none;
}
.ys-page .ai-subnav__link.is-active {
  color: var(--tt-fg-0);
  opacity: 1;
  border-bottom-color: var(--tt-accent);
}
body.theme--light .ys-page .ai-subnav {
  border-bottom-color: var(--tt-border);
}

/* Corp-page body inherits crocus #6c757d without explicit --tt-fg-0 scope. */
.ys-page.corp-page,
.ys-page .corp-page,
.ys-page .corp-page .corp-page__body,
.ys-page .corp-page .corp-page__body p,
.ys-page .corp-page .corp-page__body h2,
.ys-page .corp-page .corp-page__body h3,
.ys-page .corp-page .corp-page__body ul,
.ys-page .corp-page .corp-page__body li,
.ys-page .corp-page .corp-page__list,
.ys-page .corp-page .corp-page__list li,
.ys-page .corp-page .corp-page__title,
.ys-page .corp-page .corp-page__sub,
.ys-page .corp-page h2.s-22,
.ys-page .corp-page h3.s-18 {
  color: var(--tt-fg-0);
}

.ys-page .inner-page-hero {
  position: relative;
  z-index: 1;
  padding-top: 160px !important;
  margin-top: 0 !important;
}

.ys-community-page .inner-page-hero,
.ys-creators-page .inner-page-hero {
  padding-top: 176px !important;
}
@media (max-width: 991px) {
  .ys-page .inner-page-hero {
    padding-top: 120px !important;
  }
  .ys-community-page .inner-page-hero,
  .ys-creators-page .inner-page-hero {
    padding-top: 132px !important;
  }
  body.wsactive .ys-page .inner-page-hero {
    /* Keep content below open mobile drawer without fighting menu.js */
    pointer-events: none;
  }
  body.wsactive .ys-community-page .inner-page-hero,
  body.wsactive .ys-creators-page .inner-page-hero {
    padding-top: 280px !important;
    z-index: 1;
  }
  body.wsactive .ys-page #header {
    z-index: 1100;
  }
  body.wsactive .ys-community-page #header,
  body.wsactive .ys-creators-page #header {
    z-index: 1200;
  }
}

@media (min-width: 1280px) {
  /* [FIX] 2026-07-08 — align desktop guard with menu.js/menu.css breakpoint.
     Desktop starts at 1280; 992-1279 is still mobile drawer mode. */
  body.wsactive .ys-community-page .wsmenu,
  body.wsactive .ys-creators-page .wsmenu {
    position: static !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    background: transparent !important;
  }

  body.wsactive .ys-community-page .wsmenu > .wsmenu-list,
  body.wsactive .ys-creators-page .wsmenu > .wsmenu-list {
    max-height: none !important;
    overflow: visible !important;
    background: transparent !important;
  }

  body.wsactive .ys-community-page .wsmenu .overlapblackbg,
  body.wsactive .ys-creators-page .wsmenu .overlapblackbg {
    display: none !important;
  }
}

/* Hero band — full-width card under site header (pricing-page pattern). */
.ys-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 40px;
  margin-bottom: 48px;
  padding: 32px 36px;
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.12));
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}
body.theme--light .ys-hero {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.10);
}
.ys-hero__copy {
  flex: 1 1 420px;
  min-width: 0;
}
.ys-hero__badge {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tt-accent, #2962ff);
  background: rgba(41, 98, 255, 0.10);
  border: 1px solid rgba(41, 98, 255, 0.22);
}
body.theme--light .ys-hero__badge {
  color: #1c54f0;
  background: rgba(41, 98, 255, 0.08);
  border-color: rgba(41, 98, 255, 0.28);
}
.ys-hero__title {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--tt-fg-0);
}
.ys-hero__sub {
  font-size: 16px;
  line-height: 1.65;
  margin: 0;
  color: var(--tt-fg-0);
  opacity: 0.78;
  max-width: 62ch;
}
.ys-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}
.ys-btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}
.ys-btn--primary {
  background: #2962ff;
  border-color: #2962ff;
  color: #ffffff !important;
}
.ys-btn--primary:hover {
  background: #1c54f0;
  border-color: #1c54f0;
  transform: translateY(-1px);
  text-decoration: none;
}
.ys-btn--ghost {
  background: transparent;
  border-color: var(--tt-border);
  color: var(--tt-fg-0);
}
.ys-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}
body.theme--light .ys-btn--ghost:hover {
  background: rgba(0, 0, 0, 0.06);
}
.ys-hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--tt-border, rgba(255, 255, 255, 0.08));
}
@media (max-width: 768px) {
  .ys-hero__stats { grid-template-columns: 1fr; }
}
@media (max-width: 991px) {
  .ys-hero {
    align-items: flex-start;
  }
}
.ys-stat {
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.08));
  background: rgba(255, 255, 255, 0.015);
  min-width: 0;
}
body.theme--light .ys-stat {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}
.ys-stat__val {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--tt-fg-0);
  margin-bottom: 4px;
}
.ys-stat__lbl {
  display: block;
  font-size: 12px;
  line-height: 1.45;
  color: var(--tt-fg-0);
  opacity: 0.65;
}

.ys-workbench {
  margin: 6px 0 24px;
}
.ys-workbench__frame {
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.14));
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.015);
}
body.theme--light .ys-workbench__frame {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.12);
}
.ys-workbench__topbar {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--tt-border, rgba(255, 255, 255, 0.1));
}
.ys-workbench__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(41, 98, 255, 0.45);
}
.ys-workbench__body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 0;
}
.ys-workbench__chart {
  min-height: 210px;
  padding: 14px;
  border-right: 1px solid var(--tt-border, rgba(255, 255, 255, 0.1));
  background: rgba(255, 255, 255, 0.012);
}
body.theme--light .ys-workbench__chart {
  background: rgba(0, 0, 0, 0.015);
}
.ys-workbench__chart-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(41, 98, 255, 0.38);
  background: rgba(41, 98, 255, 0.16);
  color: var(--tt-fg-0);
  font-size: 12px;
}
.ys-workbench__candles {
  margin-top: 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  height: 150px;
}
.ys-workbench__candles span {
  flex: 1 1 0;
  border-radius: 3px 3px 2px 2px;
  background: rgba(255, 255, 255, 0.3);
}
.ys-workbench__candles span:nth-child(1) { height: 42%; }
.ys-workbench__candles span:nth-child(2) { height: 68%; }
.ys-workbench__candles span:nth-child(3) { height: 34%; }
.ys-workbench__candles span:nth-child(4) { height: 84%; }
.ys-workbench__candles span:nth-child(5) { height: 56%; }
.ys-workbench__candles span:nth-child(6) { height: 74%; }
.ys-workbench__editor {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  min-height: 210px;
  background: #0f172a;
}
body.theme--light .ys-workbench__editor {
  background: #f1f5ff;
}
.ys-workbench__gutter {
  padding: 14px 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 12px;
  color: #93a6c9;
  opacity: 0.8;
}
body.theme--light .ys-workbench__gutter {
  border-right-color: rgba(0, 0, 0, 0.12);
  color: #64748b;
}
.ys-workbench__gutter span,
.ys-workbench__line {
  display: block;
  line-height: 1.5;
}
.ys-workbench__code {
  padding: 14px 12px;
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 13px;
  color: #dbe7ff;
}
body.theme--light .ys-workbench__code {
  color: #1e293b;
}
.ys-workbench__line.is-key {
  color: #7aa6ff;
}
.ys-workbench__line.is-accent {
  color: #60a5fa;
}
.ys-workbench__tester {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--tt-border, rgba(255, 255, 255, 0.1));
}
.ys-workbench__kpi {
  border: 1px solid rgba(41, 98, 255, 0.35);
  background: rgba(41, 98, 255, 0.11);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--tt-fg-0);
}
.ys-workbench__caption {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--tt-fg-0);
  opacity: 0.68;
}

.ys-quickstart__list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  counter-reset: ysquick;
}
.ys-quickstart__list li {
  position: relative;
  min-width: 0;
  padding: 14px 14px 14px 44px;
  border-radius: 8px;
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.1));
  background: rgba(255, 255, 255, 0.015);
  color: var(--tt-fg-0);
  font-size: 14px;
  line-height: 1.5;
}
body.theme--light .ys-quickstart__list li {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.1);
}
.ys-quickstart__list li::before {
  counter-increment: ysquick;
  content: "0" counter(ysquick);
  position: absolute;
  left: 14px;
  top: 13px;
  color: #2962ff;
  font-size: 12px;
  font-weight: 700;
}

.ys-value__lead {
  margin-top: 10px;
}
.ys-value__grid {
  margin: 14px 0 6px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.ys-value__card {
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.1));
  border-radius: 8px;
  padding: 16px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.015);
}
body.theme--light .ys-value__card {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.1);
}
.ys-value__card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--tt-fg-0);
}
.ys-value__card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--tt-fg-0);
  opacity: 0.78;
}

.ys-final-cta {
  margin-top: 10px;
  padding: 20px;
  border-radius: 10px;
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.12));
  background: rgba(255, 255, 255, 0.02);
}
body.theme--light .ys-final-cta {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.12);
}
.ys-final-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.ys-final-cta__links {
  margin-bottom: 0;
}

.ys-pipeline {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0 28px;
  padding: 0;
  list-style: none;
}
@media (max-width: 991px) {
  .ys-workbench__body {
    grid-template-columns: 1fr;
  }
  .ys-workbench__chart {
    border-right: 0;
    border-bottom: 1px solid var(--tt-border, rgba(255, 255, 255, 0.1));
  }
  .ys-workbench__tester,
  .ys-quickstart__list,
  .ys-value__grid,
  .ys-pipeline,
  .ys-panel-grid {
    grid-template-columns: 1fr;
  }
  .ys-panel-grid {
    gap: 12px;
  }
}
@media (max-width: 768px) {
  .ys-btn {
    width: 100%;
    text-align: center;
  }
  .ys-workbench__tester {
    gap: 8px;
  }
  .ys-final-cta {
    padding: 16px;
  }
}
.ys-pipeline__item {
  position: relative;
  padding: 12px 10px;
  border-radius: 8px;
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.08));
  background: rgba(255, 255, 255, 0.015);
  min-width: 0;
}
body.theme--light .ys-pipeline__item {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}
.ys-pipeline__num {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--tt-accent, #2962ff);
  margin-bottom: 6px;
}
.ys-pipeline__title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--tt-fg-0);
  margin-bottom: 4px;
  line-height: 1.35;
}
.ys-pipeline__body {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  color: var(--tt-fg-0);
  opacity: 0.68;
  overflow-wrap: anywhere;
}

.ys-panel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0 24px;
}
.ys-panel {
  padding: 18px 20px;
  border-radius: 8px;
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.08));
  background: rgba(255, 255, 255, 0.015);
  min-width: 0;
}
body.theme--light .ys-panel {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}
.ys-panel h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--tt-fg-0);
}
.ys-panel p {
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 10px;
  color: var(--tt-fg-0);
  opacity: 0.78;
}

.ys-code-block {
  margin: 16px 0 24px;
  padding: 16px 18px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #121826;
  overflow-x: auto;
}
body.theme--light .ys-code-block {
  background: #eef3ff;
  border-color: #c8d4f0;
}
.ys-code-block pre {
  margin: 0;
  font-family: ui-monospace, 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.55;
  color: #e7eef9;
  white-space: pre-wrap;
  word-break: break-word;
}
body.theme--light .ys-code-block pre {
  color: #0f172a;
}
.ys-code-block__cap {
  font-size: 12px;
  margin: 10px 0 0;
  color: var(--tt-fg-0);
  opacity: 0.6;
}

/* Fix ai-step text clipping on narrow viewports */
.ys-page .ai-step__content {
  flex: 1 1 auto;
  min-width: 0;
}
.ys-page .ai-step__content p,
.ys-page .ai-step__content h2 {
  overflow-wrap: anywhere;
}

/* =======================================================================
 * YeScript Community page (TV-style script browser)
 * Reuses the .sc-row visual language from app.css with a minimal subset.
 * ======================================================================= */

.ys-community-page .ys-hero--community {
  margin-bottom: 24px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  justify-content: center;
}

body.theme--light .ys-community-page .ys-hero--community {
  background: transparent;
  border: none;
}

.ys-community-page .ys-hero--community .ys-hero__copy {
  flex: 0 1 auto;
}

.ys-community-page .ys-hero--community .ys-hero__title {
  font-size: 88px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-align: center;
}

.ys-community-page .ys-hero--community .ys-hero__sub {
  text-align: center;
  margin-inline: auto;
}

@media (max-width: 991px) {
  .ys-community-page .ys-hero--community .ys-hero__title {
    font-size: 56px;
  }
}

.ys-community__toolbar {
  display: grid;
  grid-template-columns: 180px 180px minmax(260px, 1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  position: relative;
  z-index: 40;
}

.ys-community__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ys-community__field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--tt-fg-0);
  opacity: 0.72;
}

.ys-community__field select,
.ys-community__search-wrap input {
  width: 100%;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--tt-border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--tt-fg-0);
  padding: 0 10px;
  font-size: 14px;
}

/* [FIX] 2026-08-16 — custom dropdown (replaces native select on community toolbar).
   Reason: Windows native option highlight ignores CSS and stays system blue.
   Change: fully themed menu; hover/focus uses fg/bg inversion (B&W scheme). */
.ys-community-dd {
  position: relative;
  width: 100%;
}

.ys-community-dd__trigger {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--tt-border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--tt-fg-0);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.ys-community-dd__trigger:focus-visible {
  outline: none;
  border-color: var(--tt-fg-0);
  box-shadow: 0 0 0 1px var(--tt-fg-0);
}

.ys-community-dd__chev {
  flex: 0 0 auto;
  opacity: 0.72;
  transition: transform .16s ease;
}

.ys-community-dd.is-open .ys-community-dd__chev {
  transform: rotate(180deg);
}

.ys-community-dd.is-open {
  z-index: 50;
}

.ys-community-dd__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  padding: 4px 0;
  border-radius: 8px;
  border: 1px solid var(--tt-border);
  background: var(--tt-bg-0);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
}

.ys-community-dd__menu[hidden] {
  display: none;
}

.ys-community-dd__option {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--tt-fg-0);
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.ys-community-dd__option:hover,
.ys-community-dd__option:focus-visible {
  background: var(--tt-fg-0);
  color: var(--tt-bg-0);
  outline: none;
}

.ys-community-dd__option.is-active {
  font-weight: 600;
}

body.theme--light .ys-community-dd__trigger {
  background: rgba(0, 0, 0, 0.02);
}

body.theme--light .ys-community-dd__menu {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

/* Legacy native select styling (creators page sort, etc.) */
.ys-community__field select option,
.ys-creators-toolbar__sort select option {
  color: var(--tt-fg-0);
  background: var(--tt-bg-0);
}

.ys-community__field select option:checked,
.ys-community__field select option:hover,
.ys-community__field select option:focus,
.ys-creators-toolbar__sort select option:checked,
.ys-creators-toolbar__sort select option:hover,
.ys-creators-toolbar__sort select option:focus {
  background: var(--tt-fg-0);
  color: var(--tt-bg-0);
}

.ys-community__field select:focus,
.ys-community__field select:focus-visible,
.ys-creators-toolbar__sort select:focus,
.ys-creators-toolbar__sort select:focus-visible {
  outline: none;
  border-color: var(--tt-fg-0);
  box-shadow: 0 0 0 1px var(--tt-fg-0);
}

.ys-community__field select,
.ys-creators-toolbar__sort select {
  accent-color: var(--tt-fg-0);
}

body.theme--dark .ys-community__field select,
body.theme--dark .ys-creators-toolbar__sort select,
.theme--dark .ys-page .ys-community__field select,
.theme--dark .ys-page .ys-creators-toolbar__sort select {
  color-scheme: dark;
}

body.theme--light .ys-community__field select,
body.theme--light .ys-creators-toolbar__sort select,
.theme--light .ys-page .ys-community__field select,
.theme--light .ys-page .ys-creators-toolbar__sort select {
  color-scheme: light;
}

body.theme--light .ys-community__field select,
body.theme--light .ys-community__search-wrap input {
  background: rgba(0, 0, 0, 0.02);
}

.ys-community__search-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.ys-community__search-wrap button {
  height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid rgba(41, 98, 255, 0.45);
  background: rgba(41, 98, 255, 0.14);
  color: var(--tt-fg-0);
  font-size: 13px;
  font-weight: 600;
}
body.theme--light .ys-community__search-wrap button {
  background: rgba(41, 98, 255, 0.10);
  border-color: rgba(41, 98, 255, 0.35);
}

.ys-community__status {
  min-height: 20px;
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--tt-fg-0);
  opacity: 0.7;
}

.ys-community__empty {
  padding: 28px 14px;
  border: 1px dashed var(--tt-border, rgba(255, 255, 255, 0.18));
  border-radius: 10px;
  text-align: center;
  font-size: 14px;
  color: var(--tt-fg-0);
  opacity: 0.74;
  margin-bottom: 14px;
}

.ys-community__list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.10));
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 14px;
}

.sc-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  min-height: 82px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--tt-border, rgba(255, 255, 255, 0.08));
  background: rgba(255, 255, 255, 0.01);
}

body.theme--light .sc-row {
  background: rgba(0, 0, 0, 0.012);
}

.sc-row:hover {
  background: rgba(41, 98, 255, 0.05);
}

.sc-row:last-child {
  border-bottom: none;
}

.sc-row__icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.sc-row__icon svg {
  width: 15px;
  height: 15px;
}

.sc-row__icon.is-strategy { background: rgba(38, 166, 154, 0.14); color: #26a69a; }
.sc-row__icon.is-indicator { background: rgba(41, 98, 255, 0.14); color: #6299ff; }
.sc-row__icon.is-library { background: rgba(171, 116, 248, 0.14); color: #ab74f8; }

.sc-row__info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sc-row__name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--tt-fg-0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.sc-row__slot {
  display: inline-flex;
  align-items: center;
}

.sc-row__slot--type { min-width: 56px; }
.sc-row__slot--vis { min-width: 56px; }
.sc-row__slot--ver { min-width: 28px; }

.sc-row__chip,
.sc-row__vis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 8px;
  white-space: nowrap;
}

.sc-row__chip.is-strategy { background: rgba(38, 166, 154, 0.14); color: #26a69a; border: 1px solid rgba(38, 166, 154, 0.20); }
.sc-row__chip.is-indicator { background: rgba(41, 98, 255, 0.14); color: #6299ff; border: 1px solid rgba(41, 98, 255, 0.22); }
.sc-row__chip.is-library { background: rgba(171, 116, 248, 0.14); color: #ab74f8; border: 1px solid rgba(171, 116, 248, 0.22); }

.sc-row__vis.is-open { background: rgba(38, 166, 154, 0.08); color: #26a69a; border: 1px solid rgba(38, 166, 154, 0.22); }
.sc-row__vis.is-protected { background: rgba(255, 183, 77, 0.08); color: #ffb74d; border: 1px solid rgba(255, 183, 77, 0.22); }
.sc-row__vis.is-invite { background: rgba(156, 118, 254, 0.10); color: #b388ff; border: 1px solid rgba(156, 118, 254, 0.22); }
.sc-row__vis.is-private { background: rgba(148, 163, 184, 0.12); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.24); }

.sc-row__author,
.sc-row__star-cnt,
.sc-row__slot--ver {
  font-size: 12px;
  color: var(--tt-fg-0);
  opacity: 0.76;
}

.sc-row__author a {
  color: var(--tt-accent, #2962ff);
  text-decoration: none;
}

.sc-row__author a:hover {
  text-decoration: underline;
}

.sc-row__bottom {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
}

.sc-row__desc {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--tt-fg-0);
  opacity: 0.74;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sc-row__curve {
  position: relative;
  width: 168px;
  min-width: 168px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 4px 6px;
}

body.theme--light .sc-row__curve {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.10);
}

.sc-row__curve-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.sc-row__curve-badge {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
}

.sc-row__curve-badge.is-up { color: var(--tt-up, #00C896); }
.sc-row__curve-badge.is-dn { color: var(--tt-down, #FF4D6A); }
.sc-row__curve-badge.is-na { color: var(--tt-fg-0); opacity: 0.55; }

.sc-row__acts {
  width: 180px;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.sc-btn-star,
.sc-btn-run {
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: var(--tt-fg-0);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 10px;
}

.sc-btn-star:hover,
.sc-btn-run:hover {
  border-color: rgba(41, 98, 255, 0.45);
  color: var(--tt-accent, #2962ff);
}

body.theme--light .sc-btn-star,
body.theme--light .sc-btn-run,
body.light-theme .sc-btn-star,
body.light-theme .sc-btn-run,
.theme--light .sc-btn-star,
.theme--light .sc-btn-run,
body:not(.dark-theme):not(.theme--dark) .ys-script-card__actions .sc-btn-run,
body:not(.dark-theme):not(.theme--dark) .ys-script-card__actions .sc-btn-ros,
body:not(.dark-theme):not(.theme--dark) .ys-script-card__actions .sc-btn-star {
  border-color: rgba(0, 0, 0, 0.16);
}

/* [CHG] 2026-08-03 — URL-backed page navigation with direct last-page access. */
.ys-community__pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.ys-community__pager[hidden] {
  display: none;
}

.ys-community__pager button {
  min-width: 36px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.14));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--tt-fg-0);
  font-size: 14px;
  font-weight: 600;
}

.ys-community__pager button:hover:not(:disabled) {
  border-color: rgba(41, 98, 255, 0.55);
  background: rgba(41, 98, 255, 0.12);
}

.ys-community__pager button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ys-community__page-numbers {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ys-community__page-number.is-current {
  border-color: rgba(41, 98, 255, 0.65);
  background: rgba(41, 98, 255, 0.18);
  opacity: 1;
}

.ys-community__page-gap,
.ys-community__page-label {
  color: var(--tt-fg-0);
  font-size: 14px;
}

.ys-community__page-gap {
  min-width: 16px;
  text-align: center;
  opacity: 0.72;
}

.ys-community__page-label {
  min-width: 64px;
  text-align: center;
  opacity: 0.82;
}

@media (max-width: 1024px) {
  .ys-community__toolbar {
    grid-template-columns: 1fr 1fr;
  }
  .ys-community__field--search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .sc-row {
    flex-direction: column;
  }
  .sc-row__acts {
    width: 100%;
    min-width: 0;
    flex-direction: row;
  }
  .sc-btn-star,
  .sc-btn-run {
    flex: 1 1 0;
  }
  .sc-row__curve {
    width: 128px;
    min-width: 128px;
  }
}

/* Creators showcase page */
.ys-creators-page .ys-hero--creators {
  margin-bottom: 24px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  justify-content: center;
}

body.theme--light .ys-creators-page .ys-hero--creators {
  background: transparent;
  border: none;
}

.ys-creators-page .ys-hero--creators .ys-hero__copy {
  flex: 0 1 auto;
}

.ys-creators-page .ys-hero--creators .ys-hero__title {
  font-size: 88px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-align: center;
}

.ys-creators-page .ys-hero--creators .ys-hero__sub {
  text-align: center;
  margin-inline: auto;
}

@media (max-width: 991px) {
  .ys-creators-page .ys-hero--creators .ys-hero__title {
    font-size: 56px;
  }
}

.ys-creators-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
  position: relative;
  z-index: 40;
}

.ys-creators-toolbar__sort {
  min-width: 220px;
  margin-left: auto;
}

.ys-creators-toolbar__sort label {
  font-size: 12px;
  font-weight: 600;
  color: var(--tt-fg-0);
  opacity: 0.72;
}

.ys-creators-toolbar__sort select {
  min-width: 220px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.12));
  background: rgba(255, 255, 255, 0.02);
  color: var(--tt-fg-0);
}

body.theme--light .ys-creators-toolbar__sort select {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--tt-fg-0);
}

.ys-creators-state {
  margin: 8px 0 18px;
  font-size: 14px;
  color: var(--tt-fg-0);
  opacity: 0.72;
}

.ys-author-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.ys-author-card {
  border-radius: 10px;
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.12));
  background: rgba(255, 255, 255, 0.02);
  min-width: 0;
  overflow: hidden;
}

body.theme--light .ys-author-card {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.12);
}

.ys-author-card__hit {
  display: block;
  width: 100%;
  padding: 14px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.ys-author-card__hit:hover {
  background: rgba(41, 98, 255, 0.08);
}

.ys-author-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.ys-author-card__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  flex: 0 0 42px;
}

body.theme--light .ys-author-card__avatar {
  background: rgba(0, 0, 0, 0.06);
}

.ys-author-card__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ys-author-card__identity {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ys-author-card__name {
  display: block;
  font-size: 16px;
  line-height: 1.35;
  color: var(--tt-fg-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ys-author-card__handle {
  display: block;
  font-size: 12px;
  color: var(--tt-fg-0);
  opacity: 0.7;
}

.ys-author-card__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.ys-author-card__stats span {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  color: var(--tt-fg-0);
  opacity: 0.85;
}

.ys-author-card__stats b {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.ys-author-card__latest {
  display: block;
  border-top: 1px solid var(--tt-border, rgba(255, 255, 255, 0.1));
  padding-top: 10px;
}

body.theme--light .ys-author-card__latest {
  border-top-color: rgba(0, 0, 0, 0.1);
}

.ys-author-card__latest-title {
  display: block;
  font-size: 12px;
  line-height: 1.3;
  color: var(--tt-fg-0);
  opacity: 0.68;
  margin-bottom: 4px;
}

.ys-author-card__latest-name {
  display: block;
  font-size: 14px;
  line-height: 1.4;
  color: var(--tt-fg-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ys-author-card__latest-time {
  display: block;
  font-size: 12px;
  line-height: 1.3;
  color: var(--tt-fg-0);
  opacity: 0.6;
  margin-top: 4px;
}

.ys-author-scripts {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--tt-border, rgba(255, 255, 255, 0.1));
}

body.theme--light .ys-author-scripts {
  border-top-color: rgba(0, 0, 0, 0.12);
}

.ys-author-scripts__head {
  margin-bottom: 8px;
}

.ys-author-scripts__sub {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--tt-fg-0);
  opacity: 0.72;
}

.ys-author-script-list {
  display: grid;
  gap: 10px;
}

.ys-author-script {
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.1));
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.015);
}

body.theme--light .ys-author-script {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.015);
}

.ys-author-script__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ys-author-script__name {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--tt-fg-0);
}

.ys-author-script__type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  line-height: 1.3;
  border: 1px solid rgba(41, 98, 255, 0.35);
  color: var(--tt-accent, #2962ff);
}

.ys-author-script__meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.ys-author-script__meta span {
  font-size: 12px;
  color: var(--tt-fg-0);
  opacity: 0.75;
}

.ys-author-script__actions {
  margin-top: 10px;
}

.ys-author-script__link {
  font-size: 13px;
  color: var(--tt-accent, #2962ff);
  text-decoration: none;
}

.ys-author-script__link:hover {
  color: var(--tt-accent, #2962ff);
  opacity: 0.75;
  text-decoration: underline;
}

@media (max-width: 768px) {
  .ys-creators-toolbar {
    justify-content: stretch;
  }

  .ys-creators-toolbar__sort {
    width: 100%;
    display: grid;
    gap: 8px;
  }

  .ys-creators-toolbar__sort select {
    width: 100%;
    min-width: 0;
  }

  .ys-author-card__stats {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* =======================================================================
 * 2026-07-08 — TV-style card grids + detail pages
 * ======================================================================= */

.ys-community__list {
  display: grid;
  /* ponytail: ~430px design target via min 300px + 1fr grow — fixed 430px left a dead column gap */
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  align-items: stretch;
  gap: 12px;
  border: 0;
  border-radius: 0;
  overflow: visible;
  margin-bottom: 14px;
}

.ys-script-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 14px;
  border: 1px solid var(--tt-line-2, #161616);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
  transition: border-color .16s ease, transform .16s ease, background .16s ease;
  outline: none;
}

body.theme--light .ys-script-card,
body.light-theme .ys-script-card,
.theme--light .ys-script-card,
body.dark-theme .ys-script-card,
body.theme--dark .ys-script-card,
.theme--dark .ys-script-card {
  border-color: var(--tt-line-2, #161616);
}

body.theme--light .ys-script-card,
body.light-theme .ys-script-card,
.theme--light .ys-script-card,
body:not(.dark-theme):not(.theme--dark) .ys-script-card {
  background: rgba(0, 0, 0, 0.02);
  border-color: var(--tt-line-2, #d0d0d0);
}

.ys-script-card:hover,
.ys-script-card:focus-visible {
  border-color: rgba(41, 98, 255, 0.45);
  background: rgba(41, 98, 255, 0.06);
  transform: translateY(-2px);
}

.ys-script-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ys-script-card__head-left {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.ys-script-card__head-right {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
}

.ys-script-card__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: var(--tt-fg-0);
  white-space: nowrap;
}

body.theme--light .ys-script-card__chip {
  border-color: rgba(0, 0, 0, 0.18);
}

.ys-script-card__chip--type {
  background: rgba(41, 98, 255, 0.14);
  border-color: rgba(41, 98, 255, 0.32);
  color: #7aa6ff;
}

.ys-script-card__chip--vis.is-open {
  color: #26a69a;
  border-color: rgba(38, 166, 154, 0.28);
  background: rgba(38, 166, 154, 0.10);
}

.ys-script-card__chip--vis.is-protected {
  color: #ffb74d;
  border-color: rgba(255, 183, 77, 0.30);
  background: rgba(255, 183, 77, 0.10);
}

.ys-script-card__chip--vis.is-invite {
  color: #b388ff;
  border-color: rgba(179, 136, 255, 0.28);
  background: rgba(179, 136, 255, 0.10);
}

.ys-script-card__chip--vis.is-private {
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.30);
  background: rgba(148, 163, 184, 0.12);
}

.ys-script-card__chip--featured {
  color: #ffb74d;
  border-color: rgba(255, 183, 77, 0.32);
  background: rgba(255, 183, 77, 0.12);
}

.ys-script-card__title {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  min-height: 43px;
}

.ys-script-card__title-link {
  color: var(--tt-fg-0);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  word-break: break-word;
}

.ys-script-card__title-link--btn {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  white-space: normal;
}

.ys-script-card__title-link:hover {
  color: var(--tt-accent, #2962ff);
}

.ys-script-card__meta {
  margin: 0;
  font-size: 12px;
  color: var(--tt-fg-0);
  opacity: 0.76;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.ys-script-card__author-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 18px;
  display: inline-flex;
  margin-right: 4px;
  vertical-align: middle;
}

.ys-script-card__author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ys-script-card__meta a {
  color: var(--tt-accent, #2962ff);
  text-decoration: none;
}

.ys-script-card__meta .ys-script-card__meta-link {
  color: var(--tt-accent, #2962ff);
  border: 0;
  padding: 0;
  background: transparent;
  text-decoration: none;
  cursor: pointer;
}

.ys-script-card__meta a:hover {
  text-decoration: underline;
}

.ys-script-card__meta .ys-script-card__meta-link:hover {
  text-decoration: underline;
}

.ys-script-card__desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--tt-fg-0);
  opacity: 0.78;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 44px;
}

.ys-script-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ys-script-card__tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: var(--tt-fg-0);
  font-size: 12px;
  line-height: 1.2;
  opacity: 0.82;
}

body.theme--light .ys-script-card__tag {
  border-color: rgba(0, 0, 0, 0.14);
  background: rgba(0, 0, 0, 0.02);
}

.ys-script-card__curve {
  position: relative;
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--tt-line-2, #161616);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

body.theme--light .ys-script-card__curve,
body.light-theme .ys-script-card__curve,
.theme--light .ys-script-card__curve,
body:not(.dark-theme):not(.theme--dark) .ys-script-card__curve {
  border-color: var(--tt-line-2, #d0d0d0);
  background: rgba(0, 0, 0, 0.02);
}

.ys-script-card__curve.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  opacity: 0.64;
}

.ys-script-card__curve-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ys-script-card__kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: baseline;
  gap: 6px 12px;
  min-width: 0;
}

.ys-script-card__kpi {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  font-size: 12px;
  line-height: 1.3;
  color: var(--tt-fg-0);
  white-space: nowrap;
}

.ys-script-card__kpi-label {
  opacity: 0.72;
}

.ys-script-card__kpi-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--tt-fg-0);
}

.ys-script-card__kpi-val.is-up {
  color: var(--tt-up, #00C896);
}

.ys-script-card__kpi-val.is-dn {
  color: var(--tt-down, #FF4D6A);
}

.ys-script-card__fav-star {
  color: #ffb74d;
}

.ys-script-card__foot {
  /* [FIX] 2026-08-16 — pin fav/fork + detail link to card bottom when curve/KPI block is absent (indicator/library). */
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--tt-fg-0);
  opacity: 0.78;
}

.ys-script-card__detail-link {
  color: var(--tt-accent, #2962ff);
  text-decoration: none;
  font-weight: 600;
  opacity: 1;
}

.ys-script-card__detail-link:hover {
  text-decoration: underline;
}

.ys-script-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.ys-script-card__actions .sc-btn-run {
  width: auto;
  min-width: 72px;
  flex: 0 0 auto;
  padding: 0 12px;
}

.ys-script-card__actions .sc-btn-ros {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
}
.ys-script-card__actions .sc-ros-tip-wrap {
  width: auto;
  flex: 0 0 auto;
}
.ys-script-card__actions a.sc-btn-star {
  width: auto;
  min-width: 0;
  white-space: nowrap;
  flex: 0 0 auto;
  margin-right: auto;
}

.ys-script-card__actions button.sc-btn-star {
  width: 18px;
  min-width: 18px;
  padding: 0;
  flex: 0 0 auto;
  margin-right: auto;
}

/* Creators page — larger freelancer-style cards */
.ys-creators-page .ys-author-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.ys-creators-page .ys-author-card {
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.14));
  background: rgba(255, 255, 255, 0.022);
  transition: border-color .16s ease, transform .16s ease, background .16s ease;
  cursor: pointer;
}

body.theme--light .ys-creators-page .ys-author-card {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.022);
}

.ys-creators-page .ys-author-card:hover {
  border-color: rgba(41, 98, 255, 0.42);
  background: rgba(41, 98, 255, 0.06);
  transform: translateY(-2px);
}

.ys-creators-page .ys-author-card__avatar {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
}

.ys-creators-page .ys-author-card__name {
  font-size: 18px;
}

.ys-creators-page .ys-author-card__name-link {
  color: inherit;
  text-decoration: none;
}

.ys-creators-page .ys-author-card__name-link:hover,
.ys-creators-page .ys-author-card__name-link:focus-visible {
  color: var(--tt-accent, #2962ff);
  text-decoration: underline;
  outline: none;
}

.ys-creators-page .ys-author-card__bio {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--tt-fg-0);
  opacity: 0.76;
  min-height: 42px;
}

.ys-creators-page .ys-author-card__stats {
  margin-top: 12px;
}

.ys-creators-page .ys-author-card__skills {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ys-creators-page .ys-author-card__skill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid rgba(41, 98, 255, 0.32);
  background: rgba(41, 98, 255, 0.11);
  color: #7aa6ff;
}

.ys-creators-page .ys-author-card__latest {
  margin-top: 12px;
  border-top: 1px solid var(--tt-border, rgba(255, 255, 255, 0.10));
  padding-top: 10px;
}

body.theme--light .ys-creators-page .ys-author-card__latest {
  border-top-color: rgba(0, 0, 0, 0.10);
}

.ys-creators-page .ys-author-card__latest-link {
  display: block;
  font-size: 14px;
  line-height: 1.45;
  color: var(--tt-fg-0);
  text-decoration: none;
  margin: 2px 0;
}

.ys-creators-page .ys-author-card__latest-link:hover {
  color: var(--tt-accent, #2962ff);
}

/* Script detail page */
.ys-detail-hero {
  margin-bottom: 20px;
}

.ys-detail-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  margin-bottom: 14px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  font-size: 12px;
  color: var(--tt-brand, #2962ff);
  text-decoration: none;
}

body.theme--light .ys-detail-hero__back {
  background: transparent;
}

.ys-detail-hero__back:hover {
  color: var(--tt-brand, #2962ff);
  text-decoration: underline;
  text-underline-offset: 2px;
  background: transparent;
}

.ys-detail-layout {
  display: grid;
  --ys-detail-radius: 8px;
  gap: 24px;
}

.ys-detail-hero-band {
  display: grid;
  gap: 14px;
  padding: 0 0 20px;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid var(--tt-border, rgba(255, 255, 255, 0.12));
  background: transparent;
}

body.theme--light .ys-detail-hero-band {
  border-bottom-color: rgba(0, 0, 0, 0.12);
}

.ys-detail-hero-band__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ys-detail-hero-band .ys-script-card__chip,
.ys-detail-hero-band .ys-script-card__chip--type,
.ys-detail-hero-band .ys-script-card__chip--vis.is-open,
.ys-detail-hero-band .ys-script-card__chip--vis.is-protected,
.ys-detail-hero-band .ys-script-card__chip--vis.is-invite,
.ys-detail-hero-band .ys-script-card__chip--vis.is-private,
.ys-detail-hero-band .ys-script-card__chip--featured {
  padding: 3px 8px;
  border-radius: var(--ys-detail-radius);
  font-size: 12px;
  border-width: 1px;
  color: var(--tt-fg-0);
}

.ys-detail-hero-band .ys-script-card__chip {
  border-color: var(--tt-border, rgba(255, 255, 255, 0.14));
  background: transparent;
}

body.theme--light .ys-detail-hero-band .ys-script-card__chip {
  border-color: rgba(0, 0, 0, 0.14);
}

.ys-detail-hero-band .ys-script-card__chip--type {
  color: var(--tt-brand, #2962ff);
  border-color: rgba(41, 98, 255, 0.24);
  background: rgba(41, 98, 255, 0.08);
}

.ys-detail-hero-band .ys-script-card__chip--vis.is-open {
  border-color: rgba(38, 166, 154, 0.24);
  background: rgba(38, 166, 154, 0.08);
}

.ys-detail-hero-band .ys-script-card__chip--vis.is-protected,
.ys-detail-hero-band .ys-script-card__chip--featured {
  border-color: rgba(255, 183, 77, 0.24);
  background: rgba(255, 183, 77, 0.08);
}

.ys-detail-hero-band .ys-script-card__chip--vis.is-invite {
  border-color: rgba(179, 136, 255, 0.22);
  background: rgba(179, 136, 255, 0.07);
}

.ys-detail-hero-band .ys-script-card__chip--vis.is-private {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(148, 163, 184, 0.08);
}

.ys-detail-hero-band__title {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
  color: var(--tt-fg-0);
}

.ys-detail-author {
  display: block;
}

.ys-detail-author__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  overflow: hidden;
  flex: 0 0 32px;
}
.ys-detail-author__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ys-detail-author__meta {
  margin: 0;
  font-size: 14px;
  color: var(--tt-fg-0);
  opacity: 0.84;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.ys-detail-author__meta a {
  color: var(--tt-brand, #2962ff);
  text-decoration: none;
}

.ys-detail-author__meta a:hover {
  color: var(--tt-brand, #2962ff);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ys-detail-hero-band__desc {
  margin: 0;
  max-width: 82ch;
  font-size: 14px;
  line-height: 1.6;
  color: var(--tt-fg-0);
  opacity: 0.84;
}

.ys-detail-hero-band__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ys-detail-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--ys-detail-radius);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--tt-fg-0);
  text-decoration: none;
}

.ys-detail-action:hover {
  color: var(--tt-fg-0);
  text-decoration: none;
}

.ys-detail-action--primary {
  background: rgba(41, 98, 255, 0.22);
  border-color: rgba(41, 98, 255, 0.38);
}

.ys-detail-action--secondary {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--tt-border, rgba(255, 255, 255, 0.14));
}

body.theme--light .ys-detail-action--secondary {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.14);
}

.ys-detail-main {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.ys-detail-main__left,
.ys-detail-main__right {
  display: grid;
  gap: 0;
  align-content: start;
  min-width: 0;
  max-width: 100%;
}

.ys-detail-panel {
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  min-width: 0;
}

body.theme--light .ys-detail-panel {
  border: 0;
  background: transparent;
}

.ys-detail-main__left > .ys-detail-panel + .ys-detail-panel,
.ys-detail-main__right > .ys-detail-panel + .ys-detail-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--tt-border, rgba(255, 255, 255, 0.12));
}

body.theme--light .ys-detail-main__left > .ys-detail-panel + .ys-detail-panel,
body.theme--light .ys-detail-main__right > .ys-detail-panel + .ys-detail-panel {
  border-top-color: rgba(0, 0, 0, 0.12);
}

.ys-detail-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.ys-detail-panel__head h2 {
  margin: 0;
  font-size: 16px;
  color: var(--tt-fg-0);
}

.ys-detail-net {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--tt-fg-0);
}

.ys-detail-net.is-up {
  color: var(--tt-up, #00C896);
}

.ys-detail-net.is-dn {
  color: var(--tt-down, #FF4D6A);
}

.ys-detail-panel--curve .ys-detail-panel__body {
  min-width: 0;
  max-width: 100%;
}

.ys-detail-curve {
  min-height: 220px;
  width: 100%;
  max-width: 100%;
  border-radius: var(--ys-detail-radius);
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.10));
  background: rgba(255, 255, 255, 0.012);
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

body.theme--light .ys-detail-curve {
  border-color: rgba(0, 0, 0, 0.10);
  background: rgba(0, 0, 0, 0.012);
}

.ys-detail-curve__svg {
  width: 100%;
  max-width: 100%;
  height: 220px;
  display: block;
}

.ys-detail-empty-state {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-size: 14px;
  color: var(--tt-fg-0);
  opacity: 0.72;
}

.ys-detail-panel__hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--tt-fg-0);
  opacity: 0.72;
}

.ys-detail-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 14px;
}

.ys-detail-kpi-card {
  padding: 10px 0;
  border-radius: 0;
  border: 0;
  border-top: 1px solid var(--tt-border, rgba(255, 255, 255, 0.10));
  background: transparent;
}

body.theme--light .ys-detail-kpi-card {
  border-top-color: rgba(0, 0, 0, 0.10);
  background: transparent;
}

.ys-detail-kpi-card span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--tt-fg-0);
  opacity: 0.74;
}

.ys-detail-kpi-card b {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  color: var(--tt-fg-0);
}

.ys-detail-kpi-card b.is-up {
  color: var(--tt-up, #00C896);
}

.ys-detail-kpi-card b.is-dn {
  color: var(--tt-down, #FF4D6A);
}

.ys-detail-meta-list {
  display: grid;
  gap: 0;
}

.ys-detail-meta-list__row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--tt-border, rgba(255, 255, 255, 0.10));
  font-size: 14px;
  color: var(--tt-fg-0);
}

.ys-detail-meta-list__row:first-child {
  padding-top: 0;
  border-top: 0;
}

body.theme--light .ys-detail-meta-list__row {
  border-top-color: rgba(0, 0, 0, 0.10);
}

.ys-detail-meta-list__row strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--tt-fg-0);
  opacity: 0.76;
}

.ys-detail-meta-list__row span {
  color: var(--tt-fg-0);
  font-size: 14px;
}

.ys-detail-meta-list__row.is-block p {
  margin: 6px 0 0;
  grid-column: 2 / -1;
  font-size: 12px;
  color: var(--tt-fg-0);
  opacity: 0.72;
}

.ys-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ys-detail-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: var(--ys-detail-radius);
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.14));
  background: transparent;
  font-size: 12px;
  color: var(--tt-fg-0);
}

body.theme--light .ys-detail-tag {
  border-color: rgba(0, 0, 0, 0.14);
  background: rgba(0, 0, 0, 0.014);
}

.ys-detail-tag.is-empty {
  opacity: 0.72;
}

.ys-detail-panel--about {
  display: grid;
  gap: 8px;
}

.ys-detail-about-link {
  font-size: 14px;
  color: var(--tt-brand, #2962ff);
  text-decoration: none;
}

.ys-detail-about-link:hover {
  color: var(--tt-brand, #2962ff);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ys-detail-richtext {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--tt-fg-0);
  white-space: pre-wrap;
  word-break: break-word;
}

.ys-detail-richtext__link {
  color: var(--tt-brand, #2962ff);
  text-decoration: none;
  text-underline-offset: 2px;
}

.ys-detail-richtext__link:hover {
  color: var(--tt-brand, #2962ff);
  text-decoration: underline;
}

.ys-detail-source-note {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--tt-fg-0);
  opacity: 0.8;
}

.ys-detail-source-copy {
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.16));
  background: transparent;
  color: var(--tt-fg-0);
  font-size: 12px;
  line-height: 1.2;
  border-radius: var(--ys-detail-radius);
  padding: 4px 10px;
  flex-shrink: 0;
  transition: background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.ys-detail-source-copy[hidden] {
  display: none;
}

.ys-detail-source-copy:hover {
  background: rgba(41, 98, 255, 0.08);
  border-color: rgba(41, 98, 255, 0.24);
}

.ys-detail-source-copy:disabled {
  opacity: 0.78;
  cursor: default;
}

.ys-detail-source-viewer {
  margin: 0;
  border-radius: var(--ys-detail-radius);
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.12));
  background: rgba(255, 255, 255, 0.02);
  min-height: 220px;
  width: 100%;
  overflow: hidden;
}

body.theme--light .ys-detail-source-viewer,
body:not(.dark-theme):not(.theme--dark) .ys-detail-source-viewer {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.02);
}

.ys-detail-source-code {
  margin: 0;
  min-height: 220px;
  max-height: 460px;
  overflow: auto;
  padding: 8px 0;
  color: var(--tt-fg-0);
  background: transparent;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  line-height: 19px;
  tab-size: 2;
}

.ys-detail-source-code code {
  display: block;
  min-width: max-content;
}

.ys-source-line {
  display: grid;
  grid-template-columns: 48px minmax(max-content, 1fr);
  min-height: 19px;
}

.ys-source-line__number {
  padding-right: 12px;
  text-align: right;
  color: var(--tt-fg-0);
  opacity: 0.42;
  user-select: none;
}

.ys-source-line__text {
  padding-right: 12px;
  white-space: pre;
}

.ys-token--keyword { color: #569cd6; font-weight: 700; }
.ys-token--comment { color: #6a9955; }
.ys-token--string { color: #ce9178; }
.ys-token--number { color: #b5cea8; }
.ys-token--type { color: #4ec9b0; }
.ys-token--namespace { color: #9cdcfe; }
.ys-token--builtin { color: #dcdcaa; }

body.theme--light .ys-token--keyword,
body:not(.dark-theme):not(.theme--dark) .ys-token--keyword { color: #0000ff; }
body.theme--light .ys-token--comment,
body:not(.dark-theme):not(.theme--dark) .ys-token--comment { color: #008000; }
body.theme--light .ys-token--string,
body:not(.dark-theme):not(.theme--dark) .ys-token--string { color: #a31515; }
body.theme--light .ys-token--number,
body:not(.dark-theme):not(.theme--dark) .ys-token--number { color: #098658; }
body.theme--light .ys-token--type,
body:not(.dark-theme):not(.theme--dark) .ys-token--type { color: #267f99; }
body.theme--light .ys-token--namespace,
body:not(.dark-theme):not(.theme--dark) .ys-token--namespace { color: #001080; }
body.theme--light .ys-token--builtin,
body:not(.dark-theme):not(.theme--dark) .ys-token--builtin { color: #795e26; }

.ys-detail-tabs {
  display: grid;
}

.ys-detail-tabs__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
  min-height: 0;
}

.ys-detail-tabs__nav {
  display: inline-flex;
  align-items: center;
  gap: 0;
  width: fit-content;
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.16));
  border-radius: var(--ys-detail-radius);
  background: rgba(255, 255, 255, 0.02);
  margin: 0;
}

body.theme--light .ys-detail-tabs__nav {
  border-color: rgba(0, 0, 0, 0.14);
  background: rgba(0, 0, 0, 0.02);
}

.ys-detail-tabs__tab {
  border: 0;
  background: transparent;
  color: var(--tt-fg-0);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  padding: 4px 12px;
  border-radius: var(--ys-detail-radius);
  cursor: pointer;
  opacity: 0.72;
}

.ys-detail-tabs__tab.is-active {
  background: transparent;
  color: var(--tt-fg-0);
  font-weight: 700;
  opacity: 1;
}

.ys-detail-tabs__tab:focus-visible {
  outline: 1px solid rgba(41, 98, 255, 0.6);
  outline-offset: -1px;
}

.ys-detail-tabs__panel[hidden] {
  display: none;
}

.ys-detail-tabs__panel.is-active {
  display: block;
}

.sc-strategy-snapshot__report-label {
  width: 100%;
}

.sc-strategy-snapshot__report-label .sc-detail-section__label {
  margin-bottom: 0;
}

#scriptDetailDrawer .sc-detail-section__label--major {
  font-size: 14px;
}

#scriptDetailDrawer .sc-detail-section__label--major .sc-detail-section__icon {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
}

.ys-detail-snapshot {
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.12));
  border-radius: var(--ys-detail-radius);
  background: rgba(255, 255, 255, 0.012);
  overflow: hidden;
  min-height: 160px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

body.theme--light .ys-detail-snapshot {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.012);
}

.ys-detail-snapshot__image {
  display: block;
  width: 100%;
  height: auto;
}

.ys-detail-snapshot__curve {
  display: block;
  width: 100%;
  height: 180px;
}

.ys-detail-snapshot__chart {
  width: 100%;
  max-width: 100%;
  height: 400px;
  min-height: 280px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.ys-detail-chart-context {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  pointer-events: none;
  max-width: calc(100% - 16px);
  font-size: 12px;
  line-height: 1.35;
  color: var(--tt-fg-0);
  opacity: 0.78;
  text-align: left;
}

.ys-detail-chart-context__row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
}

.ys-detail-chart-context__icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 14px;
}

.ys-detail-chart-context__text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ys-detail-chart-logo {
  position: absolute;
  left: 8px;
  bottom: 40px;
  z-index: 3;
  pointer-events: none;
}

.ys-detail-chart-logo svg {
  display: block;
  width: 100px;
  height: 20px;
}

.ys-detail-snapshot__chart > div {
  border-radius: var(--ys-detail-radius);
}

.ys-detail-empty-state--compact {
  min-height: 160px;
}

.ys-detail-inline-state {
  font-size: 14px;
  line-height: 1.6;
  color: var(--tt-fg-0);
  opacity: 0.76;
}

.ys-detail-inline-state.is-error {
  opacity: 0.92;
}

.ys-detail-versions {
  display: grid;
  gap: 0;
}

.ys-detail-version-item {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 12px 0;
}

.ys-detail-version-item + .ys-detail-version-item {
  border-top: 1px solid var(--tt-border, rgba(255, 255, 255, 0.1));
}

body.theme--light .ys-detail-version-item + .ys-detail-version-item {
  border-top-color: rgba(0, 0, 0, 0.1);
}

.ys-detail-version-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.ys-detail-version-item__ver {
  font-size: 14px;
  font-weight: 700;
  color: var(--tt-fg-0);
}

.ys-detail-version-item__time {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--tt-fg-0);
  opacity: 0.7;
}

.ys-detail-version-item__note {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--tt-fg-0);
  white-space: pre-wrap;
  word-break: break-word;
}

.ys-detail-lineage-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.ys-detail-lineage-list__item {
  border-left: 2px solid var(--tt-border, rgba(255, 255, 255, 0.16));
  padding-left: 10px;
  display: grid;
  gap: 4px;
}

body.theme--light .ys-detail-lineage-list__item {
  border-left-color: rgba(0, 0, 0, 0.14);
}

.ys-detail-lineage-list__item.is-hidden {
  font-size: 14px;
  color: var(--tt-fg-0);
  opacity: 0.68;
}

.ys-detail-lineage-list__script {
  font-size: 14px;
  color: var(--tt-brand, #2962ff);
  text-decoration: none;
}

.ys-detail-lineage-list__script:hover {
  color: var(--tt-brand, #2962ff);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ys-detail-lineage-list__author {
  font-size: 12px;
  color: var(--tt-fg-0);
  opacity: 0.78;
}

.ys-detail-lineage-list__author a {
  color: var(--tt-brand, #2962ff);
  text-decoration: none;
}

.ys-detail-lineage-list__author a:hover {
  color: var(--tt-brand, #2962ff);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ys-detail-comments .sc-comments__signin {
  margin: 12px 0 0;
  padding: 12px;
  border: 1px dashed var(--tt-border, rgba(255, 255, 255, 0.14));
  border-radius: var(--ys-detail-radius);
  font-size: 14px;
  color: var(--tt-fg-0);
}

body.theme--light .ys-detail-comments .sc-comments__signin {
  border-color: rgba(0, 0, 0, 0.14);
}

.ys-detail-comments .sc-comments__signin a {
  color: var(--tt-fg-0);
  text-decoration: underline;
}

.ys-detail-comments .sc-comments__composer,
.ys-detail-comments .sc-comments__list,
.ys-detail-comments .sc-comments__footer {
  max-width: 100%;
}

.ys-detail-comments .sc-comments__composer {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 0;
}

.ys-detail-comments .sc-comments__textarea {
  width: 100%;
  min-height: 88px;
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.14));
  border-radius: var(--ys-detail-radius);
  background: rgba(255, 255, 255, 0.02);
  color: var(--tt-fg-0);
  font-size: 14px;
  line-height: 1.6;
  padding: 10px;
  resize: vertical;
}

body.theme--light .ys-detail-comments .sc-comments__textarea {
  border-color: rgba(0, 0, 0, 0.14);
  background: rgba(0, 0, 0, 0.02);
}

.ys-detail-comments .sc-comments__composer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ys-detail-comments .sc-comments__counter {
  font-size: 12px;
  color: var(--tt-fg-0);
  opacity: 0.72;
}

.ys-detail-comments .sc-comments__post {
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(41, 98, 255, 0.45);
  background: rgba(41, 98, 255, 0.15);
  color: var(--tt-fg-0);
  font-size: 14px;
  font-weight: 600;
  padding: 0 14px;
}

.ys-detail-comments .sc-comments__post:disabled {
  opacity: 0.5;
}

.ys-detail-comments .sc-comments__list {
  display: grid;
  gap: 0;
}

.ys-detail-comments .sc-comment {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-radius: 0;
  border: 0;
  background: transparent;
}

.ys-detail-comments .sc-comment + .sc-comment {
  border-top: 1px solid var(--tt-border, rgba(255, 255, 255, 0.12));
}

body.theme--light .ys-detail-comments .sc-comment + .sc-comment {
  border-top-color: rgba(0, 0, 0, 0.12);
}

.ys-detail-comments .sc-comment__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.16));
  overflow: hidden;
}

body.theme--light .ys-detail-comments .sc-comment__avatar {
  border-color: rgba(0, 0, 0, 0.14);
}

.ys-detail-comments .sc-comment__body {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.ys-detail-comments .sc-comment__head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ys-detail-comments .sc-comment__author {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--tt-fg-0);
  text-decoration: underline;
  font-size: 14px;
}

.ys-detail-comments .sc-comment__time {
  font-size: 12px;
  color: var(--tt-fg-0);
  opacity: 0.72;
}

.ys-detail-comments .sc-comment__del {
  margin-left: auto;
  width: 24px;
  height: 24px;
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.16));
  border-radius: var(--ys-detail-radius);
  background: transparent;
  color: var(--tt-fg-0);
}

.ys-detail-comments .sc-comment__text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--tt-fg-0);
  white-space: pre-wrap;
  word-break: break-word;
}

.ys-detail-comments .sc-comments__empty,
.ys-detail-comments .sc-comments__error {
  font-size: 14px;
  color: var(--tt-fg-0);
  opacity: 0.76;
}

.ys-detail-comments .sc-comments__footer {
  margin-top: 0;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ys-detail-comments .sc-comments__loadmore {
  height: 34px;
  border-radius: var(--ys-detail-radius);
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.14));
  background: rgba(255, 255, 255, 0.02);
  color: var(--tt-fg-0);
  font-size: 14px;
  padding: 0 14px;
}

body.theme--light .ys-detail-comments .sc-comments__loadmore {
  border-color: rgba(0, 0, 0, 0.14);
  background: rgba(0, 0, 0, 0.02);
}

.ys-detail-comments .sc-comments__count {
  font-size: 12px;
  color: var(--tt-fg-0);
  opacity: 0.72;
}

.ys-detail-more-grid {
  display: grid;
  /* [FIX] 2026-07-22 — widen More-from-author cards to 1.5x (220px -> 330px min). */
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 14px;
}

/* [FIX] 2026-07-22 — increase card height by 1/5 across all three community
   card areas: home Script Community, /yescript/community list, and detail
   More-from-author (the list + more-grid both carry .ys-community__list).
   Scaled the height-driving inner metrics by 1.2 so each card grows ~20% and
   stays content-adaptive. */
.tt-home-community .ys-script-card {
  gap: 12px;
  padding: 17px;
}

.tt-home-community .ys-script-card__curve {
  height: 58px;
}

.ys-detail-more-fallback {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.ys-detail-more-fallback a {
  font-size: 14px;
  color: var(--tt-brand, #2962ff);
  text-decoration: none;
}

.ys-detail-more-fallback a:hover {
  color: var(--tt-brand, #2962ff);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ys-detail-panel--more .ys-script-card__head,
.ys-detail-panel--more .ys-script-card__actions {
  gap: 6px;
}

/* Creator detail page */
.ys-creator-detail__profile {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.14));
  background: rgba(255, 255, 255, 0.022);
  margin-bottom: 16px;
}

body.theme--light .ys-creator-detail__profile {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.022);
}

.ys-creator-detail__identity {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.ys-author-card__avatar--lg {
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
}

.ys-creator-detail__identity h1 {
  margin: 0 0 4px;
  font-size: 28px;
}

.ys-creator-detail__handle,
.ys-creator-detail__bio {
  margin: 0;
}

.ys-creator-detail__handle {
  font-size: 13px;
  opacity: 0.72;
}

.ys-creator-detail__bio {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.65;
  opacity: 0.82;
}

.ys-creator-detail__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ys-creator-detail__stats span {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  opacity: 0.72;
}

.ys-creator-detail__stats b {
  font-size: 17px;
  opacity: 1;
}

.ys-creator-detail__scripts h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.ys-creator-detail__scripts-grid {
  display: contents;
}

.ys-creator-detail__scripts .ys-community__list {
  margin-bottom: 0;
}

.ys-creator-script-card {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--tt-border, rgba(255, 255, 255, 0.12));
  background: rgba(255, 255, 255, 0.02);
}

body.theme--light .ys-creator-script-card {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.02);
}

.ys-creator-script-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.ys-creator-script-card__date {
  font-size: 12px;
  opacity: 0.68;
}

.ys-creator-script-card h3 {
  margin: 10px 0 8px;
  font-size: 16px;
}

.ys-creator-script-card h3 a {
  color: var(--tt-fg-0);
  text-decoration: none;
}

.ys-creator-script-card h3 a:hover {
  color: var(--tt-accent, #2962ff);
}

.ys-creator-script-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  opacity: 0.78;
  min-height: 60px;
}

.ys-creator-script-card__meta {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.ys-creator-script-card__meta a {
  color: var(--tt-accent, #2962ff);
  text-decoration: none;
  font-weight: 600;
}

.ys-creator-script-card__meta a:hover {
  text-decoration: underline;
}

.ys-creator-detail__empty {
  padding: 20px;
  border-radius: 12px;
  border: 1px dashed var(--tt-border, rgba(255, 255, 255, 0.16));
  text-align: center;
  font-size: 14px;
  opacity: 0.74;
}

@media (max-width: 900px) {
  .ys-detail-main {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .ys-detail-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ys-detail-more-grid {
    grid-template-columns: 1fr;
  }
  .ys-detail-snapshot__chart {
    height: 360px;
  }
  .ys-detail-hero-band {
    padding-bottom: 18px;
  }
  .ys-detail-hero-band__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .ys-detail-action {
    width: 100%;
  }
  .ys-detail-main__left > .ys-detail-panel + .ys-detail-panel,
  .ys-detail-main__right > .ys-detail-panel + .ys-detail-panel {
    margin-top: 16px;
    padding-top: 16px;
  }
  .ys-creator-detail__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .ys-detail-kpi-grid {
    grid-template-columns: 1fr;
  }
  .ys-script-card__actions {
    justify-content: flex-end;
  }
  .ys-detail-snapshot__chart {
    height: 320px;
    min-height: 260px;
  }
  .ys-creator-detail__stats {
    grid-template-columns: 1fr;
  }
}

/* Avatar ring — white halo in dark and light themes; PNG assets ship halo-free. */
:is(
  .ys-author-card__avatar,
  .ys-script-card__author-avatar,
  .ys-detail-author__avatar,
  .ys-detail-comments .sc-comment__avatar
) {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85);
}
