/* Top stories section: segmented tabs with sliding indicator, filter chips, medals, rails. Reuses catalog.css cards.
   Motion: transform and opacity only, every animation runs once, off for reduced motion and html.lite. */
.tp-seg { position: relative; display: flex; gap: 2px; margin: 0 0 14px; padding: 4px; border-radius: 999px; overflow-x: auto; scrollbar-width: none;
    background: rgba(20, 13, 25, .7); border: 1px solid rgba(255, 255, 255, .08); }
.tp-seg::-webkit-scrollbar { display: none; }
.tp-ind { position: absolute; left: 0; top: 4px; bottom: 4px; width: 0; border-radius: 999px; opacity: 0; pointer-events: none;
    background-image: linear-gradient(135deg, #ff6aa6, #d6377f); transition: transform .28s cubic-bezier(.3, .7, .2, 1); }
.tp-seg.tp-js .tp-ind { opacity: 1; }
.tp-tab { position: relative; z-index: 1; flex: 0 0 auto; display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
    text-decoration: none; white-space: nowrap; color: #c9b9cd !important; }
.tp-tab:hover { color: #fff !important; }
.tp-tab.on { color: #fff !important; background-image: linear-gradient(135deg, #ff6aa6, #d6377f); }
.tp-seg.tp-js .tp-tab.on { background-image: none; }
.tp-note { margin: 0 0 12px; padding: 10px 14px; border-radius: 14px; font-size: 13px; line-height: 1.5; color: #cdbdd1; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); }

.tp-cats, .tp-bar { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.tp-cats::-webkit-scrollbar, .tp-bar::-webkit-scrollbar { display: none; }
.tp-cats { padding: 2px 2px 10px; }
.tp-bar { position: sticky; top: calc(66px + env(safe-area-inset-top, 0px)); z-index: 40; margin: 0 -2px 10px; padding: 8px 2px; background: var(--bg-body, #18181b); }
.tp-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; text-decoration: none;
    color: #f0e2ec !important; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); }
.tp-chip:hover { border-color: rgba(255, 140, 195, .5); background: rgba(255, 95, 162, .08); }
.tp-chip.on { color: #fff !important; border-color: transparent; background-image: linear-gradient(135deg, #ff6aa6, #d6377f); }
.tp-reset-chip { color: #ffd0e4 !important; border-color: rgba(255, 140, 195, .5); }
.tp-sep { flex: 0 0 1px; align-self: stretch; margin: 6px 2px; background: rgba(255, 255, 255, .14); }
.tp-shown { margin: 0 0 12px; font-size: 13px; color: #a993ad; } .tp-shown b { color: #fff; }

.tp-empty { margin: 8px 0 24px; padding: 28px 20px; text-align: center; border-radius: 20px; background: rgba(255, 255, 255, .035); border: 1px dashed rgba(255, 140, 195, .35); }
.tp-empty b { display: block; margin-bottom: 6px; font-size: 18px; color: #fff; }
.tp-empty p { margin: 0 0 16px; color: #cdbdd1; font-size: 14.5px; }

.tp-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.tp-rank { display: inline-grid; place-items: center; min-width: 34px; height: 28px; padding: 0 9px; border-radius: 999px; font-weight: 800; font-size: 13px; color: #fff;
    background-image: linear-gradient(135deg, #ff6aa6, #8a2be2); }
.tp-rank-m { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px 0 11px; font-size: 22px; line-height: 1; }
.tp-rank-m i { font-size: 17px; }
.tp-badge { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #d9cbdc; background: rgba(255, 255, 255, .06); }
.tp-badge-a { color: #6ef0a5; background: rgba(110, 240, 165, .1); }
.tp-hot { color: #ffd9ea; font-weight: 700; }
.tp-m1 { border-color: rgba(255, 201, 77, .7); box-shadow: 0 0 0 1px rgba(255, 201, 77, .35), 0 16px 30px -22px rgba(255, 201, 77, .9); }
.tp-m1 .tp-rank-m { color: #3a2a00; background-image: linear-gradient(135deg, #ffe08a, #f2a900); }
.tp-m2 { border-color: rgba(207, 214, 228, .65); box-shadow: 0 0 0 1px rgba(207, 214, 228, .3), 0 16px 30px -22px rgba(207, 214, 228, .8); }
.tp-m2 .tp-rank-m { color: #20242c; background-image: linear-gradient(135deg, #f1f4fa, #a9b2c4); }
.tp-m3 { border-color: rgba(224, 138, 82, .7); box-shadow: 0 0 0 1px rgba(224, 138, 82, .3), 0 16px 30px -22px rgba(224, 138, 82, .9); }
.tp-m3 .tp-rank-m { color: #2f1604; background-image: linear-gradient(135deg, #f0b98c, #c0672a); }

.tp-card { animation: tpIn .45s cubic-bezier(.2, .7, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
.tp-card:hover { transform: translateY(-3px); }
@keyframes tpIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tp-card { animation: none; } .tp-ind { transition: none; } }
html.lite .tp-card { animation: none !important; } html.lite .tp-ind { transition: none !important; }

.tp-block { margin: 0 0 22px; }
.tp-block-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 12px; }
.tp-block-title { margin: 0; font-size: 22px; line-height: 1.25; font-weight: 800; color: #fff; }
.tp-block-sub { margin: 4px 0 0; font-size: 13.5px; color: #b9a7bd; }
.tp-all { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 600; text-decoration: none;
    color: #fff !important; background: rgba(255, 95, 162, .14); border: 1px solid rgba(255, 140, 195, .35); }
.tp-catgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tp-catbox { padding: 14px 16px; border-radius: 18px; background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .07); }
.tp-cathead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.tp-catname { font-weight: 800; font-size: 16px; color: #fff !important; text-decoration: none; }
.tp-catall { font-size: 12.5px; font-weight: 600; color: #ff8fc0 !important; text-decoration: none; white-space: nowrap; }
.tp-catlist { margin: 0; padding: 0; list-style: none; counter-reset: c; }
.tp-catlist li { counter-increment: c; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid rgba(255, 255, 255, .06); font-size: 14px; }
.tp-catlist li::before { content: counter(c); flex: 0 0 18px; font-weight: 800; color: #ff8fc0; }
.tp-catlist a { flex: 1; min-width: 0; color: #f0e2ec !important; text-decoration: none; overflow-wrap: anywhere; }
.tp-catlist span { flex: 0 0 auto; font-size: 12.5px; color: #a993ad; }
.tp-allcats { margin-top: 14px; }
.tp-sub-head { margin-top: 6px; }
.tp-sub-title { margin: 0; font-size: 18px; font-weight: 800; color: #fff; }
.tp-more-lists { margin-top: 26px; }
.tp-more h2 { margin: 0 0 12px; font-size: 20px; color: #fff; }

@media (min-width: 761px) { .tp-bar { top: 10px; } }
@media (max-width: 1000px) { .tp-catgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
    .tp-block-title { font-size: 19px; }
    .tp-catgrid { grid-template-columns: 1fr; }
    .tp-rail { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84%; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; scrollbar-width: none; }
    .tp-rail::-webkit-scrollbar { display: none; }
    .tp-rail > .tp-card { scroll-snap-align: start; }
}
html:not(.dark-theme) .tp-seg { background-color: rgba(243, 238, 246, .8); border-color: rgba(150, 40, 100, .112); }
html:not(.dark-theme) .tp-tab { color: #6a5070 !important; }
html:not(.dark-theme) .tp-tab:hover { color: #212121 !important; }
html:not(.dark-theme) .tp-tab.on { color: #fff !important; }
html:not(.dark-theme) .tp-chip { color: #462a3e !important; background-color: rgba(150, 40, 100, .038); border-color: rgba(150, 40, 100, .14); }
html:not(.dark-theme) .tp-chip.on { color: #fff !important; border-color: transparent; }
html:not(.dark-theme) .tp-reset-chip { color: #c20054 !important; }
html:not(.dark-theme) .tp-sep { background: rgba(150, 40, 100, .2); }
html:not(.dark-theme) .tp-note, html:not(.dark-theme) .tp-empty, html:not(.dark-theme) .tp-catbox { background-color: rgba(150, 40, 100, .026); border-color: rgba(150, 40, 100, .112); color: #593f5e; }
html:not(.dark-theme) .tp-empty b, html:not(.dark-theme) .tp-shown b, html:not(.dark-theme) .tp-catname, html:not(.dark-theme) .tp-block-title, html:not(.dark-theme) .tp-sub-title, html:not(.dark-theme) .tp-more h2 { color: #212121 !important; }
html:not(.dark-theme) .tp-empty p, html:not(.dark-theme) .tp-block-sub, html:not(.dark-theme) .tp-shown { color: #664c6c; }
html:not(.dark-theme) .tp-badge { color: #593f5e; background-color: rgba(150, 40, 100, .06); }
html:not(.dark-theme) .tp-badge-a { color: #0e9a4a; background-color: rgba(18, 176, 85, .1); }
html:not(.dark-theme) .tp-hot { color: #c20054; }
html:not(.dark-theme) .tp-all { color: #212121 !important; }
html:not(.dark-theme) .tp-catall { color: #c20054 !important; }
html:not(.dark-theme) .tp-catlist a { color: #2d1a32 !important; }
html:not(.dark-theme) .tp-catlist li { border-top-color: rgba(150, 40, 100, .1); }
html:not(.dark-theme) .tp-catlist li::before { color: #c20054; }
html:not(.dark-theme) .tp-catlist span { color: #866a8b; }
